#194 : Saisie manuelle du résultat
This commit is contained in:
parent
e9f6d5f4b9
commit
52fff9e79e
@ -213,7 +213,7 @@ export class RdDCalendrier extends Application {
|
|||||||
newList[i] = await this.ajouterNombreAstral(dayIndex, showDice );
|
newList[i] = await this.ajouterNombreAstral(dayIndex, showDice );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log("SAVE list", newList, jourCourant);
|
//console.log("SAVE list", newList, jourCourant);
|
||||||
this.listeNombreAstral = newList;
|
this.listeNombreAstral = newList;
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "liste-nombre-astral", this.listeNombreAstral);
|
game.settings.set("foundryvtt-reve-de-dragon", "liste-nombre-astral", this.listeNombreAstral);
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ export class RdDResolutionTable {
|
|||||||
chances.showDice = rollData.showDice;
|
chances.showDice = rollData.showDice;
|
||||||
chances.rollMode = rollData.rollMode;
|
chances.rollMode = rollData.rollMode;
|
||||||
|
|
||||||
let rolled = await this.rollChances(chances, rollData.diviseurSignificative);
|
let rolled = await this.rollChances(chances, rollData.diviseurSignificative, rollData.forceDiceResult);
|
||||||
rolled.caracValue = caracValue;
|
rolled.caracValue = caracValue;
|
||||||
rolled.finalLevel = finalLevel;
|
rolled.finalLevel = finalLevel;
|
||||||
rolled.bonus = rollData.bonus;
|
rolled.bonus = rollData.bonus;
|
||||||
@ -163,8 +163,11 @@ export class RdDResolutionTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async rollChances(chances, diviseur) {
|
static async rollChances(chances, diviseur, forceDiceResult = -1) {
|
||||||
chances.roll = await RdDDice.rollTotal("1d100", chances);
|
if (forceDiceResult <= 0 || forceDiceResult > 100) {
|
||||||
|
forceDiceResult = -1;
|
||||||
|
}
|
||||||
|
chances.roll = await RdDDice.rollTotal((forceDiceResult == -1) ? "1d100" : `${forceDiceResult}`, chances);
|
||||||
mergeObject(chances, this.computeReussite(chances, chances.roll, diviseur), { overwrite: true });
|
mergeObject(chances, this.computeReussite(chances, chances.roll, diviseur), { overwrite: true });
|
||||||
return chances;
|
return chances;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,9 @@ export class RdDRoll extends Dialog {
|
|||||||
encTotal: actor.getEncTotal(),
|
encTotal: actor.getEncTotal(),
|
||||||
ajustementAstrologique: actor.ajustementAstrologique(),
|
ajustementAstrologique: actor.ajustementAstrologique(),
|
||||||
surprise: actor.getSurprise(false),
|
surprise: actor.getSurprise(false),
|
||||||
canClose: true
|
canClose: true,
|
||||||
|
isGM: game.user.isGM,
|
||||||
|
forceDiceResult: -1
|
||||||
};
|
};
|
||||||
|
|
||||||
mergeObject(rollData, defaultRollData, { recursive: true, overwrite: false });
|
mergeObject(rollData, defaultRollData, { recursive: true, overwrite: false });
|
||||||
@ -189,6 +191,9 @@ export class RdDRoll extends Dialog {
|
|||||||
this.rollData.diffConditions = Misc.toInt(event.currentTarget.value); // Update the selected bonus/malus
|
this.rollData.diffConditions = Misc.toInt(event.currentTarget.value); // Update the selected bonus/malus
|
||||||
this.updateRollResult();
|
this.updateRollResult();
|
||||||
});
|
});
|
||||||
|
html.find('#force-dice-result').change((event) => {
|
||||||
|
this.rollData.forceDiceResult = Misc.toInt(event.currentTarget.value);
|
||||||
|
});
|
||||||
html.find('#carac').change((event) => {
|
html.find('#carac').change((event) => {
|
||||||
let caracKey = event.currentTarget.value;
|
let caracKey = event.currentTarget.value;
|
||||||
this.rollData.selectedCarac = this.rollData.carac[caracKey]; // Update the selectedCarac
|
this.rollData.selectedCarac = this.rollData.carac[caracKey]; // Update the selectedCarac
|
||||||
|
@ -60,6 +60,13 @@
|
|||||||
|
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.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-enctotal.html"}}
|
||||||
|
|
||||||
|
{{#if isGM}}
|
||||||
|
<div>
|
||||||
|
<span><label>Forcer le résultat : </label><input name='force-dice--result' id='force-dice-result' value='{{forceDiceResult}}'></span>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-group-left">
|
<div class="flex-group-left">
|
||||||
|
Loading…
Reference in New Issue
Block a user