class Game_Character < Game_CharacterBase
  ROUTE_MOVE_POINT            = 100           
  #--------------------------------------------------------------------------
  # ● 移動コマンドの処理
  #--------------------------------------------------------------------------
  alias tako875yprocess_move_command process_move_command
  def process_move_command(command)
    tako875yprocess_move_command(command)
    params = command.parameters
    case command.code
    when ROUTE_MOVE_POINT;            move_to_the_point(params[0],params[1])
    end
  end
  #--------------------------------------------------------------------------
  # ● 指定したポイントに近づく
  #--------------------------------------------------------------------------
  def move_to_the_point(x,y)
    sx = distance_x_from(x)
    sy = distance_y_from(y)
    if sx.abs > sy.abs
      move_straight(sx > 0 ? 4 : 6)
      move_straight(sy > 0 ? 8 : 2) if !@move_succeed && sy != 0
    elsif sy != 0
      move_straight(sy > 0 ? 8 : 2)
      move_straight(sx > 0 ? 4 : 6) if !@move_succeed && sx != 0
    end
  end  
end  