diff --git a/module/actor.js b/module/actor.js index bcbc7388..4295e8b5 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2413,6 +2413,24 @@ export class RdDActor extends RdDBaseActor { if (tache) { 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) + }); } /* -------------------------------------------- */