feat: jets d'attaque depuis les armes (combat en opposition)

- Bouton ⚔ Attaquer sur chaque arme (onglet Équipement, mode Jeu)
- rollAttack(itemId) dans character.mjs : jet Échauffourée vs Corps PNJ
- Dialog combat : input numérique 'Corps du PNJ' à la place du sélect difficulté
- computeResult() : margin===0 → résultat 'tie' (égalité) en combat
- Mêlée échec → blessure joueur auto-cochée (comme résistance)
- Distance échec → simple raté, pas de blessure joueur
- Chat message : infos arme, bandeau égalité, desc succès/échec combat
- CSS : bandeau 'tie' (brun doré), zone arme dans dialog
- i18n : CELESTOPOL.Combat.* (attack, corpsPnj, tie, successHit, etc.)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-30 00:29:29 +02:00
parent 149d55dfa0
commit 79a68ee9ab
8 changed files with 210 additions and 23 deletions

View File

@@ -22,6 +22,7 @@ export default class CelestopolActorSheet extends HandlebarsApplicationMixin(fou
toggleSheet: CelestopolActorSheet.#onToggleSheet,
edit: CelestopolActorSheet.#onItemEdit,
delete: CelestopolActorSheet.#onItemDelete,
attack: CelestopolActorSheet.#onAttack,
},
}
@@ -151,6 +152,12 @@ export default class CelestopolActorSheet extends HandlebarsApplicationMixin(fou
await item?.deleteDialog()
}
static async #onAttack(_event, target) {
const itemId = target.getAttribute("data-item-id")
if (!itemId) return
await this.document.system.rollAttack(itemId)
}
/**
* Setup sequential checkbox logic for wound/destin/spleen tracks
* Only allows checking the next checkbox in sequence