From 179ec39843d3f8e032e8cfd37a664a2dbfad3b30 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 30 Oct 2021 02:21:41 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20pas=20de=20bonus=20de=20case=20au=20del?= =?UTF-8?q?=C3=A0=20de=20-10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Si l'ajustement final est -11 à -16, le bonus de case n'augmente plus les chances de succès --- module/rdd-resolution-table.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/rdd-resolution-table.js b/module/rdd-resolution-table.js index c4ec2c5c..52d0bd6a 100644 --- a/module/rdd-resolution-table.js +++ b/module/rdd-resolution-table.js @@ -84,7 +84,7 @@ export class RdDResolutionTable { /* -------------------------------------------- */ static async roll(caracValue, finalLevel, rollData = {}){ let chances = this.computeChances(caracValue, finalLevel); - this._updateChancesWithBonus(chances, rollData.bonus); + this._updateChancesWithBonus(chances, rollData.bonus, finalLevel); this._updateChancesFactor(chances, rollData.diviseurSignificative); chances.showDice = rollData.showDice; chances.rollMode = rollData.rollMode; @@ -121,8 +121,8 @@ export class RdDResolutionTable { } /* -------------------------------------------- */ - static _updateChancesWithBonus(chances, bonus) { - if (bonus) { + static _updateChancesWithBonus(chances, bonus, finalLevel) { + if (bonus && finalLevel>-11) { let newScore = Number(chances.score) + bonus; mergeObject(chances, this._computeCell(null, newScore), { overwrite: true }); }