Constant Story "Blackout!"; Constant Headline "^A mass-transit fairy-tale \ ^Copyright (c) 2002 by Julian Graham^"; Include "Parser"; Include "VerbLib"; Include "Grammar"; Extend "look" * "through" noun -> Search * "out" noun -> Search * "outside" noun -> Search; Verb "screw" * noun -> Screw; * noun "in"/"into"/"inside" noun -> Screw; Verb "unscrew" * noun -> Unscrew * noun "from" noun -> Unscrew; Object Grue with description "Thou shalt not know!", backup_description, death_counter 3, appearance_counter 5, daemon [; if (location == thedark) { if (OffersLight (real_location)) { if (self in thedark) { thedark.description = self.backup_description; print "^Oh God. It is huge. A great hairy shape rushes by you, fleeing into a \ retreating patch of darkness. Your mind goes blank. There was something very \ big very close to you a moment ago, and now you can't for the life of you \ remember what it looked like.^"; self.death_counter = 3; self.appearance_counter = 4; remove self; return; } } else { if (self in thedark) { switch (self.death_counter) { 3: print "^You feel something hairy brush gently against the back of your hand.^"; 2: print "^You hear a wheezing sound, wet and ragged like the breathing of a wounded animal.^"; 1: print "^You feel hot breath on the back of your neck. The air turns suddenly foul.^"; 0: print "^There is a sudden violent motion in the dark behind you. Long, strange teeth tear \ savagely at your flesh.^"; deadflag = 1; } self.death_counter--; return; } else { if (self.appearance_counter == 0) { move self to thedark; return; } else { if (self.appearance_counter == 5) { if (random (0, 1, 2) == 0) { self.backup_description = thedark.description; thedark.description = "It is pitch dark. You are likely to be eaten by a grue."; self.appearance_counter--; } } else { self.appearance_counter--; } } } } } else { if (self.backup_description ~= nothing) thedark.description = self.backup_description; self.death_counter = 3; self.appearance_counter = 5; remove self; return; } ], has concealed; Class Room with exit_to, cant_go CANTGO__TX, before [; Exit: if (self.exit_to ~= nothing) { PlayerTo (self.exit_to); return; } else return L__M (##Exit, 1); ]; Object street_outside_bldg "Outside Your Apartment" with description "Outside your apartment.", n_to bldg_apt_lobby; Object bldg_apt_lobby "Lobby" with description "The lobby of your apartment building.", u_to bldg_apt_stairwell_2, s_to street_outside_bldg, exit_to street_outside_bldg; Object bldg_apt_lobby_mailbox "mailbox" with name "mailbox" "mail box" "mail" "box", description "The mailbox for your apartment building.", after [; Examine: give self general; ], has static; Object bldg_apt_stairwell_2 "Second Floor Stairwell" with description "The stairwell, second floor.", u_to bldg_apt_stairwell_3, d_to bldg_apt_lobby; Object -> bldg_apt_stairwell_2_mat "welcome mat" with name "welcome" "mat" "welcome mat" "doormat", description [; if (bldg_apt_stairwell_3_mat has general) { if (bldg_apt_lobby_mailbox has general) "You and Mr. Soebel must shop at the same store: His welcome mat is identical to \ yours."; else "You and the occupant of Apt. 2 must shop at the same store: Your welcome mats \ appear to be identical."; } else "The grungy mat has the word 'Welcome' printed on it in faded block letters."; ], before [; Take: "The welcome mat is heavy and dirty. Just leave it, okay?"; ]; Object bldg_apt_stairwell_4 "Fourth Floor Stairwell" with description "The stairwell, fourth floor.", d_to bldg_apt_stairwell_3; Object bldg_apt_stairwell_3 "Third Floor Stairwell" with description "You're in the stairwell outside your apartment.", e_to bldg_apt_hallway, u_to bldg_apt_stairwell_4, d_to bldg_apt_stairwell_2; Object -> bldg_apt_stairwell_3_mat "welcome mat" with name "welcome" "mat" "welcome mat" "doormat", description "Your welcome mat has seen better days.", before [; Take: "The welcome mat is heavy and dirty. Just leave it, okay?"; ], after [; Examine: give self general; ]; Object bldg_apt_bathroom "Bathroom" with description "The bathroom is crowded with all of the fixtures it contains. A toilet and a \ sink face each other on one side. A tiny mirror dimly reflects its \ surroundings.", exit_to bldg_apt_kitchen, e_to bldg_apt_kitchen, class Room, has light; Object -> bldg_apt_bathroom_tub "bathtub" with name "tub" "bathtub" "bath tub", initial [; if (bldg_apt_bathroom_tub_hot_tap has general || bldg_apt_bathroom_tub_cold_tap has general) { if (bldg_apt_bathroom_tub_switch has general) "Water spritzes noisily from the showerhead into the bathtub."; else "Murky water pours noisily from the faucet into the bathtub drain."; } else "A large white bathtub uneasily occupies half of the tiny bathroom."; ], description "The bathtub is modest but capacious. It has the standard set of features: a \ faucet, a showerhead, hot and cold taps, and a lever that switches between \ the faucet and the shower. There's no shower curtain. 'Hey,' you'd thought to \ yourself. 'Why bother?'", before [; Enter: if (bldg_apt_bathroom_tub_hot_tap has general || bldg_apt_bathroom_tub_cold_tap has general) print "Not while the water's running! Brrr.^"; else { move bldg_apt_bathroom_tub_hot_tap to bldg_apt_bathroom_in_tub; move bldg_apt_bathroom_tub_switch to bldg_apt_bathroom_in_tub; move bldg_apt_bathroom_tub_cold_tap to bldg_apt_bathroom_in_tub; move bldg_apt_bathroom_tub_faucet to bldg_apt_bathroom_in_tub; move bldg_apt_bathroom_tub_showerhead to bldg_apt_bathroom_in_tub; PlayerTo (bldg_apt_bathroom_in_tub); } return; ], has static; Object -> bldg_apt_bathroom_tub_faucet "faucet" with name "faucet", description "It's a big stainless-steel faucet.", has scenery; Object -> bldg_apt_bathroom_tub_showerhead "showerhead" with name "shower" "head" "showerhead", description "It's an industrial-looking showerhead, painfully grafted onto the bathroom wall \ above the bathtub.", has scenery; Object -> bldg_apt_bathroom_tub_hot_tap "hot tap" with name "tap" "water" "hot" "hot tap" "hot water", description "It's an old-fashioned, clover-shaped tap for controlling the output and \ temperature of the water. This one has an 'H' chiseled faintly on its face.^", before [; SwitchOn: if (self in bldg_apt_bathroom_in_tub) "Not while you're in the tub!"; else { if (self has general) "The hot water's already on all the way. Face it, it just isn't going to get \ any hotter."; else { give self general; if (bldg_apt_bathroom_tub_switch has general) { if (bldg_apt_bathroom_tub_cold_tap has general) "A surge of lukewarm water mingles with the icy water coming out of the \ shower."; else "A weak spray of lukewarm water starts coming out of the showerhead."; } else { if (bldg_apt_bathroom_tub_cold_tap has general) "The water gurgling from the faucet warms up slightly -- not quite hot \ enough for a real bath yet, but no longer toe-curlingly cold."; else "A noisy river of lukewarm water starts to pour from the faucet, \ straight down into the drain."; } } } SwitchOff: if (self hasnt general) "The hot tap is already off."; else { give self ~general; if (bldg_apt_bathroom_tub_switch has general) { if (bldg_apt_bathroom_tub_cold_tap has general) "You turn the hot tap off. The water coming from the shower turns icy."; else "You turn off the shower. Drops of rusty water continue to collect \ around the showerhead, dripping into the tub with a hollow sound every \ few seconds."; } else { if (bldg_apt_bathroom_tub_cold_tap has general) "You turn the hot tap off. The water coming from the faucet turns icy."; else "The water stops."; } } ], has scenery switchable; Object -> bldg_apt_bathroom_tub_switch "shower lever" with name "switch" "shower switch" "shower" "lever" "shower lever", description "It's the small switch that lets you alternate between using the bathtub \ faucet and the showerhead. It bears a passing resemblance to the triangular \ tag of a zipper.^", before [; SwitchOn: if (bldg_apt_bathroom_tub_switch has general) "The shower's already on."; else { give self general; if (bldg_apt_bathroom_tub_cold_tap has general || bldg_apt_bathroom_tub_hot_tap has general) "Abruptly, the water stops coming out of the faucet. There is a hollow \ shuddering sound, and, after a brief pause, water begins to drizzle \ from the showerhead."; else "You flip the shower lever on. There is a soft metallic thud."; } SwitchOff: if (bldg_apt_bathroom_tub_switch hasnt general) "The shower's already off."; else { give self ~general; if (bldg_apt_bathroom_tub_cold_tap has general || bldg_apt_bathroom_tub_hot_tap has general) "The water coming out of the showerhead slows to a drip, and, after a brief \ pause, begins to pour noisily out of the faucet into the drain."; else "You flip the shower lever off. There is a soft metallic thud."; } ], has scenery switchable; Object -> bldg_apt_bathroom_tub_cold_tap "cold tap" with name "tap" "water" "cold" "cold tap" "cold water", description "It's an old-fashioned, clover-shaped tap for controlling the output and \ temperature of the water. This one has an 'C' chiseled faintly on its face.^", before [; SwitchOn: if (self in bldg_apt_bathroom_in_tub) "Not while you're in the tub!"; else { if (self has general) "What, you want it to get colder?"; else { give self general; if (bldg_apt_bathroom_tub_switch has general) { if (bldg_apt_bathroom_tub_hot_tap has general) "The water coming out the shower turns several shades colder."; else "A weak spray of icy water starts coming out of the showerhead."; } else { if (bldg_apt_bathroom_tub_hot_tap has general) "The water gurgling from the faucet turns several shades colder."; else "A noisy river of icy water -- really, really wake-you-up-in-the-morning cold -- \ starts to pour from the faucet, straight down into the drain."; } } } SwitchOff: if (self hasnt general) "The cold tap is already off."; else { give self ~general; if (bldg_apt_bathroom_tub_switch has general) { if (bldg_apt_bathroom_tub_hot_tap has general) "You turn the cold tap off. The water coming from the shower warms up \ by a fraction of a degree."; else "You turn off the shower. Drops of rusty water continue to collect \ around the showerhead, dripping into the tub with a hollow sound every \ few seconds."; } else { if (bldg_apt_bathroom_tub_hot_tap has general) "You turn the cold tap off. The water coming from the faucet warms up \ by a fraction of a degree."; else "The water stops."; } } ], has scenery switchable; Object bldg_apt_bathroom_in_tub "In The Bathtub" with description "You're on your hands and knees in the bathtub. It smells faintly and poisonously \ of the bleach that's been used to clean it.", exit_to bldg_apt_bathroom, u_to bldg_apt_bathroom, before [; Exit: move bldg_apt_bathroom_tub_hot_tap to bldg_apt_bathroom; move bldg_apt_bathroom_tub_switch to bldg_apt_bathroom; move bldg_apt_bathroom_tub_cold_tap to bldg_apt_bathroom; move bldg_apt_bathroom_tub_faucet to bldg_apt_bathroom; move bldg_apt_bathroom_tub_showerhead to bldg_apt_bathroom; PlayerTo (bldg_apt_bathroom); ], class Room, has light; Object -> bld_apt_bathroom_in_tub_drain "drain" with name "drain", initial "The drain lies open, the plug long since disappeared. A faint gurgling sound \ echoes from within.", description "The drain is nothing more than an open, dark hole at the faucet-end of the tub. \ There's a notch in the drain's metal rim that seems to indicate the attachment, \ at one time, of a chain with a stopper, but those items are nowhere to be found \ now.", before [; Listen: if (self hasnt general) { print "You bend down and put your ear to the drain. At first you hear only the wet \ sounds of moving water, but after some straining, you're almost certain that \ you can hear voices somewhere below. You can't make out any words -- the \ voices are distorted by the metal of the pipes, and the more you listen, the \ less the conversations sound like any language you've ever heard. Quite \ suddenly, one voice issues forth, far louder and clearer than the others, and \ speaking English. It says, 'Wake up!'^\ ^You sit up quickly.^"; give self general; return; } else print "You hear nothing but the hollow sounds of water trickling through the pipes.^"; return; Search: "It's too dark to see anything down there."; ], has static; Object bldg_apt_kitchen "Kitchen" with description "The kitchen.", exit_to bldg_apt_hallway, n_to bldg_apt_hallway, w_to bldg_apt_bathroom, class Room, has light; Object bldg_apt_hallway "Hallway" with description "The hallway of your apartment is long and narrow. There is a small closet next \ to the door to the stairwell. Your bedroom is to the east, the small kitchen is \ to the south.", exit_to bldg_apt_stairwell_3, w_to bldg_apt_stairwell_3, s_to bldg_apt_kitchen, e_to bldg_apt_bedroom, class Room, has light; Object -> bldg_apt_closet "closet" with name "closet", description "It's your closet, full of coats and clutter.", before [; Close: "You struggle to close the sliding closet door for a moment before giving up."; ], has scenery container open openable; Object -> -> flashlight "flashlight" with name "flashlight" "torch", description "It's a yellow utility flashlight with a big, friendly switch on the side.^", after [; SwitchOn: give self light; SwitchOff: give self ~light; ], has switchable; Object -> -> new_lightbulb "new light bulb" with name "new bulb" "bulb" "light bulb" "new light bulb", description "It's a new 75-watt light bulb, perfect for the fixture in your bedroom ceiling."; Object bldg_apt_bedroom "Your Bedroom" with description "You're in the small bedroom of your small apartment. Clothes and books are \ strewn about strategically: Some people might call your room messy, but it's \ taken you years to get it just the way you like it. Your bed is up against the \ eastern wall beneath a poster of Bono. A door to the west leads to the hall.", w_to bldg_apt_hallway, exit_to bldg_apt_hallway, class Room, has light; Object -> bldg_apt_bedroom_poster "poster" with name "poster" "bono" "poster of bono" "bono poster" "u2 poster" "poster of u2", description "Bono stares down at you moonily. He's wearing his trademark yellow-tinted \ shades.", before [; Take: "Some genius used duct tape to put this poster on the wall. You won't be able \ to take it down without tearing it."; Attack: "No way! You bought that from an authorized U2 poster dealer!"; ], has scenery; Object -> bldg_apt_bedroom_window "window" with name "window", initial "Thin streams of moonlight from the window illuminate the room enough for you to \ safely navigate.", description "Your bedroom window.", difficulty_counter 3, after [; Open: switch (self.difficulty_counter) { 3: print "Years of paint and many winters have pressed the window to the sill. You pull \ upwards with all your might. Grudgingly, the window slides open, dislodging \ several chips of paint.^"; self.difficulty_counter--; 2: print "The window is somewhat easier to open this time, though it moves unevenly, \ voicing its displeasure along the way.^"; self.difficulty_counter--; 1: print "The window slides open with no complaint.^"; } return; Close: "The window slams shut with a pane-rattling crash."; ], before [; Search: if (self hasnt open) "Try as you might, you can't make out anything through the pane. You're going to \ have to open the window if you want to see out."; else "You poke your head out the window. No lights! Darkness!"; ], has static openable; Object -> bldg_apt_bedroom_switch "light switch" with name "switch" "light" "light switch", initial "There's a light switch on the far wall near the door.", description "It's a small switch for turning on the light fixture above your bed.^", before [; SwitchOn: print "You toggle the switch up and down a few times. No good.^"; ], has static switchable; Object -> bldg_apt_bedroom_bed "your bed" with name "bed" "your bed" "my bed", description "It's your bed, the covers and sheets all tossed around. Very cozy looking.", before [; Enter: PlayerTo (bldg_apt_bedroom_in_bed); return; ], has scenery; Object bldg_apt_bedroom_in_bed "In Bed" with name "bed" "your bed" "my bed", description "You are in bed with the covers on. It is hellishly hot.", exit_to bldg_apt_bedroom, u_to bldg_apt_bedroom, d_to bldg_apt_bedroom, cant_go "The blankets conspire to keep you restrained.", class Room, has light; [ Initialise; StartDaemon (Grue); location = bldg_apt_bedroom_in_bed; "The woman's disguise evaporates in the glare. It's the Evil One, ", "her mouth frozen open in a wail of despair as she fades into ", "oblivion. The memory of that face will haunt your dreams as long ", "as you live.", "^^", "You watch as the sculpture begins to soften in the ", "radiance. It wriggles like a thing alive, leaps across the floor ", "and disappears into a vortex of color. The library folds around ", "you like the closing of a great book...", "^^", "The fan is turning. It slows and comes to a delicate halt. You are ", "in your own room, suddenly awake and sweating in the dark.^"; ];