10.3.17 - petits fixes #597

Merged
uberwald merged 7 commits from VincentVk/foundryvtt-reve-de-dragon:v10 into v10 2022-12-18 17:08:22 +01:00
Showing only changes of commit fd156960a7 - Show all commits

View File

@ -405,6 +405,8 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */
async _tentativeMaitrise(rencData) {
this.rencontreState = 'normal';
rencData.reve = this.actor.getReveActuel();
rencData.etat = this.actor.getEtatGeneral();
@ -450,7 +452,6 @@ export class RdDTMRDialog extends Dialog {
this._tentativeMaitrise(rencData);
this._deleteTmrMessages(rencData.actor, rencData.nbRounds);
}, 2000);
this.rencontreState == 'normal';
}
formatMessageRencontre(rencData, template) {
@ -460,14 +461,14 @@ export class RdDTMRDialog extends Dialog {
messageDuree = ` Au total, vous avez passé ${rencData.nbRounds} rounds à vous battre!`;
}
else {
messageDuree = ` Vous avez passé ${rencData.nbRounds} rounds à lutter!`;
messageDuree = ` Vous avez passé ${rencData.nbRounds} rounds à lutter!`;
}
}
try {
const compiled = Handlebars.compile(template);
return compiled(rencData) + messageDuree ;
return compiled(rencData) + messageDuree;
} catch (error) {
return template + messageDuree ;
return template + messageDuree;
}
}
@ -520,7 +521,7 @@ export class RdDTMRDialog extends Dialog {
}
this.currentRencontre = await this._jetDeRencontre(tmr);
if (this.currentRencontre) {
if (this.rencontresExistantes.find(it => it.id == this.currentRencontre.id)){
if (this.rencontresExistantes.find(it => it.id == this.currentRencontre.id)) {
// rencontre en attente suite à dérobade
await this.maitriserRencontre();
}
@ -550,7 +551,7 @@ export class RdDTMRDialog extends Dialog {
this.currentRencontre = present.clone({
'system.force': await RdDDice.rollTotal(present.system.formule),
'system.coord': tmr.coord
}, {save: false});
}, { save: false });
await EffetsDraconiques.presentCites.ouvrirLePresent(this.actor, presentCite);
this.removeToken(tmr, presentCite);