Fix TMR up/down

This commit is contained in:
sladecraven 2021-05-28 07:54:25 +02:00
parent 879ae14b11
commit c6b571b788
2 changed files with 5 additions and 4 deletions

View File

@ -2987,6 +2987,7 @@ export class RdDActor extends Actor {
}); });
return; return;
} }
this.setStatusDemiReve(true);
} }
const actorData = Misc.data(this); const actorData = Misc.data(this);
@ -3969,7 +3970,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async addStatusEffect(statusEffect) { async addStatusEffect(statusEffect) {
const effet = Misc.data(statusEffect); const effet = Misc.data(statusEffect);
await this.deleteStatusEffectById(effet.id); //await this.deleteStatusEffectById(effet.id);
//effet.flags = effet.flags ?? { core: {} }; //effet.flags = effet.flags ?? { core: {} };
//effet.flags.core.statusId = effet.id; //effet.flags.core.statusId = effet.id;
let effectArray = await this.createEmbeddedDocuments('ActiveEffect', [effet]); let effectArray = await this.createEmbeddedDocuments('ActiveEffect', [effet]);

View File

@ -65,7 +65,6 @@ export class RdDTMRDialog extends Dialog {
this.callbacksOnAnimate = []; this.callbacksOnAnimate = [];
if (!this.viewOnly) { if (!this.viewOnly) {
this.actor.setStatusDemiReve(true);
this._tellToGM(this.actor.name + " monte dans les terres médianes (" + tmrData.mode + ")"); this._tellToGM(this.actor.name + " monte dans les terres médianes (" + tmrData.mode + ")");
} }
@ -271,12 +270,12 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
close() { close() {
this.actor.santeIncDec("fatigue", this.cumulFatigue).then(super.close()); // moving 1 cell costs 1 fatigue
this.actor.tmrApp = undefined; // Cleanup reference this.actor.tmrApp = undefined; // Cleanup reference
if ( !this.viewOnly ) { if ( !this.viewOnly ) {
this.actor.setStatusDemiReve(false); this.actor.setStatusDemiReve();
this._tellToGM(this.actor.name + " a quitté les terres médianes"); this._tellToGM(this.actor.name + " a quitté les terres médianes");
} }
this.actor.santeIncDec("fatigue", this.cumulFatigue).then(super.close()); // moving 1 cell costs 1 fatigue
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -608,6 +607,7 @@ export class RdDTMRDialog extends Dialog {
} }
} }
/* -------------------------------------------- */
async souffleSiEchecTotal(rollData) { async souffleSiEchecTotal(rollData) {
if (rollData.rolled.isETotal) { if (rollData.rolled.isETotal) {
rollData.souffle = await this.actor.ajouterSouffle({ chat: false }); rollData.souffle = await this.actor.ajouterSouffle({ chat: false });