feat: gestion de l'expérience (XP)

- Schéma xp dans CelestopolCharacter : actuel (éditable), log[] ({montant, raison, date}), depense (calculé dans prepareDerivedData)
- Bouton 'Dépenser XP' → DialogV2 (montant + raison) : décrémente actuel, logge l'entrée
- Suppression d'entrée de log avec remboursement des points (mode édition)
- Section XP en haut de l'onglet Biographie : compteurs, tableau du log, référentiel des coûts
- i18n : section CELESTOPOL.XP.* complète
- CSS : .xp-section avec compteurs, tableau de log et accordéon de référence

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-31 00:33:59 +02:00
parent 79a68ee9ab
commit 9dbd614c5a
40 changed files with 849 additions and 529 deletions

View File

@@ -1,5 +1,76 @@
<div class="tab biography {{tab.cssClass}}" data-group="sheet" data-tab="biography">
{{!-- Section XP --}}
<div class="xp-section">
<div class="section-header">{{localize "CELESTOPOL.XP.title"}}</div>
<div class="xp-counters">
<div class="xp-counter">
<label>{{localize "CELESTOPOL.XP.actuel"}}</label>
{{formInput systemFields.xp.fields.actuel value=system.xp.actuel name="system.xp.actuel"}}
</div>
<div class="xp-counter xp-depense-counter">
<label>{{localize "CELESTOPOL.XP.depense"}}</label>
<span class="xp-depense-value">{{system.xp.depense}}</span>
</div>
{{#if isPlayMode}}
<button type="button" class="xp-btn-depenser" data-action="depenseXp">
<i class="fa-solid fa-coins"></i> {{localize "CELESTOPOL.XP.depenser"}}
</button>
{{/if}}
</div>
{{!-- Log des dépenses --}}
{{#unless xpLogEmpty}}
<table class="xp-log-table">
<thead>
<tr>
<th>{{localize "CELESTOPOL.XP.date"}}</th>
<th>{{localize "CELESTOPOL.XP.raison"}}</th>
<th>{{localize "CELESTOPOL.XP.montant"}}</th>
{{#if isEditMode}}<th></th>{{/if}}
</tr>
</thead>
<tbody>
{{#each system.xp.log}}
<tr>
<td class="xp-date">{{this.date}}</td>
<td class="xp-raison">{{this.raison}}</td>
<td class="xp-montant">{{this.montant}}</td>
{{#if ../isEditMode}}
<td class="xp-suppr-cell">
<button type="button" class="xp-btn-suppr" data-action="supprimerXpLog"
data-idx="{{@index}}" title="{{localize 'CELESTOPOL.XP.supprimer'}}">
<i class="fa-solid fa-trash"></i>
</button>
</td>
{{/if}}
</tr>
{{/each}}
</tbody>
</table>
{{/unless}}
{{!-- Tableau de référence des coûts --}}
<details class="xp-ref">
<summary>{{localize "CELESTOPOL.XP.refTitle"}}</summary>
<table class="xp-ref-table">
<thead>
<tr>
<th>{{localize "CELESTOPOL.XP.refAmelioration"}}</th>
<th>{{localize "CELESTOPOL.XP.refCout"}}</th>
</tr>
</thead>
<tbody>
<tr><td>{{localize "CELESTOPOL.XP.refAugmenterSpec"}}</td><td>{{localize "CELESTOPOL.XP.refCoutNiveau"}}</td></tr>
<tr><td>{{localize "CELESTOPOL.XP.refAcquerirAspect"}}</td><td>5</td></tr>
<tr><td>{{localize "CELESTOPOL.XP.refAugmenterAspect"}}</td><td>5</td></tr>
<tr><td>{{localize "CELESTOPOL.XP.refAcquerirAttribut"}}</td><td>{{localize "CELESTOPOL.XP.refCoutAttributTotal"}}</td></tr>
</tbody>
</table>
</details>
</div>
{{!-- Description / Biographie --}}
<div class="biography-section">
<div class="section-header">{{localize "CELESTOPOL.Actor.description"}}</div>