#--------------------------------------------------------------------------
# ● 瞬移到事件身后
#--------------------------------------------------------------------------
def Teleport_event(Range) #Range为瞬移可能的距离
sx = []
sy = []
for i in $game_map.events
sx.push(@x.abs - $game_map.events[i].x.abs)
sy.push(@y.abs - $game_map.events[i].y.abs)
end
case @direction
when 8 #面向上
if $game_player.y == sy.min and sy <= Range
$game_player.y = sy.min - 1
@direction = 2 #修正朝向为面向敌人
end
when 2 #面向下
if $game_player.y == sy.min and sy <= Range
$game_player.y = sy.min - 1
@direction = 8 #修正朝向为面向敌人
end
when 4 #面向左
if $game_player.x == sx.min and sx <= Range
$game_player.x = sx.min - 1
@direction = 6 #修正朝向为面向敌人
end
@direction = 6 #修正朝向为面向敌人
when 6 #面向右
if $game_player.x == sx.min and sx <= Range
$game_player.x = sx.min - 1
@direction = 4 #修正朝向为面向敌人
end
end
end