I have included some code that, among other things, should let my actor drown and die if he goes ‘ne’,'nw, or ‘w’ of if he tries to swim in the ocean. I just can’t get this to work if I try the ‘swim’ verb. Would appreciate any help on this.
My player is on a beach near the ocean. I want him to drown if he goes
north, northeast, or northwest or ‘swims’, The code I’ve included does
not not recognize the command swim. Need some help with this. Here’s
the code:
/* (Room001) The player begins the game at this location/room.
****************/
startroom : OutdoorRoom ‘On the Beach’ ‘The Beach’
roomFirstDesc()
{
"The rocky beach continues north and south. Toward the westward
directions, is
the vast, blue ocean which stretches as far as the eye can see. The
many-sized
rocks, jutting out of the beach and the ocean, look quite dangerous
to
explore. A wide, inviting path heads east into the dense
forest. ";
beachAchievement.awardPointsOnce();
}
shortDesc = "You are at the rocky beach. "
north : FakeConnector {
“As much as you would want to explore the beach, you can’t. For one
thing, the
forest seems to tug at you relentlessly. Besides, you are a
professional
explorer and are being paid to get this stuff done. The sooner, the
better.”
}
south : FakeConnector {
“I know that you would like to roam up and down the beach. You will
be
disappointed. There’s nothing to be found but sand, rock, the ocean
and the
barrier of the dense forest. You should stick to your task. "
}
northwest : FakeConnector {
" << me.swim >>”
}
west : FakeConnector {
" << me.swim >>"
}
southwest : FakeConnector {
" << me.swim >>"
}
swim asExit (west);
east : DynamicTravelMessage
{
->path
"You head into the path and are shocked to see that it seems more worn
than you
could have imagined; as if someone has been through here recently.
This isn’t a
fact that your new employers chose to reveal. "
“You enter the eastern path.”
}
beachAchievement : Achievement { +5 "reaching the beach " }
;
/* Define the sound of the beach
**********************************************/
-
SimpleNoise ‘ocean/wave/waves’ ‘waves’
"You hear the slapping of the water against unyielding rocks. "
; -
SimpleOdor ‘salty’ ‘salty’
"You smell the salty odor of the ocean. "
;
/* Define Player Character
****************************************************/
+me: BagOfHolding, Actor
vocabWords = ‘tom thomas tom/thomas/leavens’
desc
{
“You are Thomas Leavens; also known as Doctor Tom to all your
friends
and by all of your enemies. Your ex-wife calls you names that
could
never be repeated. You graduated from college with a Doctorate
in
biology and a minor in world history. Shortly after, as part of
your
first job, you became involved in exploring cave systems
(spelunking).
This quickly evolved into self-employment in all types of world-
wide
exploration. Your intelligence and expertise in many fields
makes you a
greatly sought after scientist and explorer.”;
/* Show my Posture. */
"<.p>";
postureDesc;
"<.p>";
/* Show my Inventory. */
holdingDesc;
}
bulk = 10
goingToOcean = 1
swim
{
switch (me.goingToOcean)
{
case 1:
“As much as you would want to take a much needed break and go for a
swim, the
water seems dangerous.”;
me.goingToOcean++;
break;
case 2:
“You step to the edge of the shore and consider jumping into the
ocean. However,
the strength, speed and size of the waves make you step back, shaking
your
head.”;
me.goingToOcean++;
break;
case 3:
“Delaying your quest,for the moment, you remove everything and throw
it onto the
sand. Having done that, you jump into the water and immediately are
buffeted
against the hard rocks by wave after wave. You begin to struggle and
scream in
your last moments, but it is too late.”;
finishGameMsg(ftDeath, [finishOptionUndo, finishOptionFullScore]);
}
}
;