feat: ajout du Mod. de situation (-8 à +8) dans toutes les fenêtres de jet
- Select situationMod (-8 → +8 par pas de 1) visible sur tous les jets (y compris résistance) - Intégré dans la prévisualisation de formule (update dynamique) - Pris en compte dans totalModifier au même titre que les autres mods - Respecte la règle 'Puiser' (malus ignoré si puiser activé) - Affiché dans la carte de tchat si non nul (symbole ◈) - i18n : CELESTOPOL.Roll.situationMod Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 2.2 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 112 KiB |
@@ -185,7 +185,7 @@
|
|||||||
"puiser": "Puiser dans ses ressources",
|
"puiser": "Puiser dans ses ressources",
|
||||||
"puiserDesc": "Ignore tous les malus — coche 1 case de Spleen",
|
"puiserDesc": "Ignore tous les malus — coche 1 case de Spleen",
|
||||||
"usedPuiser": "Ressources puisées — malus ignorés, +1 Spleen",
|
"usedPuiser": "Ressources puisées — malus ignorés, +1 Spleen",
|
||||||
"autoSuccess": "Réussite automatique",
|
"situationMod": "Mod. de situation",
|
||||||
"resistanceTest": "Test de résistance",
|
"resistanceTest": "Test de résistance",
|
||||||
"resistanceClickToRoll": "Lancer un test de résistance",
|
"resistanceClickToRoll": "Lancer un test de résistance",
|
||||||
"woundTaken": "Blessure cochée suite à l'échec"
|
"woundTaken": "Blessure cochée suite à l'échec"
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ export class CelestopolRoll extends Roll {
|
|||||||
value: v,
|
value: v,
|
||||||
label: v > 0 ? `+${v}` : `${v}`,
|
label: v > 0 ? `+${v}` : `${v}`,
|
||||||
}))
|
}))
|
||||||
|
const situationChoices = Array.from({ length: 17 }, (_, i) => {
|
||||||
|
const v = i - 8
|
||||||
|
return { value: v, label: v > 0 ? `+${v}` : `${v}` }
|
||||||
|
})
|
||||||
|
|
||||||
const dialogContext = {
|
const dialogContext = {
|
||||||
actorName: options.actorName,
|
actorName: options.actorName,
|
||||||
@@ -79,6 +83,7 @@ export class CelestopolRoll extends Roll {
|
|||||||
weaponDegats,
|
weaponDegats,
|
||||||
modifierChoices,
|
modifierChoices,
|
||||||
aspectChoices,
|
aspectChoices,
|
||||||
|
situationChoices,
|
||||||
fortuneValue,
|
fortuneValue,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,6 +113,7 @@ export class CelestopolRoll extends Roll {
|
|||||||
const autoSucc = rawMod === "auto"
|
const autoSucc = rawMod === "auto"
|
||||||
const modifier = autoSucc ? 0 : (parseInt(rawMod ?? 0) || 0)
|
const modifier = autoSucc ? 0 : (parseInt(rawMod ?? 0) || 0)
|
||||||
const aspectMod = parseInt(wrap.querySelector('#aspectModifier')?.value ?? 0) || 0
|
const aspectMod = parseInt(wrap.querySelector('#aspectModifier')?.value ?? 0) || 0
|
||||||
|
const situMod = parseInt(wrap.querySelector('#situationMod')?.value ?? 0) || 0
|
||||||
const useDestin = wrap.querySelector('#useDestin')?.checked
|
const useDestin = wrap.querySelector('#useDestin')?.checked
|
||||||
const useFort = wrap.querySelector('#useFortune')?.checked
|
const useFort = wrap.querySelector('#useFortune')?.checked
|
||||||
const puiser = wrap.querySelector('#puiserRessources')?.checked
|
const puiser = wrap.querySelector('#puiserRessources')?.checked
|
||||||
@@ -128,7 +134,8 @@ export class CelestopolRoll extends Roll {
|
|||||||
const effWound = puiser ? 0 : woundMalus
|
const effWound = puiser ? 0 : woundMalus
|
||||||
const effMod = puiser ? Math.max(0, modifier) : modifier
|
const effMod = puiser ? Math.max(0, modifier) : modifier
|
||||||
const effAspect = puiser ? Math.max(0, aspectMod) : aspectMod
|
const effAspect = puiser ? Math.max(0, aspectMod) : aspectMod
|
||||||
const totalMod = skillValue + effWound + effMod + effAspect
|
const effSit = puiser ? Math.max(0, situMod) : situMod
|
||||||
|
const totalMod = skillValue + effWound + effMod + effAspect + effSit
|
||||||
|
|
||||||
let formula
|
let formula
|
||||||
if (autoSucc) {
|
if (autoSucc) {
|
||||||
@@ -146,7 +153,7 @@ export class CelestopolRoll extends Roll {
|
|||||||
if (previewEl) previewEl.textContent = formula
|
if (previewEl) previewEl.textContent = formula
|
||||||
}
|
}
|
||||||
|
|
||||||
wrap.querySelectorAll('#modifier, #aspectModifier, #useDestin, #useFortune, #puiserRessources, #corpsPnj')
|
wrap.querySelectorAll('#modifier, #aspectModifier, #situationMod, #useDestin, #useFortune, #puiserRessources, #corpsPnj')
|
||||||
.forEach(el => {
|
.forEach(el => {
|
||||||
el.addEventListener('change', update)
|
el.addEventListener('change', update)
|
||||||
el.addEventListener('input', update)
|
el.addEventListener('input', update)
|
||||||
@@ -181,6 +188,7 @@ export class CelestopolRoll extends Roll {
|
|||||||
const autoSuccess = rollContext.modifier === "auto"
|
const autoSuccess = rollContext.modifier === "auto"
|
||||||
const modifier = autoSuccess ? 0 : (parseInt(rollContext.modifier ?? 0) || 0)
|
const modifier = autoSuccess ? 0 : (parseInt(rollContext.modifier ?? 0) || 0)
|
||||||
const aspectMod = parseInt(rollContext.aspectModifier ?? 0) || 0
|
const aspectMod = parseInt(rollContext.aspectModifier ?? 0) || 0
|
||||||
|
const situationMod = parseInt(rollContext.situationMod ?? 0) || 0
|
||||||
const useDestin = destGaugeFull && (rollContext.useDestin === true || rollContext.useDestin === "true")
|
const useDestin = destGaugeFull && (rollContext.useDestin === true || rollContext.useDestin === "true")
|
||||||
const useFortune = fortuneValue > 0 && (rollContext.useFortune === true || rollContext.useFortune === "true")
|
const useFortune = fortuneValue > 0 && (rollContext.useFortune === true || rollContext.useFortune === "true")
|
||||||
const puiserRessources = rollContext.puiserRessources === true || rollContext.puiserRessources === "true"
|
const puiserRessources = rollContext.puiserRessources === true || rollContext.puiserRessources === "true"
|
||||||
@@ -194,10 +202,11 @@ export class CelestopolRoll extends Roll {
|
|||||||
const effectiveWoundMalus = effectivePuiser ? 0 : woundMalus
|
const effectiveWoundMalus = effectivePuiser ? 0 : woundMalus
|
||||||
const effectiveModifier = effectivePuiser ? Math.max(0, modifier) : modifier
|
const effectiveModifier = effectivePuiser ? Math.max(0, modifier) : modifier
|
||||||
const effectiveAspectMod = effectivePuiser ? Math.max(0, aspectMod) : aspectMod
|
const effectiveAspectMod = effectivePuiser ? Math.max(0, aspectMod) : aspectMod
|
||||||
|
const effectiveSituationMod = effectivePuiser ? Math.max(0, situationMod) : situationMod
|
||||||
|
|
||||||
// Fortune : 1d8 + 8 ; Destin : 3d8 ; sinon : 2d8
|
// Fortune : 1d8 + 8 ; Destin : 3d8 ; sinon : 2d8
|
||||||
const nbDice = (!isResistance && useDestin) ? 3 : 2
|
const nbDice = (!isResistance && useDestin) ? 3 : 2
|
||||||
const totalModifier = skillValue + effectiveWoundMalus + effectiveAspectMod + effectiveModifier
|
const totalModifier = skillValue + effectiveWoundMalus + effectiveAspectMod + effectiveModifier + effectiveSituationMod
|
||||||
const formula = (!isResistance && useFortune)
|
const formula = (!isResistance && useFortune)
|
||||||
? buildFormula(1, totalModifier + 8)
|
? buildFormula(1, totalModifier + 8)
|
||||||
: buildFormula(nbDice, totalModifier)
|
: buildFormula(nbDice, totalModifier)
|
||||||
@@ -219,6 +228,7 @@ export class CelestopolRoll extends Roll {
|
|||||||
difficultyValue: diffConfig.value,
|
difficultyValue: diffConfig.value,
|
||||||
modifier: effectiveModifier,
|
modifier: effectiveModifier,
|
||||||
aspectMod: effectiveAspectMod,
|
aspectMod: effectiveAspectMod,
|
||||||
|
situationMod: effectiveSituationMod,
|
||||||
woundMalus: effectiveWoundMalus,
|
woundMalus: effectiveWoundMalus,
|
||||||
autoSuccess,
|
autoSuccess,
|
||||||
isResistance,
|
isResistance,
|
||||||
|
|||||||
@@ -63,6 +63,10 @@
|
|||||||
<span class="fl-op">{{#if (gt aspectMod 0)}}+{{else}}−{{/if}}</span>
|
<span class="fl-op">{{#if (gt aspectMod 0)}}+{{else}}−{{/if}}</span>
|
||||||
<span class="fl-asp" title="{{localize "CELESTOPOL.Roll.usedAspect"}}">✦{{abs aspectMod}}</span>
|
<span class="fl-asp" title="{{localize "CELESTOPOL.Roll.usedAspect"}}">✦{{abs aspectMod}}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#if situationMod}}
|
||||||
|
<span class="fl-op">{{#if (gt situationMod 0)}}+{{else}}−{{/if}}</span>
|
||||||
|
<span class="fl-mod sit" title="{{localize "CELESTOPOL.Roll.situationMod"}}">◈{{abs situationMod}}</span>
|
||||||
|
{{/if}}
|
||||||
<span class="fl-sep">=</span>
|
<span class="fl-sep">=</span>
|
||||||
<span class="fl-total">{{total}}</span>
|
<span class="fl-total">{{total}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -134,6 +134,16 @@
|
|||||||
|
|
||||||
{{/unless}}{{!-- /isResistance --}}
|
{{/unless}}{{!-- /isResistance --}}
|
||||||
|
|
||||||
|
{{!-- Modificateur de situation (-8 à +8) — tous les jets --}}
|
||||||
|
<div class="form-row-line form-situation-mod">
|
||||||
|
<label for="situationMod">{{localize "CELESTOPOL.Roll.situationMod"}}</label>
|
||||||
|
<select id="situationMod" name="situationMod">
|
||||||
|
{{#each situationChoices}}
|
||||||
|
<option value="{{this.value}}" {{#if (eq this.value 0)}}selected{{/if}}>{{this.label}}</option>
|
||||||
|
{{/each}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
{{!-- Visibilité --}}
|
{{!-- Visibilité --}}
|
||||||
<div class="form-row-line form-visibility">
|
<div class="form-row-line form-visibility">
|
||||||
<label for="visibility">{{localize "CELESTOPOL.Roll.visibility"}}</label>
|
<label for="visibility">{{localize "CELESTOPOL.Roll.visibility"}}</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user