Utilisation Misc.data

This commit is contained in:
Vincent Vandemeulebrouck
2021-03-29 18:08:18 +02:00
parent 592f54af61
commit 31204cbf51
21 changed files with 254 additions and 237 deletions

View File

@ -1,4 +1,5 @@
import { Grammar } from "./grammar.js";
import { Misc } from "./misc.js";
const tableCaracDerivee = {
// xp: coût pour passer du niveau inférieur à ce niveau
@ -61,7 +62,7 @@ export class RdDCarac {
static computeTotal(carac, beaute = undefined) {
const total = Object.values(carac).filter(c => !c.derivee)
.map(it => parseInt(it.value))
.reduce((a, b) => a + b, 0);
.reduce(Misc.sum(), 0);
const beauteSuperieur10 = Math.max((beaute ?? 10) - 10, 0);
return total + beauteSuperieur10;
}