Jet de Carac avec compétence

Pour faire plus rapidement les jets depuis les caracs
This commit is contained in:
Vincent Vandemeulebrouck 2022-11-19 01:37:00 +01:00
parent 5565bb7a48
commit 3362f2473a
5 changed files with 20 additions and 1 deletions

View File

@ -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' },

View File

@ -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]);

View File

@ -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

View File

@ -5,7 +5,9 @@
<div class="flex-group-left">
<div class="flexrow">
</div>
{{>"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"}}
</div>
<div class="flex-group-left">
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html"}}

View File

@ -0,0 +1,8 @@
<div class="form-group">
<label for="roll-carac-competence">Compétence</label>
<select name="roll-carac-competence" class="roll-carac-competence" data-dtype="String">
{{#select ''}}<option value="">Sans compétence</option>
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-competence.html"}}
{{/select}}
</select>
</div>