Merge branch 'v1.4-fixes' into 'v1.4'

Fix: draconic optionnel pour Rêve de dragon

See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!284
This commit is contained in:
Leratier Bretonnien 2021-06-26 07:20:54 +00:00
commit b02ac1e7e1

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,