diff --git a/less/dialogs.less b/less/dialogs.less index 8360907..848c661 100644 --- a/less/dialogs.less +++ b/less/dialogs.less @@ -694,8 +694,8 @@ iframe { .total-value { font-family: "DistressBlack", sans-serif; font-size: @font-size-28; - color: @color-acid-green; - text-shadow: 0 0 8px fade(@color-acid-green, 40%); + color: @color-text-light-0; + text-shadow: 0 0 8px rgba(0, 0, 0, 0.6); } .totem-selector { diff --git a/module/system/dialogs/npcRollDialog.mjs b/module/system/dialogs/npcRollDialog.mjs index fabd1e8..bab15ec 100644 --- a/module/system/dialogs/npcRollDialog.mjs +++ b/module/system/dialogs/npcRollDialog.mjs @@ -174,11 +174,15 @@ export default class NpcRollDialog extends HandlebarsApplicationMixin(foundry.ap #getGroup() { return parseInt(this.#el.querySelector("#group")?.value, 10) || 0 } + #getTemporaryMalus() { return parseInt(this.#el.querySelector("#temporary-malus")?.value, 10) || 0 } + getPoolBreakdown() { const help = this.#getHelped() const group = this.#getGroup() - const malus = VermineExchange.woundMalus(this.#actor) - return { pool: this.pool, help, group, malus, total: Math.max(0, this.pool + help + group - malus) } + const wound = VermineExchange.woundMalus(this.#actor) + const tempMalus = this.#getTemporaryMalus() + const malus = wound + tempMalus + return { pool: this.pool, help, group, wound, tempMalus, malus, total: Math.max(0, this.pool + help + group - malus) } } #updateUI() { diff --git a/module/system/fight.mjs b/module/system/fight.mjs index 99bbe5b..acaa49e 100644 --- a/module/system/fight.mjs +++ b/module/system/fight.mjs @@ -210,14 +210,16 @@ export class VermineCombat extends Combat { } /************************************************************************************/ - _onDelete() { - /*let combatants = this.combatants.contents - for (let c of combatants) { - let actor = game.actors.get(c.actorId) - actor.clearInitiative() - actor.displayRecuperation() - } - super._onDelete()*/ + /** + * Nettoyage lors de la suppression du combat (bouton « Terminer » / suppression). + * Doit appeler le handler de base : c'est lui qui re-rend le CombatTracker + * (`ui.combat.render({combat: null})`) — sans cela le tracker reste figé sur + * l'ancien ordre de tour jusqu'au rechargement de la page (F5). + * @param {object} options + * @param {string} userId + */ + _onDelete(options, userId) { + super._onDelete(options, userId); } } @@ -376,6 +378,18 @@ export class VermineCombatant extends Combatant { } } _getInitiativeFormula() { + // Personnage : jet de Réaction (Réflexes + Vigilance) contre la + // Difficulté du statut de combat — les Réussites = valeur de Réaction. + // PNJ et Créature : n'ont pas de caractéristiques/compétences — ils + // roulent leur pool de Réaction (computed.reaction) contre la même + // Difficulté, majoré de leur bonus de Réaction. + const actor = this.actor + if ( actor?.type === 'npc' || actor?.type === 'creature' ) { + const reaction = parseInt(actor.system?.computed?.reaction, 10) || 0 + const difficulty = parseInt(actor.system?.combatStatus?.difficulty, 10) || 7 + const bonus = parseInt(actor.system?.computed?.reactionBonus, 10) || 0 + return `${reaction}d10cs>=${difficulty}+${bonus}` + } return String(CONFIG.Combat.initiative.formula || game.system.initiative) } } \ No newline at end of file diff --git a/templates/dialogs/npc-roll-dialog.hbs b/templates/dialogs/npc-roll-dialog.hbs index ed10079..1aff4f3 100644 --- a/templates/dialogs/npc-roll-dialog.hbs +++ b/templates/dialogs/npc-roll-dialog.hbs @@ -79,6 +79,13 @@ D +
+ + + D +
+