diff --git a/src/battle-scene.ts b/src/battle-scene.ts index b986baaa9..47de99401 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -646,7 +646,16 @@ export default class BattleScene extends SceneBase { const container = this.add.container(x, y); const icon = this.add.sprite(0, 0, pokemon.getIconAtlasKey(ignoreOverride)); - icon.setFrame(pokemon.getIconId(true)); + icon.setFrame(pokemon.getIconId(true)); + // Temporary fix to show pokemon's default icon if variant icon doesn't exist + if (icon.frame.name != pokemon.getIconId(true)) { + console.log(`${pokemon.name}'s variant icon does not exist. Replacing with default.`) + const temp = pokemon.shiny; + pokemon.shiny = false; + icon.setTexture(pokemon.getIconAtlasKey(ignoreOverride)); + icon.setFrame(pokemon.getIconId(true)); + pokemon.shiny = temp; + } icon.setOrigin(0.5, 0); container.add(icon); diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index a73f14586..0713df99f 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2492,6 +2492,13 @@ export class PlayerPokemon extends Pokemon { constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex: integer, formIndex: integer, gender: Gender, shiny: boolean, variant: Variant, ivs: integer[], nature: Nature, dataSource: Pokemon | PokemonData) { super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource); + if (Overrides.SHINY_OVERRIDE) { + this.shiny = true; + this.initShinySparkle(); + if (Overrides.VARIANT_OVERRIDE) + this.variant = Overrides.VARIANT_OVERRIDE; + } + if (!dataSource) this.generateAndPopulateMoveset(); this.generateCompatibleTms(); diff --git a/src/overrides.ts b/src/overrides.ts index 2b6106a74..7b7b24635 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -39,6 +39,8 @@ export const STARTING_LEVEL_OVERRIDE: integer = 0; export const ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const MOVESET_OVERRIDE: Array = []; +export const SHINY_OVERRIDE: boolean = false; +export const VARIANT_OVERRIDE: Variant = 0; /** * OPPONENT / ENEMY OVERRIDES diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 81f081e4c..2daec8c70 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1518,7 +1518,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler { (this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite) .setTexture(species.getIconAtlasKey(formIndex, shiny, variant), species.getIconId(female, formIndex, shiny, variant)); - + // Temporary fix to show pokemon's default icon if variant icon doesn't exist + if ((this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).frame.name != species.getIconId(female, formIndex, shiny, variant)) { + console.log(`${species.name}'s variant icon does not exist. Replacing with default.`); + (this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setTexture(species.getIconAtlasKey(formIndex, false, variant)); + (this.starterSelectGenIconContainers[this.getGenCursorWithScroll()].getAt(this.cursor) as Phaser.GameObjects.Sprite).setFrame(species.getIconId(female, formIndex, false, variant)); + } this.canCycleShiny = !!(dexEntry.caughtAttr & DexAttr.NON_SHINY && dexEntry.caughtAttr & DexAttr.SHINY); this.canCycleGender = !!(dexEntry.caughtAttr & DexAttr.MALE && dexEntry.caughtAttr & DexAttr.FEMALE); this.canCycleAbility = [ abilityAttr & AbilityAttr.ABILITY_1, (abilityAttr & AbilityAttr.ABILITY_2) && species.ability2, abilityAttr & AbilityAttr.ABILITY_HIDDEN ].filter(a => a).length > 1;