Jet de Carac avec compétence
Pour faire plus rapidement les jets depuis les caracs
This commit is contained in:
parent
5565bb7a48
commit
3362f2473a
@ -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' },
|
||||
|
@ -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]);
|
||||
|
@ -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
|
||||
|
@ -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"}}
|
||||
|
8
templates/partial-roll-competences.html
Normal file
8
templates/partial-roll-competences.html
Normal 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>
|
Loading…
Reference in New Issue
Block a user