mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
Fixed bug in previous commits, fixed Frontier/Bug Contest battles not counting towards battle counts stats
This commit is contained in:
@@ -295,7 +295,7 @@ def pbWildBattleCore(*args)
|
|||||||
# 3 - Player or wild Pokémon ran from battle, or player forfeited the match
|
# 3 - Player or wild Pokémon ran from battle, or player forfeited the match
|
||||||
# 4 - Wild Pokémon was caught
|
# 4 - Wild Pokémon was caught
|
||||||
# 5 - Draw
|
# 5 - Draw
|
||||||
case outcome
|
case decision
|
||||||
when 1, 4 # Won, caught
|
when 1, 4 # Won, caught
|
||||||
$stats.wild_battles_won += 1
|
$stats.wild_battles_won += 1
|
||||||
when 2, 3, 5 # Lost, fled, draw
|
when 2, 3, 5 # Lost, fled, draw
|
||||||
@@ -445,18 +445,18 @@ def pbTrainerBattleCore(*args)
|
|||||||
pbAfterBattle(decision,canLose)
|
pbAfterBattle(decision,canLose)
|
||||||
}
|
}
|
||||||
Input.update
|
Input.update
|
||||||
case outcome
|
|
||||||
when 1 # Won
|
|
||||||
$stats.trainer_battles_won += 1
|
|
||||||
when 2, 3, 5 # Lost, fled, draw
|
|
||||||
$stats.trainer_battles_lost += 1
|
|
||||||
end
|
|
||||||
# Save the result of the battle in a Game Variable (1 by default)
|
# Save the result of the battle in a Game Variable (1 by default)
|
||||||
# 0 - Undecided or aborted
|
# 0 - Undecided or aborted
|
||||||
# 1 - Player won
|
# 1 - Player won
|
||||||
# 2 - Player lost
|
# 2 - Player lost
|
||||||
# 3 - Player or wild Pokémon ran from battle, or player forfeited the match
|
# 3 - Player or wild Pokémon ran from battle, or player forfeited the match
|
||||||
# 5 - Draw
|
# 5 - Draw
|
||||||
|
case decision
|
||||||
|
when 1 # Won
|
||||||
|
$stats.trainer_battles_won += 1
|
||||||
|
when 2, 3, 5 # Lost, fled, draw
|
||||||
|
$stats.trainer_battles_lost += 1
|
||||||
|
end
|
||||||
pbSet(outcomeVar,decision)
|
pbSet(outcomeVar,decision)
|
||||||
return decision
|
return decision
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -90,6 +90,12 @@ def pbOrganizedBattleEx(opponent, challengedata, endspeech, endspeechwin)
|
|||||||
if decision == 1 || decision == 2 || decision == 5 # if win, loss or draw
|
if decision == 1 || decision == 2 || decision == 5 # if win, loss or draw
|
||||||
$game_temp.last_battle_record = battle.pbDumpRecord
|
$game_temp.last_battle_record = battle.pbDumpRecord
|
||||||
end
|
end
|
||||||
|
case decision
|
||||||
|
when 1 # Won
|
||||||
|
$stats.trainer_battles_won += 1
|
||||||
|
when 2, 3, 5 # Lost, fled, draw
|
||||||
|
$stats.trainer_battles_lost += 1
|
||||||
|
end
|
||||||
# Return true if the player won the battle, and false if any other result
|
# Return true if the player won the battle, and false if any other result
|
||||||
return (decision == 1)
|
return (decision == 1)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -392,6 +392,12 @@ def pbBugContestBattle(species,level)
|
|||||||
# 3 - Player or wild Pokémon ran from battle, or player forfeited the match
|
# 3 - Player or wild Pokémon ran from battle, or player forfeited the match
|
||||||
# 4 - Wild Pokémon was caught
|
# 4 - Wild Pokémon was caught
|
||||||
# 5 - Draw
|
# 5 - Draw
|
||||||
|
case decision
|
||||||
|
when 1, 4 # Won, caught
|
||||||
|
$stats.wild_battles_won += 1
|
||||||
|
when 2, 3, 5 # Lost, fled, draw
|
||||||
|
$stats.wild_battles_lost += 1
|
||||||
|
end
|
||||||
pbSet(1,decision)
|
pbSet(1,decision)
|
||||||
# Used by the Poké Radar to update/break the chain
|
# Used by the Poké Radar to update/break the chain
|
||||||
Events.onWildBattleEnd.trigger(nil,species,level,decision)
|
Events.onWildBattleEnd.trigger(nil,species,level,decision)
|
||||||
|
|||||||
Reference in New Issue
Block a user