mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Feature/517 action cost on success (#546)
* Add checkboxes * Consume post roll logic
This commit is contained in:
parent
90a97c7105
commit
c46d676cc3
11 changed files with 93 additions and 18 deletions
|
|
@ -88,7 +88,7 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
|||
|
||||
if (targets.length === 0)
|
||||
return ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected'));
|
||||
|
||||
|
||||
for (let target of targets) {
|
||||
let damages = foundry.utils.deepClone(this.system.damage);
|
||||
if (
|
||||
|
|
@ -106,6 +106,7 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
|||
});
|
||||
}
|
||||
|
||||
this.consumeOnSuccess();
|
||||
if (this.system.hasHealing) target.actor.takeHealing(damages);
|
||||
else target.actor.takeDamage(damages);
|
||||
}
|
||||
|
|
@ -132,7 +133,15 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
|||
const targets = this.getTargetList();
|
||||
if (targets.length === 0)
|
||||
ui.notifications.info(game.i18n.localize('DAGGERHEART.UI.Notifications.noTargetsSelected'));
|
||||
this.consumeOnSuccess();
|
||||
await action.applyEffects(event, this, targets);
|
||||
}
|
||||
}
|
||||
|
||||
consumeOnSuccess() {
|
||||
if(!this.system.successConsumed && !this.system.targetSelection) {
|
||||
const action = this.system.action;
|
||||
if(action) action.consume(this.system, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue