Fix: draconic optionnel pour Rêve de dragon #501

Merged
vincent.vandeme merged 1 commits from v1.4-fixes into v1.4 2021-06-26 09:20:55 +02:00
Showing only changes of commit d0764eb1c5 - Show all commits

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,