Ajout de souffle dans certains cas

- conquete de cité échouée
This commit is contained in:
Vincent Vandemeulebrouck 2021-02-28 01:54:19 +01:00
parent 34e12cd701
commit 50c336cda7

View File

@ -498,9 +498,7 @@ export class RdDTMRDialog extends Dialog {
} }
async _resultatMaitriseCaseHumide(rollData) { async _resultatMaitriseCaseHumide(rollData) {
if (rollData.rolled.isETotal) { await this.souffleSiEchecTotal(rollData);
rollData.souffle = await this.actor.ajouterSouffle({ chat: false });
}
this.toclose = rollData.rolled.isEchec; this.toclose = rollData.rolled.isEchec;
if (rollData.rolled.isSuccess && rollData.double) { if (rollData.rolled.isSuccess && rollData.double) {
rollData.previous = { rolled: rollData.rolled, ajustements: rollData.ajustements }; rollData.previous = { rolled: rollData.rolled, ajustements: rollData.ajustements };
@ -518,6 +516,12 @@ export class RdDTMRDialog extends Dialog {
} }
} }
async souffleSiEchecTotal(rollData) {
if (rollData.rolled.isETotal) {
rollData.souffle = await this.actor.ajouterSouffle({ chat: false });
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
isCaseHumide(tmr) { isCaseHumide(tmr) {
if (!(TMRUtility.isCaseHumide(tmr) || this.isCaseHumideAdditionelle(tmr))) { if (!(TMRUtility.isCaseHumide(tmr) || this.isCaseHumideAdditionelle(tmr))) {
@ -560,6 +564,7 @@ export class RdDTMRDialog extends Dialog {
action: 'Conquérir la cité', action: 'Conquérir la cité',
onConqueteReussie: r => EffetsDraconiques.fermetureCites.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)), onConqueteReussie: r => EffetsDraconiques.fermetureCites.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)),
onConqueteEchec: r => { onConqueteEchec: r => {
this.souffleSiEchecTotal(rollData);
this.close() this.close()
}, },
canClose: false canClose: false