#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
#■ BATTLER - MOVE SPEED
#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
 
 
#==============================================================================
# ■ Game_Character
#==============================================================================
class Game_Character < Game_CharacterBase
 
  include XAS_BA
  attr_accessor :base_move_speed
  attr_accessor :dash_move_speed
  attr_accessor :move_speed
 
 #--------------------------------------------------------------------------
 # ● Initialize
 #--------------------------------------------------------------------------  
  alias x_move_speed_initialize initialize 
  def initialize
      @base_move_speed = BASE_MOVE_SPEED
      @dash_move_speed = 0
      x_move_speed_initialize
  end  
 
 #--------------------------------------------------------------------------
 # ● update_battler_move_speed
 #--------------------------------------------------------------------------
  def update_battler_move_speed
      @dash_move_speed = @dash_active ? DASH_MOVE_SPEED : 0
      sp1 = @base_move_speed
      sp2 = @dash_move_speed
      sp3 = self.battler.state_move_speed
      @move_speed = (sp1 + sp2 + sp3)
  end
 
 #--------------------------------------------------------------------------
 # ● Update Animation
 #--------------------------------------------------------------------------      
  def update_animation
      super
      update_force_move_routine_move
  end 
 
 #--------------------------------------------------------------------------
 # ● Update Force Move Routine Move
 #--------------------------------------------------------------------------        
  def update_force_move_routine_move
      return if @force_action == ""
      return if @move_route == nil
      command = @move_route.list[@move_route_index]
      return if command == nil
      if command.code == ROUTE_PLAY_SE    
         params = command.parameters
         params[0].play 
         advance_move_route_index
      end   
  end
 
 #--------------------------------------------------------------------------
 # ● Update Routine Move
 #--------------------------------------------------------------------------      
 alias x_update_routine_move update_routine_move
 def update_routine_move
     return if @force_action_times > 0
     x_update_routine_move
 end
 
 #--------------------------------------------------------------------------
 # ● Can Cancel Move Type Custom
 #--------------------------------------------------------------------------    
  alias x_move_speed_process_move_command process_move_command
  def process_move_command(command)
      return if can_cancel_move_type_custom?(command)
      params = command.parameters
      x_move_speed_process_move_command(command)
      if command.code == ROUTE_CHANGE_SPEED and @battler != nil and 
         self.is_a?(Game_Event)
         @base_move_speed = params[0]
      end        
  end
 
 #--------------------------------------------------------------------------
 # ● Can Cancel Move Type Custom
 #--------------------------------------------------------------------------    
  def can_cancel_move_type_custom?(command)
      return true if command == nil
      return true if @force_action_times > 0
      return false
  end  
 
end