Fix infinite loop + dices
This commit is contained in:
@@ -197,8 +197,9 @@ export class YggdrasillActor extends Actor {
|
||||
if ( changed.data.caracsecondaire.pv.value < 0 )
|
||||
changed.data.caracsecondaire.pv.value = 0;
|
||||
if ( changed.data.caracsecondaire.pv.value > this.data.data.caracsecondaire.pv.max )
|
||||
changed.data.caracsecondaire.pv.value = this.data.data.caracsecondaire.pv.max;
|
||||
changed.data.caracsecondaire.pv.value = this.data.data.caracsecondaire.pv.max;
|
||||
}
|
||||
|
||||
if ( changed.data?.furor?.value ) {
|
||||
if ( changed.data.furor.value < 0 )
|
||||
changed.data.furor.value = 0;
|
||||
@@ -303,8 +304,10 @@ export class YggdrasillActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async setEpuise( ) {
|
||||
await this.update({ 'data.status.epuise': true});
|
||||
this.data.data.status.epuise = true;
|
||||
if (!this.data.data.status.epuise) {
|
||||
await this.update({ 'data.status.epuise': true});
|
||||
this.data.data.status.epuise = true;
|
||||
}
|
||||
/*let effect = this.getEffectByLabel('Epuisé');
|
||||
if ( !effect ) {
|
||||
let effect = statusEffects.find( ef => ef.id == 'epuise');
|
||||
@@ -313,8 +316,10 @@ export class YggdrasillActor extends Actor {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async cleanEpuise() {
|
||||
await this.update({ 'data.status.epuise': false});
|
||||
this.data.data.status.epuise = false;
|
||||
if (this.data.data.status.epuise) {
|
||||
await this.update({ 'data.status.epuise': false});
|
||||
this.data.data.status.epuise = false;
|
||||
}
|
||||
/*let effect = this.getEffectByLabel('Epuisé');
|
||||
if ( effect ) {
|
||||
await this.deleteEmbeddedDocuments("ActiveEffect", [ effect.id ]);
|
||||
@@ -335,9 +340,10 @@ export class YggdrasillActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async setBlesse( ) {
|
||||
await this.update({ 'data.status.blesse': true} );
|
||||
this.data.data.status.blesse = true;
|
||||
console.log("BLESSSE !!!!");
|
||||
if (!this.data.data.status.blesse) {
|
||||
await this.update({ 'data.status.blesse': true} );
|
||||
this.data.data.status.blesse = true;
|
||||
}
|
||||
/*let effect = this.getEffectByLabel('Blessé');
|
||||
if ( !effect ) {
|
||||
let effect = statusEffects.find( ef => ef.id == 'blesse');
|
||||
@@ -346,8 +352,10 @@ export class YggdrasillActor extends Actor {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async cleanBlesse() {
|
||||
await this.update({ 'data.status.blesse': false} );
|
||||
this.data.data.status.blesse = false;
|
||||
if (this.data.data.status.blesse) {
|
||||
await this.update({ 'data.status.blesse': false} );
|
||||
this.data.data.status.blesse = false;
|
||||
}
|
||||
/*let effect = this.getEffectByLabel('Blessé');
|
||||
if ( effect ) {
|
||||
await this.deleteEmbeddedDocuments("ActiveEffect", [ effect.id ]);
|
||||
@@ -362,13 +370,17 @@ export class YggdrasillActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async setMeurtri( ) {
|
||||
await this.setBlesse();
|
||||
await this.update({ 'data.status.meurtri': true});
|
||||
this.data.data.status.meurtri = true;
|
||||
if (!this.data.data.status.meurtri) {
|
||||
await this.update({ 'data.status.meurtri': true});
|
||||
this.data.data.status.meurtri = true;
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
async cleanMeurtri() {
|
||||
await this.update({ 'data.status.meurtri': false});
|
||||
this.data.data.status.meurtri = false;
|
||||
if (this.data.data.status.meurtri) {
|
||||
await this.update({ 'data.status.meurtri': false});
|
||||
this.data.data.status.meurtri = false;
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
isMeurtri() {
|
||||
|
||||
Reference in New Issue
Block a user