Fix: draconic optionnel pour Rêve de dragon

This commit is contained in:
Vincent Vandemeulebrouck 2021-06-26 00:09:28 +02:00
parent 4fd822eeee
commit d0764eb1c5
1 changed files with 7 additions and 2 deletions

View File

@ -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,