pelerinage

+ suppression des cases quand le souffle/queue sont supprimés
This commit is contained in:
Vincent Vandemeulebrouck
2021-02-12 18:31:49 +01:00
parent b469461cf6
commit 4f35b28aa1
22 changed files with 431 additions and 183 deletions

View File

@ -81,7 +81,7 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */
createPixiSprites() {
EffetsDraconiques.carteTmr._createSprite(this.pixiTMR);
EffetsDraconiques.carteTmr.createSprite(this.pixiTMR);
this.updateTokens();
@ -639,13 +639,18 @@ export class RdDTMRDialog extends Dialog {
dialog.render(true);
}
async validerPelerinage(tmr) {
await EffetsDraconiques.pelerinage.onFinPelerinage(this.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr));
}
/* -------------------------------------------- */
async declencheSortEnReserve(coord) {
let sortReserveList = TMRUtility.getSortReserveList(this.sortsReserves, coord);
if (sortReserveList.length > 0) {
if (EffetsDraconiques.isConquete(this.actor)) {
ui.notifications.error("Vous ne pouvez pas déclencher de sort sous l'effet d'une conquête!");
if (EffetsDraconiques.isSortImpossible(this.actor)) {
ui.notifications.error("Une queue ou un souffle vous empèche de déclencher de sort!");
return;
}
if (EffetsDraconiques.isReserveEnSecurite(this.actor) || this.isReserveExtensible(coord)) {
@ -831,26 +836,23 @@ export class RdDTMRDialog extends Dialog {
await this.manageCaseHumide(tmr);
await this.conquerirCiteFermee(tmr);
await this.conquerirTMR(tmr);
await this.validerPelerinage(tmr);
await this.declencheSortEnReserve(tmr.coord);
await this.actor.checkSoufflePeage(tmr);
}
}
/* -------------------------------------------- */
async forceDemiRevePositionView() {
this._updateDemiReve();
}
/* -------------------------------------------- */
async forceDemiRevePosition(coord) {
await this.actor.updateCoordTMR(coord);
this._updateDemiReve();
let tmr = TMRUtility.getTMR(coord);
if (!(this.viewOnly || this.currentRencontre)) {
await this.manageCaseHumide(tmr);
await this.conquerirCiteFermee(tmr);
await this.declencheSortEnReserve(tmr.coord);
}
await this.postRencontre(tmr);
return tmr;
}