#194 : Saisie manuelle du résultat
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user