!\--------------------------------------------------------------------------- DOWN2.HUG Part Two of Down by Kent Tessman (c) 1997-1998 "The Scene" Including: Bottom of slope Crash sight The plane Beside/behind the plane On the wing Exploding plane fuse DoStopFuse Replacements for (from hugolib.h): PrintEndGame PreParse ---------------------------------------------------------------------------\! #set PART2 #ifset MODULE #if undefined InitModule routine InitModule { MovePlayer(crashsite, true) plane is known } #endif #endif !---------------------------------------------------------------------------- ! BOTTOM OF SLOPE: room bottomofslope "bottom of slope" { long_desc { ! Is 'special' once the little parenthetical in the ! long_desc has been printed ! "The airplane rests precariously on the crest of a steep drop off to the southeast"; if self is not special { " (assuming you have your bearings right)"; self is special } ". There may be a fire; you can see smoke coming from the fuselage, but it's not clear where or why. You can see people: some walking, some sitting, some lying on the ground. The ground slopes up to the north." } se_to crashsite #ifset PART1 n_to gentleslope #endif after { location DoGo { plane is known return false } } } ! distant_class ! ! A useful class, built on the scenery class, since various objects may be ! visible but not accessible to a player in bottomofslope: property real_object ! i.e., "object" as to "distant_object" scenery distant_class { before { ! Pass allowable actions: object DoLook {return false} ! Give special responses: object DoGo { "Which way do you want to go?" } ! Or give the default response: object { print CThe(self); IsorAre(self, true); " too far away to do that." } } long_desc { return self.real_object.long_desc } parse_rank -1 } distant_class distant_steepdrop "steep drop" { in bottomofslope nouns "drop", "crest", "cliff" adjectives "steep", "high", "sharp" article "the" real_object steepdrop } distant_class distant_people "people" { in bottomofslope nouns "people", "men", "women", "children", "persons", "passengers" article "the" is plural real_object people } distant_class distant_plane "airplane" { found_in bottomofslope nouns "airplane", "aeroplane", "plane", "jet", "aircraft", \ "craft", "fuselage" adjective "air", "aero", "wreckage" article "the" real_object plane } !---------------------------------------------------------------------------- ! CRASH SITE: room crashsite "crash site" { long_desc "The broken body of the destroyed plane is right here--off to the south and east, if anything, but right in front of you. The passengers who can walk are helping those who survived out of the wreckage. And carrying out those who didn't. Going northwest will take you away from the wreckage and toward the bottom of the slope." nw_to bottomofslope e_to behindplane s_to besideplane before { location DoJump { "Over the edge of the steep drop? About the least healthy thing you could do right now." } } } scenery steepdrop "steep drop" { in crashsite nouns "drop", "crest", "cliff" adjectives "steep", "high", "sharp" article "the" long_desc "And a very steep drop it is. The land curves down and suddenly drops away over what can only be described as a cliff, ending a hundred feet below in the jagged, rocky landscape." } scenery people "people" { in crashsite nouns "people", "men", "women", "children", "persons", \ "passengers", "survivors" adjective "live", "living", "injured" article "the" parse_rank 1 ! so that "passengers" selects people over fatalities is plural long_desc "Some of the passengers are doing better than others: \ they're able to help the injured away from the wreckage." before { object DoListen { "Some of the injured are moaning or crying, some incoherently, some asking for help." } } } scenery fatalities "fatalities" { in crashsite nouns "body", "bodies", "corpse", "corpses", "passengers", \ "fatalities", "victims", \ "people", "men", "women", "children", "persons", "passengers" adjective "dead", "killed" article "the" is plural long_desc "Many people--dozens, at least--didn't survive the crash. \ Those passengers who can walk are helping move the injured and dead away from the plane." } !---------------------------------------------------------------------------- ! THE AIRPLANE ITSELF: scenery plane "airplane" { found_in crashsite, behindplane, besideplane, onwing nouns "airplane", "aeroplane", "plane", "jet", "aircraft", \ "craft", "fuselage" adjective "air", "aero", "wreckage" article "the" long_desc "The airplane looks strange lying here: it doesn't seem to be in one piece, although it has kept its shape--indeed, the wings and fuselage of the DC-9 seem bent and folded, broken off and laid carefully back down in place. There is smoke, too, and while you can't see fire, you can smell the thick, nose-wrinkling stink of something burning." before { object DoEnter { if location ~= onwing "You can't get into the plane from here." else MovePlayer(insideplane) } } is enterable } scenery wings "wings" { in crashsite nouns "wings", "wing" adjective "airplane", "aeroplane", "connected", "detached", \ "unattached", "end" article "the" preposition "on", "off" long_desc "One of the wings is completely detached; the other is twisted back at an odd angle, still connected to the body of the plane. The end of the connected wing is buried in the ground, a furrow of upturned earth behind it." before { object DoClimb, DoEnter { "You can't get onto the wing from here." } } is enterable, plural } !---------------------------------------------------------------------------- ! BEHIND THE AIRPLANE: room behindplane "behind the airplane" { long_desc "The wreckage doesn't look quite so bad from this angle, surprisingly. The rear view hides most of the damage to the fuselage, and the tail is for the most part unharmed. \ It looks like there's fire off to the southeast, where the detached wing was connected to the fuselage. A large tree trunk looks like it has pierced the bottom of the aircraft--you couldn't see that from the view from to the west." w_to crashsite se_to "You can't go that way--the ground slopes down over some pretty tough-to-navigate (especially in your condition) geography. It's probably best: you can't be expected to predict the future, but fire like that just might be the precursor to an explosion." extra_scenery "tail", "rudder" } scenery otherwing "wing" { in behindplane nouns "wing" adjective "airplane", "detached" article "the" long_desc return otherwing.long_desc } scenery exterior_fire "fire" { in behindplane nouns "fire", "flames", "flame" article "the" long_desc "There's fire where the wing was connected to the fuselage." } scenery treetrunk "tree trunk" { in behindplane noun "trunk", "branch", "fuselage" adjective "tree", "big", "large" article "the" long_desc "The tree trunk has actually skewered the airplane. Looking at it now, and at the angle of the earth, it almost looks like the tree trunk is the only thing anchoring the wreckage and keeping it from slipping off the steep drop." } !---------------------------------------------------------------------------- ! BESIDE THE AIRPLANE: room besideplane "beside the airplane" { long_desc "You're standing at right where the end of the remaining attached wing has burrowed into the earth at your feet. \ The entire airplane is canted toward this side, and looking up, you can see the row of windows--some broken--set into the bruised and crumpled metal shell. Walking north will take you back along the length of the plane." n_to crashsite u_to onwing extra_scenery "bruised", "crumpled", "metal", "shell" } distant_class distant_windows "windows" { in besideplane nouns "windows", "window", "glass", "holes", "hole", "plexiglass", \ "interior" adjectives "broken", "shattered", "empty", "dark" article "the" real_object windows is plural, transparent, enterable } scenery wing "wing" { in besideplane found_in onwing ! as well nouns "wing" adjective "airplane", "aeroplane", "connected", "detached", \ "unattached", "end" article "the" preposition "on", "off" long_desc "The end of the wing is buried in the ground, a furrow of upturned earth behind it." reach wing before { object DoEnter, DoClimb { if player in onwing "You're already on the wing." else MovePlayer(onwing) } } is enterable, platform, burning } !---------------------------------------------------------------------------- ! ON THE WING: room onwing "on the wing" { long_desc "Crouched where you are on the wing, you can reach out and touch the broken plexiglass where the windows used to be. A breeze blows around you, chilling you; the awful reality of the scene below you seems somewhat removed." in_to insideplane out_to besideplane d_to besideplane before { location DoJump { "Not a good idea. Not here, not in your condition, not with that leg." } } } scenery windows "windows" { in onwing nouns "windows", "window", "glass", "holes", "hole", "plexiglass", \ "interior" adjectives "broken", "shattered", "empty", "dark" article "the" long_desc "The windows are broken. Empty holes where plexiglass used to be look into the dark interior of the airplane." before { object DoEnter { MovePlayer(insideplane) } } is enterable, plural, transparent } !---------------------------------------------------------------------------- ! EXPLODING PLANE FUSE: fuse exploding_plane_fuse {} event in exploding_plane_fuse { local t t = self.tick if plane is known { select t case 60*TURNS_PER_MIN { "\nYou hear a distant, rumbling \Iboom\i. A minor explosion, it sounds like. How long before the entire wreckage goes up?" event_flag = true } case 30*TURNS_PER_MIN { "\nYou hear another distant, rumbling \Iboom\i. \ Louder this time. The wreckage is going to explode: the only question is how long before it does." event_flag = true } case 0 { if location is inside_the_plane { "\nSuddenly an \Iexplosion\i rips violently through the inside of the plane! You barely have time to half-recognize what's happening before--" } else { "\nThere's a tremendous \Iexplosion\i! The fuselage of the plane is suddenly ripped apart. The ground under your feet shakes with the force of the blast, and a rush of hot wind blows over you. Then everything around you--the trees, everything--seems to be on fire, and there's nowhere for you or anyone else to escape to..." } endflag = 2 } } else { select t case 60*TURNS_PER_MIN { "\nYou hear a distant, rumbling \Iboom\i. Almost like an explosion." if location = behindplane "\nThe woman looks up from her injured husband. \ \"Will it blow up? What if it catches fire?\" she asks in a panicky voice." event_flag = true } case 30*TURNS_PER_MIN { "\nYou hear another distant, rumbling \Ibook\i. \ Louder this time." event_flag = true } case 0 { "\nThere's a tremendous \Iexplosion\i! You have no idea what it was, but it seems like everything around you suddenly shakes violently and a blast of hot wind blows over you. Then everything around you--the trees, everything--seems to be on fire, and there's nowhere for you to escape to..." endflag = 2 } } } #ifset BETA_TEST routine DoStopFuse { if exploding_plane_fuse is not active "Already deactivated." else { Deactivate(exploding_plane_fuse) "Deactivated." } } #endif replace PrintEndGame(end_type) { Font(BOLD_ON) select end_type case 1: print "\n*** THE GAME HAS ENDED ***" case 2: { if player_person = 2 print "\n*** YOU HAVE DIED ***" else print "\n*** "; CThe(player); \ MatchPlural(player, "has", "have"); \ " died! ***" } Font(BOLD_OFF) PrintScore(true) } !---------------------------------------------------------------------------- ! PARSING ADJUSTMENTS: replace PreParse { local i ! Since "get off wing" or "exit wing" will cause a parser complaint ! because the player isn't really "in" the wing, change either to ! simply "exit" (i.e., to direct the library to out_to). ! if (word[1] = "get", "climb") and word[2] = "off" { word[1] = "exit" DeleteWord(2) } if word[1] = "exit" and ObjWord(word[2], wing) DeleteWord(2) ! Allow handing of, e.g., "ask girl about her mother", so that "her" ! doesn't get mapped incorrectly ! if word[1] = "ask", "tell" { for (i=2; i<=words and word[i]~=""; i++) { if word[i] = "his", "her", "your" { DeleteWord(i) break } } } }