mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 22:54:59 +00:00
Snowstorm, forfeiting trainer battles, battle outcome values
This commit is contained in:
@@ -128,15 +128,15 @@ def pbSafariBattle(pkmn, level = 1)
|
||||
battle.ballCount = pbSafariState.ballcount
|
||||
BattleCreationHelperMethods.prepare_battle(battle)
|
||||
# Perform the battle itself
|
||||
decision = 0
|
||||
outcome = Battle::Outcome::UNDECIDED
|
||||
pbBattleAnimation(pbGetWildBattleBGM(foeParty), 0, foeParty) do
|
||||
pbSceneStandby { decision = battle.pbStartBattle }
|
||||
pbSceneStandby { outcome = battle.pbStartBattle }
|
||||
end
|
||||
Input.update
|
||||
# Update Safari game data based on result of battle
|
||||
pbSafariState.ballcount = battle.ballCount
|
||||
if pbSafariState.ballcount <= 0
|
||||
if decision != 2 # Last Safari Ball was used to catch the wild Pokémon
|
||||
if outcome != Battle::Outcome::LOSE # Last Safari Ball was used to catch the wild Pokémon
|
||||
pbMessage(_INTL("Announcer: You're out of Safari Balls! Game over!"))
|
||||
end
|
||||
pbSafariState.decision = 1
|
||||
@@ -147,16 +147,16 @@ def pbSafariBattle(pkmn, level = 1)
|
||||
# 2 - Player ran out of Safari Balls
|
||||
# 3 - Player or wild Pokémon ran from battle, or player forfeited the match
|
||||
# 4 - Wild Pokémon was caught
|
||||
if decision == 4
|
||||
if outcome == Battle::Outcome::CATCH
|
||||
$stats.safari_pokemon_caught += 1
|
||||
pbSafariState.captures += 1
|
||||
$stats.most_captures_per_safari_game = [$stats.most_captures_per_safari_game, pbSafariState.captures].max
|
||||
end
|
||||
pbSet(1, decision)
|
||||
pbSet(1, outcome)
|
||||
# Used by the Poké Radar to update/break the chain
|
||||
EventHandlers.trigger(:on_wild_battle_end, pkmn.species_data.id, pkmn.level, decision)
|
||||
EventHandlers.trigger(:on_wild_battle_end, pkmn.species_data.id, pkmn.level, outcome)
|
||||
# Return the outcome of the battle
|
||||
return decision
|
||||
return outcome
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
|
||||
Reference in New Issue
Block a user