Player query for Roll All Save

This commit is contained in:
Dapoolp 2025-07-28 13:44:31 +02:00
parent 36959156d0
commit 9674b90967
7 changed files with 21 additions and 131 deletions

View file

@ -108,54 +108,25 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
const targets = event.target.parentElement.querySelectorAll(
'.target-section > [data-token] .target-save-container'
);
const promises = [],
actor = await this.getActor(message.system.source.actor),
const actor = await this.getActor(message.system.source.actor),
action = this.getAction(actor, message.system.source.item, message.system.source.action);
targets.forEach(async el => {
const tokenId = el.closest('[data-token]')?.dataset.token,
token = game.canvas.tokens.get(tokenId);
if(!token.actor) return;
if(game.user === token.actor.owner) {
if(game.user === token.actor.owner)
el.dispatchEvent(new PointerEvent('click', { shiftKey: true }));
} else {
// console.log(action,
// token,
// event,
// message)
const reactionRoll = await token.actor.owner.query('reactionRoll', {
else {
token.actor.owner.query('reactionRoll', {
actionId: action.uuid,
actorId: token.actor.uuid,
event,
message
});
if(reactionRoll) {
console.log(reactionRoll)
}
// const armorStackResult = await token.actor.owner.query('armorStack', {
// actorId: token.actor.uuid,
// damage: 3,
// type: ['physical']
// },
// {
// timeout: 30000
// }
// );
}).then(result => action.updateSaveMessage(result, message, token.id));
}
// el.dispatchEvent(new PointerEvent('click', { shiftKey: true }));
});
}
/* onRollAllSave(event, _message) {
event.stopPropagation();
const targets = event.target.parentElement.querySelectorAll(
'.target-section > [data-token] .target-save-container'
);
targets.forEach(el => {
el.dispatchEvent(new PointerEvent('click', { shiftKey: true }));
});
} */
async onApplyEffect(event, message) {
event.stopPropagation();
const actor = await this.getActor(message.system.source.actor);