Fix eggs ignoring forms
parent
aa94e044ab
commit
534d5a907c
|
@ -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 {
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -659,7 +659,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
|||
const selectCallback = this.selectCallback;
|
||||
this.selectCallback = null;
|
||||
selectCallback(this.cursor, PartyOption.RELEASE);
|
||||
} else
|
||||
}
|
||||
this.showText(null, 0);
|
||||
}, null, true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue