L'état général ne s'applique pas toujours
- jets de chance - jets de résistance (Rêve Actuel) - jets de stress (ne passe pas par la fenêtre de résolution) RdD Page 93
This commit is contained in:
parent
54825fe756
commit
9e8ebdda0d
@ -71,7 +71,13 @@ export class RdDRollDialog extends Dialog {
|
||||
|
||||
rollData.finalLevel = rollLevel;
|
||||
rollData.caracValue = caracValue
|
||||
|
||||
|
||||
if (RdDRollDialog._isEtatGeneralApplicable(rollData)) {
|
||||
$(".etat-general").show();
|
||||
}
|
||||
else {
|
||||
$(".etat-general").hide();
|
||||
}
|
||||
// Sort management
|
||||
if ( rollData.selectedSort ) {
|
||||
//console.log("Toggle show/hide", rollData.selectedSort);
|
||||
@ -167,9 +173,16 @@ export class RdDRollDialog extends Dialog {
|
||||
});
|
||||
}
|
||||
|
||||
static _isEtatGeneralApplicable(rollData) {
|
||||
if (rollData.selectedCarac.label == 'Chance') return false;
|
||||
if (rollData.selectedCarac.label == 'Rêve Actuel') return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static _computeFinalLevel(rollData) {
|
||||
const etat = Misc.toInt(rollData.etat);
|
||||
const etat = RdDRollDialog._isEtatGeneralApplicable(rollData) ? Misc.toInt(rollData.etat) : 0;
|
||||
const diffConditions = Misc.toInt(rollData.diffConditions);
|
||||
let malusEnc = (rollData.surencMalusApply ) ? rollData.surencMalusValue : 0;
|
||||
let diffLibre = Misc.toInt(rollData.diffLibre);
|
||||
|
@ -45,7 +45,7 @@
|
||||
{{/if}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-surenc.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-natation.html"}}
|
||||
<div class="form-group">
|
||||
<div class="form-group etat-general">
|
||||
<label for="categorie">Etat général</label><label>{{numberFormat etat decimals=0 sign=true}}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -19,7 +19,7 @@
|
||||
</select>
|
||||
</div>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/dialog-roll-surenc.html"}}
|
||||
<div class="form-group">
|
||||
<div class="form-group etat-general">
|
||||
<label for="categorie">Etat général</label><label>{{numberFormat etat decimals=0 sign=true}}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -59,7 +59,7 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group etat-general">
|
||||
<label for="categorie">Etat général</label><label>{{numberFormat etat decimals=0 sign=true}}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
Loading…
Reference in New Issue
Block a user