AI function code rewrites

This commit is contained in:
Maruno17
2023-01-12 23:08:26 +00:00
parent a22f75f500
commit 84bdd1f60b
10 changed files with 330 additions and 180 deletions

View File

@@ -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)