mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-11 23:24:59 +00:00
Snowstorm, forfeiting trainer battles, battle outcome values
This commit is contained in:
@@ -364,10 +364,10 @@ def pbDecideWinner(party0, party1, rating0, rating1)
|
||||
score0 = pbDecideWinnerScore(party0, party1, rating0)
|
||||
score1 = pbDecideWinnerScore(party1, party0, rating1)
|
||||
if score0 == score1
|
||||
return 5 if rating0 == rating1
|
||||
return (rating0 > rating1) ? 1 : 2
|
||||
return Battle::Outcome::DRAW if rating0 == rating1
|
||||
return (rating0 > rating1) ? Battle::Outcome::WIN : Battle::Outcome::LOSE
|
||||
else
|
||||
return (score0 > score1) ? 1 : 2
|
||||
return (score0 > score1) ? Battle::Outcome::WIN : Battle::Outcome::LOSE
|
||||
end
|
||||
end
|
||||
|
||||
@@ -375,7 +375,7 @@ end
|
||||
#
|
||||
#===============================================================================
|
||||
def pbRuledBattle(team1, team2, rule)
|
||||
decision = 0
|
||||
outcome = Battle::Outcome::UNDECIDED
|
||||
if rand(100) == 0
|
||||
level = rule.ruleset.suggestedLevel
|
||||
t_type = GameData::TrainerType.keys.first
|
||||
@@ -406,7 +406,7 @@ def pbRuledBattle(team1, team2, rule)
|
||||
battle.debug = true
|
||||
battle.controlPlayer = true
|
||||
battle.internalBattle = false
|
||||
decision = battle.pbStartBattle
|
||||
outcome = battle.pbStartBattle
|
||||
team1.team.each_with_index do |p, i|
|
||||
next if !p
|
||||
p.heal
|
||||
@@ -422,13 +422,13 @@ def pbRuledBattle(team1, team2, rule)
|
||||
party2 = []
|
||||
team1.length.times { |i| party1.push(team1[i]) }
|
||||
team2.length.times { |i| party2.push(team2[i]) }
|
||||
decision = pbDecideWinner(party1, party2, team1.rating, team2.rating)
|
||||
outcome = pbDecideWinner(party1, party2, team1.rating, team2.rating)
|
||||
end
|
||||
case decision
|
||||
when 1 # Team 1 wins
|
||||
case outcome
|
||||
when Battle::Outcome::WIN # Team 1 wins
|
||||
team1.addMatch(team2, 1)
|
||||
team2.addMatch(team1, 0)
|
||||
when 2 # Team 2 wins
|
||||
when Battle::Outcome::LOSE # Team 2 wins
|
||||
team1.addMatch(team2, 0)
|
||||
team2.addMatch(team1, 1)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user