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

@@ -7,6 +7,14 @@
{{/if}}
<div class="roll-info">
<span class="actor-name">{{actorName}}</span>
{{!-- Arme (mode combat) --}}
{{#if isCombat}}
<span class="weapon-info-header">
<span class="weapon-icon-small">⚔</span>
<span class="weapon-name-small">{{weaponName}}</span>
{{#if (gt weaponDegats "0")}}<span class="weapon-degats-small">+{{weaponDegats}}</span>{{/if}}
</span>
{{/if}}
<span class="skill-info">
{{#if statLabel}}<span class="stat-lbl">{{statLabel}}</span><span class="sep"> </span>{{/if}}
<span class="skill-lbl">{{skillLabel}}</span>
@@ -64,7 +72,7 @@
<span class="vs-wrap">
<span class="vs-label">vs</span>
<span class="diff-label">{{difficultyLabel}}</span>
<span class="diff-val">({{difficultyValue}})</span>
{{#unless isCombat}}<span class="diff-val">({{difficultyValue}})</span>{{/unless}}
</span>
{{#if margin}}
<span class="margin-badge {{#if marginAbove}}above{{else}}below{{/if}}">
@@ -107,27 +115,46 @@
{{#if autoSuccess}}
<span class="result-icon">★</span>
<span class="result-label">{{localize "CELESTOPOL.Roll.autoSuccess"}}</span>
{{else if isTie}}
<span class="result-icon">⚖</span>
<span class="result-label">{{localize "CELESTOPOL.Combat.tie"}}</span>
<span class="result-desc">{{localize "CELESTOPOL.Combat.tieDesc"}}</span>
{{else if isCriticalSuccess}}
<span class="result-icon">✦✦</span>
<span class="result-label">{{localize "CELESTOPOL.Roll.criticalSuccess"}}</span>
{{#if isCombat}}
<span class="result-desc">{{localize "CELESTOPOL.Combat.successHit"}}{{#if (gt weaponDegats "0")}} +{{weaponDegats}} {{localize "CELESTOPOL.Combat.weaponDamage"}}{{/if}}</span>
{{else}}
<span class="result-desc">{{localize "CELESTOPOL.Roll.criticalSuccessDesc"}}</span>
{{/if}}
{{else if isSuccess}}
<span class="result-icon">✦</span>
<span class="result-label">{{localize "CELESTOPOL.Roll.success"}}</span>
{{#if isCombat}}
<span class="result-desc">{{localize "CELESTOPOL.Combat.successHit"}}{{#if (gt weaponDegats "0")}} +{{weaponDegats}} {{localize "CELESTOPOL.Combat.weaponDamage"}}{{/if}}</span>
{{/if}}
{{else if isCriticalFailure}}
<span class="result-icon">✖✖</span>
<span class="result-label">{{localize "CELESTOPOL.Roll.criticalFailure"}}</span>
{{#if isCombat}}
<span class="result-desc">{{#if (eq weaponType "melee")}}{{localize "CELESTOPOL.Combat.failureHit"}}{{else}}{{localize "CELESTOPOL.Combat.distanceNoWound"}}{{/if}}</span>
{{else}}
<span class="result-desc">{{localize "CELESTOPOL.Roll.criticalFailureDesc"}}</span>
{{/if}}
{{else if isFailure}}
<span class="result-icon">✖</span>
<span class="result-label">{{localize "CELESTOPOL.Roll.failure"}}</span>
{{#if isCombat}}
<span class="result-desc">{{#if (eq weaponType "melee")}}{{localize "CELESTOPOL.Combat.failureHit"}}{{else}}{{localize "CELESTOPOL.Combat.distanceNoWound"}}{{/if}}</span>
{{/if}}
{{/if}}
</div>
{{!-- Blessure auto-cochée (test de résistance raté) --}}
{{!-- Blessure auto-cochée (résistance ratée ou combat mêlée raté) --}}
{{#if woundTaken}}
<div class="resistance-wound-notice">
<span class="wound-icon">🩹</span>
<span>{{localize "CELESTOPOL.Roll.woundTaken"}}</span>
<span>{{#if isCombat}}{{localize "CELESTOPOL.Combat.playerWounded"}}{{else}}{{localize "CELESTOPOL.Roll.woundTaken"}}{{/if}}</span>
</div>
{{/if}}