mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Revised changes in previous commit about Pokémon generation for non-standard battles
This commit is contained in:
@@ -196,13 +196,17 @@ EventHandlers.add(:on_calling_wild_battle, :roaming_pokemon,
|
||||
}
|
||||
)
|
||||
|
||||
def pbRoamingPokemonBattle(pkmn)
|
||||
def pbRoamingPokemonBattle(pkmn, level = 1)
|
||||
# Get the roaming Pokémon to encounter; generate it based on the species and
|
||||
# level if it doesn't already exist
|
||||
idxRoamer = $game_temp.roamer_index_for_encounter
|
||||
if !$PokemonGlobal.roamPokemon[idxRoamer] ||
|
||||
!$PokemonGlobal.roamPokemon[idxRoamer].is_a?(Pokemon)
|
||||
$PokemonGlobal.roamPokemon[idxRoamer] = pbGenerateWildPokemon(pkmn.species_data.id, pkmn.level, true)
|
||||
if pkmn.is_a?(Pokemon)
|
||||
$PokemonGlobal.roamPokemon[idxRoamer] = pbGenerateWildPokemon(pkmn.species_data.id, pkmn.level, true)
|
||||
else
|
||||
$PokemonGlobal.roamPokemon[idxRoamer] = pbGenerateWildPokemon(pkmn, level, true)
|
||||
end
|
||||
end
|
||||
# Set some battle rules
|
||||
setBattleRule("single")
|
||||
|
||||
@@ -115,8 +115,9 @@ EventHandlers.add(:on_calling_wild_battle, :safari_battle,
|
||||
}
|
||||
)
|
||||
|
||||
def pbSafariBattle(pkmn)
|
||||
def pbSafariBattle(pkmn, level = 1)
|
||||
# Generate a wild Pokémon based on the species and level
|
||||
pkmn = pbGenerateWildPokemon(pkmn, level) if !pkmn.is_a?(Pokemon)
|
||||
foeParty = [pkmn]
|
||||
# Calculate who the trainer is
|
||||
playerTrainer = $player
|
||||
|
||||
@@ -365,10 +365,12 @@ EventHandlers.add(:on_calling_wild_battle, :bug_contest_battle,
|
||||
}
|
||||
)
|
||||
|
||||
def pbBugContestBattle(pkmn)
|
||||
def pbBugContestBattle(pkmn, level = 1)
|
||||
# Record information about party Pokémon to be used at the end of battle (e.g.
|
||||
# comparing levels for an evolution check)
|
||||
EventHandlers.trigger(:on_start_battle)
|
||||
# Generate a wild Pokémon based on the species and level
|
||||
pkmn = pbGenerateWildPokemon(pkmn, level) if !pkmn.is_a?(Pokemon)
|
||||
foeParty = [pkmn]
|
||||
# Calculate who the trainers and their party are
|
||||
playerTrainer = [$player]
|
||||
|
||||
Reference in New Issue
Block a user