! _______________________________________ ! | Shamil Hadi | ! | Project: Assignment 2 Fall 2005 | ! | CIS 487 | ! | Due: 10/17/2005 | ! | Description:"Ali and his Search for his Father" | ! |______________________________________| ! ! ! ! How To Compile & Run: ! d: ! cd \inform ! d:\inform\inform tvdoh.inf ! d:\inform\winFrotz\Frotz tvdoh.z5 ! ! Objects always begin with capital letters, and for compound names, ! the first letter of each word is capitalized. ! ! I use the variable "general" to indicate when puzzles are solved. ! I always give "general" to the object directly involved with the puzzle. ! For example, if one puzzle is to read a tabloid NewsPaper, I give ! the NewsPaper "general" when the player types "read NewsPaper" ! ! ! For each door, I declare it twice. For example, if there is a door ! between room A and room B, I declare 2 objects representing doors: ! A_B and B_A. By opening one, the other corresponding door on the other ! side is automatically opened to ensure consistency. !------------------------------------------------------------ Constant Story "Ali and his Search for his Father"; Constant Headline "^An Interactive Fiction Story^ Copyright (c) 2005 by Shamel Hadi.^"; !---------------------------------------------INCLUDES Include "Parser"; Include "VerbLib"; Include "Grammar"; !---------------------------------------------HIDDEN OBJECTS ! These are objects that are created or given to the player ! during the course of the game. They are not present in any ! existing room, but are put into the players possession. !********Pizza ! Given to the player when he/she "makes a Pizza " using the ! Getting the pizza from the store. Object Pizza "Cheese and Green Peppers Pizza" has edible absent with name "Pizza ", description "Just like his father, Ali loves a good Slice of Pizza!", before [; ! Do not allow player to eat Pizza Eat: "You're not hungry...you've already eaten one Slice Pizza."; ]; !********Money ! Given to the player at the beginning of the game Object Money "couple bucks" has absent with name "money" "dollar" "dollars" "bill" "bills", description "You only have a couple dollars to your name"; !********Ticket ! Given to the player by the admissions woman at the ZOO after the ! player presents his ID card to her. Object Ticket "ticket to the ZOO" has absent with name "ticket" "pass" "ZOO" "admission", description "ZOO: admit one"; !---------------------------------------------VERBS ! _____________LivingRoom ! Contains: ! Door to kitchen ! Door to street ! Table ! Membership card Object LivingRoom "Family Living Room" with name "living" "family" "room", description "It is my parents apartment and it isn't much to look at, but you I call it home. The apartment is modestly furnished and poorly decorated.", s_to LivingRoom_Street, e_ZOO; !________________LivingRoom_Street (door) Object -> LivingRoom_Street "front door leading to the street" has static door openable with name "door" "front" "apartment" "street", description "It's just your front door leading to the street outside.", before [; Go: ! Verify that the door is open if (self hasnt open) { "You might want to open it first."; } ], ! Open the corresponding inverse door after [; Open: give Street_LivingRoom open; Close: give Street_LivingRoom ~open; ], when_open "Your front door is open", when_closed "Your front door is closed", door_to Street, door_dir s_to; !____________Table Object -> Table "Coffee Table" ! general if you've taken the membership card has static supporter with name "table" "coffee", initial "A coffee table sits in the center of the room, cluttered with all of the family junk.", description "Lots of junk here...", after [; Examine: ! See if player has already examined the coffee table if (self hasnt general) { ! Reveal membership card give MembershipCard ~concealed; "Hey, there's the membership ID card that you lost!"; } else { "Nothing worth taking."; } ]; !______________MembershipCard Object -> MembershipCard "membership Card" has concealed with name "ID" "card" "membership", initial "Your ZOO membership card sit on the coffee table.", description "It reads: Worlds biggest ZOO! – VIP member, enter at anytime of the year.", after [; Take: ! Solve coffee table puzzle give table general; "You slip the card into your wallet."; Drop: "You put the card down."; ]; !_______________Street ! Contains: ! Door to living room ! Door to store ! Door to ZOO ! Door to gas station Object Street "Street Outside the Apartment" with name "apartment" "street" "front", description "Your Parents apartment is in the center of downtown Detroit. The street heads in all directions; there are plenty of places you can walk to from here.", n_to Street_LivingRoom, w_to Street_Store, e_to Street_ZOO, s_to Street_GasStation; !_________Street_LivingRoom (door) Object -> Street_LivingRoom "front door leading to your apartment" has static door openable with name "door" "front" "apartment" "street", description "It's just the front door to your crummy apartment.", ! Open the corresponding inverse door after [; Open: give LivingRoom_Street open; Close: give LivingRoom_Street ~open; ], when_open "Your front door is open (don't forget you are in Detroit and you leave the door open!).", when_closed "The door to your apartment is closed.", door_to LivingRoom, door_dir n_to; !_________Street_Store (path) Object -> Street_Store " sidewalk running from your apartment to the grocery store" has static door open with name "path" "sidewalk" "store", description "The durty and cracked sidewalk runs westward down the street and ends at the local grocery store,be careful there are a lot of rubers are waiting for you.But i know you don't care!", door_to Store, door_dir w_to; !___________Street_ZOO (path) Object -> Street_ZOO "sidewalk running from your apartment to ZOO" has static door open with name "path" "sidewalk" "ZOO", description "To the east where monkeys dance, and eat bananas - ZOO", door_to [; ! Verify that gas station attendant puzzle has been solved if (Attendant hasnt general) { "You've been there a million times before...you don't need to go there now."; } else { return ZOO; } ], door_dir e_to; !__________Street_GasStation (path) Object -> Street_GasStation "sidewalk running from your apartment to the local gas station" has static door open with name "path" "sidewalk" "gas" "station", description "You look to the south and see a gas station at the end of the sidewalk.", door_to [; ! Verify that NewsPaper puzzle has been solved if (NewsPaper hasnt general) { "Hmmmm...Can’t Drive yet, and you want to go to a gas station? You're not THAT bored!"; } else { return GasStation; } ], door_dir s_to; !___________Store ! Contains: ! Door to street ! Clerk ! Aisle 1 ! Pizza ! Cereal ! Aisle 2 ! Banana ! Vegetables ! Aisle 3 ! Milk ! Cheese Object Store "Habibes Grocery Store and Market" with name "parkers" "grocery" "store" "market", description "Parkers grocery store has been around as long as you can remember. It's a small, neatly kept establishment. It's just large enough that you can shop here without the need to go to the new 'Grocery World' chain down the street to get your groceries. Plus, they let you buy on credit here!", e_to Store_Street; !__________Store_Street (door) Object -> Store_Street "sidewalk running from the grocery store to your apartment" has static door open with name "path" "sidewalk" "apartment", description "The cracked sidewalk runs eastward down the street and ends at your apartment.", door_to Street, door_dir e_to; !_____________Clerk Object -> Clerk "old store clerk sitting behind the counter" ! general if he has been paid has static animate male with name "clerk" "store" "old" "man" "guy" "cashier", description "The old man sits quietly behind the counter reading a newspaper. He seems to care less about anything except his reading material.", life [; Answer: "The clerk grumbles something and goes back to his paper."; Tell: "Do you really think he cares?"; Attack, Kiss: "Um, security, please report to the front desk!"; Show, Give: "He doesn't care."; ]; !___________StoreCounter Object -> StoreCounter "old-fashioned checkout counter" has static supporter with name "counter" "checkout" "oak" "old" "fashioned", description "The counter is made out of wood and very old, just like everything else in the store. It has the typical checkout counter items such as candy, gum, etc. But it is the flashy tabloid NewsPaper that catches your eye.", before [; Climb: ! Prevent player from climbing on counter "You shouldn't do that."; ]; !___________NewsPaper Object -> NewsPaper "typical tabloid: The National Rumor" has concealed with name "NewsPaper" "tabloid" "national" "rumor", description "Fine American literature - aliens, and other sorted tales. You know most of this stuff is garbage, but you love it anyway!", after [; Examine: ! Solve NewsPaper puzzle give self general; "Lets see...Gas Station Attendant Sights a man locked up in the cage of monkey in the ZOO. You pour through the article which describes a local Detroit gas station attendant who claims that he saw the man. Wow, that's right near your house; Can it be your father? (Hint)!"; ]; !__________Aisle1 Object -> Aisle1 "aisle containing dry goods" has static supporter with name "aisle" "first" "1" "one" "dry" "goods", description "This aisle has many items, particularly dry goods, and ready food such as cereal, and Pizza."; !___________HOTPizza Object -> -> HOTPizza "Pizza Box" has concealed edible with name "Box" "of" "Pizza", description "Habibes Extra tasty Pizza.", before [; Eat: ! Prevent player from eating "Too Hot!"; ]; !___________Cereal Object -> -> Cereal "box of cereal" has static concealed with name "box" "of" "cereal" "super" " Chocolaty" "marshmallow" "chocolate" "squares", description "Super-Chocolaty marshmallow chocolate squares: Part of this complete balanced breakfast!", before [; Take: ! Prevent player from taking "Do you know how much sugar is in there? No thanks!"; ]; !__________Aisle2 Object -> Aisle2 "produce aisle" has static supporter with name "aisle" "second" "2" "two" "produce" "fruit" "vegetables", description "This aisle is full of produce: bananas, as well as assorted vegetables."; !__________Banana Object -> Banana "bunch of ripe bananas" has concealed with name "banana" "bananas" "ripe" "bunch", description "You love bananas! These are perfectly ripe too.", before [; Eat: ! Prevent player from eating "I just had a bunch of them!"; ]; !__________Vegetables Object -> Vegetables "vegetables of many variety" has static concealed with name "vegetable" "vegetables", description "Just your everyday veggies.", before [; Take: ! Prevent player from taking "In general, you try not to eat a healthy diet consisting of any kind of vegetables."; ]; !___________Aisle3 Object -> Aisle3 "dairy aisle" has static supporter with name "aisle" "3" "three" "dairy", description "This cold aisle contains dairy products such as milk, and cheese."; !___________Milk Object -> Milk "carton of milk" has static concealed edible with name "carton" "of" "milk", description "Just a standard carton of milk", before [; Take: ! Prevent player from taking "Nah, you're still feeling queasy after smelling the stale milk in your fridge."; ]; !___________Cheese Object -> Cheese "block of cheese" has static concealed edible with name "block" "of" "cheese", description "Cheddar.", before [; Take: ! Prevent player from taking "You're allergic to cheese!"; ]; !__________GASSTATION ! Contains: ! Door to street Object GasStation "24 hour Gas Station" with name "gas" "station" "24" "hour", description "This crummy gas station, like most buildings in this town, has been around for quite some time. Since you don't own a car, you usually don't have a need to be here.", n_to Street; !__________GasStation_Street (door) Object -> GasStation_Street "sidewalk running from the gas station to your apartment" has static door open with name "path" "sidewalk" "apartment", description "The sidewalk runs north towards your apartment.", door_to Street, door_dir n_to; !__________Attendant Object -> Attendant "middle aged gas station attendant" has static animate male with name "attendant" "gas" "station" "man" "cashier", description [; print "The man just stands quietly at the cash register chewing on a tooth pick and listening to headphones...he's definitely not the brightest crayon in the box. He glances over at you, but doesn't say anything."; if (NewsPaper has general) { "You wonder if this is the man from the NewsPaper article..."; } ], life [; Answer: "He can't hear you with those headphones on."; Tell: "He's busy listening to the radio...do you really think he cares?"; Attack, Kiss: "He's probably got a gun behind the counter...not a good idea."; Show, Give: ! Make sure the player is giving the attendant the NewsPaper if (noun==NewsPaper) { ! Only give him the NewsPaper if the player has solved the puzzle by reading the article if (NewsPaper hasnt general) { "Why would you want to do that?"; } else { ! Solve attendant puzzle give Attendant general; ! Remove NewsPaper from game remove NewsPaper; "Now you've got his attention! He excitedly grabs the Newspaper from your hand and quickly reads the article about the man locked up in the monkey cages, and he says, that he saw him their yesterday, getting beat up by a gang of monkeys."; } } else { "He doesn't care."; } ]; !__________________ZOO ! Contains: ! Door to street ! Door to Cage ! Ticket taker Object ZOO "ZOO" with name "ZOO" "courtyard", description "Monkeys home sweet home. You've been here so many times in the past that you know it almost as well as your own place.", w_to Street, e_to Cage; !_________ZOO_Street (path) Object -> ZOO_Street "sidewalk running from ZOO to your apartment" has static door open with name "path" "sidewalk" "apartment" "street", description "It's just the road back to your apartment", door_to Street, door_dir w_to; !_________ZOO_Cage (door) Object -> ZOO_Cage "giant door entering the Cage" has static door openable with name "door" "Cage" "giant" "front" "dad", description "It's the door leading inside the Monkeys cage.", before [; Open: ! Make sure player has ticket if (Ticket notin player) { "You need a ticket to get in there."; } Go: ! Make sure door is open if (self hasnt open) { "You might want to open it first."; } ], ! Open the corresponding inverse door after [; Open: give Cage_ZOO open; Close: give Cage_ZOO ~open; ], door_to Cage, door_dir e_to; !_________TicketTaker Object -> TicketTaker "woman standing by the entrance Smiling" !general if she has given you a ticket has static animate female with name "admission" "lady" "girl" "woman", description "The lady stands as if guarding the door to ZOO. She must be in charge of admissions.", life [; Answer: "We're open weekdays 9-5, weekends 9-6, and admission is $20."; Tell: "Sir, you'll need a ticket to get in."; Attack, Kiss: "Nah."; Show, Give: ! Make sure the player is showing the ID card to the ticket taker if (noun==MembershipCard) { ! Solve the ticket taker puzzle give TicketTaker general; ! Give player ticket move Ticket to player; "Oh, I apologize sir...I didn't realize you were part of the show. Walk right in! With that, she hands you an admission ticket."; } ! Do not allow player to buy a ticket else if (noun==Money) { "Sir, you'll need more than just nothing to buy a ticket!"; } ! Do not allow the player to trade for a ticket else { "Sir, we accept cash or credit cards only."; } ]; !______________Cage Object Cage "Cage" with name "Cage" "father" "house" "home", description "Monkeys home sweet home. You've been here so many times in the past that you know it almost as well as your own place. But this time, you've come here with a purpose -- To find your father.", w_to Street; !__________Cage_ZOO (door) Object -> Cage_ZOO "door exiting to the courtyard" has static door openable with name "Cage" "house" "outside" "giant" "front" "courtyard", description "It's the door leading outside", ! Open the corresponding inverse door after [; Open: give ZOO_Cage open; Close: give ZOO_Cage ~open; ], door_to ZOO, door_dir w_to; !_________father Object -> father "suspicious looking man getting beat-up by gang of monkeys" !general if has static animate male with name "father" "dad", description " In the corner, you see your father being attacked by a gang of monkeys, and he screaming for his life.", life [; Answer: "He screamed for help."; Tell: "He needs immediate help, those monkeys are getting the best of him."; Attack, Kiss: "You love your father and would never do such a thing!"; Show, Give: if (noun==Pizza) { ! Solve Elvis puzzle give father general; ! Remove Pizza remove Pizza; !end game } else { "Oh thank you son for getting me help, I got entrapped here, when I came to visit the local monkeys, and behold the ZOO guards thought I was one of them, and they locked me up with them, this is the 10th time this happens to me, I must be too hairy or something. THANKS SON!. You are now very happy, and you have found your dad. YOU HAVE FOUND YOUR FATHER!!!!!!!!!!!", deadflag = 2; } ]; !______________INITIALISE ROUTINE [ Initialise; location = LivingRoom; give player light; move Money to player; "Per usual, it's a Saturday afternoon and you find that your dad is missing, and you are board, so you decide to go on a trip and find him..."; ];