before the player goes somewhere I want to check whether the target room has a certain attribute. “before going somewhere” seems useful, but what is the “name” of the target room? Like,
A room can be A or B. Before going somewhere: If the XXX is A, do this and that;
I don’t know whether this is the best way, but it seems to work:
A room can be good or bad.
The Kitchen is a room. The Kitchen is good.
The Playroom is south of the Kitchen. The Playroom is bad.
["Before" line taken from Recipe 213 Eddystone]
Before going from a room (called source) to a room (called destination):
if the destination is bad:
say "You enter what seems to be a bad room..."
Kitchen
>s
You enter what seems to be a bad room...
Playroom
>n
Kitchen
>