This commit is contained in:
sladecraven 2021-05-26 16:41:18 +02:00
parent 01c1978ccd
commit e0f83e9be2
3 changed files with 12 additions and 9 deletions

View File

@ -2450,9 +2450,10 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async displayTMR(mode = "normal") {
if (this.currentTMR != undefined && !this.currentTMR.isClosed) {
ui.notifications.warn('Vous êtes déja dans les Terres Médianes !');
return;
let demiReve = this.listeEffets( it => it.label == "Demi-rêve");
if ( mode != 'visu' && demiReve.length > 0 ) {
ui.notifications.warn("Le joueur ou le MJ est déja dans les Terres Médianes avec ce personnage ! Visualisation uniquement");
mode = "visu"; // bascule le mode en visu automatiquement
}
let isRapide = mode == "rapide";
@ -3054,7 +3055,7 @@ export class RdDActor extends Actor {
await this.addStatusEffect(StatusEffects.demiReve())
}
else {
this.deleteStatusEffect(StatusEffects.demiReve())
await this.deleteStatusEffect(StatusEffects.demiReve())
}
}
@ -3110,8 +3111,11 @@ export class RdDActor extends Actor {
async addStatusEffect(statusEffect, options = { renderSheet: false }) {
this.deleteStatusEffectById(statusEffect.id, options);
const effet = duplicate(statusEffect);
effet["flags.core.statusId"] = effet.id;
await this.createEmbeddedEntity('ActiveEffect', effet, options);
//effet["flags.core.statusId"] = effet.id;
let entity = await this.createEmbeddedEntity('ActiveEffect', effet, options);
if (entity) {
await entity.setFlag('core', 'statusId', effet.id );
}
}
/* -------------------------------------------- */

View File

@ -202,11 +202,10 @@ export class RdDTMRDialog extends Dialog {
close() {
this.actor.santeIncDec("fatigue", this.cumulFatigue).then(super.close()); // moving 1 cell costs 1 fatigue
this.actor.tmrApp = undefined; // Cleanup reference
this.actor.setStatusDemiReve(false);
if (!this.viewOnly) {
this.actor.setStatusDemiReve(false);
this._tellToGM(this.actor.name + " a quitté les terres médianes");
}
this.isClosed = true;
}

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT",
"version": "1.3.60",
"version": "1.3.61",
"manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.9",