!--------------- Randomizer --------------- ! Compliments of http://www.onyxring.com/InformGuide.aspx?article=12 !------------------------------------------ REPLACE KeyboardPrimitive; global randseed=0; [KeyboardPrimitive a_buffer a_table t; if(randseed>0) !Already randomized, !so use library code read a_buffer a_table; else !otherwise, get and randomize { @aread a_buffer a_table 1 procrandseed t; for(t=0:t 30 10 20 10 5; [ PrintTaskName task_number; switch (task_number) { 0: "finding out the murder room"; 1: "finding out who the murderer was"; 2: "finding out the murder weapon"; 3: "fixing the sink"; 4: "finding the secret passage"; } ]; !//Achieved(task_number) !--------------- Includes --------------- Include "parser"; Include "verblib"; Include "grammar"; !--------------- Global Variables -------------------------------------------- !----------------------------------------------------------------------------- Global murderer = "blah"; Global murder_room = "blah"; Global murder_weapon_place = "blah"; Global leakysink = 1; !--------------- OBJECTS ----------------------------------------------------- !----------------------------------------------------------------------------- Object weapon "broken base of a candlestick" with name 'candlestickbase' 'base' 'of' 'candlestick' 'candle' 'stick' 'candel', description [; if(IndirectlyContains(player, candlestick)){ move murder_location to player; print "It's the broken base to the missing candlestick! The murder must have taken place in here!"; rtrue; } print "It's a broken base to a candlestick. I wonder why it was in here?"; ], before[; Take: if(IndirectlyContains(player,candlestick)){ move murder_location to player; print "It's the broken base to the missing candlestick! The murder must have taken place in here!"; rtrue; } move weapon to player; print "Taken."; rtrue; ]; Object murder_location "murder location" with name 'murder' 'location' 'murderlocation' 'of', article "Knowledge of the", description [; print "After the murder took place, the suspect must have hid the base of the candlestick inside the ", (string) murder_weapon_place, "."; ], before[; Drop: "You can't erase this from your memory. Ctrl-Alt-Delete might work"; ]; Object you_win "you win" with name "you_win", description "", daemon [; if(IndirectlyContains(player,murder_location) && IndirectlyContains(player,journal_entry) && IndirectlyContains(player,candlestick)){ print "^"; print " / | / |^"; print " (___| ___ ___ ___ ( ___ ___|^"; print " )| )| ) |___ | )| @@92 )|___)| )^"; print " __/ |__/ |__/ __/ |__/ | @@92/ |__ |__/ ^^^"; print " / / / ^"; print " (___ (___ ___ ___ ___ ___ ___ ( ^"; print " | | )|___) | | )|___ |___) | ^"; print " |__ | / |__ |__ |__/| __/ |__ _ ^^"; print " ", (string) murderer, " did it in the ", (string) murder_room, ", with the Candlestick!"; deadflag=2; } ]; !=============== Generic Decorations ========================================= object sofa "sofa" with name "sofa", description "A comfy leather sofa. Almost fit for a king (or me!).", found_in Library Study Lounge Dining_Room Ball_Room Conservatory Billiard_Room, has concealed static; object window "windows" with name "window" "windows", description "Hmm..They're windows (of the transparent kind). Outside you see some trees, birds, and a pretty blue sky", found_in Study Library Study Billiard_Room Conservatory Ball_Room Kitchen Dining_Room Lounge Great_Hall, has concealed static; object painting "painting" with name "picture" "painting" "photos" "photo" "paintings" "pictures" "art", description "It's a painting on the wall. Not much to look at...", found_in Study Library Billiard_Room Conservatory Ball_Room Dining_Room Lounge Great_Hall, before[; Take: "Wait a minute, I'm not a thief! I better not take that..."; ], has concealed static; object mirror "mirror" with name "mirror", description "You're startled by good looking person staring back at you.", found_in Dining_Room Lounge Great_Hall, has concealed static; Object -> kitty "kitty" with name 'kitty' 'cat' 'kitten' 'pussy', before[; attack,eat: "The kitty doesn't appreciate that kind of abuse! Go take your violent tendencies to some other game!"; take : "You pick the cat up and pet it gently. As you put the kitty down, it meows and goes on with its business."; ], each_turn "^The kitten purrs peacefully.", daemon [ direction kitty_at way exit_count exit_chosen; if (random(3) ~= 1) rfalse; kitty_at = parent(kitty); objectloop (direction in compass) { way = kitty_at.(direction.door_dir); if (way ofclass Object && way hasnt door) exit_count++; } if (exit_count == 0) rfalse; exit_chosen = random(exit_count); exit_count = 0; objectloop (direction in compass) { way = kitty_at.(direction.door_dir); if (way ofclass Object && way hasnt door) exit_count++; if (exit_count == exit_chosen) { move self to way; if (kitty_at == location) "^The kitty saunters away.."; if (way == location) "^The kitty strolls in!"; rfalse; } } ], has animate; !=============== ROOM: Study ================================================= Object Study "Study" has light with name 'study' 'den' 'office', description "You are standing in the Study. The study has a darkly stained wood floor with a large carpet in the center. There are a few windows but the shades are blocking most of the light. The glow of the fireplace keeps the room much warmer than the rest of the mansion. Strangely, the lamp on a small table next to a reading chair is still on. You see some sort of notebook or journal sitting on the table.", s_to [; if(study_door hasnt open){ "THUMP! You ran into the library door. Try opening it first."; } PlayerTo(Library); rtrue; ], e_to Great_Hall, d_to [; if(trap_door hasnt open){ "The trap door is not open. I wonder what's inside?"; } return Secret_Passage; ], after[; if(IndirectlyContains(player, icecube)){ icecube.time_out(); StopTimer(icecube); score = score + 5; rtrue; } ]; Object notebook "Notebook" Study has concealed static with name 'notebook' 'book' 'note' 'journal', description "You see a notebook lying on a small table. The reading lamp next to the table is left on...", before [; Take: "You don't want to put your fingerprints on this. It might be evidence! Try taking a closer look at it..."; Push,Pull: "What are you doing?"; Open,Examine: move journal_entry to player; score = score + 10; "The notebook is opened to yesterday's date. It has several entries, but appears to stop suddenly mid-sentence. New Evidence! Based on the journal entry, you now know who committed the crime. (check your inventory)"; ]; Object journal_entry "murderer" with name 'murder' 'murderer' 'journal' 'entry' 'writing' 'evidence' 'clue', article "Knowledge of the", description [; print "As you read the text in yesterday's entry in the journal, it becomes clear that ", (string) murderer, " was the murderer. ^Evidence: ", (string) murderer, " was the murderer."; ], before[; Drop: "You can't erase this from your memory. Ctrl-Alt-Delete might work"; ]; Object fireplace "fireplace" Study has scenery static with name 'fire' 'place' 'fireplace', description "The glow of the fireplace emits warmth into the room.", before [; Take: "OUCH!"; ]; Object study_door "door" has ~open openable locked lockable scenery with name 'door' 'studydoor' 'study' 'librarydoor' 'library', description [; if(location == Study){ "A door that leads to the library."; } if(location == Library){ "A door that leads to the study."; } ], before[; Attack: "The door is made of sturdy oak. All you accomplish is pain."; Examine: if(study_door has locked){ "A door that leads to the library. It appears to be locked."; } if(study_door hasnt locked){ "A door that leads to the library."; } ], after[; Open: if(study_door has locked && ~IndirectlyContains(player, library_key)){ print "The door is locked. You must find a key to unlock it."; } ], with_key library_key, found_in Study Library; Object study_rug "rug" Study has concealed static supporter with name 'rug', description "It's a large asian rug. It looks expensive. There's a small bump on the rug. Could there be something underneath?", before [; Take: "We're not thieves, we're here to investigate a crime!"; Push,Pull: "Why would we want to do that??"; LookUnder: give trap_door ~concealed; score = score + 10; "You lift up a corner of the rug and discover the small bump was a hinge to a trapdoor! I wonder what's inside?"; ]; Object trap_door "trap door" with description [; if (self in Secret_Passage) "A trap door that leads to the Study..."; "A trap door that leads to a secret passage..."; ], name 'trap' 'trapdoor' 'door', before [; Enter: PlayerTo(Secret_Passage); rtrue; ], when_closed "The trap door is closed...", when_open "The trap door is opened...", door_to [; if (self in Study) return Secret_Passage; return Study; ], door_dir [; if (self in Study) return d_to; return u_to; ], found_in Study Secret_Passage, has static door ~open openable concealed; !=============== ROOM: Library =============================================== Object Library "Library" has light with name 'library', description "You are standing in the Library. One wall is lined with books while the opposite side has a two-seater sofa and a small chair with a floor lamp beside it. Two large windows on the west side of the library let in plenty of light for reading. A few books lie on on the table in the middle of the room.", n_to [; if(study_door hasnt open){ "THUMP! You ran into the study door. Try opening it first."; } return Study; ], s_to [; if(billiard_room_door hasnt open){ "OOF! You ran into the billiard room door. Try opening it first."; } return Billiard_Room; ]; Object library_book "book" Library has concealed static with name 'book' 'books', description "Upon closer inspection, the book is really some sort of accounting records.", before[; Examine, Open: move receipt to player; score = score + 10; "You discover a receipt for what looks to be items purchased for some sort of party. You take it as evidence.^^ ----------------^ 3 candlesticks^ 3 candles^ 1 tablecloth^ 6 place-settings^ ----------------^"; ]; Object receipt "receipt" with name 'receipt' 'receipts', description "----------------^ 3 candlesticks^ 3 candles^ 1 tablecloth^ 6 place-settings^ ----------------^"; !=============== ROOM: Billiard_Room ========================================= Object Billiard_Room "Billiard Room" has light with name 'billiard' 'room' 'billiardroom' 'billiard_room' 'billards' 'billard', description "You are standing in the Billiard Room.", n_to [; if(billiard_room_door hasnt open){ "THUMP! You ran into the library door. Try opening it first."; } return Library; ], s_to Conservatory; [ PlaySub; "Well, that wasn't much fun"; ]; Verb "play" * noun -> play; Object -> Billiards_Table "billiards table" with name "pool" "billiard" "billiards" "table", description "A billiards table is all set for a new game.", before [; play: "You start playing a quickie game of nine-ball. But before you finish a game, your great pool skills end up sending one of the balls thru the window..Oops"; ], has static; object -> dartboard "dart board" with name "dart" "board" "darts", description "A dart board hangs on the wall. You almost know better than to play it...", before [; play: "As you pick up the darts and start throwing them at the board, you hear loud *meows* off in the distance. Probably wasn't a great idea"; ], has static; object -> bar "mini-bar" with name "bar" "mini" "mini-bar", description "Woah..Great selection. I can get like..Totally liquored up!", has static container openable; Object -> -> redbull "can of RedBull energy drink" with name "redbull" "red" "bull", with description "A can of RedBull Energy Drink.", before [; take, Drink: remove self; "Mmmmmm! All of a sudden your eyes are wide open and you begin to twitch.^ 'OH MY GOD,' you say, 'RED BULL GIVES YOU WINGSSSSSSSS!!'^ Better get solving!"; ]; Object -> -> vodka "bottle of vodka" with name "A small bottle of Vodka" "vodka", with description "A small bottle of Vodka.", before [; take, Drink: remove self; "^WHOA!! You drank the entire thing! You party animal! Good luck solving the crime now!"; ]; Object billiard_room_door "door" with description [; if (self in Billiard_Room) "A door that leads to the Library..."; "A door that leads to the Billiard Room..."; ], name 'billiard' 'room' 'door', when_closed "The door is closed...", when_open "The door is opened...", door_to [; if (self in Billiard_Room) return Library; return Billiard_Room; ], door_dir [; if (self in Billiard_Room) return n_to; return s_to; ], with_key library_key, found_in Library Billiard_Room, has static door ~open openable lockable locked; !=============== ROOM: Conservatory ========================================== Object Conservatory "Conservatory" has light with name 'conservatory' 'conservetory', description "You're in the house conservatory. You see a wide variety of plants of various sizes. Interestingly enough, you soon notice that some of the plants are being grown hydroponically with moving overhead lights. Though you are delighted by the room's enticing odor.", n_to Billiard_Room, e_to Ball_Room; object -> closet "closet" with name "closet", description "There's a closet in the corner of the room probably containing some smaller plants and miscellaneous gardening accessories.", has static openable container; !=============== ROOM: Ball_Room ============================================= Object Ball_Room "Ball Room" has light with name 'ballroom' 'ball' 'room' 'ball_room', description "You are standing in the Ball Room. The room is overly plastered with various expensive paintings and art work. As you walk around, the wooden floor echoes your footsteps. ", w_to Conservatory, e_to Kitchen; object -> piano "piano" with name "piano", description [; if( IndirectlyContains(Ball_Room,weapon)) { "The grandiose piano is definetely the centerpiece of the room. Being a master pianist that you are, you notice a peculiarity with some of the notes.. Maybe you should examine the inside to see if you can find the problem.."; } "The grandiose piano is definetely the centerpiece of the room. Being a master pianist that you are, you play the piano and enjoy its breathtaking sound."; ], has static openable container; !=============== ROOM: Kitchen =============================================== object Kitchen "Kitchen" has light, with name 'kitchen' 'kichen', description "You're in the house kitchen. As with most other rooms of the house, this one is pretty messy. In fact, it almost looks like a tornado hit it. Lets see what we can dig up in here...", n_to Dining_Room, w_to Ball_Room, d_to Secret_Passage; object -> oven "oven" with name "oven" "stove", description "A huge oven is in the corner of the kitchen. It looks like it hasn't been cleaned for years, but I bet you could cook a whole cow in there!", before [; switchon: "What are you cooking? I don't see any cows around!"; ], has static; object -> countertop "counter top" with name "counter" "top" "table" , description "There's an island counter top in the center of the kitchen. It's covered by a nice layer of dust and slimy substance, as well as empty beer bottles and dishes.", has static; object -> knives "set of knives" with name "knife" "knives" "knifes" "knive", description "Some extraordinarily sharp, yet dirty, knives sit on the counter top.", before [; take: "I never did trust myself with sharp knives.. Besides, I'd rather not put my fingerprints on them"; ], has static; object -> sink "kitchen sink" with name "kitchen" "sink" "faucet", description [; if( leakySink == 1) { "A leaky kitchen sink is to your right. Your environmentally-friendly self would feel so much better if it was fixed.."; } "A fully working kitchen sink (Great Job!!!) is to your right. Your environmentally-friendly self feels so much better now.."; ], before [; tie: if(indirectlyContains(player,wrench)) { leakySink = 0; score = score + 10; "Way to put those home economics skills to good use. Karma++ !"; } "It's too tight. If only I had some kind of tool.."; ], has static container openable; object -> -> pipe "lead pipe" with name "lead" "pipe", description "A sturdy heavy lead pipe.. About a foot in length and an inch in diameter."; object -> -> wrench "wrench" with name "wrench" "rench", description "A solid wrench used for fixing and breaking."; object -> freezer "freezer" with name "fridge" "refrigerator" "freezer", description [; if(IndirectlyContains(player, icecube)){ "There's a freezer in the corner of the room by the window."; } "There's a freezer in the corner of the room by the window. It looks like it hasn't been opened for a long time.. Perhaps it's worth looking inside."; ], when_open "There is an open freezer here.", when_closed "There is a closed freezer here.", has static container openable; object -> -> icecube "ice cube" with name "ice" "cube", description "Hmmm.. a rather peculiar looking ice cube. Almost seems like there's something shiny frozen inside. If there was only a way to get it out...", before [; attack: "The slippery thing slips out of your hands onto the floor, unharmed...^ You reach down and pick it back up."; ], after [; take: give freezer ~open; StopTimer(self); StartTimer(self,ICE_MELT_TURNS); "Brrr..Chilly. If there was only a way to melt it.."; ], time_left, time_out [; move library_key to location; score = score + 10; remove icecube; print "^"; print " _ _ _ _ ^"; print " | | (_) | | (_) ^"; print " __| |_ __ _ _ __ __| |_ __ _ _ __ ^"; print " / _` | '__| | '_ @@92 / _` | '__| | '_ @@92 ^"; print " | (_| | | | | |_) | | (_| | | | | |_) |^"; print " @@92__,_|_| |_| .__/ @@92__,_|_| |_| .__/ ^"; print " | | | | ^"; print " |_| |_| ^"; print "^ The ice has melted! My pants are soaked but more importantly, they key has dropped to the floor.^"; ]; object library_key "key" with name "library" "key", description "A key. I wonder what it opens.."; !=============== ROOM: Dining_Room =========================================== Object Dining_Room "Dining Room" has light with name 'diningroom' 'dining' 'room', description "You are standing in the Dining Room. It appears as if they had just had a party.", s_to Kitchen, n_to Lounge, initial[; if(IndirectlyContains(player, receipt)) { score = score + 10; move candlestick to player; print "^"; print " _ _ _ _ ^"; print " | | | | | | | |^"; print " __ _| |__ | |__ __ _| |__ | |^"; print " / _` | '_ @@92 | '_ @@92 / _` | '_ @@92| |^"; print " | (_| | | | | | | | | (_| | | | |_|^"; print " @@92__,_|_| |_| |_| |_|@@92__,_|_| |_(_)^"; print"^After a closer examination of the room, you notice there is only two candlesticks in the dining room when you know three were purchased for the party. A third candle lays on the dining room table without a holder. The missing candlestick must have been the murder weapon!^"; if(IndirectlyContains(player, weapon)){ move murder_location to player; print "After the murder took place, the suspect must have hid the base of the candlestick inside the", (string) murder_weapon_place; } } ]; Object candlestick "murder weapon" with name 'candle' 'stick' 'candel' 'holder', article "Knowledge of the", description "The murder weapon must have been the candlestick! It's the only weapon that is unaccounted for..."; !=============== ROOM: Lounge ================================================ Object Lounge "Lounge" has light with name 'lounge', description "You are standing in the Lounge. You see a couple recliners, a mirror, a comfy window seat, and some paintings. Underneath your feet you take notice of a rug made out of a dead bear's fur.", s_to Dining_Room, w_to Great_Hall; object -> cabinet "large cabinet" with name "large" "cabinet" "dresser", description [; if( IndirectlyContains(Lounge,weapon)) { "A large wooden cabinet with many drawers to put stuff in. There are some books and a lamp on top of it. Looking closer, you notice some blood smudges next to one of the handles"; } "A large wooden cabinet with many drawers to put stuff in. There are some books and a lamp on top of it."; ], has static openable container; !=============== ROOM: Great_Hall ============================================ Object Great_Hall "Great Hall" has light with name 'greathall' 'great' 'hall', description "The great hall is pretty undeserving of it's name. It's a rather mediocre looking entry way into the house consisting of a couple of a chair, a mirror, and a coat rack", w_to Study, e_to Lounge; object -> chair "chair cushion compartment" with name "chair" "cushion" "compartment", description [; if( IndirectlyContains(Great_Hall,weapon)) { "Looks like your ordinary chair with a replaceable cushion. But although I'm no interior designer, that red paint on the sides of the cushion don't match the rest of the decor whatsoever."; } "Looks like your ordinary chair with a replaceable cushion."; ], has static openable container; !=============== Secret_Passage_from_Study_to_Kitchen ======================== Object Secret_Passage "Secret Passage" has light with name 'secretpassage' 'secret' 'passage' 'pass' 'tunnel', description "You have discovered a secret passage!!! I wonder where it leads? It's very dark, but you can feel your way around.", u_to Study; Object Staircase_to_Kitchen "Staircase" Secret_Passage has enterable static with name 'staircase' 'stairs' 'stair' 'case', description "You see a dim light at the top of the steap, winding staircase.", before[; Climb, Enter, Take: print "^You cautiously move up one stair at a time, winding around and around. The light becomes stronger and stronger.^"; PlayerTo(Kitchen); rtrue; ], u_to Study; !--------------- MAP --------------------------------------------------------- !----------------------------------------------------------------------------- Verb "map" * -> map; [ MapSub; print_map(); ]; [print_map; print "^ +-----------------------------------------------------------------------------+^ | | | |^ | Study | Great Hall | Lounge |^ | | | |^ +-------------------------+-------------------------+-------------------------+^ | | _____ _ | |^ | Library | / ____| | | |^ | | | | | |_ _ ___ | |^ +-------------------------| | | | | | | |/ _ @@92 | Dining Room |^ | | | |____| | |_| | __/ | |^ | Billiard Room | @@92_____|_|@@92__,_|@@92___| | |^ | | | |^ +-------------------------+-------------------------+-------------------------+^ | | | |^ | Conservatory | Ball Room | Kitchen |^ | | | |^ +-----------------------------------------------------------------------------+^"; rtrue; ]; !--------------- Initialization --------------- [ Initialise; !//randomize the starting location; switch(random(8)){ 1: location = Study; !note: you cannot start in the Library. Both doors are locked. 2: location = Billiard_Room; 3: location = Conservatory; 4: location = Ball_Room; 5: location = Kitchen; 6: location = Dining_Room; 7: location = Lounge; 8: location = Great_Hall; } !// randamize the murderer switch(random(6)){ 1: murderer = "Professor Plum"; 2: murderer = "Miss Scarlet"; 3: murderer = "Mrs. Peacock"; 4: murderer = "Mr. Green"; 5: murderer = "Colonel Mustard"; 6: murderer = "Mrs. White"; } !// randomize the murder_room switch(random(7)){ 1: murder_room = "Secret Passage"; murder_weapon_place = "Secret Passage"; move weapon to Secret_Passage; 2: murder_room = "Billiard Room"; murder_weapon_place = "bar"; move weapon to bar; 3: murder_room = "Conservatory"; murder_weapon_place = "closet"; move weapon to closet; 4: murder_room = "Ball Room"; murder_weapon_place = "piano"; move weapon to piano; 5: murder_room = "Kitchen"; murder_weapon_place = "freezer"; move weapon to freezer; 6: murder_room = "Lounge"; murder_weapon_place = "cabinet"; move weapon to cabinet; 7: murder_room = "Great Hall"; murder_weapon_place = "chair"; move weapon to chair; } StartDaemon(you_win); move kitty to Study; StartDaemon(kitty); print_map(); print "^ WELCOME TO CLUE^^"; print "Map: Type ~map~ at any time to display the map.^^"; print "^^^^^You have just arrived at the mansion with the other police officers. Your job as detective is to figure out who committed the murder, what weapon was used, and where the murder took place...^^"; ];