绝对不是最好的方法,但我遇到了类似的问题,我最终遍历了您创建的方向列表并将每个房间添加到房间列表中,然后可以说:
nLooking is a number that varies. nLooking is 0.
After looking:
now nLooking is 1;
let accessibleRooms be a list of rooms;
let pDirections be list of viable directions;
repeat with dirToLookAt running through pDirections:
try silently going dirToLookAt;
if rule succeeded:
add the location of the player to accessibleRooms;
try silently going the opposite of dirToLookAt;
now nLooking is 0;
say "You can go to [accessibleRooms].".
Before going through a locked door when nLooking is 1:
stop the action.
我用 nLooking 来阻止输出
(第一次开门)
好像是锁着的。
在寻找可以访问的房间时。
if rule succeeded
检查玩家是否能够进入房间。如果是这种情况,玩家走进的房间会被添加到列表中,并且玩家会被移回他原来的位置。
这只有在一个人没有制作一张混乱的地图时才有效,其中向一个人来自哪里的相反方向移动并不意味着一个人降落在同一个房间里。一个可能只是将玩家放回他来自的房间......
我知道迟到的答案,但也许它可以帮助有同样问题的人:)