!Dan Fick !Inform Text Adventure Game: Bad Night !CIS 487 Project 1 !10/17/2005 Constant Story "Bad Night"; Constant Headline "^Inform Text Adventure^by: Daniel Fick - 10/17/2005^"; Constant MAX_SCORE = 56; Include "Parser"; Include "VerbLib"; Include "Grammar"; !global variables to know if you have done various tasks yet Global PAID_PHONE = 0; Global ANSWERED_PHONE=0; Global MOTEL_PERMISSION=0; Global HAVE_MOTEL_KEY=0; Global KISSED=0; Global HAVE_KNIFE=0; Global ANSWERED_ED=0; !************************************************************ !Initialise game !************************************************************ [ Initialise; location = Dumpster; move penlight to player; print "^You have just inherited $100,000,000,000 and have been flashing^ your cash all over town, paying for everything from a big wad of^ hundreds from your pocket. You met two fine ladies at one of the^ clubs you visited tonight. They wanted to goto someplace more^ private. You take them back to your place in your limo. While in^ the limo one of the girls rubs you in the southern area of your^ body. She gets a suprised look upon her fase and remarks 'what have^ we here?' You kindly inform her that is just your pen flashlight.^ Once you are at your apartment the two girls say they need to freshen^ up. When the girls come back from the restroom they attack you. You^ are able to deflect their attacks...that is until the fire^ extinguisher connects with the back of your head.^^ This is where your story begins...^^^ You awake to the smell of rotting fish and a really bad headache.^"; ]; !************************************************************ !Places !************************************************************ Object penlight "Pen Flashlight" with name "penlight" "flashlight" "pen" "light", article "a", before [; Switchon: if(score==0){ score=score+4; } give self light; SwitchOff: give self ~light; ], has switchable ~on ~light; Object Dumpster "Dumpster, Directions = Up, Out" with description "You are face first in a dumpster. The smell is^ awful. This is not a place you wish to be for long.^", out_to DumpsterLid, has ~light; !Lobster tail can be used to get the whore's key, but the key can be obtained via a kiss as well !so the real purpose of the tail is 4 points from eatting it...or if you can't figure out the !whore is flirting with you and you should kiss her. Object -> lobsterTail "Half-Eaten Lobster Tail" with name "lobster" "tail" "lobstertail", article "a", before [; Eat: remove lobstertail; score=score+4; "That was great! Hard to believe it was garbage...wait^ i just ate garbage....eww...but it was good...yikes."; ], has edible scored; Object -> DumpsterLid "Dumpster Lid" with name "lid" "dumpster lid" "dumpster", when_closed "The dumpster lid is closed.", when_open "The dumpster lid is open.", door_to Alley, door_dir out_to, has static door openable ~open; Object Alley "Alley, Directions = East, West" with description "You are in a dirty NYC alley. You see a dumpster^ and a light on the alley wall. To the east you see^ some bums standing around a burning barrel. To the^ west you see nothing but darkness. You could always^ go back in that nice dumpster too.", in_to Dumpster, w_to Alley2, e_to Bums, has light; Object Alley2 "Alley, Directions = East, West" with description "You are in a dirty NYC alley. To the east you see^ an alley with a dumpster and a light in it. To the^ west you see a busy NYC street.", w_to Street, e_to Alley, has ~light; !useless but funny because the phone number is UMD's Object -> writing "writing on the wall" with name "writing" "wall", description "The writing on the wall reads: 'For a good time CALL (313)593-5000'", before [; Search: <>; ], has static; Object Bums "Alley, Directions = West" with description "You are in a dirty NYC alley. You see two bums standing^ around a burning barrel. The first is an old man, while^ the second is a semi-attractive young woman. The heat^ from the fire warms you. To the west you see an alley^ with a dumpster and a light in it.", w_to Alley, e_to Bums, has ~light; !purpose of this guy is to obtain the quarters from. this can be done by giving him your penlight Object -> Bum1 "Old Man" with description "An old man. From the looks of him he has not washed in^ many moons. He does not look friendly. I think he only^ has one eye. He is playing with two quarters. Perhaps^ you could persuade him to let you have them to call for^ help.", name "Old" "man" "grizzly", article "an", before [; Search, Look: <>; ], life [; Answer: "Go away young whipper snapper. I ain't got no^ time for your fiddle faddle."; Ask: switch (second){ 'quarter', 'quarters': "Are you outta your fuckin mind, boy?^ I should be asking you for money Mr. Fancy Pants."; 'food', 'tail', 'lobster': "You have food sonny boy? I'm starvin."; } "I don't know shit 'bout shit, boy."; Tell: "I ain't buyin what you sellin, boy."; Attack: deadflag=1; "You fuckin with the wrong dude. (The old man has a knife^ and stabs you repeadetly"; Kiss: deadflag=1; "What the fuck you doin, Boy? I kill you!!!(The old man^ has a knife and stabs you repeadetly"; Give: if(noun==lobsterTail){ remove lobsterTail; "The bum eats the lobster tail.^^ (I don't think that helped your cause, but it helped his...)"; } if(noun==penlight){ move quarters to player; remove penlight; "I don't need no fuckin handouts, boy. Here lemme give ya these^ here quarters."; } "There is a dumpster just over there, throw your own garbage away."; ], has animate; !this char is here to get the key from. this can be done by kissing her or giving her the lobster tail Object -> Bum2 "Young Woman" with description "After you get closer to the woman you notice that she isn't all^ that attractive (she has about three teeth in her mouth.)^ But, she seems friendly enough.", initial "You see a young woman. She says 'Hey you, why don't you come^ warm yourself up over by our fire?'", name "young" "woman" "attractive" "semi", article "a", before [; Search, Look: <>; ], life [; Answer: "Why don't you come closer to help me warm up?"; Ask: switch (second){ 'food', 'tail', 'lobster': "OMG I'm starving don't talk about food!"; 'fire': "I think i feel some sparks between us."; } "Tee hee, I don't know."; Tell: "Oh...Thats nice to know...Thank you."; Attack: remove self; "She screams and runs off down the alley. You scared her off."; Kiss: if(KISSED==0&&HAVE_MOTEL_KEY==0){ score=score+4; KISSED=1; give whoreKey ~concealed; HAVE_MOTEL_KEY=1; "I thought you would never ask big boy. When she leans over to^ kiss you a key falls out of her pocket. She jams her tounge down^ your throat. It taste like what you imagin maggotts taste like.^"; } "She sticks that nasty ass tounge down your throat again. What^ where you thinking kissing her AGAIN?"; Give: if(noun==lobsterTail){ remove lobsterTail; move whoreKey to player; HAVE_MOTEL_KEY=1; "The bum eats the lobster tail.^ That hit the spot, why don't you swing by this room later (she^ hands you a key) and hit the spot again if you know what i mean."; } "There is a dumpster just over there, throw your own garbage away."; ], has animate; !quarters used to try and make a phone call Object -> quarters "couple of dirty quarters" with name "quarter" "quarters" "change" has concealed scored; !key to the room upstairs in motel Object -> whoreKey "Key to sleezy motel" with name "key" "sleezy" "motel", has concealed scored; Object -> BurningBarrel "Burning Barrel" with name "burning" "barrel", article "a", before [; Search, Look: <>; ], description "It is a metal barrel with burning trash in it.", has static light; !if you already put the quarters in the phone, then the phone will be ringing Object Street "Street, Directions = North, South" with description [; if(PAID_PHONE==1){ "*RING* *RING* *RING*^^ You are standing on a NYC street. You see a pay phone and^ a street light nearby. The street runs north and south.^ The phone appears to be ringing...perhaps you should^ answer it."; } "You are standing on a NYC street. You see a pay phone and^ a street light nearby. The street runs north and south."; ], before [; Search: <>; ], e_to Alley2, n_to NorthStreet, s_to SouthStreet, has ~light; Object -> StreetLight "Street Light" with name "street" "streetlight", article "a", description "Finally you have found a proper light source. Your $3000^ suit is stained and covered in dirt. You look like a well dressed bum.", before [; Search, Look: <>; ], has static light; !phone. takes quarters, then starts ringing. after answered you are told the phrase to tell !Arnold at the motel to get upstairs Object -> PayPhone "Pay Phone" with name "phone" "pay", article "a", description "It is a pay phone. It takes 50 cents to make a call. It^ appears to be operational. Also there is an odd notice on it...'911 ^ calls are no longer free due to tax cutbacks'.^^ Great just your luck.", before [; Search, Look: <>; ], invent [; if (inventory_stage == 2 && PAID_PHONE==1&&ANSWERED_PHONE==0){ "(ringing)"; } if (inventory_stage == 2) { rtrue; } ], life [; Answer: if(PAID_PHONE==1&&ANSWERED_PHONE==0){ score=score+4; ANSWERED_PHONE=1; "Hiya honey. (you recognize the voice as that of the^ young woman from the alley.) I figured you would still^ be there. I am in the motel to the north come visit me^ and we'll see about getting you home in the morning.^ Tell Arnold, Betty is expecting you and he will let you^ in."; } "um...it's kind of pointless to answer a non-ringing phone..."; ], after[; Receive: if(noun==quarters){ score=score+4; remove quarters; remove Bum2; PAID_PHONE=1; "you hear your quarters fall to the coin collector in the phone.^ You do not hear a dial tone tho...and the coin return doesn't work.^ appearently the phone was not operational...guess you called that one^ wrong.^^*RING* *RING* *RING*"; } move noun to player; "That is designed to take coins only."; ], has static talkable container open; Object NorthStreet "Street, Directions = In, South" with description "You are standing on a NYC street. You see a street light^ nearby. You find yourself standing in front of a run down^ motel. The sign out front reads 'Arnie's Hump Palace'.^ You can go south down the street.", in_to Motel, s_to Street, has ~light; Object -> StreetLight1 "Street Light" with name "street" "streetlight", article "a", description "Finally you have found a proper light source. Your $3000^ suit is stained and covered in dirt. You look like a well dressed bum.", before [; Search, Look: <>; ], has static light; !motel. you cannot go upstairs until after you tell arnold about betty Object Motel "Arnies Hump Palace, Directions = Up, Out" with description "You find yourself standing in quite possibly the most discusting^ location you have been in all night (including the dumpser). At the^ counter you see a very large man. To your left you see some stairs^ leading up to what you presume are 'rooms'. And behind you is the^ way out of this place.", u_to [; if(MOTEL_PERMISSION==1){ return MotelHall; } "You start to go up the stairs when Arnold yells at you that only^ paying customers may go up there. (You assume if you continue it^ will have negative effects on your health.)"; ], out_to NorthStreet, has light; !arnold. killer. just tell him about betty Object -> Arnold "Arnold" with description "Once you approach this giant you notice he is wearing a 'gold'^ necklace that reads 'Arnie'.", initial "A LARGE man stands behind the counter looking most unpleasent.^ Uh, oh. I think he has noticed you. He shouts 'HEY BUDDDY! You^ just gonna stand there all day?", name "Arnold" "large" "man" "Arnie", before [; Search, Look: <>; ], life [; Answer: if(noun=='no'){ "Then what do you want? Be quick about it i got^ things to do and people to beat."; } if(noun=='yes'){ deadflag=1; "Oh a smartass! I'm gonna beat ya to a pulp"; } Ask: switch (second){ 'room': "Yeah we got rooms if you got money."; 'help': "This ain't no church, beat it buddy. Before i beat you."; } "I don't know. Stop bothering me before you piss me off anymore."; Tell: switch (second){ 'Betty': if(MOTEL_PERMISSION==0){ score=score+4; MOTEL_PERMISSION=1; "Ah your the...man...Betty was telling me 'bout. Go on up."; } } "I don't want to hear it."; Attack: deadflag=1; "You are a fool. He pounds you to dust."; ], has proper animate; Object MotelHall "Arnies Hump Palace, Directions = East, Down" with description "You are upstairs. There is the Door to the room at the end of the hall^ to the east. The decor of the hallway leaves much to be desired.", e_to MotelRoomDoor, d_to Motel, has light; Object -> MotelRoomDoor "Motel Room Door" with name "door", description "The door seems pretty sturdy. I hope you have a key for^ this thing.", when_closed "The door is closed.", when_open "The door is open.", door_to MotelRoom, door_dir e_to, with_key whoreKey, has static door openable ~open lockable locked; !room with no exit Object MotelRoom "Arnies Hump Palace, Directions = TRAPPED!!!" with description "You open the door and step into the room. You see Betty^ sitting on the bed on the far side of the room. You take^ another step toward her when the door suddenly slams shut.^ Arnold is standing behind you now.", has light; !this arnold is just here for show Object -> Arnold2 "Arnold" with description "Once you approach this giant you notice he is wearing a 'gold'^ necklace that reads 'Arnie'.", initial "Arnold is just standing there with a grin on his face.", name "Arnold" "large" "man", before [; Search, Look: <>; ], life [; Answer: "don't tell me. Tell her."; Ask: "I don't know. Stop bothering me before you piss me off anymore."; Tell: "I could care less what you have to say."; Attack: "Don't even think it."; ], has proper animate; !betty. She wants you to marry her. say yes or no to her. yes will result in death, no will !result in being dumped in a dumpster again...hate when that happens Object -> Betty "Betty" with description "After you get closer to the woman you notice that she isn't all^ that attractive (she has about three teeth in her mouth.)^ But, she seems friendly enough.", initial "Betty comes over to you and explains 'I know you are the^ guy that inherited the $100 billion. You are going to marry^ me and give me the good life...and my friends here probably^ deserve to be compensated as well...or....^ So...What is your answer?", name "Betty", before [; Search, Look: <>; ], life [; Answer: if(noun=='no'){ score=score+4; PlayerTo(DumpsterAgain); } if(noun=='yes'||noun=='ok'){ deadflag=1; "Nice try but playing it safe never wins the day. You were naive^ to believe they would settle for HALF your money...^ when it's so easy to take ALL your money...if you die...^ Sorry."; } Ask: "Answer my question first."; Tell: switch (second){ 'yes', 'ok', 'marry': deadflag=1; "Nice try but playing it safe never wins the day. You were naive^ to believe they would settle for HALF your money...^ when it's so easy to take ALL your money...if you die...^ Sorry."; 'no', 'fuck you': score=score+4; PlayerTo(DumpsterAgain); } "I don't want to hear it."; Attack: "Don't make us kill you."; Kiss: "Sorry sweetie i am not interested in that anymore."; Give: "The only thing you have that i want is your bank account."; ], has proper animate; Object SouthStreet "Street, Directions = North, In" with description "You are standing on a NYC street. You see a street light^ nearby. There is also a taxi parked along the side of the^ street. You can go north down the street.", n_to Street, in_to TaxiDoor, has ~light; Object -> StreetLight2 "Street Light" with name "street" "streetlight", article "a", description "Finally you have found a proper light source. Your $3000^ suit is stained and covered in dirt. You look like a well dressed bum. It is easy to get lost...all these streets look the same.", before [; Search, Look: <>; ], has static light; Object -> TaxiDoor "Taxi Door" with name "door" "taxi", description "It's a yellow car door.", when_closed "Door is closed.", when_open "The door is open.", door_to Taxi, door_dir in_to, has static door openable ~open; !The whole taxi scene really serves no purpose except to lead the user off in the wrong direction Object -> uselessTaxi "Taxi" with name "taxi", description "It is a yellow checkered taxi cab.", before [; Search, Look: <>; ], has static light; Object Taxi "Taxi, Directions = Out" with description "The Inside of the taxi is dirty, but has the strong odor of^ pine. You can see the taxi driver through the sliding car divider.^", out_to SouthStreet, has light; !again, he is useless... Object -> Driver "Taxi Driver" with initial "Hello sir. It looks like you are having one hell of a night. I^ almost mistook you for a vagrant. Do you have money?", name "driver" "man" "woman", before [; Search, Look: <>; ], life [; Answer: if(noun=='no'){ "^Sir i do not provide free rides for vagr...wait a minute i know you!^ You are in newspaper. You are rich. I take you to ATM so you can get^ money to pay me.^ You explain to the driver your wallet is gone and you have no atm card.^ The driver then proceeds to tell you to get the fuck out of her car."; } if(noun=='yes'){ "Let me see it before i take you anywhere. Thats what i thought.^ No free rides."; } "Money? Yes or no?"; ], has proper animate; !dumpser betty and arnold dump you into Object DumpsterAgain "Dumpster, Directions = Up" with description "Betty: I'm sorry to hear that.^ Arnold hits you over the back of the head. You are knocked out cold.^^ You awake to find:^ You are face first in a dumpster. The smell is^ awful. This is not a place you wish to be for long.^^ Deja vu.^ This is turning out to be one crappy night if i do say so myself.", out_to AlleyAgain, has light; !knife is needed to win the game, but be careful with it as it can be taken by the police Object -> knife "Long Rusty Knife" with name "knife" "long" "rusty", description "The knife looks like it has dried blood on it...perhaps it was used^ to kill someone or something.", article "a", before [; Search, Look: <>; Take: HAVE_KNIFE=1; Drop: HAVE_KNIFE=0; ], has scored; Object AlleyAgain "Alley, Directions = South" with description "You are in a dirty NYC alley. You see a dumpster^ and a light on the alley wall. To the south you see^ a familiar building.", in_to DumpsterAgain, s_to ApartmentBuildingStreet, has light; Object ApartmentBuildingStreet "Street, Directions = North, In" with description "You are standing on a NYC street. You see a street light^ nearby. You are standing in front of your apartment building.^ Things seem to be looking up for you now.", in_to ApartmentBuilding, n_to AlleyAgain, has ~light; Object -> StreetLightApt "Street Light" with name "street" "streetlight", article "a", description "Finally you have found a proper light source. Your $3000^ suit is stained and covered in dirt. You look like a well dressed bum. It is easy to get lost...all these streets look the same.", before [; Search, Look: <>; ], has static light; !apartment building lobby, leads to your apartment. you must answer Ed before you can go up Object ApartmentBuilding "Your Apartment Building, Directions = Up, Out" with description "As you come toward the door the security guard for your building comes^ rushing out to help you.", u_to [; if(ANSWERED_ED==1){ return Apartment; } "Ed: Excuse me sir, could you answer me before you go upstairs?"; ], out_to ApartmentBuildingStreet, has light; !Ed. Ed will need a yes or no to the police. if you answer yes and have the knife they will take it. !if the police take your knife its as good as killing you b/c you cannot win anylonger Object -> guard "Ed the Security Guard" with description "Ed the security guard for your aparartment building. He is a nice man^ A bit of a worry wort though.", initial "Security Guard: What happened to you? Did you get robbed, sir?^ Shall i call the police?", name "Ed" "large" "security" "guard", before [; Search, Look: <>; ], life [; Answer: if(noun=='no'&&ANSWERED_ED==0){ ANSWERED_ED=1; "That's ok Ed. I think i will just goto bed and forget about this^ dreadful night.^ Ed: Ok boss."; } if(noun=='yes'&&HAVE_KNIFE==0&&ANSWERED_ED==0){ ANSWERED_ED=1; "You wait in the lobby for the police to come. When they arrive^ they take your statement and tell you they will contact you if^ they have any leads. (You are not expecting a reply from them.)"; } if(noun=='yes'&&HAVE_KNIFE==1&&ANSWERED_ED==0){ ANSWERED_ED=1; remove knife; HAVE_KNIFE=0; "You wait in the lobby for the police to come. When they arrive^ they start to take your statement when one of the officers notices^ the bloody knife you have tucked in your pants.^ You tell him you found it in the alley. He says he believes you^ but will need to confiscate it for evidence. You agree, not wanting^ anymore trouble on this dreadful night."; } Attack: deadflag=1; "Sir have you gone mad? Ed shoots you before you even get close."; ], has proper animate; Object Apartment "Your Apartment, Directions = Out" with description "Ah your beautiful apartment. There is no place like home. You head toward the bedroom^ when you hear some noise coming from your office. You head toward your office to investigate^ When you reach your office you cannot believe your eyes. Those bitches are STILL HERE.", out_to ApartmentBuilding, d_to ApartmentBuilding, has light; !the girls that dumped you in the first dumpster. They just want to fight. if you have the knife you win. if not... Object -> girls "The two girls from earlier" with description "The two sexy women that you brought back here to have some fun with until they went^ all psycho on you. Damn they are sexy though...", initial "Two women: Holy shit, we thought you were dead. Guess we'll have to do a better job^ this time.", name "girls" "bitches" "women" "woman" "girl" "bitch" "two", before [; Search, Look: <>; ], life [; Answer: if(noun=='what'){ "Your money of course. Where is it?^ You respond simpiliy...'umm...in the bank bitch. You think i'm going^ to store all that money in my apartment?"; } "You try talking but they just want to get to the killing."; Attack: if(HAVE_KNIFE==1){ score=score+16; deadflag=2; "You swing your knife at the first woman and catch her in the throat.^ Blood starts pumping out of her throat. The second woman stabs you in^ the shoulder with your letter opener from your desk. This throws you^ into a blind rage and when all is said and done the second woman gets^ stabbed a dozen or so times. (She was also the one that hit you with^ that damn fire extinguisher.)^^ The police rule that it was self defense. Your night from hell is over. You have survived it. Others may not have been so lucky but your skills^ are great. You enjoy the rest of your luxurious life sipping margaritas^ on the beach...far far away from New York City."; } deadflag=1; "The first bitch jumps on you and starts clawing at your face. While she is on^ you the second grabs the letter opener off your desk and starts stabbing you in^ the midsection. You don't die quickly and instead lay there bleeding while those^ bitches rob your apartment of anything and everything they can carry."; ], has proper animate;