!!! Changes made after submission: !!! Shoot replaced with ShootAt, to match previous declaration !!! terminal_info replaced with terminal_information !!! removed extra newline from scrap's terminal_information !!! kettle now loses kernels when emptied !!! !!! kettle can no longer be retrieved from garbage !!! use before for ShootAt, not after !!! added northwest exit to outside_base descriptions ! IF-Whispers 1 ! Segment 7 ! by Andrew Schepler (schep) #Ifndef ShootAtSub; ! So yeah, this isn't object definitions. But any IF game with a ray_gun ! object really, really needs a ##Shoot verb. Most likely whoever created that ! object provided a verb, so for my own testing purposes: Verb 'shoot' 'fire' * noun -> ShootAt * noun 'with' held -> ShootAt * held 'at' noun -> ShootAt reverse; [ShootAtSub; if (noun==ray_gun) { if (second==ray_gun) { print "No, the gun is for shooting "; style underline; print "other"; style roman; "things."; } else if (second==nothing) "You need to say what you want to shoot at."; } if (second==nothing) { if (ray_gun notin player) "You would need some sort of weapon at hand."; } else if (second~=ray_gun) print_ret "You can't shoot anything with ", (the) second, "."; if (AfterRoutines() == 1) rtrue; print_ret "A shower of sparks briefly surrounds ", (the) noun, ", but there is no obvious effect."; ]; #Endif; Object elevator_hatch "service hatch" with name 'hatch' 'service' 'square' 'hexagonal' 'hole', author "schep", found_in inside_elevator atop_elevator, when_closed [; inside_elevator.u_to = self; "A small square hatch is set into one corner of the ceiling."; ], when_open [; switch (location) { inside_elevator: "The service hatch in the ceiling hangs open."; atop_elevator: "The service hatch into the elevator car is open."; } ], description [; print "The hatch is a square piece of metal, with a small hexagonal hole in a piece opposite the hinges. It is currently "; if (self has open) "open."; else "closed."; ], door_dir [; switch (location) { inside_elevator: return u_to; atop_elevator: return d_to; } ], door_to [; switch (location) { inside_elevator: return atop_elevator; atop_elevator: return inside_elevator; } ], with_key hex_wrench, before [; Turn, Pull: if (self has locked) "It does not budge."; "The hatch swings for a short while on its squeaky hinges."; Push: if (self has locked) "It does not budge."; <>; Lock: if (second ~= hex_wrench) "That won't lock the hatch."; if (location == atop_elevator) "You can't seem to pull the hatch completely shut from this side."; give self ~open locked; "You push the service hatch closed and reengage its latch."; ], after [; Unlock: give self open; "The service hatch swings down into the car."; Close: give self open; "Gravity keeps the hatch open unless it is locked."; ], has static door openable lockable locked; ! Another coder's object likes to PrintOrRun terminal_information on portable ! objects. The text should end without whitespace. Object hex_wrench "hex wrench" with name 'hex' 'wrench', author "schep", description "A small metal tool for specialized uses.", terminal_information [; print "A steel hex wrench, inner diameter 3.1 millimeters. Manufacturer unknown. Tools of this size are compatible with some models of U-Build brand home furniture, PrivaTank brand bathroom stalls, and certain items from Raiser Elevator Parts, Inc."; ]; Object atop_elevator "On the Elevator Car" with description "Daylight filters down from a crack just two stories above. A few thick pulley cables hold the car in the shaft, and you can make out rungs on one side wall.", author "schep", name 'crack' 'pulley' 'cable' 'car' 'elevator' 'rungs' 'ladder' 'cables' 'pulleys', d_to elevator_hatch, u_to elevator_shaft, has light; Object elevator_shaft "Elevator Shaft" with description "The thick cables loop over large pulleys on their axle and descend into the darkness below. The crude rungs on which you stand also continue down the shaft along this wall.", author "schep", name 'cable' 'cables' 'pulley' 'pulleys' 'axle' 'rungs' 'ladder', d_to [; if (upper_elevator_door has open) { StopTimer(upper_elevator_door); give upper_elevator_door ~open; print "The elevator doors close as you descend the ladder.^"; } return atop_elevator; ], e_to upper_elevator_door, out_to upper_elevator_door, has light; Object upper_elevator_door "elevator doors" with name 'elevator' 'doors' 'door', author "schep", found_in elevator_shaft commute_center, describe [; new_line; return self.description(); ], description [; print "The elevator doors to the ", (LanguageDirection) self.door_dir(), " are "; if (self has open) print_ret "open."; else print_ret "closed."; ], door_dir [; switch (location) { elevator_shaft: return e_to; commute_center: return w_to; } ], door_to [; switch (location) { elevator_shaft: return commute_center; commute_center: return elevator_shaft; } ], before [; Close: if (self hasnt open) rfalse; "You can't get a good grip on the open elevator doors."; ], after [; Open: StartTimer(self, 2); "You get your fingers in the crack and pull on the doors, which open the rest of the way on their own."; ], time_left 0, time_out [; give self ~open; if (TestScope(self)) "^The elevator doors slide closed."; ], has static pluralname door openable; ! There probably ought to be some reason for reaching this location. Object commute_center "Commuter Center" with description "This vast empty chamber is crossed by all manner of roads, tracks, and paths. The circle near the center even seems to be a helicopter pad. But no vehicles or people are present now. Tunnels lead away in every direction, but one larger opening to the northeast stands out.", author "schep", name 'chamber' 'roads' 'tracks' 'tunnels' 'circle' 'helicopter' 'pad', w_to upper_elevator_door, ne_to [; outside_community_center.sw_to = self; ! The following properties exist and have not yet been used. ! This code does nothing, but thought someone might want to be aware ! of them. outside_community_center.e_to = outside_community_center.e_to; outside_community_center.in_to = outside_community_center.in_to; outside_community_center.d_to = outside_community_center.d_to; if (commute_describer notin outside_community_center) { move commute_describer to outside_community_center; print "You follow the large tunnel, which leads back to what must be the city's main intersection.^"; } return outside_community_center; ], cant_go "Paths are in every direction, but they branch apart so quickly that you are certain you would get lost that way.", ! Feel free to replace in_to if you add some other structure here. ! Heading for the elevator makes marginally more sense than the above ! cant_go for >IN. in_to upper_elevator_door, ! More exits? n_to 0, nw_to 0, sw_to 0, s_to 0, se_to 0, e_to 0, d_to 0, u_to 0, has light; Object commute_describer with describe "^You could find your way back to the commuter center to the southwest.", author "schep", has static; Object waste_bucket "waste receptacle" outside_community_center with name 'metal' 'waste' 'receptacle' 'trash' 'garbage' 'bin', author "schep", describe [; outside_community_center.n_to = comm_lobby; "^There is a metal waste receptacle in one corner."; ], description [; if (child(self)) { print "The waste receptacle contains "; WriteListFrom(child(self), ENGLISH_BIT+TERSE_BIT+CONCEAL_BIT); print "."; } else print "The waste receptacle is grimy but empty."; if (cloth hasnt moved) " You notice a tiny scrap of cloth caught on the bin's edge."; ], before [; LetGo: if (noun==discarded_popcorn) "It wouldn't be worth the trouble."; if (noun==discarded_kettle) "There's not enough oil left to make another batch of poisoned popcorn, and too much poison inside to use it for anything else. The kettle's probably best where it is."; rfalse; ], after [; Receive: if (noun==kettle or popcorn) { remove kettle; remove popcorn; give kettle ~general; move discarded_popcorn to self; move discarded_kettle to self; "You dump the kettle into the waste receptacle. The popcorn spills out, making a mess."; } "You toss ", (the) noun, " in the waste receptacle."; LetGo: if (noun ~= cloth) "You retrieve ", (the) noun, " from the garbage."; ], has static container transparent open; Object cloth "scrap of cloth" waste_bucket with name 'scrap' 'piece' 'of' 'cloth' 'uniform', author "schep", description "Just a few threads, really, but they look like the same dull blue as the uniform of the woman who shot you.", terminal_information [; outside_community_center.se_to = outside_base; ! The following properties exist and have not yet been used. ! This code does nothing, but thought someone might want to be aware ! of them. outside_community_center.e_to = outside_community_center.e_to; outside_community_center.in_to = outside_community_center.in_to; outside_community_center.d_to = outside_community_center.d_to; move hq_describer to outside_community_center; print "Damaged fragment of fabric. Composition and trace chemicals match known data for uniforms of the mysterious XPQ organization.^^~ATTENTION: Filing police report. An officer will contact you for further information, Harry Nodles. For your own safety, please avoid the known XPQ location 274 meters to the southeast."; ], has concealed; Object hq_describer with describe [; if (outside_base has visited) "^The XPQ base is off to the southeast."; else "^The ~known XPQ location,~ whatever that's supposed to be, is presumably nearby to the southeast."; ], author "schep", has static; Object burnt_paper "burnt page" waste_bucket with name 'burnt' 'page' 'paper', author "schep", description "The page is almost entirely black and barely holds together. The logo in one corner might say ~XPQ~, but nothing else is legible.", terminal_information [; print "A standard size sheet of paper, severely burnt. Traces of both ink and graphite are illegible."; ]; Object discarded_popcorn "popcorn" with name 'popcorn' 'kernels', author "schep", description "The popcorn looks considerably less appetizing at the bottom of the waste bin.", article "some"; Object discarded_kettle "kettle" with name 'kettle' 'black', author "schep", description "An ordinary kettle, probably useless now."; Object comm_lobby "Community Center Lobby" with description "Off-white walls, dim overhead lights, and flimsy chairs around simple round tables--this room must have been designed for budget, not creativity. The doors outside are to the south.", author "schep", name 'chair' 'chairs', s_to outside_community_center, w_to 0, n_to 0, e_to 0, has light; Object cheap_table comm_lobby with parse_name [ w n got_noun; n = 0; got_noun = false; for (w=NextWord()::w=NextWord()) { if (w=='table') got_noun = true; else if (w~='old' or 'man^s') break; ++n; } if (got_noun) return n; else return 0; ], author "schep", short_name [; if (old_man in comm_lobby) print "old man's table"; else print "table"; rtrue; ], describe [; print "^On one table"; WriteListFrom(child(self), ENGLISH_BIT+TERSE_BIT+CONCEAL_BIT+ISARE_BIT); "."; ], description [; <>; ], after [; Receive: if (noun == chosen_card) { old_man.do_no(); rtrue; } if (old_man notin comm_lobby) give self ~concealed; LetGo: if (~~child(self)) give self concealed; ], has static concealed supporter; Object old_man "old man" comm_lobby with name 'old' 'man' 'crazy' 'psychic', author "schep", describe [; print "^An old man sits at one table, mumbling to himself and fiddling with a deck of cards"; if (child(cheap_table)) { print ". On his table"; WriteListFrom(child(cheap_table), ENGLISH_BIT+TERSE_BIT+CONCEAL_BIT+ISARE_BIT); } "."; ], description "The man is nearly bald, dressed in faded overalls and a frayed flannel shirt. He acts as though he has gone off his rocker.", do_yes [; if (chosen_card notin player) "~Yes what?~ asks the old man. ~I haven't started my trick yet.~"; remove chosen_card; remove self; move hex_wrench to cheap_table; give cheap_table ~concealed; "~Hot dog!~ The old man leaps to his feet and takes back his card. ~I knew it! I'm a gonna buy me a lotto ticket; I'll be a jillionaire, I'll....~ ^^His voice trails off as he runs out of the community center. He seems to have left something on the table."; ], do_no [; if (chosen_card notin player) "~No what?~ asks the old man. ~I haven't started my trick yet.~"; move chosen_card to comm_lobby; give chosen_card concealed; "The old man is clearly disappointed, and takes the card back into his deck. ~Well, uh, I'll get it. Take another so I can try again.~"; ], react_before [; Yes: return self.do_yes(); No: return self.do_no(); ], life [ i; Attack, ThrowAt: "The man dodges your attack, and spits on the ground. Ew."; Kiss: "The old man pushes you away. ~Pfeh, not now, cantcha see I'm busy?~"; Give, Show: if (noun == chosen_card) return self.do_no(); "~Whazzat? Nah, no use fer it.~"; Ask, Tell, Answer, Order: wn = consult_from; for (i=0: i>; ], before [; ShootAt: "With surprising agility, the old man leaps aside of the ray, which rebounds off a couple of chairs before dissipating. ~Har, we be under attack! Batten down the, uh, things, and ready the doowhatsits! Avast!~ He wields two of his cards like throwing stars, but soon forgets the ~situation~ and sits back down at the deck. Of cards."; ], has animate transparent male; Object deck_of_cards "deck of cards" old_man with parse_name [ w n got_noun; n = 0; got_noun = false; for (w=NextWord()::w=NextWord()) { if (w == 'deck' or 'cards') got_noun = true; else if (w ~= 'of' or 'playing') break; ++n; } if (got_noun) return n; else return 0; ], author "schep", description "The playing cards are a handy size, but the man is shuffling and fidgeting with them too much for you to get a good look."; Object chosen_card "card" comm_lobby with parse_name [ w n got_noun; n = 0; got_noun = false; for (w=NextWord()::w=NextWord()) { if (w == 'card') got_noun = true; else if (w ~= 'playing') break; ++n; } if (got_noun) return n; else return 0; ], author "schep", article "your", color_array 'red' 'blue' 'green' 'orange', color_ind 0, number 0, card_name [c mid num; print (address) self.&color_array-->c, (string) mid; EnglishNumber(num+1); ], description [; print "The playing card displays a"; if (self.color_ind==3) print "n"; print " "; self.card_name(self.color_ind, " number ", self.number); "."; ], react_before [; Go: if (self in player) { move self to comm_lobby; print "~Hey, my card!~ The old man snatches it from your hands as you walk off."; rfalse; } ], before [; if (action == ##Take && self in player) "The old man pulls back his cards. ~No, just the one. Did I guess right?~"; else if (action ~= ##Take && self notin player) { ! If the player tries to >X CARD or >THROW CARD etc. without one, ! take one from the deck, and stop the action, since it sets off ! some dialogue. print "(first choosing one from the deck)^"; <>; } switch (action) { ##Insert, ##Drop: if (second==cheap_table) <>; move self to comm_lobby; "~Hey, that's not for you to play with.~ The man grabs the card away from you."; } ], after [ a b; Take: give old_man general; self.color_ind = random(4)-1; self.number = random(10)-1; ! a wrong guess: a = random(39)-1; if (a >= (10*self.color_ind+self.number)) ++a; b = a%10; a = a/10; print "You draw a card from the deck. It displays a"; if (self.color_ind==3) print "n"; print " "; self.card_name(self.color_ind, " number ", self.number); print ".^^~Okay,~ says the man, ~you drew ... the "; self.card_name(a, " ", b); "! Right?~"; ], has concealed; Object outside_base "Outside XPQ Base" with description [; if (self hasnt general) { give self general; "The building the terminal described ought to be here somewhere, but they all look alike, even more so than near the intersection back to the northwest. Gray, dull buildings covered in graffiti... no, wait, the graffiti next to a door just south of here says ~XPQ~. You have the feeling you're getting close now."; } else "There is nothing but identical gray rectangular buildings in this part of the city, which is even more monotonous than the intersection to the northwest. Only the building to the south is of any interest, the territory of the mysterious XPQ."; ], author "schep", nw_to outside_community_center, s_to 0, ! now what? in_to 0, sw_to 0, ! and maybe other nearby stuff: se_to 0, d_to 0, e_to 0, has light;