#44 - Gestion sur encombrement corrigée
This commit is contained in:
parent
a13d2c7ea9
commit
11e8a64824
@ -1086,7 +1086,9 @@ export class RdDActor extends Actor {
|
||||
difficultesLibres: CONFIG.RDD.difficultesLibres,
|
||||
surencMalusFlag: false, // A ne pas utiliser pour les sorts
|
||||
surencMalusValue: 0,
|
||||
surencMalusApply: false
|
||||
surencMalusApply: false,
|
||||
isNatation: false,
|
||||
useEncForNatation: false
|
||||
}
|
||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html', rollData);
|
||||
new RdDRollDialog("sort", html, rollData, this ).render(true);
|
||||
@ -1114,7 +1116,9 @@ export class RdDActor extends Actor {
|
||||
diffLibre: 0,
|
||||
surencMalusFlag: (this.data.data.compteurs.surenc.value < 0),
|
||||
surencMalusValue: this.data.data.compteurs.surenc.value,
|
||||
surencMalusApply: false
|
||||
surencMalusApply: false,
|
||||
isNatation: false,
|
||||
useEncForNatation: false
|
||||
}
|
||||
console.log(caracName, rollData);
|
||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html', rollData);
|
||||
@ -1190,7 +1194,10 @@ export class RdDActor extends Actor {
|
||||
coupsNonMortels: false,
|
||||
surencMalusFlag: (this.data.data.compteurs.surenc.value < 0),
|
||||
surencMalusValue: this.data.data.compteurs.surenc.value,
|
||||
surencMalusApply: false
|
||||
surencMalusApply: false,
|
||||
isNatation: name.toLowerCase().includes("natation"),
|
||||
useEncForNatation: false,
|
||||
encValueForNatation: (this.encombrementTotal) ? Math.round(this.encombrementTotal) : 0
|
||||
}
|
||||
|
||||
if ( competence.type == 'competencecreature') { // Specific case for Creatures
|
||||
|
@ -156,6 +156,10 @@ export class RdDRollDialog extends Dialog {
|
||||
this.rollData.surencMalusApply = event.currentTarget.checked;
|
||||
updateRollResult(rollData);
|
||||
});
|
||||
html.find('#useEncForNatation').change((event) => {
|
||||
this.rollData.useEncForNatation = event.currentTarget.checked;
|
||||
updateRollResult(rollData);
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -164,6 +168,7 @@ export class RdDRollDialog extends Dialog {
|
||||
const diffConditions = Misc.toInt(rollData.diffConditions);
|
||||
let malusEnc = (rollData.surencMalusApply ) ? rollData.surencMalusValue : 0;
|
||||
let diffLibre = Misc.toInt(rollData.diffLibre);
|
||||
let malusEncNatation = (rollData.useEncForNatation) ? -rollData.encValueForNatation : 0;
|
||||
let diffCompetence = 0;
|
||||
if (rollData.competence) {
|
||||
diffCompetence = Misc.toInt(rollData.competence.data.niveau);
|
||||
@ -172,7 +177,7 @@ export class RdDRollDialog extends Dialog {
|
||||
diffCompetence = Misc.toInt(rollData.selectedDraconic.data.niveau);
|
||||
diffLibre = RdDItemSort.getDifficulte(rollData.selectedSort, diffLibre);
|
||||
}
|
||||
return etat + diffCompetence + diffLibre + diffConditions + malusEnc;
|
||||
return etat + diffCompetence + diffLibre + diffConditions + malusEnc + malusEncNatation;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -150,7 +150,7 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-surenc.html',
|
||||
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-natation.html',
|
||||
// Calendrier
|
||||
'systems/foundryvtt-reve-de-dragon/templates/calendar-template.html',
|
||||
// Conteneur/item in Actor sheet
|
||||
|
@ -2,7 +2,7 @@
|
||||
"name": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||
"version": "0.9.92",
|
||||
"version": "0.9.93",
|
||||
"minimumCoreVersion": "0.7.5",
|
||||
"compatibleCoreVersion": "0.7.6",
|
||||
"templateVersion": 51,
|
||||
|
@ -38,6 +38,7 @@
|
||||
</div>
|
||||
{{/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">
|
||||
<label for="categorie">Etat général</label><label>{{numberFormat etat decimals=0 sign=true}}</label>
|
||||
</div>
|
||||
|
6
templates/dialog-roll-natation.html
Normal file
6
templates/dialog-roll-natation.html
Normal file
@ -0,0 +1,6 @@
|
||||
{{#if isNatation}}
|
||||
<div class="form-group">
|
||||
<label for="xp">Appliquer l'encombrement comme malus à la Natation (-{{encValueForNatation}} ) ? </label>
|
||||
<input class="attribute-value" type="checkbox" id="useEncForNatation" name="useEncForNatation" {{#if useEncForNatation}}checked{{/if}}/>
|
||||
</div>
|
||||
{{/if}}
|
Loading…
Reference in New Issue
Block a user