Added result messages to the Death Move chat output and removed debug statements

This commit is contained in:
Chris Ryan 2026-01-13 23:13:12 +10:00
parent 4214e5133d
commit a554ec0e4d
4 changed files with 43 additions and 26 deletions

View file

@ -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() { async clearAllStressAndHitpoints() {
@ -94,9 +101,8 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
}); });
if (config.roll.isCritical) { if (config.roll.isCritical) {
console.log("Clear all stress and HP");
this.clearAllStressAndHitpoints(); this.clearAllStressAndHitpoints();
return; return "Critical Rolled, clearing all marked Stress and Hit Points";
} }
// Hope // 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("Need to clear up Stress and HP up to hope value");
console.log("Hope rolled", config.roll.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)) { 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(); 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 //Fear
if (config.roll.result.duality == -1) { if (config.roll.result.duality == -1) {
console.log("You have died..."); return "Fear rolled higher, you have died...";
return;
} }
} }
@ -133,6 +138,8 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
] ]
} }
]); ]);
return "Blaze of Glory Effect Added!";
} }
static selectMove(_, button) { static selectMove(_, button) {
@ -143,6 +150,23 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
} }
static async takeMove() { 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( const autoExpandDescription = game.settings.get(
CONFIG.DH.id, CONFIG.DH.id,
CONFIG.DH.SETTINGS.gameSettings.appearance CONFIG.DH.SETTINGS.gameSettings.appearance
@ -159,6 +183,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
title: game.i18n.localize(this.selectedMove.name), title: game.i18n.localize(this.selectedMove.name),
img: this.selectedMove.img, img: this.selectedMove.img,
description: game.i18n.localize(this.selectedMove.description), description: game.i18n.localize(this.selectedMove.description),
result: result,
open: autoExpandDescription ? 'open' : '', open: autoExpandDescription ? 'open' : '',
chevron: autoExpandDescription ? 'fa-chevron-up' : 'fa-chevron-down' chevron: autoExpandDescription ? 'fa-chevron-up' : 'fa-chevron-down'
} }
@ -175,23 +200,5 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
}; };
cls.create(msg); 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;
}
} }
} }

View file

@ -173,7 +173,6 @@ export default class DualityRoll extends D20Roll {
} }
static async buildConfigure(config = {}, message = {}) { static async buildConfigure(config = {}, message = {}) {
console.log("buildConfigure, config", config);
config.dialog ??= {}; config.dialog ??= {};
config.guaranteedCritical = config.data?.parent?.appliedEffects.reduce((a, c) => { config.guaranteedCritical = config.data?.parent?.appliedEffects.reduce((a, c) => {
const change = c.changes.find(ch => ch.key === 'system.rules.roll.guaranteedCritical'); const change = c.changes.find(ch => ch.key === 'system.rules.roll.guaranteedCritical');

View file

@ -28,11 +28,15 @@
.description { .description {
color: @dark; color: @dark;
} }
.result {
color: @dark;
}
} }
} }
.daggerheart.chat { .daggerheart.chat {
&.death { &.deathmoves {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -97,6 +101,10 @@
.description { .description {
padding: 8px; padding: 8px;
} }
.result {
padding: 8px;
}
} }
.action-use-button-parent { .action-use-button-parent {

View file

@ -12,6 +12,9 @@
<div class="description"> <div class="description">
{{{this.description}}} {{{this.description}}}
</div> </div>
<div class="result">
{{{this.result}}}
</div>
</details> </details>
</ul> </ul>
</div> </div>