Added a Setting that makes a new Pokémon's Pokédex entry show after evolution, trading, hatching, gaining from Mystery Gift and general adding

This commit is contained in:
Maruno17
2022-04-03 19:06:56 +01:00
parent e87d55f56f
commit 026e6f5c0a
7 changed files with 133 additions and 23 deletions

View File

@@ -103,6 +103,22 @@ class PokemonEggHatch_Scene
pbMEPlay("Evolution success")
@pokemon.name = nil
pbMessage(_INTL("\\se[]{1} hatched from the Egg!\\wt[80]", @pokemon.name)) { update }
# Record the Pokémon's species as owned in the Pokédex
was_owned = $player.owned?(@pokemon.species)
$player.pokedex.register(@pokemon)
$player.pokedex.set_owned(@pokemon.species)
$player.pokedex.set_seen_egg(@pokemon.species)
# Show Pokédex entry for new species if it hasn't been owned before
if Settings::SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN && !was_owned && $player.has_pokedex
pbMessage(_INTL("{1}'s data was added to the Pokédex.", @pokemon.name)) { update }
$player.pokedex.register_last_seen(@pokemon)
pbFadeOutIn {
scene = PokemonPokedexInfo_Scene.new
screen = PokemonPokedexInfoScreen.new(scene)
screen.pbDexEntry(@pokemon.species)
}
end
# Nickname the Pokémon
if $PokemonSystem.givenicknames == 0 &&
pbConfirmMessage(
_INTL("Would you like to nickname the newly hatched {1}?", @pokemon.name)
@@ -199,15 +215,27 @@ def pbHatch(pokemon)
pokemon.timeEggHatched = pbGetTimeNow
pokemon.obtain_method = 1 # hatched from egg
pokemon.hatched_map = $game_map.map_id
$player.pokedex.register(pokemon)
$player.pokedex.set_owned(pokemon.species)
$player.pokedex.set_seen_egg(pokemon.species)
pokemon.record_first_moves
if !pbHatchAnimation(pokemon)
pbMessage(_INTL("Huh?\1"))
pbMessage(_INTL("...\1"))
pbMessage(_INTL("... .... .....\1"))
pbMessage(_INTL("{1} hatched from the Egg!", speciesname))
was_owned = $player.owned?(pokemon.species)
$player.pokedex.register(pokemon)
$player.pokedex.set_owned(pokemon.species)
$player.pokedex.set_seen_egg(pokemon.species)
# Show Pokédex entry for new species if it hasn't been owned before
if Settings::SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN && !was_owned && $player.has_pokedex
pbMessage(_INTL("{1}'s data was added to the Pokédex.", speciesname))
$player.pokedex.register_last_seen(pokemon)
pbFadeOutIn {
scene = PokemonPokedexInfo_Scene.new
screen = PokemonPokedexInfoScreen.new(scene)
screen.pbDexEntry(pokemon.species)
}
end
# Nickname the Pokémon
if $PokemonSystem.givenicknames == 0 &&
pbConfirmMessage(_INTL("Would you like to nickname the newly hatched {1}?", speciesname))
nickname = pbEnterPokemonName(_INTL("{1}'s nickname?", speciesname),