#133 Fix
This commit is contained in:
@ -49,8 +49,9 @@ export class RdDRollResolutionTable extends Dialog {
|
||||
title: titleTableDeResolution,
|
||||
content: html,
|
||||
buttons: {
|
||||
'lancer': { label: 'Lancer les dés', callback: html => this.onAction(html) }
|
||||
}
|
||||
'lancer-fermer': { label: 'Lancer les dés et fermer', callback: html => this.onLancerFermer() }
|
||||
},
|
||||
default: 'lancer'
|
||||
};
|
||||
super(conf, { classes: ["rdddialog"], width: 800, height: 800, 'z-index': 99999 });
|
||||
|
||||
@ -58,7 +59,14 @@ export class RdDRollResolutionTable extends Dialog {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onAction(html) {
|
||||
async onLancer() {
|
||||
await RdDResolutionTable.rollData(this.rollData);
|
||||
console.log("RdDRollResolutionTable -=>", this.rollData, this.rollData.rolled);
|
||||
await RdDResolutionTable.displayRollData(this.rollData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onLancerFermer() {
|
||||
await RdDResolutionTable.rollData(this.rollData);
|
||||
console.log("RdDRollResolutionTable -=>", this.rollData, this.rollData.rolled);
|
||||
await RdDResolutionTable.displayRollData(this.rollData);
|
||||
@ -79,7 +87,9 @@ export class RdDRollResolutionTable extends Dialog {
|
||||
dialog.updateRollResult();
|
||||
}
|
||||
$(function () { onLoad();});
|
||||
|
||||
html.find('#lancer').click((event) => {
|
||||
this.onLancer();
|
||||
});
|
||||
// Update !
|
||||
html.find('#diffLibre').change((event) => {
|
||||
this.rollData.diffLibre = Misc.toInt(event.currentTarget.value);
|
||||
|
@ -663,12 +663,11 @@ export class RdDUtility {
|
||||
} else if (arme.name == "Draconic") {
|
||||
initOffset = 7;
|
||||
} else {
|
||||
initOffset = 2; // Melée = 3.XX
|
||||
initOffset = 3; // Melée = 3.XX
|
||||
let competence = RdDItemCompetence.findCompetence(combatant.actor.data.items, arme.data.competence);
|
||||
compNiveau = competence.data.niveau;
|
||||
|
||||
if (actor.data.type == 'creature' || actor.data.type == 'entite') {
|
||||
initOffset = 3; // Défaut, en général attaque en mélée
|
||||
caracForInit = competence.data.carac_value;
|
||||
if ( competence.data.categorie == "lancer") {
|
||||
initOffset = 5;
|
||||
|
Reference in New Issue
Block a user