Fix: Jets d'astrologies invisibles pour joueur
This commit is contained in:
@ -102,22 +102,23 @@ export class RdDResolutionTable {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async rollData(rollData) {
|
||||
rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData.bonus, rollData.diviseurSignificative, rollData.showDice);
|
||||
rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData);
|
||||
return rollData;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async roll(caracValue, finalLevel, bonus = undefined, diviseur = undefined, showDice = true) {
|
||||
static async roll(caracValue, finalLevel, rollData = {}){
|
||||
let chances = this.computeChances(caracValue, finalLevel);
|
||||
this._updateChancesWithBonus(chances, bonus);
|
||||
this._updateChancesFactor(chances, diviseur);
|
||||
chances.showDice = showDice;
|
||||
this._updateChancesWithBonus(chances, rollData.bonus);
|
||||
this._updateChancesFactor(chances, rollData.diviseurSignificative);
|
||||
chances.showDice = rollData.showDice;
|
||||
chances.rollMode = rollData.rollMode;
|
||||
|
||||
let rolled = await this.rollChances(chances, diviseur);
|
||||
let rolled = await this.rollChances(chances, rollData.diviseurSignificative);
|
||||
rolled.caracValue = caracValue;
|
||||
rolled.finalLevel = finalLevel;
|
||||
rolled.bonus = bonus;
|
||||
rolled.factorHtml = Misc.getFractionHtml(diviseur);
|
||||
rolled.bonus = rollData.bonus;
|
||||
rolled.factorHtml = Misc.getFractionHtml(rollData.diviseurSignificative);
|
||||
rolled.niveauNecessaire = this.findNiveauNecessaire(caracValue, rolled.roll );
|
||||
rolled.ajustementNecessaire = rolled.niveauNecessaire - finalLevel;
|
||||
return rolled;
|
||||
@ -163,7 +164,7 @@ export class RdDResolutionTable {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async rollChances(chances, diviseur) {
|
||||
chances.roll = await RdDDice.rollTotal("1d100", {showDice:chances.showDice});
|
||||
chances.roll = await RdDDice.rollTotal("1d100", chances);
|
||||
mergeObject(chances, this.computeReussite(chances, chances.roll, diviseur), { overwrite: true });
|
||||
return chances;
|
||||
}
|
||||
|
Reference in New Issue
Block a user