diff --git a/module/applications/dialogs/deathMove.mjs b/module/applications/dialogs/deathMove.mjs index 1bd9d242..56260559 100644 --- a/module/applications/dialogs/deathMove.mjs +++ b/module/applications/dialogs/deathMove.mjs @@ -61,7 +61,14 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV } } ); + + if (newScarAmount >= this.actor.system.resources.hope.max) { + return "You have " + newScarAmount + " Scars and have crossed out your last Hope slot. Your character's journey ends." + } + + return "You have a new scar, total scars: " + newScarAmount; } + return "You have avoided a new scar."; } async clearAllStressAndHitpoints() { @@ -94,9 +101,8 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV }); if (config.roll.isCritical) { - console.log("Clear all stress and HP"); this.clearAllStressAndHitpoints(); - return; + return "Critical Rolled, clearing all marked Stress and Hit Points"; } // Hope @@ -104,16 +110,15 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV console.log("Need to clear up Stress and HP up to hope value"); console.log("Hope rolled", config.roll.hope.value); if (config.roll.hope.value >= (this.actor.system.resources.hitPoints.value + this.actor.system.resources.stress.value)) { - console.log("Hope roll value is more than the HP + Stress, auto- remove"); this.clearAllStressAndHitpoints(); + return "Hope roll value is more than the marked Stress and Hit Points, clearing both."; } - return; + return "TODO - need to clear Stress and/or Hit Points up to: " + config.roll.hope.value; } //Fear if (config.roll.result.duality == -1) { - console.log("You have died..."); - return; + return "Fear rolled higher, you have died..."; } } @@ -133,6 +138,8 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV ] } ]); + + return "Blaze of Glory Effect Added!"; } static selectMove(_, button) { @@ -143,6 +150,23 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV } static async takeMove() { + + this.close(); + + let result = ""; + + if (CONFIG.DH.GENERAL.deathMoves.blazeOfGlory === this.selectedMove) { + result = await this.handleBlazeOfGlory(); + } + + if (CONFIG.DH.GENERAL.deathMoves.avoidDeath === this.selectedMove) { + result = await this.handleAvoidDeath(); + } + + if (CONFIG.DH.GENERAL.deathMoves.riskItAll === this.selectedMove) { + result = await this.handleRiskItAll(); + } + const autoExpandDescription = game.settings.get( CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance @@ -159,6 +183,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV title: game.i18n.localize(this.selectedMove.name), img: this.selectedMove.img, description: game.i18n.localize(this.selectedMove.description), + result: result, open: autoExpandDescription ? 'open' : '', chevron: autoExpandDescription ? 'fa-chevron-up' : 'fa-chevron-down' } @@ -175,23 +200,5 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV }; cls.create(msg); - - this.close(); - - if (CONFIG.DH.GENERAL.deathMoves.avoidDeath === this.selectedMove) { - this.handleAvoidDeath(); - return; - } - - if (CONFIG.DH.GENERAL.deathMoves.riskItAll === this.selectedMove) { - this.handleRiskItAll(); - return; - } - - if (CONFIG.DH.GENERAL.deathMoves.blazeOfGlory === this.selectedMove) { - this.handleBlazeOfGlory(); - return; - } - } } diff --git a/module/dice/dualityRoll.mjs b/module/dice/dualityRoll.mjs index 1481c546..850c811d 100644 --- a/module/dice/dualityRoll.mjs +++ b/module/dice/dualityRoll.mjs @@ -173,7 +173,6 @@ export default class DualityRoll extends D20Roll { } static async buildConfigure(config = {}, message = {}) { - console.log("buildConfigure, config", config); config.dialog ??= {}; config.guaranteedCritical = config.data?.parent?.appliedEffects.reduce((a, c) => { const change = c.changes.find(ch => ch.key === 'system.rules.roll.guaranteedCritical'); diff --git a/styles/less/ui/chat/deathmoves.less b/styles/less/ui/chat/deathmoves.less index 737482dc..53f33137 100644 --- a/styles/less/ui/chat/deathmoves.less +++ b/styles/less/ui/chat/deathmoves.less @@ -28,11 +28,15 @@ .description { color: @dark; } + + .result { + color: @dark; + } } } .daggerheart.chat { - &.death { + &.deathmoves { display: flex; flex-direction: column; align-items: center; @@ -97,6 +101,10 @@ .description { padding: 8px; } + + .result { + padding: 8px; + } } .action-use-button-parent { diff --git a/templates/ui/chat/deathMove.hbs b/templates/ui/chat/deathMove.hbs index 42ead6bc..0a20521f 100644 --- a/templates/ui/chat/deathMove.hbs +++ b/templates/ui/chat/deathMove.hbs @@ -12,6 +12,9 @@