feat: gestion de la Fiabilité du matériel (test de Fiabilité + réparations)

- module/system/reliability.mjs : VermineReliability
  - Test de Fiabilité : jet Xd10 (Mineurs 1D / Graves 3D / Critiques 5D),
    chaque dé >= Fiabilité inflige 1 Dommage ; réduit Fiabilité et dommages
    cumulés (panne/état/effet) ; destruction à 0
  - Traits appliqués : Coque (absorbe n puis se perd), Cassant (+1 perte),
    Étanche (Dommages d'immersion ignorés si Fiabilité au max)
  - Réparations : classique (Précision + Artisanat/Mécanique/Technologie/
    Armurerie vs Fiabilité d'origine + Handicap de panne, +1 Fiabilité/Réussite)
    et de fortune (Précision + Bricolage, panne réparée sans gain de Fiabilité)
- ReliabilityDialog (test/réparation) + cartes de chat dédiées
- Boutons Test de Fiabilité / Réparer sur les fiches d'items (weapon/defense/item)
- i18n fr/en + styles des cartes et boutons
This commit is contained in:
2026-08-07 08:57:35 +02:00
parent d499f60386
commit 70a97796a3
10 changed files with 688 additions and 1 deletions
+53
View File
@@ -0,0 +1,53 @@
<div class="roll-dialog-content">
{{#if isTest}}
<div class="form-group">
<label>{{ localize "VERMINE.reliability_severity" }}</label>
<div class="flexrow flex-wrap reliability-severities">
{{#each severities}}
<label class="reliability-option">
<input type="radio" name="severity" value="{{this.key}}" {{#if this.selected}}checked{{/if}}>
<span>{{this.label}}</span>
</label>
{{/each}}
</div>
</div>
{{#if hasEtanche}}
<div class="form-group">
<label class="flexrow reliability-option">
<input type="checkbox" id="reliability-immersion" name="immersion">
<span>{{ localize "VERMINE.reliability_immersion" }}</span>
</label>
</div>
{{/if}}
{{else}}
<div class="form-group">
<label>{{ localize "VERMINE.reliability_repair_mode" }}</label>
<div class="flexrow flex-wrap reliability-modes">
<label class="reliability-option">
<input type="radio" name="repairMode" value="classique" checked>
<span>{{ localize "VERMINE.reliability_repair_classic" }}</span>
</label>
<label class="reliability-option">
<input type="radio" name="repairMode" value="fortune">
<span>{{ localize "VERMINE.reliability_repair_fortune" }}</span>
</label>
</div>
</div>
<div class="form-group">
<label for="reliability-skill">{{ localize "VERMINE.reliability_skill" }}</label>
<select id="reliability-skill" name="skill">
{{#each skills}}
<option value="{{this.key}}">{{this.label}}</option>
{{/each}}
</select>
</div>
{{#unless hasActor}}
<p class="reliability-hint">{{ localize "VERMINE.reliability_need_actor" }}</p>
{{/unless}}
{{/if}}
<footer class="sheet-footer flexrow">
<button type="button" data-action="run">{{ localize "VERMINE.reliability_run" }}</button>
<button type="button" data-action="cancel">{{ localize "VERMINE.cancel" }}</button>
</footer>
</div>
@@ -38,6 +38,10 @@
</div>
</h4>
<div class="flexrow reliability-actions">
<button type="button" data-action="reliabilityTest" title="{{ localize 'VERMINE.reliability_test' }}"><i class="fas fa-flask"></i> {{ localize 'VERMINE.reliability_test' }}</button>
<button type="button" data-action="reliabilityRepair" title="{{ localize 'VERMINE.reliability_repair' }}"><i class="fas fa-hammer"></i> {{ localize 'VERMINE.reliability_repair' }}</button>
</div>
<h2>description</h2>
<fieldset>
<legend>{{localize "VERMINE.sheet.description"}}</legend>
+21
View File
@@ -0,0 +1,21 @@
<div class="vermine-reliability-message">
<div class="reliability-header flexrow">
{{#if item.img}}<img src="{{item.img}}" alt="{{item.name}}">{{/if}}
<h3>{{item.name}}{{ localize "VERMINE.reliability_repair" }}</h3>
</div>
<div class="reliability-meta flexrow flex-wrap">
<span class="reliability-meta-item"><strong>{{ localize "VERMINE.reliability_repair_mode" }}:</strong> {{modeLabel}}</span>
<span class="reliability-meta-item"><strong>{{ localize "VERMINE.reliability_skill" }}:</strong> {{skillLabel}}</span>
<span class="reliability-meta-item"><strong>{{ localize "VERMINE.difficulty" }}:</strong> {{difficulty}}</span>
{{#if handicap}}<span class="reliability-meta-item"><strong>{{ localize "VERMINE.handicap" }}:</strong> +{{handicap}}</span>{{/if}}
</div>
<ul class="flexrow reliability-results">
{{#each results}}
<li class="reliability-die {{#if this.isSuccess}}success{{/if}}">{{this.value}}</li>
{{/each}}
</ul>
<div class="reliability-summary flexrow flex-wrap">
<span><strong>{{ localize "VERMINE.reliability_successes" }}:</strong> {{successes}} / {{required}}</span>
<span><strong>{{ localize "VERMINE.reliability_result" }}:</strong> {{resultLabel}}</span>
</div>
</div>
+22
View File
@@ -0,0 +1,22 @@
<div class="vermine-reliability-message">
<div class="reliability-header flexrow">
{{#if item.img}}<img src="{{item.img}}" alt="{{item.name}}">{{/if}}
<h3>{{item.name}}{{ localize "VERMINE.reliability_test" }}</h3>
</div>
<div class="reliability-meta flexrow flex-wrap">
<span class="reliability-meta-item"><strong>{{ localize "VERMINE.reliability_severity" }}:</strong> {{severityLabel}}</span>
<span class="reliability-meta-item"><strong>{{ localize "VERMINE.reliability" }}:</strong> {{oldReliability}}</span>
</div>
<ul class="flexrow reliability-results">
{{#each results}}
<li class="reliability-die {{#if this.isDamage}}damage{{/if}}">{{this.value}}</li>
{{/each}}
</ul>
<div class="reliability-summary flexrow flex-wrap">
<span><strong>{{ localize "VERMINE.reliability_damages" }}:</strong> {{dommages}}</span>
<span><strong>{{ localize "VERMINE.reliability" }}:</strong> {{oldReliability}}{{newReliability}}</span>
{{#if state}}<span><strong>{{ localize "VERMINE.reliability_state" }}:</strong> {{state}}</span>{{/if}}
</div>
{{#each traitsNotes}}<p class="reliability-note">{{this}}</p>{{/each}}
{{#if destroyed}}<p class="reliability-destroyed">{{ localize "VERMINE.reliability_destroyed" }}</p>{{/if}}
</div>