Gestion des compteur et du Stress

This commit is contained in:
2020-08-29 22:52:41 +02:00
parent 1fd3c9d22f
commit ca8bf7f6d5
7 changed files with 130 additions and 25 deletions

View File

@@ -94,7 +94,8 @@ export class RdDActorSheet extends ActorSheet {
data.data.nbLegeres = this.actor.GetNumberBlessures(data.data.blessures.legeres.liste );
data.data.nbGraves = this.actor.GetNumberBlessures(data.data.blessures.graves.liste );
data.data.nbCritiques = this.actor.GetNumberBlessures(data.data.blessures.critiques.liste );
console.log( data.data.compteurs );
// low is normal, this the base used to compute the grid.
data.data.fatigueHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix( data.data.sante.fatigue.value, data.data.sante.endurance.max ).html() + "</table>";
data.data.materiel = this._checkNull(data.itemsByType['objet']);
@@ -234,6 +235,17 @@ export class RdDActorSheet extends ActorSheet {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCompetenceXP( compName, parseInt(event.target.value) );
} );
// On stress change
html.find('.compteur-edit').change((event) => {
let fieldName = event.currentTarget.attributes.name.value;
this.actor.updateCompteurValue( fieldName, parseInt(event.target.value) );
} );
html.find('#stress-test').click((event) => {
this.actor.stressTest();
this.render(true);
});
html.find('#vie-plus').click((event) => {
this.actor.santeIncDec("vie", 1);