mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Snowstorm, forfeiting trainer battles, battle outcome values
This commit is contained in:
@@ -378,11 +378,11 @@ def pbBugContestBattle(pkmn, level = 1)
|
||||
setBattleRule("single")
|
||||
BattleCreationHelperMethods.prepare_battle(battle)
|
||||
# Perform the battle itself
|
||||
decision = 0
|
||||
outcome = Battle::Outcome::UNDECIDED
|
||||
pbBattleAnimation(pbGetWildBattleBGM(foeParty), 0, foeParty) do
|
||||
decision = battle.pbStartBattle
|
||||
BattleCreationHelperMethods.after_battle(decision, true)
|
||||
if [2, 5].include?(decision) # Lost or drew
|
||||
outcome = battle.pbStartBattle
|
||||
BattleCreationHelperMethods.after_battle(outcome, true)
|
||||
if Battle::Outcome.should_black_out?(outcome)
|
||||
$game_system.bgm_unpause
|
||||
$game_system.bgs_unpause
|
||||
pbBugContestStartOver
|
||||
@@ -392,15 +392,15 @@ def pbBugContestBattle(pkmn, level = 1)
|
||||
# Update Bug Contest game data based on result of battle
|
||||
pbBugContestState.ballcount = battle.ballCount
|
||||
if pbBugContestState.ballcount == 0
|
||||
pbMessage(_INTL("ANNOUNCER: The Bug-Catching Contest is over!"))
|
||||
pbMessage(_INTL("ANNOUNCER: The Bug-Catching Contest is over!"))
|
||||
pbBugContestState.pbStartJudging
|
||||
end
|
||||
# Save the result of the battle in Game Variable 1
|
||||
BattleCreationHelperMethods.set_outcome(decision, 1)
|
||||
BattleCreationHelperMethods.set_outcome(outcome, 1)
|
||||
# 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 false if the player lost or drew the battle, and true if any other result
|
||||
return (decision != 2 && decision != 5)
|
||||
return !Battle::Outcome.should_black_out?(outcome)
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
|
||||
Reference in New Issue
Block a user