class Scene_Battle alias atb_update update def update @atb = Game_ATB.new unless @atb @atb.update update_phase3 atb_update end alias atb_update_phase3 update_phase3 def update_phase3 atb_update_phase3 for battler in $game_party.actors if battler.time == 0 and !@command_window_showing @actor_index = battler.index @active_battler = battler phase3_setup_command_window @command_window_showing = true end end end alias atb_start_phase2 start_phase2 def start_phase2 atb_start_phase2 @party_command_window.active = false @party_command_window.visible = false start_phase3 end def phase3_prior_actor return end def phase3_next_actor return end end class Game_Battler attr_accessor :time attr_accessor :ready alias atbv1_initialize initialize def initialize @time = 10000.0 atbv1_initialize end end class Game_ATB def initialize @speed = 1 end def update agi = count = 0 for battler in $game_troop.enemies + $game_party.actors agi += battler.agi count += 1 end for battler in $game_troop.enemies + $game_party.actors battler.time -= [(battler.agi.to_f / (agi / count) * 100 * @speed)].min if battler.time < 0 battler.time = 0 end end end end class Window_BattleStatus < Window_Base alias atbv1_update update def update atbv1_update for i in 0...$game_party.actors.size actor = $game_party.actors[i] draw_atb_meter(i * 160 + 4, 93, 120, actor) end end def draw_atb_meter(x, y, width, actor) w = width - width * (actor.time / 10000) self.contents.fill_rect(x, y, width, 6, Color.new(0, 0, 0, 255)) self.contents.fill_rect(x + 1, y + 1, w - 2, 1, Color.new(255, 255, 128, 255)) self.contents.fill_rect(x + 1, y + 2, w - 2, 1, Color.new(255, 255, 0 , 255)) self.contents.fill_rect(x + 1, y + 3, w - 2, 1, Color.new(192, 192, 0 , 255)) self.contents.fill_rect(x + 1, y + 4, w - 2, 1, Color.new(128, 128, 0 , 255)) end end