#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 );
|
||||
}
|
||||
}
|
||||
console.log("SAVE list", newList, jourCourant);
|
||||
//console.log("SAVE list", newList, jourCourant);
|
||||
this.listeNombreAstral = newList;
|
||||
game.settings.set("foundryvtt-reve-de-dragon", "liste-nombre-astral", this.listeNombreAstral);
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ export class RdDResolutionTable {
|
||||
chances.showDice = rollData.showDice;
|
||||
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.finalLevel = finalLevel;
|
||||
rolled.bonus = rollData.bonus;
|
||||
@ -163,8 +163,11 @@ export class RdDResolutionTable {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async rollChances(chances, diviseur) {
|
||||
chances.roll = await RdDDice.rollTotal("1d100", chances);
|
||||
static async rollChances(chances, diviseur, forceDiceResult = -1) {
|
||||
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 });
|
||||
return chances;
|
||||
}
|
||||
|
@ -61,7 +61,9 @@ export class RdDRoll extends Dialog {
|
||||
encTotal: actor.getEncTotal(),
|
||||
ajustementAstrologique: actor.ajustementAstrologique(),
|
||||
surprise: actor.getSurprise(false),
|
||||
canClose: true
|
||||
canClose: true,
|
||||
isGM: game.user.isGM,
|
||||
forceDiceResult: -1
|
||||
};
|
||||
|
||||
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.updateRollResult();
|
||||
});
|
||||
html.find('#force-dice-result').change((event) => {
|
||||
this.rollData.forceDiceResult = Misc.toInt(event.currentTarget.value);
|
||||
});
|
||||
html.find('#carac').change((event) => {
|
||||
let caracKey = event.currentTarget.value;
|
||||
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-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 class="flex-group-left">
|
||||
|
Loading…
Reference in New Issue
Block a user