diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 36a8913dc..226f8069c 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -730,7 +730,7 @@ export default class BattleScene extends Phaser.Scene { this.currentBattle.incrementTurn(this); //this.pushPhase(new TrainerMessageTestPhase(this)); - + if (!waveIndex) { const isNewBiome = !lastBattle || !(lastBattle.waveIndex % 10); const resetArenaState = isNewBiome || this.currentBattle.battleType === BattleType.TRAINER; @@ -782,7 +782,7 @@ export default class BattleScene extends Phaser.Scene { return this.arena; } - getSpeciesFormIndex(species: PokemonSpecies): integer { + getSpeciesFormIndex(species: PokemonSpecies, ignoreArena?: boolean): integer { if (!species.forms?.length) return 0; @@ -794,7 +794,9 @@ export default class BattleScene extends Phaser.Scene { return Utils.randSeedInt(species.forms.length); } - return this.arena.getSpeciesFormIndex(species); + return !ignoreArena + ? this.arena.getSpeciesFormIndex(species) + : 0; } trySpreadPokerus(): void { diff --git a/src/egg-hatch-phase.ts b/src/egg-hatch-phase.ts index e22a05d93..047eb5ed4 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -327,7 +327,8 @@ export class EggHatchPhase extends BattlePhase { if (speciesOverride) { this.scene.executeWithSeedOffset(() => { - ret = new PlayerPokemon(this.scene, getPokemonSpecies(speciesOverride), 5, null, null, undefined, false); + const pokemonSpecies = getPokemonSpecies(speciesOverride); + ret = new PlayerPokemon(this.scene, pokemonSpecies, 5, undefined, this.scene.getSpeciesFormIndex(pokemonSpecies, true), undefined, false); }, this.egg.id, EGG_SEED.toString()); } else { let minStarterValue: integer; @@ -394,7 +395,9 @@ export class EggHatchPhase extends BattlePhase { } } - ret = new PlayerPokemon(this.scene, getPokemonSpecies(species), 5, null, null, undefined, false); + const pokemonSpecies = getPokemonSpecies(species); + + ret = new PlayerPokemon(this.scene, pokemonSpecies, 5, undefined, this.scene.getSpeciesFormIndex(pokemonSpecies, true), undefined, false); }, this.egg.id, EGG_SEED.toString()); } diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index 431334419..ebcc2146c 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -659,8 +659,8 @@ export default class PartyUiHandler extends MessageUiHandler { const selectCallback = this.selectCallback; this.selectCallback = null; selectCallback(this.cursor, PartyOption.RELEASE); - } else - this.showText(null, 0); + } + this.showText(null, 0); }, null, true); }