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

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,