Average out growth rates

pull/2/head
Flashfyre 2023-10-24 19:39:34 -04:00
parent 610218fe16
commit a53dc0f025
1 changed files with 9 additions and 2 deletions

View File

@ -17,8 +17,12 @@ const expLevels = [
]; ];
export function getLevelTotalExp(level: integer, growthRate: GrowthRate): integer { export function getLevelTotalExp(level: integer, growthRate: GrowthRate): integer {
if (level < 100) if (level < 100) {
return expLevels[growthRate][level - 1]; const levelExp = expLevels[growthRate][level - 1];
if (growthRate !== GrowthRate.MEDIUM_FAST)
return Math.floor(levelExp * 0.325 + getLevelTotalExp(level, GrowthRate.MEDIUM_FAST) * 0.675);
return levelExp;
}
let ret: integer; let ret: integer;
@ -43,6 +47,9 @@ export function getLevelTotalExp(level: integer, growthRate: GrowthRate): intege
break; break;
} }
if (growthRate !== GrowthRate.MEDIUM_FAST)
return Math.floor(ret * 0.325 + getLevelTotalExp(level, GrowthRate.MEDIUM_FAST) * 0.675);
return Math.floor(ret); return Math.floor(ret);
}; };