Constant Story "Master Thief"; Constant Headline "^An Interactive Fiction^by Brian Rodriguez^"; Constant DEBUG; Constant MAX_SCORE = 54; Include "parser"; Include "verblib"; Include "grammar"; Global loc = 1; Attribute edge; Attribute dusty; !***************************************************************************************Classes !For every destination: !destination object under the car object !code in the car's out_to routine !code in the verb DriveSub Class destination with before [; Take: print "Try driving there. "; ], has static scenery; Class case with before [; Open: if(comp has general){ print "You notice a light where the glass meets its stand. There seems to be some kind of security system."; rtrue; } ], name "glass" "case" "pedestal", with_key mKey, !description "A pedestal, with a glass case affixed on top." has static scenery container openable transparent lockable locked concealed ; !*******************************************************************************************Locations !**********************HOME object homeLR "Living Room" with description "It's your base of operations. Your garage is east of here.", e_to homeG, has light; object homeG "Garage" !loc 1 with description "It's your garage. Your living room is west of here.",! Your car is parked here.", w_to homeLR, in_to carA, has; !**********************RICH HOUSE object richFront "Outside Rich Man's House" !loc 4 with description "You're standing in a neatly trimmed lawn, outside a three-story house lined with ivy.", in_to carA, has light; !**********************BANK object bankFront "Bank Parking Lot" !loc 3 with description "In the parking lot east of a bank. There's an ATM, of course.", in_to carA, has light; object -> bankLot "Parking Lot" with name "Parking" "Lot" "ground" "floor", description "Wet. Dirty. Oily.", has static scenery; object -> atm "ATM" with name "ATM" "Automatic" "Teller" "Machine", description "You aren't interested in acquiring any money legally.", has static scenery; !**********************MUSEUM object museumFront "Museum Parking Lot" !loc 2 with description "In the parking lot south of a dignified building in the neo-classical style.",! Your car is parked here.", in_to carA, n_to mWindow, has light; object -> mkLot "Parking Lot" with name "Parking" "Lot" "ground" "floor", description "Wet. Dirty. Oily.", has static scenery; object -> mWindow "Window" with description "The windows can't be opened as long as the iron grates block them.", name "window", when_closed "The windows open by tilting them to the outside.", when_open "A window invitingly hangs open.", door_to museumLobby, door_dir n_to, has static door concealed; Object -> mDoor "Front Door" with description "It's just a big ol' door.", name 'door' 'massive' 'big' , when_closed "The front door is locked, chained, and barred.", when_open "It's open.", door_to museumLobby, door_dir n_to, has static door openable lockable locked; object museumLobby "Museum Lobby" with description "Under a towering diplodocus skeleton, in a column-lined hall stretching to the north. You see many glass cases containing items of historical interest, and in the far end of the hall, can just barely make out a pack of velociraptor skeletons. You entered the museum from the south, and are near some doors on the east and west.", s_to museumFront, e_to mEast, w_to mWest, u_to diplo, has ; case -> gc1 "first Glass Case" with name "1" "one" "first", has; case -> gc2 "second Glass Case" with name "2" "two" "second", has; case -> gc3 "third Glass Case" with name "3" "three" "third", has; case -> gc4 "fourth Glass Case" with name "4" "for" "fourth", has; object -> cases "Glass Cases" with name "Glass" "Case" "Cases", description "There are 4 of them. To examine a specific one, try:^ x case 1^ x case 4", before [; Unlock: if(mKey in player){ print "You unlock all the cases."; give gc1 ~locked; give gc2 ~locked; give gc3 ~locked; give gc4 ~locked; rtrue; } ], has static scenery; object -> diplo "Diplodocus Skeleton" with name "Diplodocus" "diplo" "fossil" "skeleton", description "It's just you and the big guy.", before [; Take: print "Yes, it's valuable, but..."; Climb: print "You climb up the bones of the long dead animal."; PlayerTo(diploHead); rtrue; ], door_to diploHead, door_dir u_to, has static scenery door open; object -> column "Column" with name "Column", description "These columns are styled in the Corinthian order. They're not important.", has static scenery; object diploHead "Diplodocus Skull" with description "You can touch the ceiling from up here.", d_to museumLobby, has ; object mWest "Curator's Office" with description "This tiny office is cluttered with history-related paraphanalia.", e_to museumLobby, has ; object mEast "Security Office" with description "This tiny office features a computer awaiting a login, and a wall of TV's showing various places in the museum.", w_to museumLobby, has; object -> comp "Security Computer" with name "Security" "Computer" "PC", description "It's protected with a fingerprint scanner.", has static scenery light general; object -> scanner "Fingerprint Scanner" with name "fingerprint" "scanner" "sensor", description "Whoever used it last left a greasy handprint here.", has static scenery; object -> tv "TV" with name "TV" "television" "surveillance" "wall", description"Looks like they never dust the diplodocus.", has static scenery light; !**********************CAR object carA "Car" with name "car", initial "Your car is parked here.", with description "Just a car.", before [; Enter: print "Just type 'enter'"; rtrue; ], out_to [; print "You get out of the car."; if (loc == 4) PlayerTo(richFront); if (loc == 3) PlayerTo(bankFront); if (loc == 2) PlayerTo(museumFront); if (loc == 1) PlayerTo(homeG); rtrue; ], has light static ; destination -> destMuseum "Museum" with name "museum" "m"; destination -> destHome "Home" with name "home" "garage"; destination -> destBank "Bank" with name "bank" "comerica"; destination -> destRichHouse "Rich Man's House" with name "Rich" "Mans" "House"; !***************************************************************************************Initilization [ Initialise; location = homeLR; move carA to homeG; print"^^^You are a master thief. Try to 'get' as many valuable items as you can. When you are done, return to the starting location and type 'done'.^^^"; ]; !***********************************************************************************************Items Object note "note" carA with name "sticky" "note", initial "A sticky note is ... sticking to ... the dashboard.", description "Places to 'drive to':^ museum^ home^ ", has; Object box "box" with name "box", initial "You see a box.", description "What could be in it?", has enterable container openable; Object wallet "Wallet" homeLR with name "umd" "leather" "wallet", initial "A wallet lies on the table here.", description "A leather wallet empressed with the U of M - D seal.", has container openable; object battery "9v battery" homeLR with name "9v battery" "battery" "9v" "9volt", description "It's rectangular!", has; object goldStatue "Golden Elephant Statue" gc4 with name "Gold" "golden" "elephant" "Statue", description "This figurine was found in India. Don't pocket size elephant's look cute?"; object scarabPendant "Scarab Pendant" gc3 with name "cursed" "egyptian" "scarab" "pendant", description "Found in an Egyptian mummy's tomb, this pendant shaped like a scarab beetle is said to bestow a curse apon whoever possesses it.",; object woodStatue "Tiny wooden statue" gc2 with name "tiny" "wood" "wooden" "statue" "fat" "woman", description "It looks like a horribly obese woman.",; object dustA "Dust" diploHead with name "dust", description "... ", has dusty; object creditCard "Credit Card" wallet with name "Card" "Credit" "cc", description "... ", has edge; object ironGrate "Iron Grate" museumFront with name "iron" "grate" "grates" "porticullis", initial "The windows are blocked by iron grates, screwed into the stone museum wall.", description "It looks like it should be protecting a castle, except it's small enough that you can easily carry it.", after [; Take: give mWindow ~concealed; give mWindow openable; ] has static; object mKey "Key" mWest with name "key" "Museum Key", description "It's marked with some numbers. ", has; object lightbulb "lightbulb" homeG with name "lightbulb" "light" "bulb", initial "A bare electric light hangs from the ceiling, illuminating this room", description "You look at this electric lightbulb for a while, but you don't get any ideas.", before [; Take: give self ~light; move lightbulb to player; "You unscrew the lightbulb - and it goes out."; ] has light; object lightbulb_lit "lightbulb & 9v battery" with name "lightbulb" "light" "bulb" "9v battery" "battery" "9v" "9volt" "flashlight", description "A lightbulb powered by a 9v battery", has light; !***********************************************************************************************Verbs verb 'drive' * 'to' noun -> drive; extend 'drive' * noun -> drive; [DriveSub; if (player in carA){ if (noun == destHome){ print "You drive home."; move carA to homeG; loc = 1; } else if (noun == destMuseum){ print "You go to the museum."; move carA to museumFront; loc = 2; } else if (noun == destBank){ print "You drive to the bank."; move carA to bankFront; loc = 3; } else if (noun == destRichHouse){ print "You drive to a wealthy home you've been casing for a while."; move carA to richFront; loc = 4; } else print "You can't drive there."; } else print "You have to be inside a vehicle to drive somewhere."; ]; Verb 'dissassemble''disassemble''disemble' * noun -> disassemble; Extend 'take' * 'apart' noun -> disassemble; [DisassembleSub; if (noun == lightbulb_lit){ remove lightbulb_lit; move lightbulb to player; move battery to player; print "You remove the batttery and the lightbulb goes out."; } else print "You can't take it apart."; ]; Verb 'use' *noun -> use; [UseSub; if (location == museumFront){ if (noun has edge){ print "you use the edge of your ", (name) noun, " to unscrew the iron grate."; give ironGrate ~static; } } else if (location == mEast){ if (noun has dusty){ print "Noticing that the previous user of this computer left fingerprints on the scanner due to his greasy hand, you sprinkle your ", (name) noun, " over his handprint. You blow away the ", (name) noun, " which failed to stick to the grease. You cover the scanner with the edge of your shirt, and lightly press down. The computer accepts it as the previous user. Once logged in, you deactivate the museum security."; !this is from Macgyver give comp ~general; remove noun; } } else print "You can't use that here."; ]; Verb 'combine''make''mix' * noun 'with'/'in' noun -> mix; extend 'use' * noun 'with'/'in' noun -> mix; [MixSub; if (noun == battery){ if (second == lightbulb){ remove battery; remove lightbulb; move lightbulb_lit to player; print "You bring the two together and the bulb lights up!"; } else print "It doesn't work. Nice try."; } if (noun == lightbulb){ if (second == battery){ remove battery; remove lightbulb; move lightbulb_lit to player; print "You bring the two together and the bulb lights up!"; } else print "It doesn't work. Nice try."; } else print "You can't combine that object with any other object."; ]; verb 'done''finish' * ->done; [DoneSub; if (location == homeLR){ print "Are you really done? "; if ( YesOrNo() ){ print "counting your score"; if(woodStatue in player){print "^Wood Statue: $9"; score = score + 9;} if(goldStatue in player){print "^Gold Statue: $65"; score = score + 45;} if(scarabPendant in player){print "^Scarab Pendant: $25"; score = score + 25; print "^Sadly, you are cursed by the Scarab Pendant. minus $50"; score = score -50; } deadflag = 2; } } else print "You have to be in your living room to finish the game."; ];