Constant Story "Peanuts";
Constant Headline "^A small exercise to see how properties can replace attributes.
^In the public domain 9/30/2005
^from Al the Game Designer^";
Release 2;
Serial "093005";
CONSTANT MANUAL_PRONOUNS;
Include "Parser";
Include "VerbLib";
[Initialise;
Banner();
location = PlainRoom;
lookmode =2;
print"^You are in a plain non-descriptive room wth a table, a jar holding an endless supply of unsalted^
peanuts, a pitcher of water with an infinite quantity of water, and a salt shaker with an infinite supply of salt.^";
return 2;];
Object PlainRoom "Plain Room"
with description
"You are in a plain non descriptive room.",
cant_go "You are stuck here till you quit the game.",
has light
;
Object DTable "Dining Table" PlainRoom
with name 'dining' 'table' 'DiningTable',
description "A very large and well built table.",
initial "There is a dining table here.",
before [;
take: "Its way too heavy for you.";],
has static supporter
;
Object PeaJar "Peanut Jar" PlainRoom
with name 'jar',
initial "There is a jar of peanuts here. (on the table)",
has container openable transparent
;
Object Shaker "Salt Shaker" PlainRoom
with name 'shaker',
initial "There is a salt shaker here. (on the table)",
has container open
;
Object TableSalt "Table Salt" Shaker
with name 'salt' 'seasoning' 'condiment',
article "a small amount of",
description "a bunch of table salt.",
initial "There is an infinite amount of salt in the shaker.",
before [;
pour:
if (second ~=Peanuts) "What? Waste good salt? Not on your life!";
if (Peanuts.salted) "You've already over-salted the damn things as it is!";
if (second == Peanuts && ~Peanuts.salted)
{Peanuts.salted = true;
"You pour salt over the peanuts they have now become salted.";};],
has edible static
;
Object WaterPitch "Pitcher" PlainRoom
with name 'pitcher',
initial "This is a pitcher of water here. (on the table)",
before [;
receive: "Nothing goes in the pitcher except water.";]
has container open
;
Object Water "Water" WaterPitch
with name 'water',
article "an inexhaustible quantity of",
description " Water for washing the peanuts",
initial "There is an infinite quantity of water in the pitcher.",
before [;
drink: "That water is for washing the peanuts only!";
pour:
if (second ~=Peanuts) "What? and waste some good washing water on that?";
if (Peanuts.salted ==false) "The peanuts are already washed!";
if (Peanuts.salted == true)
{Peanuts.salted = false;
"You pour water over the salted peanuts they have now become plain again.";};],
has edible static
;
Object Peanuts "Peanuts" PeaJar
with name 'peanuts' 'nuts',
initial "The jar has an inexhautible supply of peanuts.",
article "an endless supply of",
salted false,
description [;
if (~~self.salted) "A bunch of plain unsalted peanuts.";
if (self.salted) "A bunch of salted peanuts.";],
before [;
eat,taste:
if (self.salted == false)
"You pop a few of the peanuts into your mouth. UGH!!^
You spit them out. Way way too plain for your delicate palate.";
if (self.salted)
{move self to PeaJar;
"You pop the peanuts into your mouth. YUM YUM they've been salted^
to just the right degree.";}
salt:
if (PeaJar hasnt open) "The jar ain't open!";
if (self.salted && PeaJar has open || Peanuts in DTable && self.salted)
"You've already over-salted the damn things as it is!";
if (~~self.salted)
{self.salted = true;
"You pour salt over the plain peanuts they have now become salted.";};
pour:
if (self in DTable) "The jar is empty!";
if (second == DTable && PeaJar has open)
{move self to DTable;
"You pour the plain nuts on the table.";};
if (second == DTable && PeaJar hasnt open) "The jar ain't open!";
if (second == PeaJar && PeaJar has open)
{move Peanuts to peajar;
"You re-pour the peanuts back into the jar.";};
wash:
if (PeaJar hasnt open) "The jar ain't open!";
if (~~self.salted) "They've already been washed!";
if (self.salted)
{self.salted = false;
"You wash the salt off the peanuts.";};],
has edible pluralname
;