! Petition Quest ! by David Ruthinowski ! Version 1 Constant Story "PETITION QUEST"; Constant Headline "^An Interactive Adventure^by David Ruthinowski^"; Constant DEBUG; Include "parser"; Include "verblib"; Include "grammar"; Attribute discovered; Attribute filled; Attribute signed; Attribute tilted; Attribute phone; Attribute dialable; Attribute connected; Attribute under; Constant MOD_IN_OFFICE_STATE = 0; Constant MOD_OUT_OFFICE_STATE = 1; Global modesitt_state; Global modesitt_move; ! Movement of Modesitt from office to office !------------------------------------------------------------------------------ ! !------------------------------------------------------------------------------ [ DoMapFromHere; new_line; print "Map relative to ", (the) location, ":"; new_line; if (location.nw_obj~=0) { print " Northwest: ", (the) location.nw_obj; new_line; } if (location.n_obj~=0) { print " North: ", (the) location.n_obj; new_line; } if (location.ne_obj~=0) { print " Northeast: ", (the) location.ne_obj; new_line; } if (location.w_obj~=0) { print " West: ", (the) location.w_obj; new_line; } if (location.e_obj~=0) { print " East: ", (the) location.e_obj; new_line; } if (location.sw_obj~=0) { print " Southwest: ", (the) location.sw_obj; new_line; } if (location.s_obj~=0) { print " South: ", (the) location.s_obj; new_line; } if (location.se_obj~=0) { print " Southeast: ", (the) location.se_obj; new_line; } if (location.u_obj~=0) { print " Above: ", (the) location.u_obj; new_line; } if (location.d_obj~=0) { print " Below: ", (the) location.d_obj; new_line; } new_line; ]; !------------------------------------------------------------------------------ ! Dr. Modesitt Office !------------------------------------------------------------------------------ Object Mod_Office "Dr. Modesitt's Office" has light proper with name "office", description "It's Dr. Modesitt's office. Virtually every wall is covered with books or boxes of former projects and teaching materials.", e_to Stairwell_Base, w_to Maxim_Office, before [; Go: modesitt_state = 0; rfalse; ]; Object Modesitt "Dr. Modesitt" Mod_Office has animate male proper with name "Modesitt", description "Dr. Modesitt...you've seen him!!^ He looks very busy and not too happy that you are wondering around his office. Perhaps you should not provoke him with your presence.", state MOD_IN_OFFICE_STATE, daemon [; switch (self.state) { MOD_IN_OFFICE_STATE: if (self notin Mod_Office || player notin Mod_Office) rtrue; print "^Dr. Modesitt: ~"; switch (modesitt_state) { 0: print "Can I Help You!!"; 1: print "What do you want??"; 2: print "Hello!?!?"; 3: print "GET OUT!!!!!!!"; <>; } print "~^"; modesitt_state++; MOD_OUT_OFFICE_STATE: if (modesitt_move==2) { if (player has connected) { print "^You hear Dr. Modesitt's voice on the phone:^"; print " ~I can't talk...I'm very busy!!~^"; give player ~connected; print "You hear a click and realize your no longer connected.^"; } } if (modesitt_move==4) { self.state = MOD_IN_OFFICE_STATE; move self to Mod_Office; modesitt_move = 0; } modesitt_move++; } ], life [; Ask, Tell: "Dr. Modesitt: ~Can't you see I'm VERY busy!!~"; ]; Object Spam_Box "box of spam" Mod_Office has supporter enterable with name "spam" "box" "junk" "crap", description "It's a medium size box containing spam...not the edible kind, but the tons of papers distributed in a Modesitt class. The box looks packed solid and very sturdy...", before [; Take: "Its far too heavy to carry...perhaps it could be moved some other way..."; PushDir: if (self in Mod_Office && Modesitt in Mod_Office) "I think that Modesitt might try and stop you!! If only there were some way to get him out of his office..."; AllowPushDir(); rtrue; ]; !------------------------------------------------------------------------------ ! Engineering Records Office !------------------------------------------------------------------------------ Object Engin_Records "Engineering Student Records Office" has light proper with name "records office", description "The sound of typing and phones ringing suggest the office is very busy. There are forms and pens on the counter.", w_to Stairwell_Top, before [; ThrowAt, ThrownAt: if (second has animate) "How cruel!!!"; ]; Object Counter "Counter" Engin_Records has static supporter ! general with name "counter", description "The barrier that guards advising faculty from students. It is covered with course schedules, forms and pens.", before [; Take: "Who needs a college education when you can steal furnature!"; Push,Pull: "Nope...this thing isn't going anywhere!"; ]; Object Petition "Petition" Counter !has concealed with name "form" "petition", description [; print "A "; if (self has filled) print "filled in "; if (self has signed) print "and signed "; "petition."; ], before [; ThrowAt: "Show a little respect!!"; WriteOn: if (self has filled) { "Its already filled out."; } if (Pen in player) { give self filled; "You fill in your name and request to the school."; } ]; Object Doorstop "doorstop" Engin_Records with name "doorstop" "stopper" "stop" "wedge", description "Yep...sure enough...its a doorstop. Its shape implies that it wedges things...", before [; Kick: if (Doorstop has under && Vending_Machine has tilted) { move Doorstop to Vending_Room; give Doorstop ~under; "You kick the doorstop out from under the vending machine."; } "The doorstop slides along the floor."; KickUnder: if (second~=Vending_Machine) rtrue; if (player has self) { if (Vending_Machine has tilted) "If you had a free hand you could take the doorstop out of your inventory..."; "No matter how hard you kick it, it will not go under the machine."; } give Doorstop under; "You kick the doorstop and watch as it slides under the edge of the vending machine."; ]; Object ESRO_Admin "administrative assistant" Engin_Records has animate female with name "secretary" "assistant", description "Assistant working diligantly.", life [; Tell, Ask: if (second==Petition) "Assistant: ~Fill it out, have it signed and give it back to me.~"; "Assistant: ~Unless you've got something to give me, quit bothering me!~^"; Show: if (noun~=Petition) { print (The) self; " doesn't seem interested in that item."; } if (Petition hasnt filled) "Assistant: ~Still needs to be filled out and signed.~^"; if (Petition hasnt signed) "Assistant: ~Still needs to be signed.~^"; "Assistant: ~Looks good to me...just turn it in now.~^"; Give: if (noun~=Petition) { print (The) self; " doesn't seem interested in that item."; } if (Petition hasnt filled && Petition hasnt signed) "She replies, ~You still need to fill it out and have it signed.~"; ! Victory!!!!!! deadflag = 2; print "^^Congratulations...you've won!!! It's over...you feel relieved!!!! Its like a huge burden has been lifted, yet deep down you know you'll be back again because you can never escape...^^"; style bold; spaces(20); "PETITION QUEST!!!^"; ]; !------------------------------------------------------------------------------ ! Vending Machine Room ! ! The player can tilt a vending machine here, so make sure that while the ! player is holding the vending machine in its tilted state, he/she can't leave ! without releasing it. !------------------------------------------------------------------------------ Object Vending_Room "Vending Room" has light with name "vending" "vending-room", description "Decisions, Decisions!! A room full of vending machines, everything from bottles of pop to candy-bars and even school supplies like pencils and pens. I'm sure over the years many interesting things have rolled under the machines...", e_to CIS_Office, before [; if (Vending_Machine has tilted && (action ~= ##Kick or ##KickUnder or ##Push or ##Pull or ##TiltForward or ##TiltBackward)) "You can't do that while tilting the vending machine."; ]; Object Vending_Machine "vending machine" Vending_Room has static open container with name "machine" "vending-machine" "vending", description "Its a new vending machine that sells pens for $0.25. The machine looks brand new and is hardly any competition for the machine selling candy next to it.^^The Machine is very simple... put in a coin and get a pen.", before [; if (self has tilted && (action ~= ##KickUnder or ##Push or ##Pull or ##TiltForward or ##TiltBackward)) "You can't do anything while tilting the vending machine."; Receive: if (noun~=Coin) "Sorry...vending machines only take coins..."; move Coin to self; give Coin concealed; give Coin static; print "You hear the coin drop in the machine...^^"; move Pen to Vending_Machine; "After a few seconds of waiting a pen drops out!"; Push: if (self has tilted) "If you tilt it any further, you'll knock it over."; give self tilted; if (Doorstop in self) { give Doorstop under; move Doorstop to Vending_Room; } "You gather your strength and tilt the machine away from you and hold it there...feeling like Atlas, you wonder what to do now?"; Pull: if (self has tilted) { give self ~tilted; print "The machine is resting "; if (Doorstop has under) { move Doorstop to self; } if (Doorstop in self) { if (Coin notin player) { move Coin to parent(self); !give Coin ~concealed; } "at an angle on top of the doorstop."; } if (Coin notin player) { remove Coin; give Coin concealed; } "flat on the ground."; } LookUnder: if (Doorstop in self) { if (Coin notin player) { give Coin ~concealed; give Coin discovered; ! You've finally found it } print "You see "; if (Coin in parent(self)) print "a coin resting on "; "a dusty floor."; } "The machine is flat on the ground and you can't see under it."; ]; Object Pen "pen" with name "pen", description "A brand new black pen."; Object Coin "coin" has concealed ! discovered with name "coin" "money" "change", description [; if (self has discovered) print "Its a bright, shiny quarter."; print "I don't see ", (the) self, "."; ], before [; if (self hasnt discovered) "I don't see ", (the) self, "."; Take: if (self in player) "Taking it twice won't increase its value."; if (self hasnt concealed) { move self to player; "Excellent...nothing better than free money!!"; } "How do you expect to get to it?"; ]; !------------------------------------------------------------------------------ ! Stairwell Area ! ! Three Phases: ! 1) Base Stairway Floor ! 2) Stairwell ! 3) Top Stairway Floor !------------------------------------------------------------------------------ Object Stairwell_Base "Base Of The Stairwell" has light with name "stairwell" "base", description "The bottom stairs that lead to the second floor lay in a pile of rubble after years of abuse.", w_to Mod_Office, u_to Stairwell, ! No access unless climbing from something e_to Lobby, before [; Go: if (noun==u_obj && player notin Spam_Box) { print "Too bad the stairs were crumbled, otherwise you could..."; rtrue; } if (noun~=u_obj && player in Spam_Box) { ! If going up from spam box move player to self; ! Move the player to the room print "You climb down from the spam box."; new_line; } if (noun==u_obj && player in Spam_Box) { move player to self; ! Move the player to the room print "Using the box of spam to reach the next floor you suddenly realize that maybe there IS some use to all of those papers!!!"; new_line; } ]; Object Stairwell "Stairwell" has light with name "stairwell", description "Below is the collaped stairwell, above are the stairs leading to the second floor.", u_to Stairwell_Top, d_to Stairwell_Base; Object Stairwell_Top "Top Of The Stairwell" has light with name "stairwell" "top", description "A stairwell leading down to the ground floor.", d_to Stairwell, e_to Engin_Records; !------------------------------------------------------------------------------ ! CIS Office !------------------------------------------------------------------------------ Object CIS_Office "CIS Office" has light dialable proper with name "cis" "cis-office" "office", description [; print "The CIS office...where all things are good.^ You see a sign three signes:^"; spaces(10); print "~Petitions are located on the second floor~^"; spaces(10); print "~Student advisor today: Dr. Maxim~^"; spaces(10); print "~Dr. Modesitt is in today and is will receive calls through this office.~^"; ], w_to Vending_Room, e_to Maxim_Office; Object CIS_Assistant "administrative assistant" CIS_Office has animate female with name "assistant" "secretary", description "The CIS Office's administrative assistant hard at work.", life [; Ask, Tell: "Assistant: ~Can't talk right now, I'm busy.~^"; ]; !------------------------------------------------------------------------------ ! Dr. Maxim's Office !------------------------------------------------------------------------------ Object Maxim_Office "Dr. Maxim's Office" has light proper with name "office", description "It's Dr. Maxim's office!! You see the walls lined with books and computer equipment. Dr. Maxim is sitting in front of his PC working hard as always.", w_to CIS_Office, e_to Mod_Office; Object Maxim "Dr. Maxim" Maxim_Office has animate male proper with name "Maxim", description "It's Dr. Maxim...you know...the guy who assigned this game?? Working late to finish this project has obviously reduced your mental capacity!!", life [; Show, Give: if (noun==Coin) { print "Bribery? Not a bad idea considering this program isn't fini"; new_line; print "** Library error 10 (0,0) **"; new_line; print "** The player-object is outside the object tree **"; new_line; print "^^"; "Just Kidding...The program works fine...no need for paying of the professor!"; } if (noun~=Petition && noun~=Pen) "I don't think ", (the) self, " is very interested."; if (noun==Petition) { if (Petition has filled) { move Petition to Maxim; print "He looks over the petition and nods in agreement. "; } else { "He replies, ~How about you fill it out first.~"; } if (Petition hasnt signed) { if (Pen in Maxim) { move Petition to player; "~Let me sign it for you...~ ~...done!!~"; } "I'll hold on to this until I get a pen to sign it."; } } if (noun==Pen) { if (Petition in Maxim) { print "~Let me sign your petition...~ ~...done!!~"; give Petition signed; move Petition to player; print "^Dr. Maxim returned your petition signed!!!^"; "Dr. Maxim also returned your pen."; } } Tell: "^Dr. Maxim: ~Hm...that's very interesting.~"; Ask: "^Dr. Maxim: ~You should ask that in class...I'm sure everyone would benefit from hearing that.~"; ]; !------------------------------------------------------------------------------ ! Lobby !------------------------------------------------------------------------------ Object Lobby "Lobby" has light dialable with name "lobby", description[; print "Your in the the lobby of the engineering complex. There are phones, couches and chairs, you know, the usual stuff you see in the lobby."; new_line; ], w_to Stairwell_Base, before [; Dial: if (player has connected) "You're already connected...hang up first."; if (player hasnt phone) rfalse; if (noun~=CIS_Office) "You call but no one answers."; give player connected; print "You call..."; print (the) CIS_Assistant; print " Answers."; give CIS_Assistant phone; rtrue; PhoneAskFor: if (player hasnt connected) "Perhaps you should pick up the phone and call someone first."; if (noun~=Modesitt) { print "I'm sorry...I don't know who ", (the) noun, " is."; } move Modesitt to CIS_Office; Modesitt.state = MOD_OUT_OFFICE_STATE; modesitt_move = 0; "One moment please..."; Listen: if (player hasnt connected) "You don't hear anything...perhaps you would hear something if you were connected."; "You hear background noise normally heard in an office.^"; Go: if (player has phone) "And what?...rip the phone out of the wall? Maybe you should hang up the phone first!!"; ]; Object TelePhone "Courtesy Phone" Lobby has static with name "phone" "tele" "telephone", description "Telephone...", before [; Take: if (player hasnt phone) { give player phone; "You Pick Up The Receiver"; } "You're already holding the receiver."; Drop: if (player has phone) { give player ~phone; give player ~connected; "You Hang Up The Receiver"; } "You're not holding the receiver."; ]; !------------------------------------------------------------------------------ ! Initialize !------------------------------------------------------------------------------ [ Initialise; modesitt_state = 0; StartDaemon(Modesitt); StartDaemon(CIS_Assistant); location = Lobby; print "^^^Wow...the semester's beginning again and already you find yourself at school struggling with the registration process. The rooms are filled with professors and assistants and you find yourself searching for a petition. Without it you just might find yourself out in the streets next semester after being denied registration. Better hurry and find that petition and get it signed by your advisor...^^"; spaces(10); print "At any time type "; style bold; print "map"; style roman; print " to display the compass.^^"; ]; !------------------------------------------------------------------------------ ! New Verbs Subroutines !------------------------------------------------------------------------------ [ KickSub; <>;]; [ KickUnderSub; "What would that accomplish?";]; [ TiltBackwardSub; <>;]; [ TiltForwardSub; <>;]; [ HangUpSub; ;]; [ DialSub; "You cannot call anyone without a phone!";]; [ PhoneAskForSub; "Who?";]; [ PhoneSpeakSub i other; if (player hasnt connected) !Not on the phone "Who are you talking to??"; objectloop (i ofclass Object) { if (i has phone && i~=player) { other = i; } } if (other==0) "Who are you talking to??"; print (The) other, " doesn't answer...perhaps"; if (other has female) print " she "; else if (other has male) print " he "; else print " it "; print "is angry that you are wasting "; if (other has female) print "her "; else if (other has male) print "his "; else print "its "; "time."; ]; [ WriteOnSub; if (Pen notin player) "You can't because you don't have anything to write with."; "You scribble all over it and admire your beautiful artwork ;-)"; ]; [ SignSub; "Someone with authority should do that.";]; [ MapSub; DoMapFromHere();]; [ PhoneScope i; if (scope_stage==1) rfalse; if (scope_stage==2) { objectloop (i ofclass Object) { if (i has dialable) ! If the object can be called PlaceInScope(i); } rtrue; } "No such in game."; ]; [ AskForScope i; if (scope_stage==1) rfalse; if (scope_stage==2) { objectloop (i ofclass Object) { if (i has animate) ! If the object can be called PlaceInScope(i); } rtrue; } "No such in game."; ]; !------------------------------------------------------------------------------ ! New Verbs !------------------------------------------------------------------------------ Verb "kick" * noun -> Kick * noun "under" noun -> KickUnder; Verb "tilt" * noun "forward" -> TiltForward * noun "back" -> TiltBackward; Verb "tip" * noun "forward" -> TiltForward * noun "back" -> TiltBackward; Verb "hang" * "up" noun -> HangUp; Extend "fill" * "out" noun -> WriteOn * "in" noun -> WriteOn; Verb "write" * "on" noun -> WriteOn; Verb "sign" * noun -> Sign; Verb "dial" "call" "ring" * scope=PhoneScope -> Dial; ! So you can ask for anyone if your on the phone Extend "ask" * "for" scope=AskForScope -> PhoneAskFor; Extend "ask" * "about" noun -> PhoneSpeak; Extend "tell" * "about" noun -> PhoneSpeak; Verb "map" * -> Map;