Séparation de l'Actor Entités

This commit is contained in:
2023-11-04 03:42:39 +01:00
parent d4be2957a3
commit 1d3ae9bb1a
18 changed files with 945 additions and 674 deletions

View File

@ -55,7 +55,8 @@ function _cumulSegmentsFatigue(matrix) {
}
/* -------------------------------------------- */
export const fatigueMatrix = _buildAllSegmentsFatigue(60);
export const MAX_ENDURANCE_FATIGUE = 60;
const fatigueMatrix = _buildAllSegmentsFatigue(MAX_ENDURANCE_FATIGUE);
const cumulFatigueMatrix = _cumulSegmentsFatigue(fatigueMatrix);
const fatigueMalus = [0, 0, 0, -1, -1, -1, -2, -3, -4, -5, -6, -7]; // Provides the malus for each segment of fatigue
@ -465,11 +466,10 @@ export class RdDUtility {
}
/* -------------------------------------------- */
static calculMalusFatigue(fatigue, maxEnd) {
maxEnd = Math.max(maxEnd, 1);
maxEnd = Math.min(maxEnd, cumulFatigueMatrix.length);
let segments = cumulFatigueMatrix[maxEnd];
for (let i = 0; i < 12; i++) {
static calculMalusFatigue(fatigue, endurance) {
endurance = Math.min(Math.max(endurance, 1), cumulFatigueMatrix.length);
let segments = cumulFatigueMatrix[endurance];
for (let i = 0; i < segments.length; i++) {
if (fatigue <= segments[i]) {
return fatigueMalus[i]
}