Gestion des signes draconiques #455

Closed
vincent.vandeme wants to merge 233 commits from v1.4-signes-draconiques into master
Showing only changes of commit a9d49d793c - Show all commits

View File

@ -167,7 +167,7 @@ export class RdDActor extends Actor {
// Initialize empty items // Initialize empty items
RdDCarac.computeCarac(actorData.data); RdDCarac.computeCarac(actorData.data);
this.computeIsHautRevant(); this.computeIsHautRevant();
this.computeEncombrementTotalEtMalusArmure(); await this.computeEncombrementTotalEtMalusArmure();
this.computePrixTotalEquipement(); this.computePrixTotalEquipement();
this.computeEtatGeneral(); this.computeEtatGeneral();
// Sanity check // Sanity check
@ -1083,11 +1083,10 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
computeEncombrement() { computeEncombrement() {
const tplData = Misc.templateData(this); this.encTotal = this.filterItemsData(it => it.data.encombrement != undefined)
tplData.encTotal = this.filterItemsData(it => it.data.encombrement != undefined)
.map(it => it.data.encTotal) .map(it => it.data.encTotal)
.reduce(Misc.sum(), 0); .reduce(Misc.sum(), 0);
return tplData.encTotal; return this.encTotal;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -1104,12 +1103,11 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
computePrixTotalEquipement() { computePrixTotalEquipement() {
const tplData = Misc.templateData(this); this.prixTotalEquipement = this.filterItemsData(it => it.data.prixTotal)
tplData.prixTotalEquipement = this.filterItemsData(it => it.data.prixTotal)
.map(it => it.data.prixTotal ?? 0) .map(it => it.data.prixTotal ?? 0)
.reduce(Misc.sum(), 0); .reduce(Misc.sum(), 0);
// Mise à jour valeur totale de l'équipement // Mise à jour valeur totale de l'équipement
return tplData.prixTotalEquipement; return this.prixTotalEquipement;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */