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() {
@ -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;
}
}
}

View file

@ -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');