Fix danses

This commit is contained in:
sladecraven 2021-02-14 18:31:00 +01:00
parent 5e53dc5262
commit 98c6133938

View File

@ -2087,11 +2087,13 @@ export class RdDActor extends Actor {
diffLibre: - (oeuvre.data.niveau ?? 0),
diffConditions: 0,
use: { libre: false, conditions: true },
selectedCarac: duplicate(this.data.data.carac[selected]),
forceCarac: {}
selectedCarac: duplicate(this.data.data.carac[selected])
});
artData.competence.data.defaut_carac = selected;
artData.forceCarac[selected] = duplicate(this.data.data.carac[selected]);
if ( !artData.forceCarac ) {
artData.forceCarac = {};
artData.forceCarac[selected] = duplicate(this.data.data.carac[selected]);
}
console.log("rollArt !!!", artData);
@ -2122,14 +2124,22 @@ export class RdDActor extends Actor {
const oeuvre = duplicate(this.getChant(id));
await this._rollArt(artData, "ouie", oeuvre);
}
/* -------------------------------------------- */
async rollDanse(id) {
const artData = { art: 'danse', verbe: 'Danser' };
const artData = { art: 'danse', verbe: 'Danser', forceCarac: {} };
const oeuvre = duplicate(this.getOeuvre(id, artData.art));
const selectedCarac = this._getCaracDanse(oeuvre,);
const selectedCarac = this._getCaracDanse(oeuvre);
if ( oeuvre.data.agilite) {
artData.forceCarac['agilite'] = duplicate(this.data.data.carac.agilite );
}
if ( oeuvre.data.apparence) {
artData.forceCarac['apparence'] = duplicate(this.data.data.carac.apparence );
}
await this._rollArt(artData, selectedCarac, oeuvre);
}
/* -------------------------------------------- */
_getCaracDanse(oeuvre) {
if (oeuvre.data.agilite) { return "agilite"; }
else if (oeuvre.data.apparence) { return "apparence"; }