Files
fvtt-celestopol/templates/roll-dialog.hbs
LeRatierBretonnier 54eacf6afc Fix formule de dés : 2d8 de base (règles Célestopol)
Correction majeure de la mécanique de jet selon les règles :

- Formule : 2d8 + Spécialisation + modificateurs (blessures/aspect/manual)
  (vs. ancienne formule erronée : Nd6 pool variable)
- Dé de la Lune : 1d8 narratif optionnel (résultat 1-8 → Triomphe /
  Brio / Contrecoup / Catastrophe) — pas un bonus numérique
- Destin : disponible uniquement jauge pleine (lvl=8), donne 3d8,
  vide la jauge entière après usage
- system.mjs : MOON_DIE_FACES (tableau 1-8) + MOON_RESULT_TYPES
- roll.mjs : logique complète réécrite (2d8, lune séparée, destin reset)
- character/npc.mjs : prefs.rollMoonDie + destGaugeFull
- roll-dialog.hbs : sans grille lune, checkbox dé lune, destin conditionnel
- chat-message.hbs : résultat dé lune narratif (phase + type + desc),
  dés .d8, suppression moonSymbol/moonBonus header
- roll.less : .form-moon-row, .moon-die-result avec couleurs Triomphe/
  Brio/Contrecoup/Catastrophe
- lang/fr.json : Moon.triomphe/brio/contrecoup/catastrophe + Full descs,
  Roll.rollMoonDie/destGaugeFull/destGaugeEmpty/baseDice

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-29 16:19:04 +02:00

129 lines
4.7 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div class="roll-dialog-content">
{{!-- En-tête : acteur + domaine + formule de base --}}
<div class="roll-info-block">
<div class="roll-actor">{{actorName}}</div>
<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>
</div>
<div class="roll-dice-summary">
<div class="dice-breakdown">
<span class="base-dice">2d8</span>
<span class="plus-sign"> + </span>
<span class="dval">{{skillValue}}</span>
{{#if woundMalus}}
<span class="dminus"> {{abs woundMalus}}</span>
{{/if}}
</div>
{{#if woundLabel}}
<div class="wound-info">⚠ {{woundLabel}}</div>
{{/if}}
</div>
</div>
<div class="roll-form-rows">
{{!-- Difficulté --}}
<div class="form-row-line">
<label for="difficulty">{{localize "CELESTOPOL.Roll.difficulty"}}</label>
<select id="difficulty" name="difficulty">
{{#each difficultyChoices as |diff key|}}
<option value="{{key}}" {{#if (eq key ../defaultDifficulty)}}selected{{/if}}>
{{localize diff.label}}{{#if diff.value}} ({{diff.value}}){{/if}}
</option>
{{/each}}
</select>
</div>
{{!-- Modificateur & Aspect côte à côte --}}
<div class="form-two-col">
<div class="form-row-line">
<label for="modifier">{{localize "CELESTOPOL.Roll.modifier"}}</label>
<input type="number" id="modifier" name="modifier" value="0" min="-10" max="10">
</div>
<div class="form-row-line">
<label for="aspectModifier">{{localize "CELESTOPOL.Roll.aspect"}}</label>
<input type="number" id="aspectModifier" name="aspectModifier" value="0" min="-4" max="4">
</div>
</div>
{{!-- Dé de la Lune --}}
<div class="form-moon-row">
<label class="moon-toggle" for="rollMoonDie">
<input type="checkbox" id="rollMoonDie" name="rollMoonDie" {{#if defaultRollMoonDie}}checked{{/if}}>
<span class="moon-icon">🌑</span>
<span class="moon-text">{{localize "CELESTOPOL.Roll.rollMoonDie"}}</span>
</label>
</div>
{{!-- Destin (3d8) — seulement si jauge pleine --}}
<div class="form-destin-row {{#unless destGaugeFull}}destin-disabled{{/unless}}">
<label class="destin-toggle" for="useDestin">
<input type="checkbox" id="useDestin" name="useDestin" {{#unless destGaugeFull}}disabled{{/unless}}>
<span class="destin-icon">✦</span>
<span class="destin-text">
<span class="destin-main">{{localize "CELESTOPOL.Roll.destin"}}</span>
<span class="destin-bonus">{{localize "CELESTOPOL.Roll.destinBonus"}}</span>
</span>
{{#if destGaugeFull}}
<span class="destin-badge full">{{localize "CELESTOPOL.Roll.destGaugeFull"}}</span>
{{else}}
<span class="destin-badge empty">{{localize "CELESTOPOL.Roll.destGaugeEmpty"}}</span>
{{/if}}
</label>
</div>
{{!-- Visibilité --}}
<div class="form-row-line form-visibility">
<label for="visibility">{{localize "CELESTOPOL.Roll.visibility"}}</label>
<select id="visibility" name="visibility">
<option value="publicroll">{{localize "CELESTOPOL.Roll.visibilityPublic"}}</option>
<option value="gmroll">{{localize "CELESTOPOL.Roll.visibilityGM"}}</option>
<option value="selfroll">{{localize "CELESTOPOL.Roll.visibilitySelf"}}</option>
</select>
</div>
</div>
{{!-- Prévisualisation formule --}}
<div class="dice-preview">
<span class="preview-label">{{localize "CELESTOPOL.Roll.formula"}}</span>
<span class="preview-formula" id="preview-formula">2d8</span>
</div>
</div>
<script>
(function() {
const wrap = document.querySelector('.roll-dialog-content');
if (!wrap) return;
const skillVal = {{skillValue}};
const woundMalus = {{woundMalus}};
function update() {
const modifier = parseInt(wrap.querySelector('#modifier')?.value ?? 0) || 0;
const aspectMod = parseInt(wrap.querySelector('#aspectModifier')?.value ?? 0) || 0;
const useDestin = wrap.querySelector('#useDestin')?.checked;
const ndice = useDestin ? 3 : 2;
const totalMod = skillVal + woundMalus + modifier + aspectMod;
let formula = `${ndice}d8`;
if (totalMod > 0) formula += ` + ${totalMod}`;
if (totalMod < 0) formula += ` ${Math.abs(totalMod)}`;
const previewEl = wrap.querySelector('#preview-formula');
if (previewEl) previewEl.textContent = formula;
}
wrap.querySelectorAll('#modifier, #aspectModifier, #useDestin').forEach(el => {
el.addEventListener('change', update);
el.addEventListener('input', update);
});
update();
})();
</script>