diff --git a/module/actor.js b/module/actor.js index 6632412a..5e91f3c7 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2471,7 +2471,10 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async rollCarac(caracName) { - let rollData = { selectedCarac: this.getCaracByName(caracName) }; + let rollData = { + selectedCarac: this.getCaracByName(caracName), + competences: this.itemTypes['competence'] + }; const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html' }, diff --git a/module/rdd-roll.js b/module/rdd-roll.js index 3c10fcad..836bce49 100644 --- a/module/rdd-roll.js +++ b/module/rdd-roll.js @@ -217,6 +217,11 @@ export class RdDRoll extends Dialog { this.updateRollResult(); $("#diffLibre").val(this.rollData.diffLibre); }); + html.find('.roll-carac-competence').change((event) => { + const competence = event.currentTarget.value; + this.rollData.competence = this.rollData.competences.find(it => it.name == competence); + this.updateRollResult(); + }); html.find('.roll-signedraconique').change((event) => { let sortKey = Misc.toInt(event.currentTarget.value); this.setSelectedSigneDraconique(this.rollData.signes[sortKey]); diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 7f99fc45..636487a0 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -222,6 +222,7 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-enctotal.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html', + 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-competences.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html', // Dialogs diff --git a/templates/dialog-roll-carac.html b/templates/dialog-roll-carac.html index 89c454ab..d2f3e5dc 100644 --- a/templates/dialog-roll-carac.html +++ b/templates/dialog-roll-carac.html @@ -5,7 +5,9 @@
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-competences.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-enctotal.html"}}
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html"}} diff --git a/templates/partial-roll-competences.html b/templates/partial-roll-competences.html new file mode 100644 index 00000000..9d13235d --- /dev/null +++ b/templates/partial-roll-competences.html @@ -0,0 +1,8 @@ +
+ + +