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) { async _tentativeMaitrise(rencData) {
this.rencontreState = 'normal';
rencData.reve = this.actor.getReveActuel(); rencData.reve = this.actor.getReveActuel();
rencData.etat = this.actor.getEtatGeneral(); rencData.etat = this.actor.getEtatGeneral();
@ -450,7 +452,6 @@ export class RdDTMRDialog extends Dialog {
this._tentativeMaitrise(rencData); this._tentativeMaitrise(rencData);
this._deleteTmrMessages(rencData.actor, rencData.nbRounds); this._deleteTmrMessages(rencData.actor, rencData.nbRounds);
}, 2000); }, 2000);
this.rencontreState == 'normal';
} }
formatMessageRencontre(rencData, template) { formatMessageRencontre(rencData, template) {
@ -465,9 +466,9 @@ export class RdDTMRDialog extends Dialog {
} }
try { try {
const compiled = Handlebars.compile(template); const compiled = Handlebars.compile(template);
return compiled(rencData) + messageDuree ; return compiled(rencData) + messageDuree;
} catch (error) { } catch (error) {
return template + messageDuree ; return template + messageDuree;
} }
} }
@ -520,7 +521,7 @@ export class RdDTMRDialog extends Dialog {
} }
this.currentRencontre = await this._jetDeRencontre(tmr); this.currentRencontre = await this._jetDeRencontre(tmr);
if (this.currentRencontre) { 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 // rencontre en attente suite à dérobade
await this.maitriserRencontre(); await this.maitriserRencontre();
} }
@ -550,7 +551,7 @@ export class RdDTMRDialog extends Dialog {
this.currentRencontre = present.clone({ this.currentRencontre = present.clone({
'system.force': await RdDDice.rollTotal(present.system.formule), 'system.force': await RdDDice.rollTotal(present.system.formule),
'system.coord': tmr.coord 'system.coord': tmr.coord
}, {save: false}); }, { save: false });
await EffetsDraconiques.presentCites.ouvrirLePresent(this.actor, presentCite); await EffetsDraconiques.presentCites.ouvrirLePresent(this.actor, presentCite);
this.removeToken(tmr, presentCite); this.removeToken(tmr, presentCite);