Fix update endurance/vie
Dans certains cas, les valeurs de vie/endurance n'étaient pas mises à jour
This commit is contained in:
@ -408,19 +408,18 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async remiseANeuf() {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: 'Remise à neuf de ' + this.name
|
||||
});
|
||||
await this.supprimerBlessures(it => true);
|
||||
await this.removeEffects(e => e.id != STATUSES.StatusDemiReve);
|
||||
const updates = {
|
||||
await this.update({
|
||||
'system.sante.endurance.value': this.system.sante.endurance.max,
|
||||
'system.sante.vie.value': this.system.sante.vie.max,
|
||||
'system.sante.fatigue.value': 0,
|
||||
'system.compteurs.ethylisme': { value: 1, nb_doses: 0, jet_moral: false }
|
||||
};
|
||||
await this.update(updates);
|
||||
})
|
||||
await this.removeEffects(e => e.id != STATUSES.StatusDemiReve);
|
||||
await this.supprimerBlessures(it => true);
|
||||
await ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: 'Remise à neuf de ' + this.name
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -524,7 +523,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
jet_moral: false,
|
||||
value: value
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1891,8 +1890,8 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
rollData.tache.system.tentatives = rollData.tache.system.nb_jet_succes + rollData.tache.system.nb_jet_echec;
|
||||
|
||||
this.updateEmbeddedDocuments('Item', [rollData.tache]);
|
||||
this.santeIncDec("fatigue", rollData.tache.system.fatigue);
|
||||
await this.updateEmbeddedDocuments('Item', [rollData.tache]);
|
||||
await this.santeIncDec("fatigue", rollData.tache.system.fatigue);
|
||||
|
||||
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-tache.html');
|
||||
if (options?.onRollAutomate) {
|
||||
@ -2590,7 +2589,7 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
for (const armure of armures) {
|
||||
protection += await RdDDice.rollTotal(armure.system.protection.toString());
|
||||
if (dmg > 0 && attackerRoll.dmg.encaisserSpecial != "noarmure") {
|
||||
armure.deteriorerArmure(dmg);
|
||||
await armure.deteriorerArmure(dmg)
|
||||
dmg = 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user