mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-12 15:44:57 +00:00
Snowstorm, forfeiting trainer battles, battle outcome values
This commit is contained in:
@@ -12,11 +12,11 @@ class Battle
|
||||
if @rules["selfkoclause"]
|
||||
if self.lastMoveUser < 0
|
||||
# in extreme cases there may be no last move user
|
||||
return 5 # game is a draw
|
||||
return Outcome::DRAW
|
||||
elsif opposes?(self.lastMoveUser)
|
||||
return 2 # loss
|
||||
return Outcome::LOSE
|
||||
else
|
||||
return 1 # win
|
||||
return Outcome::WIN
|
||||
end
|
||||
end
|
||||
return __clauses__pbDecisionOnDraw
|
||||
@@ -27,11 +27,11 @@ class Battle
|
||||
if @rules["drawclause"] # NOTE: Also includes Life Orb (not implemented)
|
||||
if !(move && move.function_code == "HealUserByHalfOfDamageDone")
|
||||
# Not a draw if fainting occurred due to Liquid Ooze
|
||||
@decision = (user.opposes?) ? 1 : 2 # win / loss
|
||||
@decision = (user.opposes?) ? Outcome::WIN : Outcome::LOSE
|
||||
end
|
||||
elsif @rules["modifiedselfdestructclause"]
|
||||
if move && move.function_code == "UserFaintsExplosive" # Self-Destruct
|
||||
@decision = (user.opposes?) ? 1 : 2 # win / loss
|
||||
@decision = (user.opposes?) ? Outcome::WIN : Outcome::LOSE
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -39,13 +39,13 @@ class Battle
|
||||
|
||||
def pbEndOfRoundPhase
|
||||
__clauses__pbEndOfRoundPhase
|
||||
if @rules["suddendeath"] && @decision == 0
|
||||
if @rules["suddendeath"] && !decided?
|
||||
p1able = pbAbleCount(0)
|
||||
p2able = pbAbleCount(1)
|
||||
if p1able > p2able
|
||||
@decision = 1 # loss
|
||||
@decision = Outcome::WIN
|
||||
elsif p1able < p2able
|
||||
@decision = 2 # win
|
||||
@decision = Outcome::LOSE
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -261,7 +261,7 @@ class Battle::Move::UserFaintsExplosive
|
||||
count += @battle.pbAbleNonActiveCount(user.idxOpposingSide)
|
||||
if count == 0
|
||||
@battle.pbDisplay(_INTL("{1}'s team was disqualified!", user.pbThis))
|
||||
@battle.decision = (user.opposes?) ? 1 : 2
|
||||
@battle.decision = (user.opposes?) ? Outcome::WIN : Outcome::LOSE
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user