Fi creature sheet

This commit is contained in:
2020-09-20 21:14:05 +02:00
parent 43c5f6570c
commit ad8354217c
6 changed files with 38 additions and 71 deletions

View File

@ -53,8 +53,6 @@ export class RdDActorCreatureSheet extends ActorSheet {
data.data.nbGraves = this.actor.GetNumberBlessures(data.data.blessures.graves.liste );
data.data.nbCritiques = this.actor.GetNumberBlessures(data.data.blessures.critiques.liste );
// 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.competencecreature = data.itemsByType["competencecreature"];
return data;
@ -147,14 +145,6 @@ export class RdDActorCreatureSheet extends ActorSheet {
this.actor.santeIncDec("endurance", -1);
this.render(true);
});
html.find('#fatigue-plus').click((event) => {
this.actor.santeIncDec("fatigue", 1);
this.render(true);
});
html.find('#fatigue-moins').click((event) => {
this.actor.santeIncDec("fatigue", -1);
this.render(true);
});
}

View File

@ -494,7 +494,7 @@ export class RdDActor extends Actor {
//console.log(name, inc, data.value);
let diffEndurance = sante.endurance.max - this.data.data.sante.endurance.value;
if ( sante.fatigue.value < diffEndurance) // If endurance lost, then the same amount of fatigue cannot be recovered
if ( sante.fatigue && sante.fatigue.value < diffEndurance) // If endurance lost, then the same amount of fatigue cannot be recovered
sante.fatigue.value = diffEndurance;
//console.log("SANTE::::", sante);
@ -728,7 +728,6 @@ export class RdDActor extends Actor {
armeItem = { name: compName, data: { dommages: compItem.data.dommages} };
}
compItem.data.defaut_carac = "carac_creature"; // Fake default competence
console.log("V:", compItem.data.carac_value, compItem)
let rollData = {
"competence": compItem,
"arme": armeItem,