From f2816051460a43fccfa6735f37f75d028bc57269 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Fri, 26 Apr 2024 19:36:27 -0400 Subject: [PATCH] Fix wild shiny luck generation --- src/field/pokemon.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 7408b86de..a17621f4b 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -194,7 +194,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } } - this.luck = (this.shiny ? (this.variant + 1) : 0) + (this.fusionShiny ? this.fusionVariant + 1 : 0); + this.luck = (this.shiny ? this.variant + 1 : 0) + (this.fusionShiny ? this.fusionVariant + 1 : 0); } this.generateName(); @@ -693,7 +693,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } getLuck(): integer { - return this.luck + this.fusionLuck; + return this.luck + (this.isFusion() ? this.fusionLuck : 0); } isFusion(): boolean { @@ -2111,7 +2111,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (variantColors) { const color = Utils.rgbaToInt([r, g, b, a]); if (variantColorSet.has(color)) { - console.log(color); const mappedPixel = variantColorSet.get(color); [ r, g, b, a ] = mappedPixel; } @@ -2550,6 +2549,8 @@ export class EnemyPokemon extends Pokemon { if (this.shiny) this.variant = this.generateVariant(); + this.luck = (this.shiny ? this.variant + 1 : 0) + (this.fusionShiny ? this.fusionVariant + 1 : 0); + let prevolution: Species; let speciesId = species.speciesId; while ((prevolution = pokemonPrevolutions[speciesId])) {