Fix: pas de bonus de case au delà de -10

Si l'ajustement final est -11 à -16, le bonus de case n'augmente plus
les chances de succès
This commit is contained in:
Vincent Vandemeulebrouck 2021-10-30 02:21:41 +02:00
parent c76cb5ae1c
commit 179ec39843

View File

@ -84,7 +84,7 @@ export class RdDResolutionTable {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async roll(caracValue, finalLevel, rollData = {}){ static async roll(caracValue, finalLevel, rollData = {}){
let chances = this.computeChances(caracValue, finalLevel); let chances = this.computeChances(caracValue, finalLevel);
this._updateChancesWithBonus(chances, rollData.bonus); this._updateChancesWithBonus(chances, rollData.bonus, finalLevel);
this._updateChancesFactor(chances, rollData.diviseurSignificative); this._updateChancesFactor(chances, rollData.diviseurSignificative);
chances.showDice = rollData.showDice; chances.showDice = rollData.showDice;
chances.rollMode = rollData.rollMode; chances.rollMode = rollData.rollMode;
@ -121,8 +121,8 @@ export class RdDResolutionTable {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static _updateChancesWithBonus(chances, bonus) { static _updateChancesWithBonus(chances, bonus, finalLevel) {
if (bonus) { if (bonus && finalLevel>-11) {
let newScore = Number(chances.score) + bonus; let newScore = Number(chances.score) + bonus;
mergeObject(chances, this._computeCell(null, newScore), { overwrite: true }); mergeObject(chances, this._computeCell(null, newScore), { overwrite: true });
} }