Boutons créatures/entités #69

Change-Id: I0aeded39e99551dbe09dc988e04c1de185c1dc70
This commit is contained in:
Vincent Vandemeulebrouck
2020-12-27 22:21:08 +01:00
parent 97a6ef408d
commit 5d1cb2abec
5 changed files with 40 additions and 14 deletions

View File

@ -309,7 +309,11 @@ export class RdDActor extends Actor {
whisper: ChatUtility.getWhisperRecipientsAndGMs( this.name ),
content : "Remise à neuf de " + this.name
};
if (!this.isEntiteCauchemar()) {
if (this.isEntiteCauchemar()) {
await this.santeIncDec("endurance", this.data.data.sante.endurance.max - this.data.data.sante.endurance.value);
}
else {
if (this.data.data.blessures){
const blessures = duplicate(this.data.data.blessures);
for (let listeBlessures of [blessures.legeres.liste, blessures.graves.liste, blessures.critiques.liste]) {
@ -322,9 +326,7 @@ export class RdDActor extends Actor {
await this.update({ "data.compteurs.ethylisme.value": 0 });
await this.update({ "data.compteurs.ethylisme.nb_doses": 0 });
await this.santeIncDec("vie", this.data.data.sante.vie.max - this.data.data.sante.vie.value);
}
await this.santeIncDec("endurance", this.data.data.sante.endurance.max - this.data.data.sante.endurance.value);
if (!this.isEntiteCauchemar()) {
await this.santeIncDec("endurance", this.data.data.sante.endurance.max - this.data.data.sante.endurance.value);
if (this.data.data.sante.fatigue){
let fatigue = duplicate(this.data.data.sante.fatigue)
fatigue.value = 0;
@ -1760,6 +1762,13 @@ export class RdDActor extends Actor {
new RdDEncaisser(html, this ).render(true);
}
/* -------------------------------------------- */
async encaisser( ) {
let data = { ajustementsEncaissement: RdDUtility.getAjustementsEncaissement() };
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html', data );
new RdDEncaisser(html, this).render(true);
}
/* -------------------------------------------- */
async encaisserDommages( attackerRoll, attacker = undefined ) {
if (attacker && !await attacker.accorder(this, 'avant-encaissement')) {