fix(combat): re-render tracker après suppression + initiative par Réaction + lisibilité + malus PNJ
Release Creation / build (release) Failing after 1m41s

- fight.mjs : _onDelete appelle super._onDelete() → le tracker se vide immédiatement après « Terminer » (plus de F5)
- fight.mjs : _getInitiativeFormula type-dépendante — PNJ/Créature roulent leur pool de Réaction (computed.reaction + reactionBonus) au lieu de 0D → classement par Réaction correct
- dialogs.less : total des dés (.total-value) en blanc au lieu du vert sombre (illisible sur fond foncé)
- npc-roll-dialog : champ « Malus temporaires » + logique pool (dés malus dans le dialogue PNJ/Créature)
This commit is contained in:
2026-08-07 21:04:24 +02:00
parent 9f88a66b72
commit c7e6660d9d
4 changed files with 37 additions and 12 deletions
+2 -2
View File
@@ -694,8 +694,8 @@ iframe {
.total-value { .total-value {
font-family: "DistressBlack", sans-serif; font-family: "DistressBlack", sans-serif;
font-size: @font-size-28; font-size: @font-size-28;
color: @color-acid-green; color: @color-text-light-0;
text-shadow: 0 0 8px fade(@color-acid-green, 40%); text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
} }
.totem-selector { .totem-selector {
+6 -2
View File
@@ -174,11 +174,15 @@ export default class NpcRollDialog extends HandlebarsApplicationMixin(foundry.ap
#getGroup() { return parseInt(this.#el.querySelector("#group")?.value, 10) || 0 } #getGroup() { return parseInt(this.#el.querySelector("#group")?.value, 10) || 0 }
#getTemporaryMalus() { return parseInt(this.#el.querySelector("#temporary-malus")?.value, 10) || 0 }
getPoolBreakdown() { getPoolBreakdown() {
const help = this.#getHelped() const help = this.#getHelped()
const group = this.#getGroup() const group = this.#getGroup()
const malus = VermineExchange.woundMalus(this.#actor) const wound = VermineExchange.woundMalus(this.#actor)
return { pool: this.pool, help, group, malus, total: Math.max(0, this.pool + help + group - malus) } 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() { #updateUI() {
+22 -8
View File
@@ -210,14 +210,16 @@ export class VermineCombat extends Combat {
} }
/************************************************************************************/ /************************************************************************************/
_onDelete() { /**
/*let combatants = this.combatants.contents * Nettoyage lors de la suppression du combat (bouton « Terminer » / suppression).
for (let c of combatants) { * Doit appeler le handler de base : c'est lui qui re-rend le CombatTracker
let actor = game.actors.get(c.actorId) * (`ui.combat.render({combat: null})`) — sans cela le tracker reste figé sur
actor.clearInitiative() * l'ancien ordre de tour jusqu'au rechargement de la page (F5).
actor.displayRecuperation() * @param {object} options
} * @param {string} userId
super._onDelete()*/ */
_onDelete(options, userId) {
super._onDelete(options, userId);
} }
} }
@@ -376,6 +378,18 @@ export class VermineCombatant extends Combatant {
} }
} }
_getInitiativeFormula() { _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) return String(CONFIG.Combat.initiative.formula || game.system.initiative)
} }
} }
+7
View File
@@ -79,6 +79,13 @@
<span>D</span> <span>D</span>
</div> </div>
<div class="flexrow bonus-item full-width">
<label class="label" for="temporary-malus">{{localize 'VERMINE.temporary_malus'}}</label>
<input type="number" data-roll="true" class="numeric-entry" style="text-align: center;"
name="temporary-malus" id="temporary-malus" min="0" max="5" value="0" />
<span>D</span>
</div>
</div> </div>
</details> </details>