Fix: draconic optionnel pour Rêve de dragon

This commit is contained in:
Vincent Vandemeulebrouck 2021-06-26 00:09:28 +02:00
parent b06018d252
commit 4f6cc3e6e3

View File

@ -371,11 +371,16 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
getBestDraconic() { getBestDraconic() {
const list = this.getDraconicList(); 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) { if (list.length == 0) {
return { name: "Aucun", data: { name: "Aucun", data: { niveau: 0 } } }; return { name: "Aucun", data: { niveau: 0 } };
} }
return duplicate(list[0]); return duplicate(list[0]);
} }
getDemiReve() { getDemiReve() {
return Misc.templateData(this).reve.tmrpos.coord; return Misc.templateData(this).reve.tmrpos.coord;
} }
@ -724,7 +729,7 @@ export class RdDActor extends Actor {
async combattreReveDeDragon(force) { async combattreReveDeDragon(force) {
let rollData = { let rollData = {
actor: this, actor: this,
competence: duplicate(this.getBestDraconic()), competence: duplicate(this.getDraconicOrZero()),
canClose: false, canClose: false,
rencontre: duplicate(TMRRencontres.getRencontre('rdd')), rencontre: duplicate(TMRRencontres.getRencontre('rdd')),
tmr: true, tmr: true,