Start on Avoid Death death move

This commit is contained in:
Chris Ryan 2025-12-10 22:41:34 +10:00
parent c11a4f617d
commit e166a408f1

View file

@ -1,3 +1,6 @@
import { enrichedFateRoll } from '../../enrichers/FateRollEnricher.mjs';
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV2) { export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV2) {
@ -40,12 +43,14 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
async handleAvoidDeath() { async handleAvoidDeath() {
console.log("Avoid Death!"); console.log("Avoid Death!");
if (game.modules.get('dice-so-nice')?.active) { const target = this.actor.uuid;
await enrichedFateRoll({
const { diceSoNice } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.appearance); target,
title: "Avoid Death Hope Fate Roll",
const hopeDice = await getDiceSoNicePreset(diceSoNice.hope, 12); label: 'test',
} fateType: "Hope"
});
console.log("enrichedFateRoll done...");
} }
handleRiskItAll() { handleRiskItAll() {
@ -87,6 +92,8 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
cls.create(msg); cls.create(msg);
this.close();
if (CONFIG.DH.GENERAL.deathMoves.avoidDeath === this.selectedMove) { if (CONFIG.DH.GENERAL.deathMoves.avoidDeath === this.selectedMove) {
this.handleAvoidDeath(); this.handleAvoidDeath();
return; return;
@ -97,8 +104,5 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
return; return;
} }
this.close();
} }
} }