From e617017330fc0e05bcb741a2bcd1067ce662ac4f Mon Sep 17 00:00:00 2001 From: RedstonewolfX <108761527+RedstonewolfX@users.noreply.github.com> Date: Tue, 24 Sep 2024 18:45:44 -0400 Subject: [PATCH] Update pokemon.ts Good riddance, shiny RNG breaking! --- src/field/pokemon.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 2a5cf92d17d..a03400bcf4b 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1713,10 +1713,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (!this.shiny || (!variantData.hasOwnProperty(variantDataIndex) && !variantData.hasOwnProperty(this.species.speciesId))) { return 0; } - const rand = Utils.randSeedInt(10, undefined, "Random variant selection"); - if (rand >= 4) { + const rand = new Utils.IntegerHolder(0) + this.scene.executeWithSeedOffset(() => { + rand.value = Utils.randSeedInt(10, undefined, "Random variant selection"); + }, this.id, this.scene.waveSeed) + if (rand.value >= 4) { return 0; // 6/10 - } else if (rand >= 1) { + } else if (rand.value >= 1) { return 1; // 3/10 } else { return 2; // 1/10