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

@@ -3,6 +3,14 @@
{{!-- En-tête : acteur + domaine + formule de base --}}
<div class="roll-info-block">
<div class="roll-actor">{{actorName}}</div>
{{!-- Arme (mode combat) --}}
{{#if isCombat}}
<div class="roll-weapon-line">
<span class="weapon-icon">⚔</span>
<span class="weapon-name">{{weaponName}}</span>
<span class="weapon-degats">+{{weaponDegats}}</span>
</div>
{{/if}}
<div class="roll-skill-line">
{{#if statLabel}}<span class="stat-label">{{localize statLabel}}</span><span class="sep"> </span>{{/if}}
<span class="skill-label">{{localize skillLabel}}</span>
@@ -24,7 +32,13 @@
<div class="roll-form-rows">
{{!-- Difficulté --}}
{{!-- Difficulté : sélect standard OU input Corps PNJ en combat --}}
{{#if isCombat}}
<div class="form-row-line form-corps-pnj">
<label for="corpsPnj">{{localize "CELESTOPOL.Combat.corpsPnj"}}</label>
<input type="number" id="corpsPnj" name="corpsPnj" value="7" min="1" max="30" class="corps-pnj-input">
</div>
{{else}}
<div class="form-row-line">
<label for="difficulty">{{localize "CELESTOPOL.Roll.difficulty"}}</label>
<select id="difficulty" name="difficulty">
@@ -35,6 +49,7 @@
{{/each}}
</select>
</div>
{{/if}}
{{!-- Options non disponibles en test de résistance --}}
{{#unless isResistance}}