#--------------------------------------------------------------------------
# ● 由鼠标移动
#--------------------------------------------------------------------------
def move_by_mouse
unless @mouse_move_path.empty? # 移动路线数组不为空则执行移动
dir = @mouse_move_path.shift
if passable?(x, y, dir) && !@mouse_move_path.empty?
move_straight(dir)
elsif @mouse_move_path.empty? # 判断是否是最后一步
x2 = $game_map.round_x_with_direction(x, dir)
y2 = $game_map.round_y_with_direction(y, dir)
move_straight(dir) unless dir.zero?
unless @x == x2 && @y == y2 # 如果移动失败,检查是否启动前方事件
check_event_trigger_there([0,1,2])
get_on_off_vehicle unless $game_map.setup_starting_event
end
$mouse_move_sign.transparent = true if $mouse_move_sign.direction == 2
@mouse_dash = false
elsif @mouse_move_path[0].zero? # 目标点无法抵达,调整朝向→目标点
@mouse_move_path.shift
@direction = dir
@mouse_dash = false
else
draw_move_path
end
end
end