Fixed Safari/Bug Contest/roaming battles generating Pokémon while ignoring that Pokémon's defined form

This commit is contained in:
Maruno17
2022-11-05 18:08:04 +00:00
parent 096957bc20
commit 4f42eca3ee
5 changed files with 15 additions and 18 deletions

View File

@@ -105,19 +105,18 @@ EventHandlers.add(:on_player_step_taken_can_transfer, :safari_game_counter,
#
#===============================================================================
EventHandlers.add(:on_calling_wild_battle, :safari_battle,
proc { |species, level, handled|
proc { |pkmn, handled|
# handled is an array: [nil]. If [true] or [false], the battle has already
# been overridden (the boolean is its outcome), so don't do anything that
# would override it again
next if !handled[0].nil?
next if !pbInSafari?
handled[0] = pbSafariBattle(species, level)
handled[0] = pbSafariBattle(pkmn)
}
)
def pbSafariBattle(species, level)
def pbSafariBattle(pkmn)
# Generate a wild Pokémon based on the species and level
pkmn = pbGenerateWildPokemon(species, level)
foeParty = [pkmn]
# Calculate who the trainer is
playerTrainer = $player
@@ -156,7 +155,7 @@ def pbSafariBattle(species, level)
end
pbSet(1, decision)
# Used by the Poké Radar to update/break the chain
EventHandlers.trigger(:on_wild_battle_end, species, level, decision)
EventHandlers.trigger(:on_wild_battle_end, pkmn.species_data.id, pkmn.level, decision)
# Return the outcome of the battle
return decision
end