mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Fixes for Battle Arena
This commit is contained in:
@@ -74,6 +74,10 @@ class Window
|
|||||||
attr_reader :openness
|
attr_reader :openness
|
||||||
attr_reader :stretch
|
attr_reader :stretch
|
||||||
|
|
||||||
|
def inspect
|
||||||
|
return self.to_s.chop + ">"
|
||||||
|
end
|
||||||
|
|
||||||
def windowskin
|
def windowskin
|
||||||
@_windowskin
|
@_windowskin
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -88,10 +88,10 @@ class PokeBattle_Battler
|
|||||||
# Pursuit was used specially to intercept a switching foe.
|
# Pursuit was used specially to intercept a switching foe.
|
||||||
# Cancels the use of multi-turn moves and counters thereof. Note that Hyper
|
# Cancels the use of multi-turn moves and counters thereof. Note that Hyper
|
||||||
# Beam's effect is NOT cancelled.
|
# Beam's effect is NOT cancelled.
|
||||||
def pbCancelMoves
|
def pbCancelMoves(full_cancel = false)
|
||||||
# Outragers get confused anyway if they are disrupted during their final
|
# Outragers get confused anyway if they are disrupted during their final
|
||||||
# turn of using the move
|
# turn of using the move
|
||||||
if @effects[PBEffects::Outrage]==1 && pbCanConfuseSelf?(false)
|
if @effects[PBEffects::Outrage]==1 && pbCanConfuseSelf?(false) && !full_cancel
|
||||||
pbConfuse(_INTL("{1} became confused due to fatigue!",pbThis))
|
pbConfuse(_INTL("{1} became confused due to fatigue!",pbThis))
|
||||||
end
|
end
|
||||||
# Cancel usage of most multi-turn moves
|
# Cancel usage of most multi-turn moves
|
||||||
|
|||||||
@@ -1,3 +1,37 @@
|
|||||||
|
#===============================================================================
|
||||||
|
# Success state
|
||||||
|
#===============================================================================
|
||||||
|
class PokeBattle_SuccessState
|
||||||
|
attr_accessor :typeMod
|
||||||
|
attr_accessor :useState # 0 - not used, 1 - failed, 2 - succeeded
|
||||||
|
attr_accessor :protected
|
||||||
|
attr_accessor :skill
|
||||||
|
|
||||||
|
def initialize; clear; end
|
||||||
|
|
||||||
|
def clear(full=true)
|
||||||
|
@typeMod = Effectiveness::NORMAL_EFFECTIVE
|
||||||
|
@useState = 0
|
||||||
|
@protected = false
|
||||||
|
@skill = 0 if full
|
||||||
|
end
|
||||||
|
|
||||||
|
def updateSkill
|
||||||
|
if @useState==1
|
||||||
|
@skill = -2 if !@protected
|
||||||
|
elsif @useState==2
|
||||||
|
if Effectiveness.super_effective?(@typeMod); @skill = 2
|
||||||
|
elsif Effectiveness.normal?(@typeMod); @skill = 1
|
||||||
|
elsif Effectiveness.not_very_effective?(@typeMod); @skill = -1
|
||||||
|
else; @skill = -2 # Ineffective
|
||||||
|
end
|
||||||
|
end
|
||||||
|
clear(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -94,15 +128,18 @@ class PokeBattle_BattleArena < PokeBattle_Battle
|
|||||||
def pbEndOfRoundPhase
|
def pbEndOfRoundPhase
|
||||||
super
|
super
|
||||||
return if @decision != 0
|
return if @decision != 0
|
||||||
@count += 1
|
|
||||||
# Update skill rating
|
# Update skill rating
|
||||||
for side in 0...2
|
for side in 0...2
|
||||||
@skill[side] += self.successStates[side].skill_level
|
@skill[side] += self.successStates[side].skill
|
||||||
end
|
end
|
||||||
# PBDebug.log("[Mind: #{@mind.inspect}, Skill: #{@skill.inspect}]")
|
# PBDebug.log("[Mind: #{@mind.inspect}, Skill: #{@skill.inspect}]")
|
||||||
if @count==3
|
# Increment turn counter
|
||||||
@battlers[0].pbCancelMoves
|
@count += 1
|
||||||
@battlers[1].pbCancelMoves
|
return if @count < 3
|
||||||
|
# Half all multi-turn moves
|
||||||
|
@battlers[0].pbCancelMoves(true)
|
||||||
|
@battlers[1].pbCancelMoves(true)
|
||||||
|
# Calculate scores in each category
|
||||||
ratings1 = [0, 0, 0]
|
ratings1 = [0, 0, 0]
|
||||||
ratings2 = [0, 0, 0]
|
ratings2 = [0, 0, 0]
|
||||||
if @mind[0] == @mind[1]
|
if @mind[0] == @mind[1]
|
||||||
@@ -132,12 +169,13 @@ class PokeBattle_BattleArena < PokeBattle_Battle
|
|||||||
else
|
else
|
||||||
ratings2[2] = 2
|
ratings2[2] = 2
|
||||||
end
|
end
|
||||||
|
# Show scores
|
||||||
@scene.pbBattleArenaJudgment(@battlers[0], @battlers[1], ratings1.clone, ratings2.clone)
|
@scene.pbBattleArenaJudgment(@battlers[0], @battlers[1], ratings1.clone, ratings2.clone)
|
||||||
|
# Calculate total scores
|
||||||
points = [0, 0]
|
points = [0, 0]
|
||||||
for i in 0...ratings1.length
|
ratings1.each { |val| points[0] += val }
|
||||||
points[0] += ratings1[i]
|
ratings2.each { |val| points[1] += val }
|
||||||
points[1] += ratings2[i]
|
# Make judgment
|
||||||
end
|
|
||||||
if points[0] == points[1]
|
if points[0] == points[1]
|
||||||
pbDisplay(_INTL("{1} tied the opponent\n{2} in a referee's decision!",
|
pbDisplay(_INTL("{1} tied the opponent\n{2} in a referee's decision!",
|
||||||
@battlers[0].name, @battlers[1].name))
|
@battlers[0].name, @battlers[1].name))
|
||||||
@@ -162,7 +200,6 @@ class PokeBattle_BattleArena < PokeBattle_Battle
|
|||||||
pbEORSwitch
|
pbEORSwitch
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -305,8 +342,8 @@ class PokeBattle_Scene
|
|||||||
ensure
|
ensure
|
||||||
pbDisposeMessageWindow(msgwindow)
|
pbDisposeMessageWindow(msgwindow)
|
||||||
dimmingvp.dispose
|
dimmingvp.dispose
|
||||||
infowindow.contents.dispose
|
infowindow.contents.dispose if infowindow && infowindow.contents
|
||||||
infowindow.dispose
|
infowindow.dispose if infowindow
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,37 +48,3 @@ class PokeBattle_DamageState
|
|||||||
@berryWeakened = false
|
@berryWeakened = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Success state (used for Battle Arena)
|
|
||||||
################################################################################
|
|
||||||
class PokeBattle_SuccessState
|
|
||||||
attr_accessor :typeMod
|
|
||||||
attr_accessor :useState # 0 - not used, 1 - failed, 2 - succeeded
|
|
||||||
attr_accessor :protected
|
|
||||||
attr_accessor :skill
|
|
||||||
|
|
||||||
def initialize; clear; end
|
|
||||||
|
|
||||||
def clear(full=true)
|
|
||||||
@typeMod = Effectiveness::NORMAL_EFFECTIVE
|
|
||||||
@useState = 0
|
|
||||||
@protected = false
|
|
||||||
@skill = 0 if full
|
|
||||||
end
|
|
||||||
|
|
||||||
def updateSkill
|
|
||||||
if @useState==1
|
|
||||||
@skill = -2 if !@protected
|
|
||||||
elsif @useState==2
|
|
||||||
if Effectiveness.super_effective?(@typeMod); @skill = 2
|
|
||||||
elsif Effectiveness.normal?(@typeMod); @skill = 1
|
|
||||||
elsif Effectiveness.not_very_effective?(@typeMod); @skill = -1
|
|
||||||
else; @skill = -2 # Ineffective
|
|
||||||
end
|
|
||||||
end
|
|
||||||
clear(false)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|||||||
@@ -159,9 +159,10 @@ class PBPokemon
|
|||||||
pokemon.nature = nature
|
pokemon.nature = nature
|
||||||
pokemon.happiness=0
|
pokemon.happiness=0
|
||||||
pokemon.moves[0] = Pokemon::Move.new(self.convertMove(@move1))
|
pokemon.moves[0] = Pokemon::Move.new(self.convertMove(@move1))
|
||||||
pokemon.moves[1] = Pokemon::Move.new(self.convertMove(@move2))
|
pokemon.moves[1] = (@move2) ? Pokemon::Move.new(self.convertMove(@move2)) : nil
|
||||||
pokemon.moves[2] = Pokemon::Move.new(self.convertMove(@move3))
|
pokemon.moves[2] = (@move3) ? Pokemon::Move.new(self.convertMove(@move3)) : nil
|
||||||
pokemon.moves[3] = Pokemon::Move.new(self.convertMove(@move4))
|
pokemon.moves[3] = (@move4) ? Pokemon::Move.new(self.convertMove(@move4)) : nil
|
||||||
|
pokemon.moves.compact!
|
||||||
if ev.length > 0
|
if ev.length > 0
|
||||||
ev.each { |stat| pokemon.ev[stat] = Pokemon::EV_LIMIT / ev.length }
|
ev.each { |stat| pokemon.ev[stat] = Pokemon::EV_LIMIT / ev.length }
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user