mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +02:00
Changed so that a confirmation warning pops up when trying to apply effects to targets that haven't done their saves
This commit is contained in:
parent
d0c29ede56
commit
b78a585c79
1 changed files with 13 additions and 1 deletions
|
|
@ -247,8 +247,20 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
const targets = this.filterPermTargets(this.system.hitTargets),
|
const targets = this.filterPermTargets(this.system.hitTargets),
|
||||||
config = foundry.utils.deepClone(this.system);
|
config = foundry.utils.deepClone(this.system);
|
||||||
config.event = event;
|
config.event = event;
|
||||||
|
|
||||||
if (targets.length === 0)
|
if (targets.length === 0)
|
||||||
ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelectedOrPerm'));
|
return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelectedOrPerm'));
|
||||||
|
else if (config.hasSave) {
|
||||||
|
const pendingingSaves = targets.filter(t => t.saved.success === null);
|
||||||
|
if (pendingingSaves.length) {
|
||||||
|
const confirm = await foundry.applications.api.DialogV2.confirm({
|
||||||
|
window: { title: game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.title') },
|
||||||
|
content: `<p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.unfinishedRolls')}</p><p>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.confirmation')}</p><p><i>${game.i18n.localize('DAGGERHEART.APPLICATIONS.PendingReactionsDialog.warning')}</i></p>`
|
||||||
|
});
|
||||||
|
if (!confirm) return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.consumeOnSuccess();
|
this.consumeOnSuccess();
|
||||||
this.system.action?.workflow.get('effects')?.execute(config, targets, true);
|
this.system.action?.workflow.get('effects')?.execute(config, targets, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue