if ((@tu_id==v[0] or @tu_id==v[4]) and d!=8) or ((@tu_id==v[1] or @tu_id==v[5]) and d!=2) or ((@tu_id==v[2] or @tu_id==v[6]) and d!=4) or ((@tu_id==v[3] or @tu_id==v[7]) and d!=6)
return false#当前坐标也为向上箭头且主角不是向上前进
else
return true
end
else
return false
end
when v[1]#新坐标为向下箭头
if d!=8#主角不是向上的情况
if ((@tu_id==v[0] or @tu_id==v[4]) and d!=8) or ((@tu_id==v[1] or @tu_id==v[5]) and d!=2) or ((@tu_id==v[2] or @tu_id==v[6]) and d!=4) or ((@tu_id==v[3] or @tu_id==v[7]) and d!=6)
return false#当前坐标也为向下箭头且主角不是向下前进
else
return true
end
else
return false
end
when v[2]#新坐标为向左箭头
if d!=6#主角不是向右的情况
if ((@tu_id==v[0] or @tu_id==v[4]) and d!=8) or ((@tu_id==v[1] or @tu_id==v[5]) and d!=2) or ((@tu_id==v[2] or @tu_id==v[6]) and d!=4) or ((@tu_id==v[3] or @tu_id==v[7]) and d!=6)
return false#当前坐标也为向左箭头且主角不是向左前进
else
return true
end
else
return false
end
when v[3]#新坐标为向右箭头
if d!=4#主角不是向左的情况
if ((@tu_id==v[0] or @tu_id==v[4]) and d!=8) or ((@tu_id==v[1] or @tu_id==v[5]) and d!=2) or ((@tu_id==v[2] or @tu_id==v[6]) and d!=4) or ((@tu_id==v[3] or @tu_id==v[7]) and d!=6)
return false#当前坐标也为向右箭头且主角不是向右前进
else
return true
end
else
return false
end
#以下四个为可以两两交换的箭头标记
when v[4]#新坐标为向上箭头
if d!=2#主角不是向下的情况
if ((@tu_id==v[0] or @tu_id==v[4]) and d!=8) or ((@tu_id==v[1] or @tu_id==v[5]) and d!=2) or ((@tu_id==v[2] or @tu_id==v[6]) and d!=4) or ((@tu_id==v[3] or @tu_id==v[7]) and d!=6)
return false#当前坐标也为向上箭头且主角不是向上前进
else
return true
end
else
return false
end
when v[5]#新坐标为向下箭头
if d!=8#主角不是向上的情况
if ((@tu_id==v[0] or @tu_id==v[4]) and d!=8) or ((@tu_id==v[1] or @tu_id==v[5]) and d!=2) or ((@tu_id==v[2] or @tu_id==v[6]) and d!=4) or ((@tu_id==v[3] or @tu_id==v[7]) and d!=6)
return false#当前坐标也为向下箭头且主角不是向下前进
else
return true
end
else
return false
end
when v[6]#新坐标为向左箭头
if d!=6#主角不是向右的情况
if ((@tu_id==v[0] or @tu_id==v[4]) and d!=8) or ((@tu_id==v[1] or @tu_id==v[5]) and d!=2) or ((@tu_id==v[2] or @tu_id==v[6]) and d!=4) or ((@tu_id==v[3] or @tu_id==v[7]) and d!=6)
return false#当前坐标也为向左箭头且主角不是向左前进
else
return true
end
else
return false
end
when v[7]#新坐标为向右箭头
if d!=4#主角不是向左的情况
if ((@tu_id==v[0] or @tu_id==v[4]) and d!=8) or ((@tu_id==v[1] or @tu_id==v[5]) and d!=2) or ((@tu_id==v[2] or @tu_id==v[6]) and d!=4) or ((@tu_id==v[3] or @tu_id==v[7]) and d!=6)
return false#当前坐标也为向右箭头且主角不是向右前进
else
return true
end
else
return false
end
###上一段在踩上箭头后设置通行只可沿箭头方向前进###
#使用楼层范围变量来定位
when v[8]#菱形标志,双箭头转换
for i in $game_variables[90][0]...$game_variables[90][0]+$game_variables[90][1]
for j in $game_variables[90][2]...$game_variables[90][2]+$game_variables[90][3]
case $game_map.data[i,j,2]
when v[4]
$game_map.data[i,j,2]=v[5]
when v[5]
$game_map.data[i,j,2]=v[4]
when v[6]
$game_map.data[i,j,2]=v[7]
when v[7]
$game_map.data[i,j,2]=v[6]
end
end
end
when v[9]#黑框不可进入,但可以出去
#$data_tilesets[1].passages[@tunew_id]=15
return false#新坐标为黑框则不能通行
end
###以上增加图块中箭头方向的指向功能###箭头画在第3层
# 坐标在地图以外的情况
unless $game_map.valid?(new_x, new_y)
# 不能通行
return false
end
# 穿透是 ON 的情况下
if @through
# 可以通行
return true
end
# 移动者的元件无法来到指定方向的情况下
unless $game_map.passable?(x, y, d, self)
# 通行不可
return false
end
# 从指定方向不能进入到移动处的元件的情况下
unless $game_map.passable?(new_x, new_y, 10 - d)
# 不能通行
return false
end
# 循环全部事件
for event in $game_map.events.values
# 事件坐标于移动目标坐标一致的情况下
if event.x == new_x and event.y == new_y
# 穿透为 ON
unless event.through
# 自己就是事件的情况下
if self != $game_player
# 不能通行
return false
end
# 自己是主角、对方的图形是角色的情况下
if event.character_name != ""
# 不能通行
return false
end
end
end
end
# 主角的坐标与移动目标坐标一致的情况下
if $game_player.x == new_x and $game_player.y == new_y