rollCaracCompetence avec dialog

This commit is contained in:
Vincent Vandemeulebrouck 2023-03-10 22:26:38 +01:00
parent 41335cd433
commit d739a7993a

View File

@ -2413,6 +2413,24 @@ export class RdDActor extends RdDBaseActor {
if (tache) { if (tache) {
await this.createEmbeddedDocuments('Item', [tache], { renderSheet: false }); await this.createEmbeddedDocuments('Item', [tache], { renderSheet: false });
} }
async rollCaracCompetence(caracName, compName, diff, options = { title: "" }) {
const competence = this.getCompetence(compName);
await this._openRollDialog({
name: 'jet-competence',
label: 'Jet ' + Grammar.apostrophe('de', competence.name),
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html',
rollData: {
alias: this.name,
carac: this.system.carac,
selectedCarac: this.getCaracByName(caracName),
selectedCaracName: caracName,
diffLibre: diff,
competence: competence,
show: { title: options?.title ?? '' }
},
callbackAction: r => this.$onRollCompetence(r)
});
} }
/* -------------------------------------------- */ /* -------------------------------------------- */