From d0764eb1c53041a6adbac4660ae00824b4c7bb4c Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 26 Jun 2021 00:09:28 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20draconic=20optionnel=20pour=20R=C3=AAve?= =?UTF-8?q?=20de=20dragon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/module/actor.js b/module/actor.js index c0519e1e..1444840d 100644 --- a/module/actor.js +++ b/module/actor.js @@ -371,11 +371,16 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ getBestDraconic() { const list = this.getDraconicList(); + return duplicate(list[0]); + } + getDraconicOrZero() { + const list = this.getDraconicList().filter(it => Misc.data(it).data.niveau >= 0); if (list.length == 0) { - return { name: "Aucun", data: { name: "Aucun", data: { niveau: 0 } } }; + return { name: "Aucun", data: { niveau: 0 } }; } return duplicate(list[0]); } + getDemiReve() { return Misc.templateData(this).reve.tmrpos.coord; } @@ -724,7 +729,7 @@ export class RdDActor extends Actor { async combattreReveDeDragon(force) { let rollData = { actor: this, - competence: duplicate(this.getBestDraconic()), + competence: duplicate(this.getDraconicOrZero()), canClose: false, rencontre: duplicate(TMRRencontres.getRencontre('rdd')), tmr: true,