!*************************************************************************** !** !** Not Just A Game - Copyright (c) 1999 by John Menichelli !** !** The Beginning !** !** Note: Requires Graham Nelson's menus.h extension for the menu system !** !*************************************************************************** Constant TASKS_PROVIDED; Constant AMUSING_PROVIDED; Constant DIALECT_US; Constant INCLUDE_HINTS; Constant DEATH_MENTION_UNDO; Constant Story "Not Just A Game"; #ifdef INCLUDE_HINTS; Constant Headline "^Copyright (c) 2000 by John Menichelli ^For more information type ~HELP~ ^For hints type ~HINT~^^"; #ifnot; Constant Headline "^Copyright (c) 2000 by John Menichelli ^For more information type ~HELP~^^"; #endif; Release 3; Include "Parser"; Constant NUMBER_TASKS = 18; Array task_scores -> 2 2 2 2 2 2 2 2 2 2 1 2 1 2 1 2 1 2; Constant MAX_SCORE = 28; Object LibraryMessages with before [; Listen: "You hear nothing."; Strong: "Real Go players have more class than that."; Drink: "You can't drink that."; Jump: "Go players are known to have more dignity than that."; Burn: if (second == 0) "You'll have to specify what you want to burn the ", (name) noun, " with."; if ((second == match && match has light) || (second ofclass HotIngot) || (second == asbestos_cup && asbestos_cup has general)) "Feeling destructive, are you?"; "You've lost your mind."; ]; Include "Verblib"; Include "menus"; !*************************************************************************** !** !** Attributes, Globals, and Arrays !** !*************************************************************************** Attribute dialable; ! Is that a word? Attribute stone; Attribute nobehind; ! For things you can't look behind Global dial_setting = 0; ! Used by safe Global combo1 = 0; ! Used to randomize the safe's combo each game Global combo2 = 0; Global combo3 = 0; Global virtual_loc = 72; ! Virtual location in Maze room Global stair1; ! Non-zero if stairwell is open Global stair2; Global stair3; Global stair4; Global stair5; Global position = 0; ! Internal position number of 9x9 Go board Global rank = 0; Global file = 0; Global last_hole; ! Used for the 100-hole peg board Array tries -> 5; ! Number of times player has tried to answer one ! of the Go problems. Array answers -> 5; ! Each element holds a '1' if the Go problem has ! been answered correctly. ! For 'tries' and 'answers', the values are as ! follows: ! 1 = north, 2 = south, 3 = east and 4 = west. Array go_bd -> 81; ! Array holding information on 9x9 Go board. Array puz_bd -> 81; ! Array containing data for Go problem boards Array go_coord string "IHGFEDCBA"; !*************************************************************************** !** !** Abbreviations !** !*************************************************************************** #ifdef INCLUDE_HINTS; Abbreviate ". "; Abbreviate ", "; Abbreviate " the "; Abbreviate "The"; Abbreviate "You"; Abbreviate "Go stone"; Abbreviate "Go board"; Abbreviate "ing"; Abbreviate "That doesn't"; Abbreviate "you"; Abbreviate "'ll have to"; Abbreviate "and"; Abbreviate ".^^"; Abbreviate " th"; Abbreviate "stone"; Abbreviate " mo"; Abbreviate " to"; Abbreviate " fi"; Abbreviate " of"; Abbreviate "board"; Abbreviate " so"; Abbreviate " do"; Abbreviate " ma"; Abbreviate " com"; Abbreviate " wh"; Abbreviate " close"; Abbreviate " de"; Abbreviate " are"; Abbreviate " in"; Abbreviate "'s already"; Abbreviate " teac"; Abbreviate " fo"; Abbreviate " game"; Abbreviate " can"; Abbreviate " bl"; Abbreviate " on"; Abbreviate " with"; Abbreviate " an"; Abbreviate " time"; Abbreviate " wo"; Abbreviate " pl"; Abbreviate "Room"; Abbreviate "ter"; Abbreviate " li"; Abbreviate "pedestal"; Abbreviate " have"; Abbreviate " lo"; Abbreviate "X X X"; Abbreviate "tion"; Abbreviate " room"; Abbreviate " ex"; Abbreviate " po"; Abbreviate " ho"; Abbreviate " co"; Abbreviate "her"; Abbreviate "ame"; Abbreviate "int"; Abbreviate " st"; Abbreviate " has"; Abbreviate " is"; Abbreviate "ate"; Abbreviate " will"; Abbreviate "n't"; Abbreviate "black"; #ifnot; Abbreviate ". "; Abbreviate ", "; Abbreviate " the "; Abbreviate "The"; Abbreviate "You"; Abbreviate "Go stone"; Abbreviate "That doesn't"; Abbreviate "Go board"; Abbreviate "ing"; Abbreviate "you"; Abbreviate ".^^"; Abbreviate "and"; Abbreviate "'ll have to"; Abbreviate " th"; Abbreviate "stone"; Abbreviate " mo"; Abbreviate " to"; Abbreviate " of"; Abbreviate "board"; Abbreviate " fi"; Abbreviate " ma"; Abbreviate " com"; Abbreviate " so"; Abbreviate "'s already"; Abbreviate " wh"; Abbreviate " close"; Abbreviate " do"; Abbreviate " de"; Abbreviate " teac"; Abbreviate " are"; Abbreviate " game"; Abbreviate " in"; Abbreviate " po"; Abbreviate " can"; Abbreviate " hav"; Abbreviate " pl"; Abbreviate " wo"; Abbreviate "X X X"; Abbreviate " li"; Abbreviate " on"; Abbreviate " an"; Abbreviate " with"; Abbreviate " it"; Abbreviate "pedestal"; Abbreviate " fo"; Abbreviate " bl"; Abbreviate " lo"; Abbreviate " not"; Abbreviate " ex"; Abbreviate " le"; Abbreviate " ho"; Abbreviate " room"; Abbreviate " co"; Abbreviate "her"; Abbreviate "ame"; Abbreviate " no"; Abbreviate " st"; Abbreviate " has"; Abbreviate " is"; Abbreviate "int"; Abbreviate " will"; Abbreviate "n't"; Abbreviate "ite"; Abbreviate "black"; #endif; !*************************************************************************** !** !** Classes !** !*************************************************************************** Class white_stone with name "white" "go" "stone" "stones//p", short_name "white Go stone", plural "white Go stones", description "The white Go stone is made of clamshell.", has stone; Class silver_stone with name "silver" "go" "stone" "stones//p", short_name "silver Go stone", plural "silver Go stones", description "The Go stone is fairly heavy and is made of solid silver.", has stone; Class gold_stone with name "gold" "go" "stone", short_name "gold Go stone", description "This Go stone is made of solid gold. According to your teacher, only four such stones exist. They were made long ago, and each one had a drop of dragon's blood added to it while it was still molten. She never did explain how she came to be in possession of this particular stone, though.", has stone; Class crystal_stone with name "crystal" "go" "stone" "stones//p", short_name "crystal Go stone", plural "gold Go stones", description "This Go stone is made of flawless crystal.", has stone; Class cube with name "cube" "cubes//p", description [; print "The "; switch (self.number) { 1 : print "jet black"; 2 : print "dark green"; 4 : print "bright white"; 5 : print "deep red"; } " cube is approximately four inches on each side. "; ], before [; Attack, AttackWith: deadflag = 1; "The cube implodes with a small 'pop', somewhat like a light bulb. Unlike a light bulb, the implosion doesn't stop - the universe (or at least the part you occupy) begins to fold in on itself. Unfortunately, you get folded along with it..."; ]; Class StorageBin with description [; print (The) self, " which is currently "; if (self has open) print "open, "; else print "closed, "; print "is used to hold raw materials. "; if (self has open) ; else new_line; ], before [; Receive: if (noun hasnt ingot) "That doesn't go there."; ], capacity 1, has container openable scenery ~open; Class Ingot with before [; Empty, EmptyT: if (self in asbestos_cup) print_ret (The) self, " won't pour since it's still a solid."; ]; Class HotIngot with before [; Take: if (gloves hasnt worn) "It's too hot to pick up with your bare hands."; Empty, EmptyT: if (self in asbestos_cup) print_ret (The) self, " won't pour since it's still a solid."; ]; [ CubeMessage a ; print "^^For a moment, nothing happens. Then the "; switch (a) { 1 : print "black"; 2 : print "red"; 3 : print "green"; 4 : print "white"; } print " cube slowly fades away, leaving nothing behind. The ground beneath you rumbles slightly and you see that a passageway to the "; switch (a) { 1 : print "north"; 2 : print "south"; 3 : print "east"; 4 : print "west"; } print " has opened in the wall."; ]; Class pedestal with name "small" "depression" "notched" "marble" "block" "of" "square", description [; print "A block of marble, approximately three feet on each side, occupies the center of the room. A square depression, approximately four inches on a side, is notched in the top of the pedestal. "; if (children(self) ~= 0) { print "A "; switch (child(self).number) { 1 : print "jet black"; 2 : print "dark green"; 4 : print "bright white"; 5 : print "deep red"; } " cube rests in the depression."; } else new_line; rtrue; ], before [; Receive: if (children(self) ~= 0) "There's already something there."; if (noun ofclass cube) { move noun to self; give noun concealed; print (The) noun, " fits snugly in the depression. "; if (location == Room3N && noun == black_cube) { remove black_cube; give Room3N general; CubeMessage(1); } if (location == Room3S && noun == red_cube) { remove red_cube; give Room3S general; CubeMessage(2); } if (location == Room3E && noun == green_cube) { remove green_cube; give Room3E general; CubeMessage(3); } if (location == Room3W && noun == white_cube) { remove white_cube; give Room3W general; CubeMessage(4); } new_line; rtrue; } else "That doesn't fit there."; LetGo: give noun ~concealed; rfalse; ], has supporter scenery; Class House has light; Class PuzzleBoard with name "small" "wood" "wooden" "go" "board", before [ ; Search: <>; Burn: if (second == match && match has light) { deadflag = 1; "A booming voice says ~Wrong, cretin!~ and you notice that you have turned into a pile of dust. Wait - wrong game.... Oh, well, too late now."; } rfalse; Take: "It's firmly attached to the pedestal."; Receive: if (noun hasnt stone) "It's a Go board, not a table."; else "To place a stone on the board, you'll have to specify which coordinate to put the stone on, such as, ~PUT [or PLACE or PLAY] THE CRYSTAL STONE ON E5.~"; ], has scenery; !*************************************************************************** !** !** Scenery !** !*************************************************************************** ! This object is available for viewing only in the Maze Object m_room "room" with name "room" "wall" "walls" "floor" "ceiling" "roof" "silver" "gold" "wood" "light" "colored" "fine-grained" "fine" "grained" "stone" "clam" "shell" "clamshell" "smooth" "black", description [; print "The walls, floor and ceiling of this room are made of "; switch (go_bd->virtual_loc) { 0: "a light colored, fine-grained wood."; 1: "smooth, black stone."; 2 to 5: "a translucent material, like clamshell."; 6 to 9: "silver."; 10: "gold."; } ], found_in Maze, before [; Touch, Rub: "The surfaces in this room are highly polished and feel smooth to the touch."; ], has scenery; !*************************************************************************** !** !** The start !** !*************************************************************************** white_stone stone1 "white Go stone" with number 2; white_stone stone2 "white Go stone" with number 3; white_stone stone3 "white Go stone" with number 4; white_stone stone4 "white Go stone" with number 5; Object tv_shows "tv shows" with name "documentary" "elephants" "rerun" "sitcom" "commercial" "product" "24" "hour" "24-hour" "news" "channel" "cartoon", description "Don't you have something you should be doing instead of watching TV?", has scenery; House Living_Room "Living Room" with description [; print "The living room is tastefully decorated. The furniture is arranged to make maximum use of the limited space. A bookshelf "; if (bookshelf has general) print "(which has moved to reveal a passageway leading down) "; "takes up one wall, while a sofa and end table are pushed up against another. Directly across from the sofa is a television.^^ On your last visit, a large wooden Go board occupied the space between the sofa and the TV, but now it's missing. The only thing left in its place are a pair of wooden Go bowls.^^ The front door is to the north, the kitchen is east and the bedroom lies to the south."; ], e_to Kitchen, n_to [; "You consider leaving, but your curiosity gets the better of you. Where is your teacher? Where is her valuable Go board? Should you call the police? Or is there a logical explanation for all of this? Thinking that maybe this is another of your teacher's famous ~tests,~ you decide to press on." ;], s_to Bedroom, d_to [; if (bookshelf has general) { print "You walk down a dimly lit stairway. Eventually you emerge into a...^"; #ifdef INCLUDE_HINTS; move dim_menu to hint_menu; #endif; return go_room; } else rfalse; ]; Object -> front_door "front door" with name "front" "door", description "The front door is made of wood. It is currently closed.", before [; Open: "You consider leaving, but your curiosity gets the better of you. Where is your teacher? Where is her valuable Go board? Should you call the police? Or is there a logical explanation for all of this? Thinking that maybe this is another of your teacher's famous ~tests,~ you decide to press on."; Close: "It's already closed."; ], has scenery; Object -> wood_bowl "wood bowls" with name "kaya" "gold" "colored" "gold-colored" "fine" "grained" "fine-grained" "wood" "wooden" "go" "bowls" "lids" "pair" "of" "bowl" "lid" "go-ke" "ke", description "The Go bowls (and their matching lids) are made from kaya, a gold-colored, fine-grained wood. ", before [; Touch: "Nothing happens."; Shake: "You can hear Go stones rattling around inside the bowls."; Receive: if (receive_action == ##PutOn) "The ", (name) self, " are not tables."; else <>; Open: "For some reason you can't get the lids to come off of the bowls. Your teacher was the only one to ever open these bowls - she had a habit of muttering something under her breath and touching the lids in a certain way before removing them. Maybe that has something to do with it..."; Close: "They're already closed."; Burn: if (second == match && match has light) { deadflag = 1; "A booming voice says ~Wrong, cretin!~ and you notice that you have turned into a pile of dust. Wait - wrong game.... Oh, well, too late now."; } rfalse; Push, Pull, Take: "The Go board is already missing - don't you think you should at least leave the bowls where they are?"; ], has scenery pluralname; Object -> television "television set" with name "tv" "television" "set" "screen", before [; Examine: if (self hasnt general) { give self general; print "An older model television, the only ~high tech~ item your teacher actually bought for herself. "; } if (television hasnt on) "It's turned off."; else { print "As you randomly flip through the channels, you see "; switch(random(5)) { 1 : "a documentary about elephants."; 2 : "a rerun of an old sitcom."; 3 : "a commercial for a product you'd probably never buy."; 4 : "a 24-hour news channel."; 5 : "a cartoon."; }} SwitchOn: if (self has on) "It's already on."; else { give self on; move tv_shows to Living_Room; print "The screen lights as you turn the television on. "; <>; } SwitchOff: if (self hasnt on) "It's already off."; else { give self ~on; remove tv_shows; "You turn the television off."; } ], react_before [; Listen: if (television has on) "The only noise comes from the television."; else rfalse; ], has transparent scenery; Object -> sofa "sofa" with name "sofa" "leather" "black" "comfortable" "couch", description "It's a comfortable black leather sofa.", before [; Enter: "You don't have time to lounge around just now."; ], has scenery enterable supporter; Object -> end_table "end table" with name "table" "end" "wood" "wooden", description [; print "A wooden end table. It nicely complements the sofa, don't you think? "; if (self hasnt general) { give self general; move go_booklet to self; move stone1 to self; move stone2 to self; move stone3 to self; move stone4 to self; } if (children(self) ~= 0) <>; else new_line; rtrue; ], before [; Receive: if (noun == Go_Board) "There's no room on ", (the) self, " for that."; ], has scenery supporter; Object -> bookshelf "bookshelf" with name "bookshelf" "shelf" "shelves", description [; print "A large collection of neatly arranged books line the shelves. "; if (self has general) "A section of the bookshelf has moved, revealing a passageway leading down."; else new_line; rtrue; ], before [; Search: <>; Receive: "There's no room on ", (the) self, " for that."; ], has scenery supporter; Object -> passageway "passageway" with name "passageway" "dimly" "lit" "stairway", description [; if (bookshelf has general) "You can see a dimly lit stairway leading down."; else "You can't see any such thing."; ], has scenery; Object -> books "books" with name "history" "philosophy" "mathematics" "math" "books" "volumes" "large" "collection" "of" "neatly" "arranged" "book", number 0, before [ ; Count: "There are 561 books on the shelves."; Take, Examine, Search, Open: print "You select a book at random and read "; self.number++; if (self.number > 5) self.number = 1; switch(self.number) { 1 : "about how an egg can be made to float in a glass of water just by adding salt to the water."; 2 : "a section on advanced calculus."; 3 : print "a list of metals and their melting points:^^"; font off; print "Metal Degrees C Degrees F^ ----- --------- ---------^ Copper 1083 1982^ Gold 1064 1948^ Platinum 1772 3222^ Silver 962 1764^ Steel 1535 2795^ Titanium 1660 3020^"; font on; rtrue; 4 : "about how the police use a special black powder to recover fingerprints."; 5 : "a chapter in ~Arms and Armor of the Samurai~ by Dr. Stephen Turnbull."; } ], has scenery pluralname; Object go_booklet "Go booklet" with name "small" "go" "booklet" "rules" "of", description [; Achieved(0); book_menu.select(); ], before [; Burn: if ((second == match && match has light) || (second ofclass HotIngot) || (second == asbestos_cup && asbestos_cup has general)) "That wouldn't be a good idea."; rfalse; ]; House Kitchen "Kitchen" with description "This is a small kitchen. The only things of note here are the refrigerator and the stove. The only exit is to the west, towards the living room.", w_to Living_Room, has light; Object -> fridge "refrigerator" with name "refrigerator" "icebox" "fridge" "freezer", description "Just your basic two-door freezer/refrigerator. There is a poster glued to the side.", before [; Open: "Opening the refrigerator reveals more or less what you'd expect: health food. You don't feel hungry, though, so you close it."; Receive: "There's no room in ", (the) self, " for that."; ], has openable scenery; Object -> poster "poster" with name "poster" "five" "elements" "Chinese" "philosophy" "water" "wood" "metal" "fire", description [; font off; print "^The Five Elements of^"; print " Chinese Philosophy^^^"; print " Water^^"; print "Metal Earth Wood^^"; print " Fire"; font on; new_line; rtrue; ], before [; Burn: if (second == match && match has light) "It's flame-resistant."; Take, LookBehind: "You can't - it's glued to the refrigerator."; ], has scenery; Object -> kitchen_stove "kitchen stove" with name "stove" "oven", capacity 10, description [; print "An electric stove and oven."; if (self hasnt general) { give self general; "^^Looking at the oven reminds you of the times you suggested to your teacher that she get a microwave oven. She would always reply that this one was already too modern for her."; } else new_line; rtrue; ], before [; Receive, Open, Close, SwitchOn: "You don't have time for that just now."; SwitchOff: "It's already off."; ], has scenery nobehind supporter; Object -> -> matchbook "matchbook" with name "matchbook" "book" "matches", description [ ; print (The) self; switch(self.number) { 0: " is empty."; 1: " has a single match left."; default: print_ret " contains ", (LanguageNumber) self.number, " matches."; } ], number 3, before [; Burn: if ((second == match && match has light) || (second ofclass HotIngot) || (second == asbestos_cup && asbestos_cup has general)) "That's not a good plan."; ], invent [; if (inventory_stage==2) { print " (which "; switch(self.number) { 0: print "is empty)"; 1: print "has one match left)"; default: print "has ", (LanguageNumber) self.number, " matches left)"; }} ], daemon [; if (match notin matchbook && match notin player) { move match to matchbook; if (match has light) { give match ~light; StopTimer(match); } StopDaemon(self); } ], has transparent; Object match "match" matchbook with parse_name [ i j; if (self has light) j = 'burning'; else j = 'unlit'; while (NextWord() == 'match' or j) i++; return i; ], article "an", before [ ; Take, Remove: if (matchbook notin player) "You need to be holding the matchbook before you can do that."; if (self in player) "You already have one."; if (matchbook.number == 0) "There are no matches left in the book."; matchbook.number--; move self to player; StartDaemon(matchbook); self.article = "an"; print "You take the match from the matchbook, which "; if (matchbook.number == 0) "is now empty."; if (matchbook.number == 1) "has one more left."; if (matchbook.number > 1) "has ", (LanguageNumber) matchbook.number, " matches left."; Burn: if (self has light) "The match is already lit."; if (self notin player) "You need to be holding the match before you can do that."; if (matchbook notin player) "You need the matchbook to strike the match."; give self light; StartTimer(self, 2 + random(3)); self.article = "a"; "The match flares to life as you strike it."; ], short_name [; if (self has light) print "burning match"; else print "unlit match"; rtrue; ], time_left, time_out [; move self to matchbook; give self ~light; "^You drop the match as the flame reaches your finger."; ]; Object diary "leather-bound diary" with name "leather" "bound" "leather-bound" "diary", number 0, description [ ; print "This is your teacher's leather-bound diary. You peek inside and see that it is written in her small, precise script. You randomly select an entry and read "; self.number++; if (self.number > 5) self.number = 1; switch(self.number) { 1: "about your teacher's childhood in China."; 2: "a conversation your teacher once had with a dragon. You re-read this section, but can't find any mention that this was from a dream - maybe it's a metaphor...."; 3: "a short, cryptic note: Electricity on / check fuse / blower on / crucible shut."; 4: "about... you! She seems proud of your progress and believes you are ready for the 'next level,' whatever that means."; 5: "a particularly difficult Go problem your teacher had devised - in fact, it's one she made you solve just a few weeks ago."; } ], before [; Burn: if ((second == match && match has light) || (second ofclass HotIngot) || (second == asbestos_cup && asbestos_cup has general)) { deadflag = 1; print "Unlike Middle Eastern or Western dragons, Chinese dragons are wingless, with sinuous and scaled bodies, a large horned and whiskered head, and four stumpy clawed legs. I mention this because "; if (teacher in location) "your teacher just changed into one - and she does not look pleased."; else "one is now standing over you - and it does not look pleased..."; } rfalse; ]; House Bedroom "Bedroom" with description "This appears to be a combination bedroom/computer room. A futon occupies one corner, while a desk, which has a computer on it, occupies another. The living room is to the north, the bathroom is to the east and a walk-in closet is south.", n_to Living_Room, s_to Closet, e_to Bathroom, has light; Object -> desk "desk" with name "wood" "wooden" "desk", description [; print "A single-drawer desk, with a computer on it, occupies one corner of the room. "; <>; ], before [; Open, Close: "You might want to try the drawer."; Search: if (drawer hasnt open) "You might want to open the drawer."; else <>; LookUnder: if (drawer hasnt general) "It looks like there's something under the drawer."; rfalse; ], has scenery supporter; Object -> drawer "drawer" with name "wood" "wooden" "drawer", description [; print "The drawer is currently "; if (self has open) print "open"; else "closed. "; if (children(self) == 0) " and empty."; else { print ". "; <>; } ], before [; Receive: if (noun == baseball_bat) "That doesn't fit in there."; rfalse; Open, Pull: if (self hasnt general && self hasnt open) { give self open; print "The "; if (children(self) == 0) print "empty "; print "drawer seems to stick slightly as it opens. "; if (children(self) > 0) <>; else new_line; rtrue; } rfalse; Close, Push: if (self hasnt general && self has open) { give self ~open; "The drawer seems to stick slightly as it closes. "; } rfalse; Search: if (self hasnt open) <>; rfalse; LookUnder: if (self hasnt general) { give self general; move business_card to player; "Wedged under the drawer is a business card, which you take."; } rfalse; ], has scenery container openable ~open; Object -> -> ornate_box "ornate box" with name "ornate" "box" "wood" "wooden" "ivory" "inlays" "velvet" "lined" "velvet-lined", capacity 1, description [; print "A small, ornately carved wooden box with ivory inlays. The inlays show a fanciful depiction of a wizard's duel. "; if (self has open) { if (children(self) == 0) print "The velvet-lined box is open and empty."; else print "A ", (name) child(self), " is inside the velvet-lined box."; } if (self hasnt open) print "The box is closed."; if (self hasnt general) { give self general; "^^Your teacher once told you that the duel depicted on the box had actually occurred over a thousand years ago. You almost burst out laughing, but something in her eyes stopped you."; } else new_line; rtrue; ], before [; Shake: if (self hasnt open || (self has open && children(self) == 0)) rfalse; else { print (The) child(self), " falls out of ", (the) self, " and onto the "; move child(self) to location; if (location ofclass House) "floor."; else "ground."; } Receive: if (noun hasnt stone) "That doesn't fit in there."; ], has container openable ~open; gold_stone gold_stone1 "gold Go stone" ornate_box with number 10; Object -> futon "futon" with name "comfortable" "looking" "futon" "bed", description "As futons go, it looks pretty comfortable.", before [; Enter: <>; Take: "It's too bulky."; LookUnder: if (self hasnt general) { give self general; move diary to player; "Under the futon you find ", (a) diary, ", which you take."; } else "There's nothing under the futon."; ], has scenery supporter enterable nobehind; Object -> computer "computer" with name "computer" "monitor" "CPU" "keyboard" "mouse" "case", description [; print "The computer is an all-in-one model, which combines the monitor and CPU in one case. "; print "It is currently "; if (self has on) print "on. A menu is displayed on the screen."; else print "turned off."; if (self hasnt general) { give self general; "^^You remember when you purchased this computer for your teacher. It's not that she wasn't ... grateful - but you got the feeling that she didn't feel comfortable around technological equipment."; } else new_line; rtrue; ], before [; Reboot, Reset: if (self has on) "The computer screen blanks momentarily, then the computer reboots and displays a menu. (This isn't a Windows system, so that wasn't really necessary.)"; else "Turning it on would have the same effect."; SwitchOn: if (self has on) "It's already on."; else { give self on; move comp_game to location; "You turn on the computer. After a short boot-up sequence a menu is displayed on the screen."; } SwitchOff: if (self hasnt on) "It's already off."; else { give self ~on; remove comp_game; "You turn off the computer."; } ], has scenery ~on; Menu game_menu "Main Menu"; Option -> "Tetris" with description [; PlayTetris(); return 2; ]; Option -> "Reverzi" with description [; PlayRev(); return 2; ]; Object comp_game "computer game" with name "display" "screen" "menu" "game" "games" "tetris" "reversi" "othello" "reverzi", description [; game_menu.select(); <>; ], before [; Play: <>; Take: "Now that would be a trick."; SwitchOn: <>; SwitchOff, Exit, Abort: "It appears this is the only application this computer has."; ], has scenery nobehind; Object business_card "business card" with name "business" "card" "paper", description [; print_ret "It's actually a blank business card-sized piece of paper. Written on one side is ~", combo1, "-", combo2, "-", combo3, ".~"; ]; House Closet "Closet" with description "This is a walk-in closet. You don't find anything unusual here: clothes, shoes, boxes and other assorted junk. Like everything else in the house, though, it is neatly arranged. The only exit is north.", n_to Bedroom, has light; Object -> clothes "clothes" with name "neatly" "arranged" "clothes", description "The clothes are neatly arranged in the closet.", before [; Take, Wear: "They're not your size, so you leave them where they are."; Push, Pull: "You'd only make a mess."; ], has scenery pluralname; Object -> shoes "shoes" with name "neatly" "arranged" "shoes", description "The shoes are neatly arranged on the floor of the closet.", before [; Take, Wear: "They're not your size, so you leave them where they are."; Push, Pull: "You'd only make a mess."; ], has scenery pluralname; Object -> junk "junk" with name "other" "assorted" "junk", description "Just the usual stuff you find in a closet.", before [; Take: "You don't have any use for those things."; Push, Pull: "It's neatly arranged junk - moving it would only make a mess."; ], has scenery; Object -> boxes "boxes" with name "neatly" "stacked" "neatly-stacked" "boxes", description [; print "Many neatly-stacked boxes "; if (safe in nothing) print "(maybe too neatly, even for your teacher) "; "cover the floor of the closet. "; ], before [; Take: "What would you do with them?"; Open, Search: "The boxes contain old bills, tax records, and other mundane items. You don't find the contents very interesting, so you close them again."; Push, Pull, LookUnder, LookBehind: if (safe in nothing) { move safe to Closet; move dial to Closet; "Moving the boxes around reveals a safe mounted in the floor."; } else "You're making a mess...."; ], has scenery pluralname openable; Object safe "safe" with name "steel" "safe" "door", capacity 1, description [; print "A steel safe is set into the floor. The safe's door "; if (self has open) print "(which is open)"; else print "(which is closed)"; print " has a dial mounted on it. "; if (self has open) "Looking inside, you see that it is empty except for a small lever mounted on the bottom."; else new_line; rtrue; ], before [; Lock, Unlock: "That's what the dial is for."; Take, LookUnder, LookBehind: print "You can't - it's mounted "; style bold; print "in"; style roman; " the floor."; Receive: if (noun == baseball_bat) "That doesn't fit in there."; ], has openable lockable locked container static; Object dial "dial" with dials_set 0, name "circular" "dial" "knob", description [; print_ret "The circular dial has numbers printed on it; they range from 0 to 99. It is currently set at ", dial_setting, "."; ], before [; Take: "You can't - it's part of the safe."; Turn: "You have to specify a number, such as, ~TURN DIAL TO 50.~"; TurnDial: if (second > 99) "The dial only goes up to 99."; if ((second == combo1 && self.dials_set==0) || (second == combo2 && self.dials_set==1) || (second == combo3 && self.dials_set==2)) self.dials_set++; else self.dials_set = 0; if (self.dials_set == 3) give safe ~locked; else give safe locked ~general; ], each_turn [; if (safe hasnt locked && safe hasnt general) { give safe general; Achieved(1); "^As you finish turning the dial, you hear a soft 'click.' "; } ], has static concealed dialable; Object lever "lever" safe with name "lever", description "The lever is mounted in the bottom of the safe. ", before [; Pull: if (bookshelf hasnt general) { give bookshelf general; "You hear a muffled rumbling sound from somewhere in the house."; } else "You can't pull the lever any farther."; Push: if (bookshelf has general) { give bookshelf ~general; "You hear a muffled rumbling sound from somewhere in the house."; } else "You can't push the lever any farther."; Turn, SwitchOn, SwitchOff: if (bookshelf has general) "You might want to try pushing it instead."; else "You might want to try pulling it instead."; ], has static; House Bathroom "Bathroom" with description [; if (self hasnt general) { give self general; print "Unlike the rest of the house, which could be described as ~old but well-maintained,~ the bathroom strikes you as ~ancient but well-maintained.~ Everything in here - the bathtub, toilet, sink and medicine cabinet - seems to be from another era.^^"; } else print "This is the bathroom, which has the usual (if somewhat dated) fixtures: bathtub, toilet, sink and medicine cabinet. "; "The only exit is west."; ], w_to Bedroom, has light; Object -> bathtub "bathtub" with name "authentic" "cast-iron" "cast" "iron" "claw" "foot" "feet" "bathtub" "clawed" "bath" "tub", description "An authentic cast-iron bathtub, complete with clawed feet.", before [; Enter: "You don't feel especially dirty just now."; Take: "It's definitely too heavy for you to move."; ], has scenery; Object -> bathroom_sink "bathroom sink" with name "bathroom" "sink" "faucet" "old" "fashioned" "old-fashioned", description "A cast-iron bathroom sink, complete with an old-fashioned faucet.", before [; Turn, Open, Close: "You don't have time for that just now."; ], has scenery; Object -> toilet "toilet" with name "old" "fashioned" "old-fashioned" "porcelain" "toilet", description "An old-fashioned porcelain toilet.", before [; Enter: "It doesn't look like it would support your weight."; Flush: "Try as you might, you can't see how to flush this toilet."; Open: "You'd rather not."; ], has scenery; Object -> cabinet "medicine cabinet" with name "medicine" "cabinet", description [; print "The cabinet is mounted on the wall, over the sink. "; if (self has open) "It is currently open."; else "Oddly, it has no mirror. It is currently closed."; ], before [; Receive: "That doesn't belong in there."; Search: if (self has open) "It is filled with several small jars."; Open: if (self has open) "It's already open."; else { give self open; "You open ", (the) self, " revealing several small jars."; } Close: if (self hasnt open) "It's already closed."; else { give self ~open; "You close ", (the) self, "."; } ], has scenery container openable ~open; Object -> -> jars "unmarked jars" with name "clay" "unmarked" "jars" "jar", description "The clay jars are of various sizes and shapes. None of them are labeled. ", before [ a; Receive: "There's already something in there."; Take: "That's probably not a good idea."; Open, Search: print "Opening a jar at random, you find that it is filled with "; a = random(5); switch(a) { 1 : print "a brown, syrupy liquid."; 2 : print "green leaves from a kind of plant you've never seen before."; 3 : print "a fine, gray powder."; 4 : print "a clear liquid."; 5 : print "small blue beads."; } " Satisfied, you close it again."; ], has scenery openable ~open pluralname; Object -> -> jar_contents "contents of the jar" with name "brown" "syrupy" "liquid" "green" "leaves" "fine" "gray" "powder" "clear" "small" "blue" "beads" "plant" "medicine", description "It's not like any medicine you've ever seen.", before [; Take, Smell, Eat: "That's probably not a good idea."; ], has scenery; Include "njag1"; Include "njag2"; Include "njag3"; Include "njag4"; Include "njag5"; Include "njaghint"; Include "njagtet"; Include "njagrev";