From a0bbeea99bbca1a68b9f372b384fa7088feaf3e7 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Fri, 28 May 2021 10:25:34 +0200 Subject: [PATCH] =?UTF-8?q?Meilleur=20affichage=20pour=20rencontre/pas=20r?= =?UTF-8?q?encontre=20et=20type=20de=20TMR=20affich=C3=A9s=20sur=20TMR=20c?= =?UTF-8?q?ach=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 2 +- module/rdd-tmr-dialog.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/module/actor.js b/module/actor.js index 4a205e45..76f5605a 100644 --- a/module/actor.js +++ b/module/actor.js @@ -1395,7 +1395,7 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async updateCoordTMR(coord) { - console.log("UPDATE TMR", coord); + //console.log("UPDATE TMR", coord); await this.update({ "data.reve.tmrpos.coord": coord }); } diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index cb067208..48770b48 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -105,6 +105,7 @@ export class RdDTMRDialog extends Dialog { } } + /* -------------------------------------------- */ updateTokens() { this._removeTokens(t => true); this.loadRencontres(); @@ -113,6 +114,7 @@ export class RdDTMRDialog extends Dialog { this._createTokens(); } + /* -------------------------------------------- */ removeToken(tmr, casetmr) { this._removeTokens(t => t.coordTMR() == tmr.coord && t.caseSpeciale?._id == casetmr._id); this.updateTokens() @@ -537,12 +539,15 @@ export class RdDTMRDialog extends Dialog { if (rencontre) { return rencontre; } + let locTMR = (this.cacheTMR) ? Misc.upperFirst(tmr.type) + " ??" : tmr.label + " (" + tmr.coord + ")"; + let myRoll = await RdDDice.rollTotal("1d7"); if (TMRUtility.isForceRencontre() || myRoll == 7) { + this._tellToUser(myRoll + ": Rencontre en " + locTMR); return await this.rencontreTMRRoll(tmr, this.actor.isRencontreSpeciale()); + } else { + this._tellToUser(myRoll + ": Pas de rencontre en " + locTMR); } - let locTMR = (this.cacheTMR) ? "??" : tmr.label + " (" + tmr.coord + ")"; - this._tellToUser(myRoll + ": Pas de rencontre en " + locTMR); } /* -------------------------------------------- */