Part of my current project’s map is a lake.
I made a “Lake” class to describe the rooms which make up the lake. It has rules for drowning (or swimming to shore if there is one nearby).
I also made gave a “dock” attribute to the two actual docks in the map. These are not Lake rooms.
I’d like to limit the movement of the boat to Lake rooms, and to the docks.
Below is how I roughed it out:
Object lost_boat "A humble punt" north_shore
with name 'punt' 'humble' 'boat',
description "A shallow old punt made of weathered plywood. It looks in good repair.",
before
[;
Go:
if(parent(GODIR)==Lake)
{
print "You row the punt";
move self to direction;
}
else if(GODIR has dock)
{
print "You skillfully tie the punt to the dock.";
move self to direction;
}
else
{
"Sorry. Unlike Michael, you can't row the boat ashore . . . only on the lake or up to a dock.";
}
],
has enterable container open static
;
Now, the problem is, how do I determine the room that lies in the desired direction?
Example:
Lake middlelake
with description "middle of lake",
n_to north_dock,
s_to south_lake;
The player is in the boat and the boat is in middlelake. The player enters “GO NORTH”.
How do I extract “north dock” from that command?
Thanks,
Stefan