mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
AI function code rewrites
This commit is contained in:
@@ -84,6 +84,7 @@ class Battle
|
||||
attr_accessor :poke_ball_failed # Set after first_poke_ball to prevent it being set again
|
||||
attr_reader :switching # True if during the switching phase of the round
|
||||
attr_reader :futureSight # True if Future Sight is hitting
|
||||
attr_reader :command_phase
|
||||
attr_reader :endOfRound # True during the end of round
|
||||
attr_accessor :moldBreaker # True if Mold Breaker applies
|
||||
attr_reader :struggle # The Struggle move
|
||||
@@ -159,6 +160,7 @@ class Battle
|
||||
@lastMoveUser = -1
|
||||
@switching = false
|
||||
@futureSight = false
|
||||
@command_phase = false
|
||||
@endOfRound = false
|
||||
@moldBreaker = false
|
||||
@runCommand = 0
|
||||
|
||||
@@ -172,6 +172,7 @@ class Battle
|
||||
# Command phase
|
||||
#=============================================================================
|
||||
def pbCommandPhase
|
||||
@command_phase = true
|
||||
@scene.pbBeginCommandPhase
|
||||
# Reset choices if commands can be shown
|
||||
@battlers.each_with_index do |b, i|
|
||||
@@ -186,8 +187,12 @@ class Battle
|
||||
end
|
||||
# Choose actions for the round (player first, then AI)
|
||||
pbCommandPhaseLoop(true) # Player chooses their actions
|
||||
return if @decision != 0 # Battle ended, stop choosing actions
|
||||
if @decision != 0 # Battle ended, stop choosing actions
|
||||
@command_phase = false
|
||||
return
|
||||
end
|
||||
pbCommandPhaseLoop(false) # AI chooses their actions
|
||||
@command_phase = false
|
||||
end
|
||||
|
||||
def pbCommandPhaseLoop(isPlayer)
|
||||
|
||||
Reference in New Issue
Block a user