Cleanup & Reformatage

This commit is contained in:
Vincent Vandemeulebrouck
2022-11-05 18:06:30 +01:00
parent d183ce505a
commit e198cb60b1
21 changed files with 1111 additions and 1175 deletions

View File

@ -54,7 +54,7 @@ export class RdDResolutionTable {
/* -------------------------------------------- */
static explain(rolled) {
let message = "<br>Jet : <strong>" + rolled.roll + "</strong> sur " + rolled.score + "% ";
if (rolled.caracValue != null && rolled.finalLevel != null) {
if (rolled.caracValue != undefined && rolled.finalLevel != undefined) {
message += (rolled.diviseurSignificative > 1 ? `(1/${rolled.diviseurSignificative} de ` : "(")
+ rolled.caracValue + " à " + Misc.toSignedString(rolled.finalLevel) + ") ";
}
@ -116,7 +116,7 @@ export class RdDResolutionTable {
static _updateChancesFactor(chances, diviseur) {
if (chances.level > -11 && diviseur && diviseur > 1) {
let newScore = Math.floor(chances.score / diviseur);
mergeObject(chances, this._computeCell(null, newScore), { overwrite: true });
mergeObject(chances, this._computeCell(undefined, newScore), { overwrite: true });
}
}
@ -124,7 +124,7 @@ export class RdDResolutionTable {
static _updateChancesWithBonus(chances, bonus, finalLevel) {
if (bonus && finalLevel>-11) {
let newScore = Number(chances.score) + bonus;
mergeObject(chances, this._computeCell(null, newScore), { overwrite: true });
mergeObject(chances, this._computeCell(undefined, newScore), { overwrite: true });
}
}