diff --git a/lang/en.json b/lang/en.json index 12fe01c8..d40ce87f 100755 --- a/lang/en.json +++ b/lang/en.json @@ -2112,6 +2112,7 @@ "formula": "Formula", "general": "General", "gm": "GM", + "guaranteedCriticalSuccess": "Guaranteed Critical Success", "healing": "Healing", "healingRoll": "Healing Roll", "hit": { diff --git a/module/applications/dialogs/deathMove.mjs b/module/applications/dialogs/deathMove.mjs index a0b2ec2b..256da777 100644 --- a/module/applications/dialogs/deathMove.mjs +++ b/module/applications/dialogs/deathMove.mjs @@ -97,7 +97,19 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV } async handleBlazeOfGlory() { - console.log("TODO: Blaze Of Glory"); + this.actor.createEmbeddedDocuments('ActiveEffect', [ + { + name: game.i18n.localize('DAGGERHEART.CONFIG.DeathMoves.blazeOfGlory.name'), + img: 'icons/magic/movement/abstract-ribbons-red-orange.webp', + changes: [ + { + key: 'system.rules.roll.guaranteedCritical', + mode: 2, + value: "true" + } + ] + } + ]); } static selectMove(_, button) { diff --git a/module/dice/dualityRoll.mjs b/module/dice/dualityRoll.mjs index 8a4364fb..01b212e5 100644 --- a/module/dice/dualityRoll.mjs +++ b/module/dice/dualityRoll.mjs @@ -13,7 +13,6 @@ export default class DualityRoll extends D20Roll { super(formula, data, options); this.rallyChoices = this.setRallyChoices(); this.guaranteedCritical = this.setGuaranteedCritical(); - console.log("guaranteedCritical", this.guaranteedCritical); } static messageType = 'dualityRoll'; @@ -73,13 +72,9 @@ export default class DualityRoll extends D20Roll { } setGuaranteedCritical() { - console.log("setGuaranteedCritical", this); return this.data?.parent?.appliedEffects.reduce((a, c) => { - console.log("a,c", a,c); - - const change = c.changes.find(ch => ch.key === 'system.rules.role.guaranteedCritical'); - console.log("change", change); - if (change) a.push({ value: c.id, label: change.value }); + const change = c.changes.find(ch => ch.key === 'system.rules.roll.guaranteedCritical'); + if (change) a = true; return a; }, false); } @@ -105,8 +100,6 @@ export default class DualityRoll extends D20Roll { get isCritical() { if (this.guaranteedCritical) { - this.dHope.total = this.dice[0]?.faces ?? 12; - this.dFear.total = this.dice[1]?.faces ?? 12; return true; } if (!this.dHope._evaluated || !this.dFear._evaluated) return; @@ -114,17 +107,18 @@ export default class DualityRoll extends D20Roll { } get withHope() { - if (!this._evaluated) return; + if (!this._evaluated || this.guaranteedCritical) return; return this.dHope.total > this.dFear.total; } get withFear() { - if (!this._evaluated) return; + if (!this._evaluated || this.guaranteedCritical) return; return this.dHope.total < this.dFear.total; } get totalLabel() { - const label = this.isCritical ? 'DAGGERHEART.GENERAL.criticalSuccess' : + const label = this.guaranteedCritical ? 'DAGGERHEART.GENERAL.guaranteedCriticalSuccess' : + this.isCritical ? 'DAGGERHEART.GENERAL.criticalSuccess' : this.withHope ? 'DAGGERHEART.GENERAL.hope' : 'DAGGERHEART.GENERAL.fear'; return game.i18n.localize(label); @@ -206,7 +200,7 @@ export default class DualityRoll extends D20Roll { data.hope = { dice: roll.dHope.denomination, - value: roll.dHope.total, + value: this.guaranteedCritical ? 0 : roll.dHope.total, rerolled: { any: roll.dHope.results.some(x => x.rerolled), rerolls: roll.dHope.results.filter(x => x.rerolled) @@ -214,7 +208,7 @@ export default class DualityRoll extends D20Roll { }; data.fear = { dice: roll.dFear.denomination, - value: roll.dFear.total, + value: this.guaranteedCritical ? 0 : roll.dFear.total, rerolled: { any: roll.dFear.results.some(x => x.rerolled), rerolls: roll.dFear.results.filter(x => x.rerolled) @@ -226,7 +220,7 @@ export default class DualityRoll extends D20Roll { }; data.result = { duality: roll.withHope ? 1 : roll.withFear ? -1 : 0, - total: roll.dHope.total + roll.dFear.total, + total: this.guaranteedCritical ? 0 : roll.dHope.total + roll.dFear.total, label: roll.totalLabel };