From ab44755d4b574b59ec1f5af2487f292cebd39a13 Mon Sep 17 00:00:00 2001 From: Madmadness65 Date: Sun, 27 Oct 2024 10:35:39 -0500 Subject: [PATCH] Move `rand` value I had done the randSeedInt value in the wrong place, so the value wasn't saving to the session data properly, so that has been fixed. --- src/data/challenge.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/data/challenge.ts b/src/data/challenge.ts index 721a11efec4..2bb5cbf8adb 100644 --- a/src/data/challenge.ts +++ b/src/data/challenge.ts @@ -451,6 +451,11 @@ export class SingleGenerationChallenge extends Challenge { applyFixedBattle(waveIndex: Number, battleConfig: FixedBattleConfig): boolean { let trainerTypes: TrainerType[] = []; + if (this.rand === 0 && this.value === 3 || this.value === 7) { + /** Currently used for determining the evil team when there is more than one for a given generation. */ + const rand = Utils.randSeedInt(2, 1); + this.rand = rand; + } switch (waveIndex) { case 35: trainerTypes = [ TrainerType.ROCKET_GRUNT, TrainerType.ROCKET_GRUNT, TrainerType.UNKNOWN, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.UNKNOWN, TrainerType.MACRO_GRUNT, TrainerType.STAR_GRUNT ]; @@ -689,8 +694,7 @@ export class SingleGenerationChallenge extends Challenge { const newChallenge = new SingleGenerationChallenge(); newChallenge.value = source.value; newChallenge.severity = source.severity; - /** Currently used for determining the evil team when there is more than one for a given generation. */ - newChallenge.rand = Utils.randSeedInt(2, 1); + newChallenge.rand = source.rand; return newChallenge; } }