diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb index 1646660d4..2ab4d78c8 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb @@ -295,7 +295,7 @@ def pbWildBattleCore(*args) # 3 - Player or wild Pokémon ran from battle, or player forfeited the match # 4 - Wild Pokémon was caught # 5 - Draw - case outcome + case decision when 1, 4 # Won, caught $stats.wild_battles_won += 1 when 2, 3, 5 # Lost, fled, draw @@ -445,18 +445,18 @@ def pbTrainerBattleCore(*args) pbAfterBattle(decision,canLose) } 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) # 0 - Undecided or aborted # 1 - Player won # 2 - Player lost # 3 - Player or wild Pokémon ran from battle, or player forfeited the match # 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) return decision end diff --git a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/004_Challenge_Battles.rb b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/004_Challenge_Battles.rb index a028d253e..2501c85a7 100644 --- a/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/004_Challenge_Battles.rb +++ b/Data/Scripts/018_Alternate battle modes/001_Battle Frontier/004_Challenge_Battles.rb @@ -90,6 +90,12 @@ def pbOrganizedBattleEx(opponent, challengedata, endspeech, endspeechwin) if decision == 1 || decision == 2 || decision == 5 # if win, loss or draw $game_temp.last_battle_record = battle.pbDumpRecord 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 (decision == 1) end diff --git a/Data/Scripts/018_Alternate battle modes/002_BugContest.rb b/Data/Scripts/018_Alternate battle modes/002_BugContest.rb index 87adeb0ba..f0ce30aff 100644 --- a/Data/Scripts/018_Alternate battle modes/002_BugContest.rb +++ b/Data/Scripts/018_Alternate battle modes/002_BugContest.rb @@ -392,6 +392,12 @@ def pbBugContestBattle(species,level) # 3 - Player or wild Pokémon ran from battle, or player forfeited the match # 4 - Wild Pokémon was caught # 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) # Used by the Poké Radar to update/break the chain Events.onWildBattleEnd.trigger(nil,species,level,decision)