/* use the HTML status line and prompts */
#define USE_HTML_STATUS
#define USE_HTML_PROMPT
/* include the standard TADS libraries */
#include <adv.t>
#include
<std02.t>
/* at game startup, turn on HTML mode */
replace commonInit: function
{
/* display the special code sequence to turn on HTML recognition */
"\H+";
}
/*ALL OF MY COMENTS APPEAR
IN CAPITAL LETTERS LIKE THIS. THE PROGRAM IS FAIRLY WELL COMMENTED...I HAVE
BASICALLY EXPLAINED ALMOST EVERY FUNCTION, SCRIPT, AND METHOD AND ASSUMED THAT
IF YOU'RE GOING TO BOTHER READING THIS YOU ALREADY KNOW WHAT THE BASIC
PROPERTIES LIKE SDESC AND LDESC MEAN (I.E. COMMENTING THEM WOULD BE A WASTE
OF TIME). THERE ARE SEVERAL PLACES THAT COULD BE CODED DIFFERENTLY (AND MUCH
MORE SIMPLY) BUT SINCE THIS WAS MY FIRST GAME I WAS LEARNING AS I WENT AND USUALLY
DIDN'T BOTHER GOING BACK TO FIX THINGS IF THEY WORKED (UNLESS IT WAS REALLY
UGLY LIKE SOME OF THE ORIGINAL CODE FOR THE MARBLE TABLE AND IT'S ENVIRONS
IN THE MASTER BEDROOM). FEEL FREE TO EMAIL ME WITH QUESTIONS: erthwin at cox
dot net OR COMMENTS. IF YOU CAN'T GET THE GAME TO COMPILE SEE THE COMMENTS
I MADE NEAR THE END OF THE CODE ABOVE THE ALANNA2 ACTOR OBJECT*/
startroom: room
sdesc = "Entry Way"
ldesc = "You are standing in what seems to be the entry way of a large house. Behind you is an iron door and ahead of you to the north lies the other end of this expansive room.\n "
north = NorthEnd
south = IronDoor
out = IronDoor
;
IronDoor: doorway
location = startroom
noun = 'door' 'irondoor'
adjective = 'iron'
sdesc = "iron door"
ldesc = "A massive iron door."
isopen = nil
verDoOpen( actor ) = {}
doOpen( actor ) =
//DON'T WANT THE PLAYER OPENING THIS ONE, IT'S A BOUNDARY
{
"You push against the door with all your might but it doesn\'t move an inch.\n";
return nil;
}
doordest =
//THERE'S NOTHING ON THE OTHER SIDE
{
"The iron door doesn\'t budge.\n";
return nil;
}
;
/*THIS SECTION IS FOR COMMANDS THAT WORK ANYWHERE IN THE GAME*/
To
view this code click here.
/*END OF SECTION FOR COMMANDS THAT WORK ANYWHERE IN THE GAME*/
NorthEnd: room
sdesc = "North End of Entry Way"
ldesc = "At this end of the room a hallway branches off to the east and west. The eastern side goes only a few feet before running into a door. There is a bronze placard on the wall. \n"
south = startroom
east = LockedDoor
west = BayHall
;
Placard: readable, fixeditem
//GOOD OLD STEPHEN CRANE...
location = NorthEnd
noun = 'placard' 'sign' 'bronzeplacard'
adjective = 'bronze'
sdesc = "bronze placard"
ldesc = "\tA man said to the universe:\n
\t\"Sir, I exist!\"\n
\t\"However,\" replied the universe,\n
\t\"The fact has not created in me\n
\tA sense of obligation.\"\n
\t\t\t\t\t--S.C.\n"
;
LockedDoor: lockableDoorway
location = NorthEnd
noun = 'door'
adjective = 'east' 'eastern'
sdesc = "door"
doordest = Study
mykey = StudyKey
otherside = LockedDoor2
;
Study: darkroom
sdesc = "The Study"
ldesc =
//LDESC SHOULD REFLECT THE OPEN/CLOSED STATE OF THE BOOKCASE
{
if (BookCase.isopen)
"This room has a wood floor and three large leather chairs arranged around an intricately engraved coffee table. The floor is covered with a thick rug and a dim lamp in the corner gives the room an eerie glow. To the north is a hallway that used to be concealed by the large bookcase which now protrudes out into the room. There is also a doorway in the northeastern corner of the room and a hallway leading west.\n";
else
{
if ( not self.score )
//+10 POINTS THE FIRST TIME THE PLAYER GETS IN THE STUDY
{
incscore( 10 );
self.score := true;
}
"You have entered a room with wood floors and three large leather chairs arranged around an intricately engraved coffee table. The floor is covered with a thick rug and a dim lamp in the corner gives the room an eerie glow. A large bookcase covers most of the northern wall except for a small doorway in the northeastern corner of the room and the hallway leads back west.\n ";
}
}
west = LockedDoor2
ne = StudyDoor
north =
//IS THE BOOKCASE OPEN?
{
if (BookCase.isopen)
return (BookCase);
else
"You can\'t go that way.\n";
}
;
LockedDoor2: lockableDoorway
location = Study
noun = 'door'
adjective = 'west' 'western'
sdesc = "west door"
doordest = NorthEnd
mykey = StudyKey
otherside = LockedDoor
;
BookCase: doorway
location = Study
noun = 'bookcase' 'bookshelf' 'case' 'shelf'
adjective = 'book' 'large'
sdesc = "bookcase"
ldesc =
//LDESC SHOULD REFLECT OPEN/CLOSED STATE OF THE BOOKCASE
{
if (BookCase.isopen)
"The bookcase has swung open revealing a hallway to the north.\n";//MENTION OPEN / CLOSED STATE
"Books line the shelves in no apparent order, some of them are so old the bindings are falling apart while others look brand new. Titles include \"Heart of Darkness\", \"The Circular Staircase\", and even a Bible.\n";
}
doordest = HallsEnd3
verDoOpen( actor ) = {}
doOpen( actor ) =
//YOU CAN'T JUST WALK UP TO A BOOKCASE AND EXPECT TO OPEN IT!
{
if (BookCase.isopen)
"The bookcase is already open.\n";
else
"And just how pray tell do you expect to open a bookcase?\n";
return nil;
}
verDoClose( actor ) = {}
doClose( actor ) =
{
if (BookCase.notclosed)
//THE RESULTS OF NOT KNOWING WHAT I WAS DOING, IT WORKS THOUGH SO I LEFT IT
{
BibleKey.moveInto( Study );
OpenKey.moveInto( nil );
Study.lightsOn := nil;
pass doClose;
}
else
//IF THE BOOKCASE HAS NEVER BEEN OPENED WE DON'T WANT TO GIVE AWAY THE FACT THAT IT CAN BE
"I don't know how to close the bookcase.\n";
}
isopen = nil
noAutoOpen = true
;
BibleKey: fixeditem
location = Study
noun = 'bible'
sdesc = "Bible"
ldesc = "It looks like an old family Bible."
verDoRead( actor ) = {}
doRead( actor ) = ( self.doTake( actor ) )
verDoPull( actor ) = {}
doPull( actor ) = ( self.doTake( actor ) )
verDoTake( actor ) = {}
doTake( actor ) =
{
"As you pull the Bible out of the shelf you hear a soft click and the Bible quickly slides back into place on the shelf. A moment later the entire bookcase swings open revealing a hallway to the north.\n";
BookCase.isopen := true;
BookCase.notclosed := true;
self.moveInto( nil );
OpenKey.moveInto( Study );
//CHANGE PLACES WITH THE OTHER BIBLE
Study.lightsOn := true;
//OPENING THE BOOKCASE LETS LIGHT FROM THE HALL COME IN...SEE LAMP FOR DETAILS
}
;
/*SINCE LEAVING THE ORIGINAL BIBLE IN THE ROOM WHEN THE BOOKASE IS OPEN RESULTS IN SOME WEIRD THINGS HAPPENING I'VE MOVED THE ORIGINAL ONE TO NIL AND BRING THIS ONE (OPENKEY) INTO STUDY SO IT LOOKS LIKE THE BIBLE IS STILL ON THE BOOKCASE EVEN THOUGH IT IS TWO SEPARATE OBJECTS*/KE THE BIBLE IS STILL ON THE BOOKCASE EVEN THOUGH IT IS TWO SEPARATE OBJECTS*/
OpenKey: fixeditem
noun = 'bible'
sdesc = "Bible"
ldesc = "It looks like an old family Bible."
verDoRead( actor ) = {}
doRead( actor ) = ( self.doTake( actor ) )
verDoPull( actor ) = {}
doPull( actor ) = ( self.doTake( actor ) )
verDoTake( actor ) = {}
doTake( actor ) =
//WHAT DOES IT LOOK LIKE WHEN YOU MOVE THE LATCH OF AN OPEN DOOR?
{
"Pulling on the Bible while the bookcase is open allows you to see the latching mechanism move up and down but has no other obvious effects...you can\'t take it if that\'s what you\'re getting at; its attached.\n";
}
;
StairKey: fixeditem
location = Study
noun = 'staircase' 'circularstaircase'
adjective = 'circular'
sdesc = "\"The Circular Staircase\""
ldesc = "You see the words, \"Rinehart, Mary Roberts - 1908\" presumably the author and publication date.\n"
verDoRead( actor ) = {}
doRead( actor ) = ( self.doTake( actor ) )
verDoPull( actor ) = {}
doPull( actor ) = ( self.doTake( actor ) )
verDoTake( actor ) = {}
doTake( actor ) = //MOVE THE STAIRS UP
{
if ( not self.score )
//+10 POINTS FOR COMPLETION OF THE STAIRS THE FIRST TIME
{
incscore( 10 );
self.score := true;
}
if (BookCase.isopen)
//CAN THE PLAYER SEE THE STAIRS WHILE THIS IS HAPPENING?
"There is a soft click as you try to take the book and it slides back into place, at the north end of the hallway the spiral staircase begins to move upward as steps come up through the floor. Each new step is accompanied by a loud thunk and finally as the stairway is completed there is the clang of the top step meeting the floor above and latching in place.\n";
else
"There is a soft click as you try to take the book and it slides back into place, in the distance somewhere you here a series of thunking noises followed by a metallic clang.\n";
StairWell.isfull := true;
self.moveInto( nil );
StairKey2.moveInto( Study );
//CHANGE PLACES WITH IDENTICAL "STAIRS DOWN" BOOK
}
;
StairKey2: fixeditem
noun = 'staircase' 'circularstaircase'
adjective = 'circular'
sdesc = "\"The Circular Staircase\""
ldesc = "You see the words, \"Rinehart, Mary Roberts - 1908\" presumably the author and publication date.\n"
verDoRead( actor ) = {}
doRead( actor ) = ( self.doTake( actor ) )
verDoPull( actor ) = {}
doPull( actor ) = ( self.doTake( actor ) )
verDoTake( actor ) = {}
doTake( actor ) =
//MOVE THE STAIRS BACK DOWN
{
if (BookCase.isopen)
//CAN THE PLAYER SEE THE STAIRS WHILE THIS IS HAPPENING?
"There is a soft click as you try to take the book and it slides back into place, you watch in amazement as half of the spiral staircase disappears into the floor with a rapid succession of thunking noises before coming to a halt with a hydraulic hiss.\n";
else
"There is a soft click as you try to take the book and it slides back into place, somewhere in the distance you here a rapid succession of thunks followed by the hiss of released pressure.\n";
StairWell.isfull := nil;
self.moveInto( nil );
StairKey.moveInto( Study );
//CHANGE PLACES WITH IDENTICAL "STAIRS UP" BOOK
}
;
DreamLight: fixeditem
location = Study
noun = 'darkness' 'heartofdarkness'
adjective = 'heart'
sdesc = "\"Heart of Darkness\""
ldesc = "You see the words, \"Conrad, Joseph - 1902\" presumably the author and publication date.\n"
verDoRead( actor ) = {}
doRead( actor ) = ( self.doTake( actor ) )
verDoPull( actor ) = {}
doPull( actor ) = ( self.doTake( actor ) )
verDoTake( actor ) = {}
doTake( actor ) =
{
if ( not self.score )
//+10 POINTS FOR LIGHTING THE DREAMROOM THE FIRST TIME
{
incscore( 10 );
self.score := true;
}
"There is a soft click as you try to take the book, accompanied by the soft hum of electricity, and it slides back into place.\n";
DreamRoom.lightsOn := true;
self.moveInto( nil );
DreamDark.moveInto( Study );
}
;
DreamDark: fixeditem
noun = 'darkness' 'heartofdarkness'
adjective = 'heart'
sdesc = "\"Heart of Darkness\""
ldesc = "You see the words, \"Conrad, Joseph - 1902\" presumably the author and publication date.\n"
verDoRead( actor ) = {}
doRead( actor ) = ( self.doTake( actor ) )
verDoPull( actor ) = {}
doPull( actor ) = ( self.doTake( actor ) )
verDoTake( actor ) = {}
doTake( actor ) =
{
"There is a soft click as you try to take the book and it slides back into place. The electric hum stops. \n";
DreamRoom.lightsOn := nil;
self.moveInto( nil );
DreamLight.moveInto( Study );
}
;
CoffeeTable: fixeditem
location = Study
noun = 'table' 'engravedtable' 'coffeetable'
adjective = 'coffee'
sdesc = "coffee table"
ldesc = "The engravings on the table swirl around each other so that each engraving seems to flow into the next. "
;
Engravings: decoration
location = Study
noun = 'engraving' 'engravings' 'carving'
sdesc = "engravings"
ldesc = "The engravings show a progression of images centered around a non-descript figure of a person. The person enters the top of a large box and then the engraved box swirls into a pattern of stars and waves which swirl back into a box on the other side where the person is seen coming out of the bottom of the box.\n"
;
Pattern: decoration
location = Study
noun = 'pattern'
sdesc = "pattern"
ldesc = "Maybe pattern isn\'t quite the right word for what you see on the table, there isn\'t really any distiguishable order to it.\n"
;
Person: decoration
location = Study
noun = 'person'
sdesc = "person"
ldesc = "Like I said to begin with: non-descript. There is a head, a torso, two arms and two legs but nothing to set the engraving apart from any other person with those same characteristics.\n"
;
Rug: fixeditem
location = Study
noun = 'rug' 'carpet'
adjective = 'thick'
sdesc = "thick rug"
ldesc = "The rug is apparently made out of bear skins or some other similar animal, it is very soft."
verDoLookunder( actor ) = {}
doLookunder( actor ) =
//IF YOU BUILD IT THEY WILL SEARCH...
{
"You lift up a corner of the rug but see nothing of interest.\n";
}
verDoSearch( actor ) = {}
doSearch( actor ) =
//SOME SEARCH MORE DILIGENTLY THAN OTHERS...
{
"You search diligently through the thick fur and to your utter amazement find absolutley nothing of interest.\n";
}
;
Lamp: lightsource, fixeditem
location = Study
noun = 'lamp' 'light'
adjective = 'dim' 'corner' 'eerie'
sdesc = "dim lamp"
ldesc = "A victorian style lamp, probably best to leave it alone. "
islit = true
verDoTurnoff( actor ) = {}
doTurnoff( actor ) =
//IF THE BOOKCASE IS OPEN LIGHT FROM THE HALLWAY LIGHTS THE ROOM
{
if ( BookCase.isopen )
{
if ( self.islit )
"The room is now pitch black, well ok, actually it isn\'t...it\'s just a little dimmer, but it would be pitch black if the bookcase weren\'t open.\n", islit := nil;
else
//SINCE THE PLAYER CAN SEE THEY MIGHT TRY TURNING THE LAMP OFF TWICE IN A ROW
"The lamp is already off.";
}
else
//SINCE THE PLAYER CAN'T SEE NOW, THERE IS NO DANGER OF THEM TRYING TO TURN THE LAMP OFF TWICE
"The lamp is now off.", islit := nil;
}
verDoTurnon( actor ) = {}
doTurnon( actor ) =
//CAN'T TURN A LAMP ON IF IT'S ALREADY ON
{
if ( self.islit )
"The lamp is already on.";
else
"The lamp is now on.\n", islit := true;
}
;
StudyChair: chairitem
location = Study
noun = 'chair' 'chairs'
adjective = 'large' 'leather'
sdesc = "leather chair"
ldesc = "A wide leather chair just like you would expect to find in a study.\n"
;
StudyDoor: doorway
location = Study
noun = 'door' 'doorway'
adjective = 'small' 'north'
sdesc = "small door"
doordest = BathRoom2
otherside = StudyDoor2
;
/*THIS IS THE STUDY BATHROOM - NOT TO BE CONFUSED WITH THE HALLWAY2 BATHROOM*/
To
view this code click here.
/*THIS IS THE STUDY BATHROOM - NOT TO BE CONFUSED WITH THE HALLWAY2 BATHROOM*/
BayHall: room
sdesc = "Bay Window"
ldesc = "The hallway turns toward the north here and the corner has been widened to accomodate a large bay window overlooking a clearing outside.\n"
east = NorthEnd
north = HallWay
;
Parchment: readable
location = BayHall
noun = 'paper' 'parchmentpaper' 'crumpledparchmentpaper' 'crumpledparchment' 'crumpledpaper'
adjective = 'piece' 'crumpled' 'parchment'
sdesc = "piece of parchment paper"
ldesc = "The parchment paper is slightly crumpled and has apparently been written on.\n"
readdesc = "\tA breeze through the air in a night full of stars,\n
\tCaptured perhaps in a light colored jar\n
\tWould be just the cure for a mind full of dreams\n
\tThat run rampant through corridors and burst at the seams.\n "
verIoBreakWith( actor ) = {}
ioBreakWith(actor, dobj) =
{
dobj.doBreakWith(actor, self);
}
verIoAttackWith( actor ) = {}
ioAttackWith(actor, dobj) =
{
dobj.doAttackWith(actor, self);
}
issmall = true
;
BayWindow: seethruItem, fixeditem
location = BayHall
noun = 'window' 'glass' 'baywindow'
adjective = 'bay' 'large'
sdesc = "window"
ldesc = (self.thrudesc)
thrudesc =
//GIVES A DESCRIPTION OF THE CLEARING AND ITS CONTENTS
{
"Outside you see a clearing amid pine trees that sway back and forth in the wind. At the center of the clearing is a marble pillar with <<listcont( Pillar )>> sitting on top of it. ";
if ( itemcnt( Clearing.contents ) <> 0 )
"You also see <<listcont( Clearing )>> in the clearing.\n";
}
verDoAttackWith( actor, dobj ) = {}
doAttackWith( actor, dobj ) = ( self.doBreakWith(actor, dobj) )
verDoBreakWith( actor, dobj ) = {}
doBreakWith( actor, dobj ) =
{
if( dobj = ButterKnife )
/*ALLOWING THIS GLASS TO BREAK CAUSES TOO MANY PROBLEMS, BUT A REASON MUST BE GIVEN*/
{
"Gripping the handle of the butter knife firmly you slam its point into the bay window but the thick glass refuses to break and the knife slips backwards through your hand falling to the floor. Luckily for you butter knives are rather dull and your hand is still intact.\n";
dobj.moveInto( Me.location );
}
if( dobj.isgem or dobj.issmall)
//SMALL OBJECTS JUST BOUNCE OFF
{
"You throw <<dobj.thedesc>> against the glass but it bounces off harmlessly.\n";
dobj.moveInto( Me.location );
}
if( dobj = Mask )
//THE MASK IS A BIT ODD...
{
"It\'s doubtful that the delicate mask would survive such an ordeal but you decide to give it a shot anyway. Strangely the mask seems to know what you\'re thinking and as soon as you try to use it to break the glass it slips out of your hand.\n";
Mask.moveInto( Me.location );
}
if ( dobj = Bonsai )
{
"The bonsai is much too heavy, if you tried to smash it through the window all you would be likely to do is drop the massive tree on your foot.\n";
}
if ( dobj = ClearJar or dobj = BlackJar )
{
"Considering the thickness of <<self.thedesc>> it probably wouldn\'t be a good idea to try and break it with <<dobj.thedesc>>. \^<<dobj.thedesc>> is likely to shatter on impact which would make a mess of your hands, since there are no band-aids around let\'s not try it, eh?\n";
}
if ( dobj = Candle )
//THIS IS STRETCHING IT A BIT BUT I REALLY DON'T WANT THIS WINDOW BREAKING
{
"As you bring <<dobj.thedesc>> up to break the window it suddenly feels very heavy in your hands, so heavy in fact that you are forced to drop it before you can even bring it within a foot of the window. \n";
Candle.moveInto( Me.location );
}
}
;
WindowJar1: floatingItem, distantItem
location =
{
if ( ClearJar.location = Pillar )
return( BayHall );
}
noun = 'jar' 'clearjar'
adjective = 'glass'
sdesc = "clear jar"
ldesc = "The clear jar is sitting on top of the marble pedestal. It looks like the type of jar used for canning fruit, really I don't see why it should be on a pedestal at all.\n"
;
WindowJar2: floatingItem, distantItem
location =
{
if ( BlackJar.location = Pillar )
return( BayHall );
}
noun = 'jar' 'blackjar'
adjective = 'glass'
sdesc = "black jar"
ldesc = "The black jar is sitting on top of the marble pedestal, it looks like the type of jar used for canning fruit, really I don't see why it should be on a pedestal at all.\n"
;
WindowPed: distantItem
location = BayHall
noun = 'pedestal' 'pillar'
adjective = 'marble' 'corinthian'
sdesc = "marble pedestal"
ldesc = "It\'s a Corinthian style pillar about four feet tall with a square, flat top on which the glass jar is sitting.\n"
;
WClearing: decoration
location = BayWindow
noun = 'clearing' 'tree' 'trees'
adjective = 'pine'
sdesc = "clearing"
ldesc = "The clearing is scattered with pine needles from the thick pine trees that surround it.\n"
;
HallWay: room
sdesc = "Hallway"
ldesc = "You are in a hallway that runs north and south. To the south is the bay window and the hallway continues to the north. Thick red carpet lines the floor and tall pillars stretch up to the twenty foot ceiling along either side of the hall.\n"
south = BayHall
north = HallsEnd
;
Carpet: decoration
location = HallWay
noun = 'carpet' 'rug'
adjective = 'thick' 'red'
sdesc = "thick red carpet"
ldesc = "It's thick and red...what else is there to say?"
;
Pillars: decoration
location = HallWay
noun = 'pillars' 'pillar'
adjective = 'tall'
sdesc = "pillars"
ldesc = "The pillars are about a foot wide, square, and set into the wall, like the wall they are white."
isThem = true
;
HallsEnd: room
sdesc = "Hallway"
ldesc = "You are standing at the end of a hallway that continues to the south. A pair of french doors lead into a glass room to the west and a solid double door leads north.\n"
south = HallWay
north = NHallDoor
west = WHallDoor
;
Carpet2: decoration
location = HallsEnd
noun = 'carpet' 'rug'
adjective = 'thick' 'red'
sdesc = "thick red carpet"
ldesc = "It's thick and red...what else is there to say?"
;
Pillars2: decoration
location = HallsEnd
noun = 'pillars' 'pillar'
adjective = 'tall'
sdesc = "pillars"
ldesc = "The pillars are about a foot wide, square, and set into the wall, like the wall they are white."
isThem = true
;
NHallDoor: doorway
location = HallsEnd
noun = 'door' 'doorway' 'doors'
adjective = 'north' 'double' 'solid'
sdesc = "north door"
doordest = LivingRoom
isopen = nil
otherside = DenDoor
;
GlassPanes: decoration, seethruItem
location = HallsEnd
noun = 'panes' 'pane'
adjective = 'glass'
sdesc = "glass panes"
ldesc = "The individual glass panes are six by eight inch rectangles set into the french doors.\n"
thrudesc -> WHallDoor
;
WHallDoor: lockableDoorway, seethruItem
location = HallsEnd
noun = 'door' 'doorway' 'doors' 'frenchdoor' 'frenchdoors'
adjective = 'west' 'double' 'french' 'pair' 'glass'
sdesc = "french door"
doordest = GlassRoom
isopen = nil
otherside = GlassDoor
isThem = true
thrudesc =
{
"You see a glass room full of plants on the other side of the french doors. ";
if ( itemcnt( GlassRoom. contents ) <> 0 )
"You also see <<listcont( GlassRoom )>>.\n";
}
ldesc = "It\'s a set of french doors with a dozen or so individual glass panes<<self.isbroken ? ", one of which is broken." : ".">> The door is <<self.isopen ? "open" : "closed">><<self.islocked ? " and locked." : ".">>\n"
verDoAttackWith( actor, dobj ) = {}
doAttackWith( actor, dobj ) = ( self.doBreakWith(actor, dobj) )
verDoBreakWith( actor, dobj ) = {}
doBreakWith( actor, dobj ) =
/*BREAKING THE GLASS DOOR IS A REASONABLE (ALTHOUGH NOT PREFERRED) SOLUTION TO THE PUZZLE AND SINCE I HATE PUZZLES THAT REQUIRE THE PLAYER TO READ THE AUTHORS MIND I HAD TO INCLUDE IT AS A POSSIBILITY...AS IT TURNS OUT AFTER IFCOMP2001 I REALISED THAT THIS IS THE SOLUTION ALMOST EVERY PLAYER USES*/
{
if( not self.isbroken )
{
if( dobj = ButterKnife )
//ONE OF THE FEW OBJECTS THAT CAN BREAK THE GLASS
{
"Gripping the handle of the butter knife firmly you slam its point into the glass pane next to the doorknob. The glass shatters leaving a sizeable hole in the french door.\n";
self.isbroken := true;
self.otherside.isbroken := true;
}
if( dobj.isgem or dobj.issmall)
//SMALL OBJECTS JUST BOUNCE OFF
{
"You throw <<dobj.thedesc>> against the glass but it bounces off harmlessly.\n";
dobj.moveInto( Me.location );
}
if( dobj = Bonsai )
/*MUCH TOO BIG, ALTHOUGH I DON'T SEE WHY ANYONE WOULD TRY ANYWAY CONSIDERING ITS STARTING LOCATION (THE OTHER SIDE OF THE DOOR)*/
{
"Each of the individual glass panes that make up the french door are smaller than the bonsai tree which makes breaking any of them with the bonsai impossible.\n";
}
if( dobj = Mask )
//THE MASK IS A BIT ODD...
{
"It\'s doubtful that the delicate mask would survive such an ordeal but you decide to give it a shot anyway. Strangely the mask seems to know what you\'re thinking and as soon as you try to use it to break the glass it slips out of your hand.\n";
Mask.moveInto( Me.location );
}
if( dobj = BlackJar or dobj = ClearJar )
//JARS BREAK THE GLASS BUT THERE IS A SLIGHT CONSEQUENCE
{
"You throw <<dobj.thedesc>> through the glass pane nearest the doorknob shattering the glass and leaving a sizeable hole in the french door. As <<dobj.thedesc>> lands on the other side of the door it shatters into hundreds of tiny pieces.\b";
self.isbroken := true;
self.otherside.isbroken := true;
dobj.moveInto( GlassRoom );
warp ();
//THE WARP FUNCTION IS DESCRIBED IN STD02.T
}
if ( dobj = Candle )
{
"Gripping the base of <<dobj.thedesc>> you swing it into the glass pane nearest the doorknob of <<self.thedesc>>. The glass shatters leaving a sizeable hole in the french door.\n";
self.isbroken := true;
self.otherside.isbroken := true;
}
}
else
//DOOR IS ALREADY BROKEN
"You already broke a hole in the glass there\'s no need to do any more damage.\n";
}
verDoOpenWith( actor, dobj ) = {}
doOpenWith( actor, dobj ) =
//THE LOCK IS JAMMED BUT THE BUTTERKNIFE CAN BE USED TO PRY THE DOOR OPEN
{
if ( not self.isopen )
//MAKE SURE THE DOOR ISN'T ALREADY OPEN
{
if ( dobj = ButterKnife )
//OPEN DOOR WITH KNIFE
{
"You slide the butter knife in between the two doors and manage to pop the lock open.\n",
self.isopen := true;
GlassDoor.isopen := true;
}
else
//NOTHING ELSE WORKS
"You can\'t open the french doors with <<dobj.thedesc>>.\n";
}
else
//AN APPROPRIATE MESSAGE INCASE THE DOOR IS ALREADY OPEN
"\^<<self.thedesc>> is already open.\n";
}
verDoUnlock( actor ) = {}
doUnlock( actor ) =
{
if ( not self.islocked )
//CAN'T UNLOCK A DOOR IF ITS NOT LOCKED TO BEGIN WITH
"It\'s not locked!\n";
else
{
if ( not self.isopen and not self.isbroken )
//THE LOCK IS ON THE OTHER SIDE OF THE DOOR
"You can't reach the lock from this side of the glass.\n";
else if ( self.isopen )
//IF THE DOOR IS OPEN THE LOCK CAN BE REACHED
"Now that the door is opened it unlocks easily.\n", self.islocked := nil;
else if ( self.isbroken )
//IF THE DOOR IS BROKEN THE LOCK CAN BE REACHED
{
"You reach through the hole in the door and unlock it from the otherside.\n";
self.islocked := nil;
}
}
}
verDoLock( actor ) = {}
doLock( actor ) =
//ALMOST EXACTLY LIKE THE UNLOCK CODE WITH A FEW WORDS CHANGED
{
if ( self.islocked )
"\^<<self.thedesc>> is already locked.\n";
else
{
if ( not self.isopen and not self.isbroken )
"You can't reach the lock from this side of the glass.\n";
else if ( self.isopen )
"Now that the door is opened it unlocks easily.\n", self.islocked := nil;
else if ( self.isbroken )
{
"You reach through the hole in the door and unlock it from the otherside.\n";
self.islocked := nil;
}
}
}
verDoUnlockWith ( actor, iobj ) = {}
doUnlockWith ( actor, iobj ) =
{
if ( not self.isopen )
{
if ( iobj = ButterKnife or iobj = StudyKey )
{
if ( iobj = ButterKnife )
//THE ONLY OBJECT THAT WILL UNLOCK THE DOOR
{
"You slide the butter knife in between the two doors and manage to pop the lock open.\n",
self.isopen := true;
GlassDoor.isopen := true;
}
if ( iobj = StudyKey )
//THE ELSE RESPONSE FELT TOO MUCH LIKE A PARSER FOR THIS OBJECT
"The key doesn't seem to fit the lock.\n";
}
else
"You can\'t unlock the french doors with <<iobj.thedesc>>.\n";
}
else
return doUnlock;
}
;
GlassRoom: room
sdesc = "Glass Room"
//LDESC SHOULD REFLECT THE OPEN/CLOSED STATE OF THE PANEL
ldesc =
{
if ( not self.score )
//+10 POINTS FOR GETTING IN THE GLASS ROOM THE FIRST TIME
{
incscore( 10 );
self.score := true;
}
"This room is made up almost entirely of glass window panes; only the floor and east wall are not. All around the room are various exotic plants sitting on slatted wooden tables. <<(SPanel.location = GlassRoom) ? "One of the panels on the southern side of the room seems to be open." : "A movement on the southern wall catches your attention for an instant but when you look again things seem perfectly normal.">> The doorway leads back east.\n";
}
east = GlassDoor
south =
//HAS THE PLAYER FOUND THE OPEN PANEL?
{
if ( SPanel.location = self )
return SPanel;
else
{
"You can't go that way.\n";
return nil;
}
}
;
SlatTable: surface, fixeditem
location = GlassRoom
noun = 'table' 'tables'
adjective = 'slatted' 'wooden' 'wood'
sdesc = "slatted wooden tables"
ldesc = "The tables are all around the room covered in plants. They sit about two feet off the ground and are made up of a series of wooden slats about three inches wide with gaps between them.\n"
verIoPutOn( actor ) = {}
ioPutOn( actor, dobj ) =
//SOUNDS BETTER THAN A STANDARD PARSER RESPONSE
{
"The tables are already covered in plants.";
return nil;
}
;
ExoticPlants: fixeditem
location = SlatTable
noun = 'plant' 'plants'
adjective = 'exotic'
sdesc = "exotic plants"
ldesc = "The plants range from green and white striped ivy to bushier plants with leaves almost as large as you. They are all massed together in a profusion of green shades and hues that makes it hard to distinguish one plant from another.\n"
;
Ivy: fixeditem
//THIS IS ONLY HERE BECAUSE I MENTIONED IVY IN THE EXOTICPLANTS LDESC
location = SlatTable
noun = 'ivy'
adjective = 'striped'
sdesc = "ivy"
ldesc = (ExoticPlants.ldesc)
//NOT REALLY A SEPARATE ITEM AS FAR AS THE PLAYER IS CONCERNED
;
Bonsai: qcontainer
location = GlassRoom
noun = 'tree' 'bonsaitree'
adjective = 'bonsai' 'weeping'
sdesc = "bonsai tree"
ldesc = "The bonsai is a weeping willow and judging from the size close to a hundred years old. A snail is stuck to the side of its trunk.\n"
verIoPutIn( actor ) = {}
ioPutIn( actor, dobj ) =
/*IT'S A CONTAINER SO IT CAN HOLD THE SNAIL...I DON'T REALLY WANT IT ACTING LIKE A CONTAINER THOUGH*/
{
"You can\'t put anything into the bonsai tree.\n";
return nil;
}
verDoTake( actor ) = {}
doTake( actor ) =
{
if ( itemcnt( Me.contents ) = 0 )
pass doTake;
else
{
"The large size of the bonsai tree combined with its rather odd shape prevent you from carrying anything else at the same time you carry it. If you would like to take the bonsai you'll have to drop what you\'re carrying.\n";
return nil;
}
}
bulk = 10
;
Snail: decoration
location = Bonsai
noun = 'snail'
sdesc = "snail"
ldesc = "On closer inspection you notice that the word \"Home\" has been written on the snail\'s shell."
verDoTake( actor ) = {}
doTake( actor ) =
//I DIDN'T LIKE THE STANDARD PARSER RESPONSE IN THIS CASE
{
"The snail is stuck to the trunk of the bonsai tree.\n";
}
verDoBreak( actor ) = {}
doBreak( actor ) =
{
"Oh come on! Leave the poor thing alone, there is no need to go around breaking everything you see and breaking the snail certainly won\'t help anything.\n";
}
;
GlassPanes2: decoration, seethruItem
location = GlassRoom
noun = 'panes' 'pane'
adjective = 'glass'
sdesc = "glass panes"
ldesc = "The individual glass panes are six by eight inch rectangles set into the french doors.\n"
thrudesc -> GlassDoor
;
GlassDoor: lockableDoorway, seethruItem
location = GlassRoom
noun = 'door' 'doorway' 'doors'
adjective = 'east' 'double' 'french' 'pair' 'glass'
sdesc = "french door"
doordest = HallsEnd
otherside = WHallDoor
isThem = true
thrudesc =
//A DESCRIPTION OF THE HALLWAY AND ITS CONTENTS
{
"Looking through the french doors you can see into the hallway. ";
if ( itemcnt( HallsEnd ) <> 0 )
"In the hallway is <<listcont( HallsEnd )>>.\n";
}
ldesc = "It\'s a set of french doors with a dozen or so individual glass panes<<self.isbroken ? ", one of which is broken." : ".">> The door is <<self.isopen ? "open" : "closed">><<self.islocked ? " and locked." : ".">>\n"
verDoAttackWith( actor, dobj ) = {}
doAttackWith( actor, dobj ) = ( self.doBreakWith(actor, dobj) )
verDoBreakWith( actor, dobj ) = {}
doBreakWith( actor, dobj ) =
{
if ( self.isbroken )
{
if( dobj = BlackJar or dobj = ClearJar )
//THESE OBJECTS LAND ON THE OTHER SIDE WHEN USED TO BREAK DOOR
{
"You throw <<dobj.thedesc>> through the glass pane nearest the doorknob shattering the glass and leaving a sizeable hole in the french door. As <<dobj.thedesc>> lands on the other side of the door it shatters into hundreds of tiny pieces.\b";
self.isbroken := true;
self.otherside.isbroken := true;
dobj.moveInto( HallsEnd );
warp ();
}
else
//EVERYTHING ELSE ACTS JUST LIKE IT DID ON THE OTHER SIDE OF THE DOOR...NO NEED TO WRITE IT TWICE
( WHallDoor.doBreakWith( actor, dobj ) );
}
else
//DOOR IS ALREADY BROKEN
"You already broke a hole in the glass there\'s no need to do any more damage.\n";
}
;
class glasswall: seethruItem, fixeditem
verDoAttackWith( actor, dobj ) = {}
doAttackWith( actor, dobj ) = ( self.doBreakWith(actor, dobj) )
verDoBreakWith( actor, dobj ) = {}
doBreakWith( actor, dobj ) =
{
"With the plants between you and the wall it\'s impossible to get close enough to break the glass.\n";
}
thrudesc = ( self.ldesc )
;
NorthWall: glasswall
location = GlassRoom
noun = 'wall' 'window'
adjective = 'north' 'glass' 'panes'
sdesc = "north wall"
ldesc =
{
"Through the north wall you can see a cliff in the distance. ";
if( itemcnt(CliffEdge2.contents) <> 0 )
"You also notice <<listcont(CliffEdge2)>> near the cliff.\n";
}
;
DistCliff: distantItem
location = GlassRoom
noun = 'cliff'
sdesc = "cliff"
ldesc = "You can tell that it is indeed a cliff but from this distance but more detail is impossible.\n"
;
WestWall: glasswall
location = GlassRoom
noun = 'wall' 'window'
adjective = 'west' 'glass' 'panes'
sdesc = "west wall"
ldesc =
{
"Looking through the west wall you see a few pine trees and beyond them a high-reaching stone wall. ";
if ( itemcnt( ThinPines.contents ) <> 0 )
"Among the pines you see <<listcont( ThinPines )>>.\n";
}
;
DistWall: distantItem
location = GlassRoom
noun = 'wall'
adjective = 'high' 'high-reaching' 'reaching' 'stone'
sdesc = "stone wall"
ldesc = "It\'s about twenty feet high and made of large stones stacked on top of each other.\n"
;
SouthWall: glasswall
location = GlassRoom
noun = 'wall' 'window'
adjective = 'south' 'glass' 'panes'
sdesc = "south wall"
ldesc =
//MAKE THE PLAYER EXAMINE THE WALL BEFORE THEY CAN GO THROUGH IT
{
if ( not self.score )
//+15 POINTS FOR FINDING THE PANEL THE FIRST TIME
{
incscore( 15 );
self.score := true;
}
"South of the glass room seems to be nothing but pine trees. As you look through the wall you notice that one of the panels is open. ";
SPanel.location := GlassRoom;
if (itemcnt( Outside.contents ) <> 0 )
"You also notice <<listcont( Outside )>> lying under the pine trees.\n";
}
;
DistPines: distantItem
location = GlassRoom
noun = 'tree' 'trees'
adjective = 'pine'
sdesc = "pine trees"
ldesc = "They look like ordinary pine trees; lots of them.\n"
isThem = true
;
Ceiling: seethruItem, fixeditem
location = GlassRoom
noun = 'ceiling' 'roof' 'top' 'up'
adjective = 'glass' 'panes'
sdesc = "ceiling"
thrudesc = ( self.ldesc )
ldesc = "The milky way stretches across the sky above you; with so many stars visible it\'s hard to recognize any constellations at all.\n"
verDoAttackWith( actor, dobj ) = {}
doAttackWith( actor, dobj ) = ( self.doBreakWith(actor, dobj) )
verDoBreakWith( actor, dobj ) = {}
doBreakWith( actor, dobj ) =
{
"The ceiling is rather high, you certainly can\'t just reach up and break it.\n";
}
;
GlassConst: distantItem
location = GlassRoom
noun = 'constellation' 'constellations'
sdesc = "constellations"
ldesc = "There are too many stars visible to make out individual constellations.\n"
isThem = true
;
GlassStars: distantItem
location = GlassRoom
noun = 'star' 'stars'
sdesc = "stars"
ldesc = "Beautiful aren\'t they?\n"
isThem = true
;
GlassMilk: distantItem
location = GlassRoom
noun = 'way' 'milkyway'
adjective = 'milky'
sdesc = "milky way"
ldesc = "It stretches across the sky like a giant dust cloud.\n"
;
SPanel: doorway, seethruItem
noun = 'panel'
sdesc = "panel"
doordest = Outside
otherside = NPanel
thrudesc = ( SouthWall.ldesc )
//LOOKING THROUGH A PANEL IN THE WALL IS THE SAME AS LOOKING THROUGH THE WALL
isopen = true
verDoAttackWith( actor, dobj ) = {}
doAttackWith( actor, dobj ) = ( self.doBreakWith(actor, dobj) )
verDoBreakWith( actor, dobj ) = {}
doBreakWith( actor, dobj ) =
{
if ( dobj = Bonsai )
"The bonsai is much too heavy, if you tried to smash it through the panel all you would be likely to do is drop the massive tree on your foot.\n";
else
{
if ( self.isopen )
{
"You throw <<dobj.thedesc>> at the open panel, it misses and lands outside.\n";
dobj.moveInto( Outside );
}
else
{
"You throw <<dobj.thedesc>> at the panel but instead of breaking when it is hit the panel swings open and <<dobj.thedesc>> lands outside.\n";
dobj.moveInto( Outside );
}
}
}
;
/*THIS SECTION IS FOR THE AREA OUTSIDE THE GLASSROOM*/
To
view this code click here.
/*END OF SECTION FOR THE AREA OUTSIDE THE GLASSROOM*/
LivingRoom: room
sdesc = "Living Room"
ldesc = "The living room is an octagon shaped room at the northwest corner of the house. Recessed lighting gives a warm even glow to the room which is furnished with two long white couches, a matching overstuffed chair, several tables and book stands all in the victorian style. Heavy drapes frame a sliding glass door to the north that opens on to a balcony and a hallway leads east. There is a pair of cedar doors on the southeastern wall appearing impossibly heavy and there is also a less impressive doorway leading south.\n"
south = DenDoor
north = Drapes
out = SlidingDoor
east = HallWay2
se = CedarDoor
enterRoom(actor) =
//GET THE OPEN DOOR SCRIPT READY
{
notify (self, &script, 0);
pass enterRoom;
}
leaveRoom(actor) =
//LET THE OPEN DOOR SCRIPT RELAX
{
unnotify(self, &script);
pass leaveRoom;
}
script =
//AN OPEN DOOR TO THE OUTSIDE WORLD HAS AN EFFECT ON THE ROOM'S STATE
{
if ( SlidingDoor.isopen )
switch(rand(4))
{
case 1:
"\n\tYou can hear the distant sound of running water coming through the open door. ";
break;
case 2:
"\n\tOutside, pine trees rustle in the wind. ";
break;
case 3:
"\n\tA breeze blows in through the open door. ";
break;
case 4:
"\n\tThe red drapes rustle in the breeze. ";
break;
}
}
;
DenDoor: doorway
location = LivingRoom
noun = 'door' 'doorway' 'doors'
adjective = 'south' 'double' 'large'
sdesc = "south door"
doordest = HallsEnd
otherside = NHallDoor
;
Drapes: doorway
location = LivingRoom
noun = 'drapes' 'curtains' 'drape'
adjective = 'heavy' 'deep' 'red'
sdesc = "drapes"
ldesc = "Thick red velvet drapes, inlaid with patterns from top to bottom. The drapes are <<self.isopen ? "open." : "closed.">>\n"
doordest = SlidingDoor
isopen = true
isThem = true
;
DrapePattern: decoration
location = LivingRoom
noun = 'pattern' 'patterns'
adjective = 'inlaid'
sdesc = "patterns on the drapes"
ldesc = "The patterns on the drapes show a person disappearing through a swirling vortex in the corner of a featureless room.\n"
isThem = true
;
DrapePerson: decoration
location = LivingRoom
noun = 'person'
sdesc = "person"
ldesc = "Non-descript.\n"
;
SlidingDoor: doorway, seethruItem
location = LivingRoom
noun = 'door' 'doorway'
adjective = 'sliding' 'glass' 'north'
sdesc = "sliding glass door"
thrudesc =
//LIGHTS REFLECT OFF GLASS DOORS BUT ONLY WHEN THE DOOR IS CLOSED...WHAT DOES THE PLAYER SEE?
{
if ( Drapes.isopen )
{
if (self.isopen)
{
"With the door open you can see out onto the balcony but there isn't enough light to see what lies beyond from here. ";
if ( itemcnt( Balcony.contents ) <> 0 )
"There is <<listcont( Balcony )>> on the balcony.\n";
}
else
"The lights in the living room reflect off the glass and prevent you from seeing out into the darkness beyond.\n";
}
else
"You can\'t look through <<self.thedesc>> with the drapes closed!\n";
}
isopen = nil
noAutoOpen = true
verDoOpen( actor ) = {}
doOpen( actor ) =
//SLIDING DOORS OPEN DIFFERENTLY THAN OTHER DOORS
{
if ( Drapes.isopen )
{
"The door slides open smoothly.\n";
LivingRoom.iswindy := true;
pass doOpen;
}
else
"You\'ll have to open the drapes first.\n";
}
verDoClose( actor ) = {}
doClose( actor ) =
//SLIDING DOORS CLOSE DIFFERENTLY THAN OTHER DOORS
{
if ( Drapes.isopen )
{
"The door slides closed with a soft \"click.\"\n";
LivingRoom.iswindy := nil;
pass doClose;
}
else
"You\'ll have to open the drapes first.\n";
}
verDoAttackWith( actor, dobj ) = {}
doAttackWith( actor, dobj ) = ( self.doBreakWith(actor, dobj) )
verDoBreakWith( actor, dobj ) = {}
doBreakWith( actor, dobj ) =
{
if ( Drapes.isopen )
{
if( dobj = ButterKnife )
//THIS GLASS WON'T BREAK, SLIDING GLASS DOORS ARE GENERALLY THICK
{
"Gripping the handle of the butter knife firmly you slam its point into the sliding glass door but the thick glass refuses to break and the knife slips backwards through your hand falling to the floor. Luckily for you butter knives are rather dull and your hand is still intact.\n";
dobj.moveInto( Me.location );
}
if( dobj.isgem or dobj.issmall)
//SMALL OBJECTS JUST BOUNCE OFF
{
"You throw <<dobj.thedesc>> against the glass but it bounces off harmlessly.\n";
dobj.moveInto( Me.location );
}
if( dobj = Mask )
//THE MASK IS A BIT ODD...
{
"It\'s doubtful that the delicate mask would survive such an ordeal but you decide to give it a shot anyway. Strangely the mask seems to know what you\'re thinking and as soon as you try to use it to break the glass it slips out of your hand.\n";
Mask.moveInto( Me.location );
}
if ( dobj = Bonsai )
{
"The bonsai is much too heavy, if you tried to smash it through <<self.thedesc