From 39b31e7d6fbbaebc07f268d983f859d166517961 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 5 Jan 2024 00:44:28 -0500 Subject: [PATCH] Add back old random seed gaussian function to fix level balancing --- src/battle.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/battle.ts b/src/battle.ts index ba5c66b1a..8206e82f9 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -80,7 +80,14 @@ export default class Battle { const deviation = 10 / this.waveIndex; - return Math.max(Math.round(baseLevel + Math.abs(Utils.randSeedGauss(deviation))), 1); + return Math.max(Math.round(baseLevel + Math.abs(this.randSeedGaussForLevel(deviation))), 1); + } + + randSeedGaussForLevel(value: number): number { + let rand = 0; + for (var i = value; i > 0; i--) + rand += Phaser.Math.RND.realInRange(0, 1); + return rand / value; } getBattlerCount(): integer {