module Atoa
State_Cycle_Time = 2
end
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
include Atoa
#--------------------------------------------------------------------------
alias state_cycle_initialize_gamebattler initialize !method_defined?(:state_cycle_initialize_gamebattler)
def initialize
state_cycle_initialize_gamebattler
@state_frame = @state_animation_id = 0
@anim_states = []
end
#--------------------------------------------------------------------------
def state_animation_id
return 0 if @states.empty?
return 0 if @states.include?(1)
@state_frame -= 1 if @state_frame > 0
return @state_animation_id if @state_frame > 0
if @anim_states.empty?
for state in @states
@anim_states << state if $data_states[state].animation_id > 0
end
end
now_state = @anim_states.shift
return 0 if now_state.nil?
@state_animation_id = $data_states[now_state].animation_id
return 0 if $data_animations[@state_animation_id].nil?
@state_frame = $data_animations[@state_animation_id].frame_max * State_Cycle_Time * 2
return @state_animation_id
end
end