Object Octagonal_Room "Octagonal Room"
with ...
ne_to "The way north-east is barred by an invisible wall!",
w_to Courtyard,
e_to [;
if (Amulet has worn) {
print "A section of the eastern wall suddenly parts
before you, allowing you into...^";
return HiddenShrine;
}
],
s_to [;
if (random(5) ~= 1) return Gateway;
print "The floor unexpectedly gives way, dropping you
through an open hole in the plaster...^";
return random(Maze1, Maze2, Maze3, Maze4);
];
Which is how fredrik showed you.
Edit:
So, how about
if (frob notin self) return secondRoom;
"The way is blocked!"