Snowstorm, forfeiting trainer battles, battle outcome values

This commit is contained in:
Maruno17
2024-06-15 21:29:00 +01:00
parent 22b33ca6c2
commit 8e9417c3b7
41 changed files with 284 additions and 214 deletions

View File

@@ -205,7 +205,7 @@ class BattleChallengeData
def pbStart(t, numRounds)
@inProgress = true
@resting = false
@decision = 0
@decision = Battle::Outcome::UNDECIDED
@swaps = t.currentSwaps
@wins = t.currentWins
@battleNumber = 1
@@ -251,7 +251,7 @@ class BattleChallengeData
end
def pbMatchOver?
return true if !@inProgress || @decision != 0
return true if !@inProgress || @decision != Battle::Outcome::UNDECIDED
return @battleNumber > @numRounds
end
@@ -275,7 +275,7 @@ class BattleChallengeData
def pbEnd
$player.party = @oldParty
return if !@inProgress
save = (@decision != 0)
save = (@decision != Battle::Outcome::UNDECIDED)
reset
$game_map.need_refresh = true
Game.save(safe: true) if save
@@ -293,7 +293,7 @@ class BattleChallengeData
@inProgress = false
@resting = false
@start = nil
@decision = 0
@decision = Battle::Outcome::UNDECIDED
@wins = 0
@swaps = 0
@battleNumber = 0
@@ -343,11 +343,11 @@ class BattleChallengeType
end
def saveWins(challenge)
if challenge.decision == 0 # if undecided
if challenge.decision == Battle::Outcome::UNDECIDED
@currentWins = 0
@currentSwaps = 0
else
if challenge.decision == 1 # if won
if challenge.decision == Battle::Outcome::WIN
@currentWins = challenge.wins
@currentSwaps = challenge.swaps
else # if lost