! ---------------------------------------------------------------------------- ! A Matrix Adventure Game for the Inform compiler ! Designed and Written by Patrick Kenny: 2002 ! Copyright (c) 2002 by Patrick Kenny ! Built with the Inform v6.21 and library 6/10 SD !----------------------------------------------------------------------------- ! The main general header info Constant Story " Flip Side^"; Constant Headline " A Matrix Adventure Game^ by Patrick G. Kenny^"; Constant DEBUG; Release 1; Serial "021010"; Constant MAX_SCORE = 30; !======================================= ! Basic Inform include Files Include "Parser"; Include "Verblib"; !======================================== ! Define some Classes !======================================== Class Room has light; Class Prop has scenery; Class Furniture with before [; Take,Pull,Push,PushDir: print_ret (The) self, " is too heavy for that."; ], has static supporter; Class FContainer with before [; Take,Pull,Push,PushDir: print_ret (The) self, " is too heavy for that."; ], has static container; Class NPC with life [; Answer,Ask,Order,Tell: print_ret "Just use T[ALK] [TO ", (the) self, "]."; ], has animate; !================================= ! NPCs characters in the Game only 2, trinity and morpheus !================================= NPC trinity "Trinity" with name 'trin' 'trinity' '3', description "She is all dressed up in tight black leather.", initial [; print "There is a woman standing here..^"; if (location hasnt visited) { print "~Hello Neo.~, says a woman approaching you.^"; print "^~I know alot about you. I've been wanting to meet you for sometime.~^"; } ], times_spoken_to 0, ! for counting the conversation topics life [; Kiss: print_ret "~Ooh, you saucy thing!~"; Talk: self.times_spoken_to = self.times_spoken_to + 1; switch (self.times_spoken_to) { 1: score = score + 1; print_ret "~I am Trinity.~"; 2: print_ret "~Yes, the Trinity that cracked the I.R.S. D-Base.~"; 3: print_ret "~Do you have something for me?~"; 4: print_ret "~They're watching you, Neo. Right now, all I can tell you, is that you are in danger.~"; 5: print_ret "~Please. Just Listen. I know why you're here, Neo. I know what you've been doing. I know why you hardly sleep, why you live alone and why, night after night, you sit at your computer; you're looking for him. But he is not what your looking for, what you really seek is an answer. It's the question that drives us, the question that brought you here. You know the question, just as I did.~"; 6: "~What is the Matrix. You have to see it to believe it.~"; 7: "~I must leave now.~"; default: return false; } Give: score = score + 5; move noun to self; print "She Takes the disc.^"; print "~You must leave now, go see Morpheus at the Lafaytte Hotel.^"; move morpheus to Room1313; remove trinity; rtrue; ], has female proper; NPC morpheus "Morpheus" with name 'mo' 'morpheus' '2', description "He wears a long black coat and his eyes are invisible behind circular mirrored glasses.", initial [; print "There is a man standing here.^"; if (location hasnt visited) { print "~Welcome Neo.~, says Morpheus approaching you.^"; print "^~As you no doubt have guessed, I am Morpheus.~^"; } ], times_spoken_to 0, ! for counting the conversation topics life [; Kiss: print_ret "~It's not real!~"; Talk: self.times_spoken_to = self.times_spoken_to + 1; switch (self.times_spoken_to) { 1: score = score + 1; print_ret "~The honor is all mine.~"; 2: score = score + 1; print_ret "~I imagine, right now, you must be feeling a but like Alice, tumbling down the rabbit hole?.~"; 3: score = score + 1; print_ret "~Let me tell you why you are here. You have come because you know something. What you know you can't explain but you feel it. You've felt it your whole life, felt that something was wrong with the world. You don't know what, but it's there like a splinter in your mind, driving you mad. It is this feeling that brought you to me. Do you know what it is?~"; 4: score = score + 1; print_ret "~Yes, The Matrix. The Matrix is everwhere, it's all around us, here even in this room. It is the world that has been pulled over your eyes to blind you from the truth.~"; 5: score = score + 2; print "~Unfortunately, no one can be told what the Matrix is. You have to see it for yourself.~^^"; print "Morpheus holds out his hands and opens them.^In the right hand is a red pill. In the left, a blue pill.^^"; move redpill to Room1313; move bluepill to Room1313; rtrue; 6: score = score + 5; print_ret "~This is your last chance. After this, there is no going back. You take the blue pill and the store ends. You wake up in your bed and you believe whatever you want to believe. You take the red pill and you stay in Wonderland and I show you how deep the rabbit hole goes.~^^"; 7: "~We must leave now.~"; default: return false; } Take: score = score + 5; remove morpheus; rtrue; ], has male proper; !====================== ! Props !====================== Prop phone "Telephone" with name "phone" "telephone", description "This is a telephone^.", found_in Apt101; !======================================= ! These are all of the rooms in the game !======================================= !------------------------------------------------------ !=============================== ! This is the Apartment 101 room !=============================== Room Apt101 "Apartment 101" with name "bedroom" "pad" "bedroom", description "^This is where you live. It is a studio apartment that seems overgrown with technology. Weed-like cables coil everywhere, spare parts and equipment lay open on the desk like an autopised corpse. It's not much of an apartment, but it has what you need most.^ To the west is the door.^To the north is the bathroom.^", w_to Hall101, n_to bathroom, cant_go "The only way out is the door.^", has ; !============================== ! Dynamic Objects for this room !============================== Object book "book" Apt101 with name "book", description "This title of this book is Simulation and Simulacra. Certain pages have been heavily read.^", after [; Open: "There is a disc hidden inside a special compartment.^^^"; ], has container openable; Object disc "Computer Disc" Apt101 with name "disc" "floppy" "CD" "media", description "This is the disc with certain codes on it.^", has ; Furniture computer "Hax0r Computer" Apt101 with name "computer", description "This is your workstation, your life blood. You use it to Hack.^", after [; Receive: "The disc has encrypted data on it, a readme file say's you should take it to the Bar.^^^"; Take, LetGo: "Your computer beeps.^^ Wake up NEO...^^ The Matrix Has you...^^ Follow the white rabbit...^^", score = score + 1; ], has container open ; Furniture Bookshelf "Old wood 2x4 bookshelf" Apt101 with name "shelf" "bookshelf" "bookcase" "shelf" "shelves", description "This is just a bookshelf you made from 2x4's.^", has ; !============================= ! Static objects for this room !============================= Object bed "An Uncomfortable Bed" Apt101 with name "bed", description "This is where you sleep. A hard uncomfortable mattress, with metal coil springs showing down by the feet. No wonder you stay up late.^", has static; ! need to make this on object of the bed, and only viewable after the bed is examined somehow. Object coils "Metal Springs" Apt101 with name "metal" "coils" "springs" "spring" "coil", description "These are metal coil springs that punch through the mattress, leaving a nice hole, A good hiding place for something. Like a cockroach!.^", has scenery; !------------------------------------------------------ !=============================== ! This is the Bathroom in the Apartment !=============================== Room Bathroom "Bathroom in the apartment" with name "bath" "bathroom", description "^This is your bathroom, needs cleaning, the pipes are also leaking. There is a small window cracked open, which lets in sunlight and rain.^", s_to Apt101, cant_go "You try climbing out the window, but you don't fit. Try the door.^", after [; Clean: "You scrub and scrub, you make the bathroom so clean your mother would be proud.^"; ], has ; !============================== ! Dynamic Objects for this room !============================== Object towel "Towel" bathroom with name "towel" "cloth", description "This is a towel, you should never be without it.^", after [; Take: "You feel lesss paniced now"; ], has ; [ CleanSub; "What curious ideas you have!"; ]; !------------------------------------------------------ !=============================== ! This is the Hall next to Apt 101 !=============================== Room Hall101 "Dim Hallway" with name "hall" "hallway", description "^This is a hall way, not very well lit. To your east is Apartment 101. To your west is a little old lady's apartment, to the north is another apartment. There are some stairs leading down to the street.^", d_to Outside101, n_to "A low grumbling voice yells out, go away...", s_to "You run into a crumbling wall, chips fall off.", e_to Apt101, w_to OldLady, has ; !------------------------------------------------------ !=============================== ! This is the Outside Old Ladys Apartment !=============================== Room OldLady "In front of Old Lady's Apartment" with name "lady" "old", description [; print "^You are standing in front of your neighbor's apartment, a little old lady.^"; if (garbage in OldLady) print "She would be pleased if you took the trash out."; ], e_to Hall101, cant_go "The only way out is the Hall to your east.^", has ; !============================== ! Dynamic Objects for this room !============================== Object garbage "trashbag of garbage" OldLady with name "garbage" "trash" "bag", description "This is a black plastic bag of the Old Lady's garbage, a bit smelly.^", has ; !=============================== ! This is the Outside your Apartment building !=============================== Room Outside101 "Outside the building to your apartment" with name "building" "outside", description "^Your standing outside your apartment building^Clouds are starting to roll in, looks like rain.^ To your West is an alley with garbage cans,^to your East is a street.", u_to Hall101, w_to GarbagePile, e_to Street1, has ; !------------------------------------------------------ !=============================== ! This is the Trashcan, where you put all your garbage, and the old lady's !=============================== Room GarbagePile "Garbage Cans" with name "garbage" "pile" "cans" "garbagepile" "garbagecan" "garbagecans", description "^This is a small alleyway with a few small tipped over garbage cans with trash scattered about.^", e_to Outside101, cant_go "The allyway is small a narrow, the only way out is to the East.", has ; !============================== ! Dynamic Objects for this room !============================ Object coin "coin" with name "coin" "quarter", description "This is a nice shiny quarter, just what you need to play a video game.^", has ; !============================= ! Static objects for this room !============================= FContainer garbagecan "Garbage Dumpster" GarbagePile with name "garbage" "trash" "can" "dumpster" "dump", description "This is a large rusted out, green dumpster, with the name 'City Waste' printed on it.^", after [; Receive: score = score + 1; move coin to GarbagePile; print_ret "A coin dropped out of the bag"; ], has open ; == !------------------------------------------------------ !=============================== ! This is the Street Container room !=============================== Room Street1 "Wells and Lake" with name "wells" "lake" "street1", description "^You are standing on the intersection of Wells and Lake.^ To the north in a back alley is a small BAR. ^To the West is your Apartment building.^ To the East is another street.^", e_to Street2, w_to Outside101, n_to Bar, has ; !------------------------------------------------------ !=============================== ! This is the Street Container room !=============================== Room Street2 "Franklin and Erie" with name "street", description "^You follow the street. This is an older part of town^with closed shops and cheap restrauants.^ To the north is your favorite noodle cafe.^To your south is a closed TV Repair shop.^ The street runs East and West.^", e_to Street3, w_to Street1, n_to Noodle, s_to TVRepair, has ; !------------------------------------------------------ !=============================== ! This is the Street Container room !=============================== Room Street3 "Chicago St." with name "street", description "^The street continues East and West.^A powerstation with a fence around it is to your south.^ A video arcade is to your north.^", e_to Street4, w_to Street2, n_to VideoArcade, s_to PowerStation, has ; !------------------------------------------------------ !=============================== ! This is the Street Container room !=============================== Room Street4 "Adams St. Bridge" with name "street" "bridge" "tunnel" "adams", description "^This part of the road goes under the Adams Street Bridge.^The road continues East and West^ There is a small back side street that leads North.", e_to Street5, w_to Street3, n_to Hotel, s_to "That way is blocked by some rubble.^", has ; !------------------------------------------------------ !=============================== ! This is the Street Container room !=============================== Room Street5 "DownTown" with name "street", description "^Your getting to the downtown area. There are people going from and to places, one can only imagine. There are many high rises around here.^", e_to Outside101, w_to Street4, has ; !------------------------------------------------------ !=============================== ! This is the Bar room !=============================== Room Bar "TRON bar and Lounge" with name "bar", description "^You see a sign that reads:^ ! TRON bar and Lounge !^^ The music in here is loud, it is crowed and smokey.", s_to Street1 , has ; !------------------------------------------------------ !=============================== ! This is the Noodle Cafe room !=============================== Room Noodle "Noodle Cafe" with name "cafe" "noodle" "noodles", description "^Umm, Good noodles.^", s_to Street2 , cant_go "The only exit is to the South.^" has ; !------------------------------------------------------ !=============================== ! This is the TV Repair room !=============================== Room TVRepair "TV Repair shop" with name "tv" "shop" "tvrepair", description "^This is an old TV repairman shop.^There is a sign falling over that says 'Closed for Repairs'^", n_to Street2, has ; !------------------------------------------------------ !=============================== ! This is the video arcade room !=============================== Room VideoArcade "Video Arcade" with name "video" "arcade", description "^ Great, just what you needed, a video arcade!^", s_to Street3, has ; !------------------------------------------------------ !=============================== ! This is the Power Sub Station room !=============================== Room PowerStation "A sub power station" with name "powerplant" "power" "station", description "^Some sort of Power Sub-Station.^Locked up nice and tight.", n_to Street3 , cant_go "The only exit is back North^", has ; !------------------------------------------------------ !=============================== ! This is the Hotel Layfayette room !=============================== Room Hotel "Hotel Layfayette" with name "hotel" "layfayette", description "^This is a deserted alley of a forgotten hotel.^Inside the hotel is a checkerd black and white tiled floor.^ Something that reminds you of Alice in Wonderland.^ Up the stairs are some rooms, one is labeled 1313", s_to Street4, u_to Room1313, has ; !------------------------------------------------------ !=============================== ! This is the 1313 room !=============================== Room Room1313 "Room 1313" with name "room" "1313", description "^This is a large room with decaying lace veiled windows.^ The room is worn down and abandoned.^There are two cracked, burgundy-leather chairs near a fireplace.^ The rain hits windows and drips down the sides.^Some thunder and lightning can be seen out the window.^", d_to Hotel, has ; !============================= ! Static objects for this room !============================= !Furniture chair1 "Burgendy Leather Chair" Room1313 ! with name "chair" "burgendy" "leather" "chair", ! description "This is a cracked burgendy leather chair, old but comfortable.^", ! has enterable; !============================== ! Dynamic Objects for this room !============================== Object redpill "Red Pill" with name "red" "redpill", description "This is the red pill.^", after [; Take: print "You pickup the Red Pill, you must eat it now...^"; score = score + 5; Eat: score = score + 5; print "You swallow the Red Pill.. End Game.^"; deadflag = 3; ], has edible; Object bluepill "Blue Pill" with name "blue" "bluepill", description "This is the blue pill.^", after [; Take: "You pickup the Blue Pill, you must eat it now...^"; Eat: print "You swallow the Blue Pill, you feel dizzy and faint...^"; print "^It's 9:18PM. You dozed off. You were up late hacking on your computer again, searching. Trying to find the answer. You know it's out there, if you could only find the code you could find out what The Matrix is!^^ You need to find a way out of The Matrix to Win.^"; remove morpheus; remove trinity; remove redpill; remove bluepill; score = 0; PlayerTo(Apt101); rtrue; ], has edible; !======================================== ! Routines [PhoneRings; print "You hear the phone ring.^"; ]; !======================================== ! Entry Point Routines [Initialise; location = Apt101; score = 0; lookmode = 2; move book to Bookshelf; move disc to book; move trinity to Bar; ! remove next live for release, just for testing. !move morpheus to Room1313; player.description = "You are wearing a black T-shirt and blue jeans."; TitlePage(); "^^^^^It's 9:18PM. You dozed off. You were up late hacking on your computer again, searching. Trying to find the answer. You know it's out there, if you could only find the code you could find out what The Matrix is!^^ You need to find a way out of The Matrix to Win.^^^"; ]; [ TitlePage i; @erase_window -1; print "^^^^^^^^^^^^^"; i = 0->23; if (i > 20) i = (i-20)/2; style bold; font off; spaces(i); print " Flip Side: A Matrix Adventure Game. By Patrick Kenny"; style roman; print "^^"; spaces(i); print "[Please press SPACE to begin.]^"; font on; box "What is the Matrix?" " Control!" "" "-- Morpheus, From the Land of the Real"; @read_char 1 -> i; @erase_window -1; ]; [ TalkSub; if (noun == player) print_ret "Nothing you hear surprises you."; if (RunLife(noun,##Talk) ~= false) return; ! consult life[; Talk: ] print_ret "At the moment, you can't think of anything to say."; ]; !========================================= Verb 'talk' 't//' 'converse' 'chat' 'gossip' * 'to'/'with' creature -> Talk * creature -> Talk; !========================================= ! Standard and Extended Grammer Include "Grammar";