;---------------------------------------------------------------------------- ; ; Advent: a demonstration of GINAS code, and a classic game. ; ; Translation to Inform code begun 17.5.94: completed 24.5.94 ; ; Translation to GINAS begun 3/3/95 ; continued 8/20/95 ; ;---------------------------------------------------------------------------- ; include the default class and action definitions ; (load "defaults.gns") ; disable default lighting so that a light source is required (set *ignore-lighting* nil) ;******************************************* change max-lift back to 7 (function max-lift () 100) (set MAX_SCORE 350) (set MAX_TREASURES 15) (set caves_closed nil) (set canyon_from nil) (set treasures_found 0) (set deaths 0) (class Treasure (getable-object) ((depositpoints . 10) (valuable)) ((do-drop (actptr) (move self (location-of actptr)) (set score (- score 5)) (if (= 'Inside_Building (objectname (location-of actptr))) (begin (set score (+ score (getprop self 'depositpoints))) (print "Safely deposited.\n")) (print "Dropped.\n"))) (do-get (actptr) (cond ((equal? self actptr) (print "Picking yourself up accomplishes nothing.\n")) ((contained-in? self actptr) (print "You are already carrying it.\n")) ((> (+ (total-weight-contained actptr) (total-weight self)) (max-lift actptr)) (print "You are carrying too much.\n")) ((move self actptr) (if (= 'Inside_Building (objectname (location-of actptr))) (set score (- score (getprop self depositpoints)))) (set score (+ score 5)) (if (not (hasprop self 'istaken)) (begin (setprop self 'istaken nil) (set treasures_found (1+ treasures_found)) (set score (+ score 2)))) (setprop self 'istaken nil) (print "Taken.\n")) (t (print "Unable to comply.\n")))) )) ;---------------------------------------------------------------------------- ; The outside world ;---------------------------------------------------------------------------- (object At_End_Of_Road nil (location) ((name . "At End Of Road") (nouns "gully" "road" "street" "path") (ldesc . "You are standing at the end of a road before a small \ brick building. Around you is a forest. A small \ stream flows out of the building and down a gully. ") (west . At_Hill_In_Road) (up . At_Hill_In_Road) (east . Inside_Building) (down . In_A_Valley) (south . In_A_Valley) (north . In_Forest_1) (in . Inside_Building) (light)) ()) (object well scenery-objects (thing) ((name . "well house") (nouns "well" "house" "brick" "building" "wellhouse") (adjectives "small") (ldesc . "It's a small brick building. It seems to be a well house. ") (found_in At_End_Of_Road At_Hill_In_Road Inside_Building)) ()) (object Stream scenery-objects (thing) ((name . "stream") (nouns "stream" "water" "brook" "river" "lake" "reservoir") (adjectives "small" "tumbling" "splashing" "babbling" "rushing") (found_in At_End_Of_Road In_A_Valley At_Slit_In_Streambed In_Pit In_Cavern_With_Waterfall At_Reservoir Inside_Building)) ((do-drink (actptr) (print "You have taken a drink from the stream. The water \ tastes strongly of minerals, but is not unpleasant. \ It is extremely cold.\n")) (do-get (actptr) (if (not (contained-in? (findobject 'bottle) actptr)) (print "You have nothing in which to carry the water.\n") (method (findobject 'bottle) do-fill actptr))) (do-put-in (actptr objptr) (if (or (= (objectname objptr) 'ming_vase) (= (objectname objptr) 'bottle)) (method objptr do-fill actptr) (print "The " (method objptr get-name) "does not hold water.\n"))) (move-into (actptr objptr) (move objptr *voidptr*) (if (subclassof? objptr 'Treasure) (set score (- score 5))) (print "The " (method objptr get-name) " washes away with the stream.\n")) )) (object Road scenery-objects (thing) ((name . "road") (nouns "road" "street" "path" "dirt") (ldesc . "The road is dirt, not yellow brick. ") (found_in At_End_Of_Road At_Hill_In_Road In_Forest_2)) ()) (object forest scenery-objects (thing) ((name . "forest") (nouns "forest" "tree" "oak" "maple" "grove" "pine" "spruce" "birch" "ash" "sabling" "bush" "leaf" "berry" "hardwood") (ldesc . "The trees of the forest are large hardwood oak and \ maple, with an occasional grove of pine or spruce. \ There is quite a bit of undergrowth, largely birch \ and ash saplings plus nondescript bushes of various \ sorts. This time of year visibility is quite \ restricted by all the leaves, but travel is quite \ easy if you detour around the spruce and berry bushes. ") (found_in At_End_Of_Road At_Hill_In_Road In_A_Valley In_Forest_1 In_Forest_2)) ()) (object At_Hill_In_Road nil (location) ((name . "At Hill In Road") (nouns "gully" "road" "street" "path") (ldesc . "You have walked up a hill, still in the forest. The road \ slopes back down the other side of the hill. There is a \ building in the distance. ") (east . At_End_Of_Road) (north . At_End_Of_Road) (down . At_End_Of_Road) (south . In_Forest_1) (light)) ()) (object Hill At_Hill_In_Road (thing) ((name . "hill") (nouns "hill" "bump" "incline") (ldesc . "It's just a typical hill. ") (noshow)) ()) (object OtherSideOfHill At_Hill_In_Road (thing) ((name . "other side of hill") (article . "the") (nouns "other" "side" "hill") (ldesc . "Why not explore it yourself? ") (noshow)) ()) (object Inside_Building nil (location) ((name . "Inside Building") (ldesc . "You are inside a building, a well house for a \ large spring. ") (baddir . "The stream flows out through a pair of 1 foot \ diameter sewer pipes. The only exit is to the west. ") (in . "The pipes are too small. ") (west . At_End_Of_Road) (out . At_End_Of_Road) (light)) ()) (object Spring Inside_Building (thing) ((name . "spring") (nouns "spring") (adjectives "large") (ldesc . "The stream flows out through a pair of 1 foot \ diameter sewer pipes. ") (noshow)) ((do-drink (actptr) (method (findobject 'Stream) do-drink actptr)) (do-get (actptr) (method (findobject 'Stream) do-get actptr)) (do-put-in (actptr) (method (findobject 'Stream) do-put-in actptr)) (move-into (actptr) (method (findobject 'Stream) move-into actptr)) (do-enter (actptr) (print "The stream flows out through a pair of 1 foot diameter \ sewer pipes. It would be advisable to use the exit.\n")) )) (object SewerPipes Inside_Building (thing) ((name . "pair of 1 foot diameter sewer pipes") (ldesc . "Too small. The only exit is to the west. ") (nouns "pipe" "one" "foot" "diameter" "sewer" "sewer-pipe") (noshow)) ((do-enter (actptr) (print "The stream flows out through a pair of 1 foot diameter \ sewer pipes. It would be advisable to use the exit.\n")) )) (object set_of_keys Inside_Building (key-object getable-object) ((name . "set of keys") (nouns "key" "keyring" "set" "bunch") (ldesc . "It's just a normal-looking set of keys. ") (initial . "There are some keys on the ground here. ")) ()) (object tasty_food Inside_Building (getable-object) ((name . "tasty food") (article . "some") (nouns "food" "ration" "tripe") (adjectives "yummy" "tasty" "delicious" "scrumtious") (ldesc . "Sure looks yummy! ") (initial . "There is tasty food here. ")) ((do-eat (actptr) (print "Delicious!\n")))) (object brass_lantern Inside_Building (switchable-light getable-object) ((name . "brass lantern") (nouns "lamp" "headlamp" "headlight" "lantern" "light") (adjectives "shiny" "brass") (nopower . "Unfortunately, the batteries seem to be dead. ") (onmesg . "The lamp emits a cheery glow. ") (powerleft . 330)) ((when-light-active () (let ((timeleft (getprop self 'powerleft))) (set timeleft (1- timeleft)) (setprop self 'powerleft timeleft) (if (= timeleft 30) (player-message self "Your lamp is getting dim. ")) (if (<= timeleft 0) (begin (player-message self "Your lamp has run out of power. ") (setprop self 'activated 'no))))) (power-low? () (if (< (getprop self 'powerleft) 30))) (descfull () (print "It is a shiny brass lamp" (cond ((= (getprop self 'activated) 'no) ". It is not currently lit. ") ((power-low?) ", glowing dimly. ") (t ", glowing brightly. ")))) (descpart () (print (if (sheds-light?) "Your lamp is here, gleaming brightly. " "There is a shiny brass lamp nearby. "))) (when-light-active () (let ((timeleft (getprop self 'powerleft))) (set timeleft (1- timeleft)) (setprop self 'powerleft timeleft) (cond ((<= timeleft 0) (setprop self 'activated 'no) (player-message self "Your lamp has run out of power.\n") (if (and (not (contained-in? (findobject 'fresh_batteries) *player*)) (not (method (location-of *player*) is-illuminated?))) (begin (print "You can't explore the cave without \ a lamp. So let's just call it a day.\n") (exit-game)) (replace-batteries))) ((= timeleft 30) (print "Your lamp is getting dim. ") (if (contained-in? (findobject 'fresh_batteries) *voidptr) (print "You're also out of spare batteries. \ You'd best start wrapping this up. ")) (if (method (findobject 'Dead_End_14) visited? *player*) (if (contained-in? (findobject 'fresh_batteries) (findobject 'VendingMachine)) (print "You'd best start wrapping this up, \ unless you can find some fresh \ batteries. I seem to recall there's a \ vending machine in the maze. Bring \ some coins with you.\n") (print "You'd best go back for those \ batteries.\n"))))))) (replace-batteries () (let ((batts (findobject 'fresh_batteries))) (cond ((or (contained-in? batts *player*) (contained-in? batts (location-of *player*))) (move batts *voidptr*) (move (findobject 'old_batteries) (location-of *player*)) (setprop self 'powerleft 2500) (print "I'm taking the liberty of replacing the \ batteries.\n"))))) (move-into (actptr objptr) (cond ((= 'old_batteries (objectname objptr)) (print "Those batteries are dead; they won't do any \ good at all.\n")) ((= 'fresh_batteries (objectname objptr)) (replace-batteries)) (t (print "The only thing you might successfully put in \ the lamp is a fresh pair of batteries.\n")))) (do-rub (actptr) (print "Rubbing the electric lamp is not particularly \ rewarding. Anyway, nothing exciting happens.\n")) )) (spawn (findobject 'brass_lantern) light-daemon) (object bottle Inside_Building (openable-container getable-object) ((name . "small bottle") (initial . "There is an empty bottle here. ") (nouns "bottle" "jar" "flask") (adjectives "small" "empty" "full" "water") (isclosed)) ((do-empty (actptr) (cond ((null? (child self)) (print "The bottle is already empty!\n")) ((is-closed?) (print "You'd best open the bottle first.\n")) (t (begin (move (child self) *voidptr*) (print "Your bottle is now empty and the ground is \ now wet.\n"))))) (do-fill (actptr) (cond ((child self) (print "The bottle is full already.\n")) ((is-closed?) (print "You'd best open the bottle first.\n")) ((or (contained-in? (findobject 'Spring) (location-of self)) (member (objectname (location-of self)) (getprop (findobject 'Stream) 'found_in))) (move-by-name 'water_in_the_bottle 'bottle) (print "The bottle is now full of water.\n")) ((contained-in? (findobject 'Oil) (location-of self)) (move-by-name 'oil_in_the_bottle 'bottle) (print "The bottle is now full of oil.\n")) (t (print "There is nothing here with which to fill \ the bottle.\n")))) (do-put-in (actptr objptr) (if (not (contained-in? self actptr)) (do-get actptr)) (if (or (= (objectname objptr) 'Stream) (= (objectname objptr) 'Spring) (= (objectname objptr) 'Oil)) (do-fill actptr) (method objptr move-into actptr self))) (move-into (actptr objptr) (if (or (= objptr (findobject 'Stream)) (= objptr (findobject 'Oil))) (do-fill actptr) (print "The bottle is only supposed to hold liquids.\n"))) )) (object water_in_the_bottle the-void (thing) ((name . "bottled water") (article . "some") (nouns "water" "h2o") (adjectives "bottled") (ldesc . "It looks like ordinary water to me. ")) ((do-drink (actptr) (method (findobject 'Stream) do-drink actptr)) )) (object oil_in_the_bottle the-void (thing) ((name . "bottled oil") (ldesc . "It looks like ordinary oil to me. ") (article . "some") (nouns "oil" "lubricant" "grease") (adjectives "bottled")) ((do-drink (actptr) (method (findobject 'Oil) do-drink actptr)) )) (object In_Forest_1 nil (location) ((name . "In Forest") (ldesc . "You are in open forest, with a deep valley to one side. ") (east . In_A_Valley) (down . In_A_Valley) (north . In_Forest_1) (west . In_Forest_1) (south . In_Forest_1) (light)) ((upon-entry (actptr) (if (= (random 2) 1) (move actptr (findobject 'In_Forest_2)))) )) (object In_Forest_2 nil (location) ((name . "In Forest") (ldesc . "You are in open forest near both a valley and a road. ") (north . At_End_Of_Road) (south . In_Forest_1) (east . In_A_Valley) (west . In_A_Valley) (down . In_A_Valley) (light)) ()) (object In_A_Valley nil (location) ((name . "In A Valley") (ldesc . "You are in a valley in the forest beside a \ stream tumbling along a rocky bed. ") (north . At_End_Of_Road) (east . In_Forest_1) (west . In_Forest_1) (up . In_Forest_1) (south . At_Slit_In_Streambed) (down . At_Slit_In_Streambed) (name "valley") (light)) ()) (object Streambed In_A_Valley (thing) ((name . "streambed") (nouns "bed" "streambed" "rock") (adjectives "small" "rocky" "bare" "dry") (noshow)) ()) (object At_Slit_In_Streambed nil (location) ((name . "At Slit In Streambed") (ldesc . "At your feet all the water of the stream \ splashes into a 2-inch slit in the rock. Downstream \ the streambed is bare rock. ") (north . In_A_Valley) (east . In_Forest_1) (west . In_Forest_1) (south . Outside_Grate) (light)) ((do-enter (actptr) (print "You don't fit through a two-inch slit!\n")) )) (object Slit At_Slit_In_Streambed (thing) ((name . "2-inch slit") (nouns "slit") (adjectives "2-inch" "two" "inch" "two-inch") (ldesc . "It's just a 2-inch slit in the rock, through which the \ stream is flowing. ") (noshow)) ()) (object Outside_Grate nil (location) ((name . "Outside Grate") (ldesc . "You are in a 20-foot depression floored with bare \ dirt. Set into the dirt is a strong steel grate mounted \ in concrete. A dry streambed leads into the depression. ") (east . In_Forest_1) (west . In_Forest_1) (south . In_Forest_1) (north . At_Slit_In_Streambed) (light)) ()) (object Depression Outside_Grate (thing) ((name . "20-foot depression") (nouns "depression" "dirt") (adjectives "twenty" "foot" "bare" "20-foot" "twenty-foot") (ldesc . "You're standing in it. ") (noshow)) ()) (object Grate Outside_Grate (portal) ((name . "steel grate") (nouns "grating" "grate" "lock" "gate" "grille") (adjectives "metal" "strong" "steel" "grating") (ldesc . "It just looks like an ordinary grate mounted in concrete. ") (othername . Grate-Other) (direction . down) (islocked) (isclosed)) ((do-lock (actptr) (let ((objptr (findobject 'set_of_keys))) (if (contained-in? objptr actptr) (begin (print "(with the keys)\n") (do-lock-with actptr objptr)) (print "You do not have any keys.\n")))) (do-unlock (actptr) (let ((objptr (findobject 'set_of_keys))) (if (contained-in? objptr actptr) (begin (print "(with the keys)\n") (do-unlock-with actptr objptr)) (print "You do not have any keys.\n")))) (descfull () (print (getprop self 'ldesc) (cond ((is-locked?) nil) ((is-closed?) "The grate is unlocked but shut. ") (t "The grate stands open. ")))) (before (actptr objptr actionname) (if (and (= 'do-enter actionname) (is-closed?) (not (is-locked?))) (begin (print "(opening it first)\n") (set-opened)) t)) )) ;---------------------------------------------------------------------------- ; Facilis descensus Averno... ;---------------------------------------------------------------------------- (object Below_The_Grate nil (location) ((name . "Below the Grate") (ldesc . "You are in a small chamber beneath a 3x3 steel \ grate to the surface. A low crawl over cobbles leads \ inward to the west. ") (west . In_Cobble_Crawl) (light)) ()) (object Grate-Other Below_The_Grate (portal-other) ((name . "steel grate") (nouns "grating" "grate" "lock" "gate" "grille") (adjectives "metal" "strong" "steel" "grating") (ldesc . "It just looks like an ordinary grate mounted in concrete. ") (othername . Grate) (direction . up)) ((do-lock (actptr) (let ((objptr (findobject 'set_of_keys))) (if (contained-in? objptr actptr) (begin (print "(with the keys)\n") (do-lock-with actptr objptr)) (print "You do not have any keys.\n")))) (do-unlock (actptr) (let ((objptr (findobject 'set_of_keys))) (if (contained-in? objptr actptr) (begin (print "(with the keys)\n") (do-unlock-with actptr objptr)) (print "You do not have any keys.\n")))) (before (actptr objptr actionname) (if (and (= 'do-enter actionname) (is-closed?) (not (is-locked?))) (begin (print "(opening it first)\n") (set-opened)) t)) )) (object Cobbles scenery-objects (thing) ((name . "cobbles") (article . "the") (nouns "cobble" "cobblestone" "stone") (ldesc . "They're just ordinary cobbles. ") (found_in In_Cobble_Crawl In_Debris_Room Below_The_Grate)) ()) (object In_Cobble_Crawl nil (location) ((name . "In Cobble Crawl") (ldesc . "You are crawling over cobbles in a low passage. \ There is a dim light at the east end of the passage. ") (east . Below_The_Grate) (west . In_Debris_Room) (light)) ()) (object wicker_cage In_Cobble_Crawl (in-container getable-object) ((name . "wicker cage") (nouns "cage") (adjectives "small" "wicker") (ldesc . "It's a small wicker cage. ") (initial . "There is a small wicker cage discarded nearby. ") (transparent)) ((do-open (actptr) (cond ((contained-in? (findobject 'little_bird) self) (print "(releasing the little bird)\n") (method (findobject 'little_bird) do-release actptr)))) (do-close (actptr) (print "The cage is now closed.\n")) )) (object In_Debris_Room nil (location) ((name . "In Debris Room") (ldesc . "You are in a debris room filled with stuff \ washed in from the surface. A low wide passage with \ cobbles becomes plugged with mud and debris here, but \ an awkward canyon leads upward and west. \ A note on the wall says, \"Magic word XYZZY.\" ") (east . In_Cobble_Crawl) (up . In_Awkward_Sloping_E_W_Canyon) (west . In_Awkward_Sloping_E_W_Canyon) (nodwarf)) ()) (object Debris In_Debris_Room (thing) ((name . "debris") (nouns "debris" "stuff" "mud") (ldesc . "Yuck. ") (noshow)) ()) (object XyzzyNote In_Debris_Room (thing) ((name . "note") (ldesc . "The note says \"Magic word XYZZY\". ") (nouns "note" "writing") (noshow)) ()) (object black_rod In_Debris_Room (getable-object) ((name . "black rod with a rusty star on the end") (nouns "rod" "star" "black") (adjectives "rusty" "three" "foot" "three-foot" "iron") (ldesc . "It's a three foot black rod with a rusty star on an end. ") (initial . "A three foot black rod with a rusty star on one \ end lies nearby. ")) ((do-wave (actptr) (let ((bridge1 (findobject 'CrystalBridge1)) (bridge2 (findobject 'CrystalBridge2)) (eastside (findobject 'On_East_Bank_Of_Fissure)) (westside (findobject 'West_Side_Of_Fissure))) (if (or (= westside (location-of actptr)) (= eastside (location-of actptr))) (cond (caves_closed (print "Peculiar. Nothing happens.\n")) ((contained-in? bridge1 *voidptr*) (move bridge1 eastside) (move bridge2 westside) (print "A crystal bridge now spans the fissure.\n")) (t (move bridge1 *voidptr*) (move bridge2 *voidptr*) (print "The crystal bridge has vanished!\n"))) (print "Nothing happens.\n")))) )) (object In_Awkward_Sloping_E_W_Canyon nil (location) ((name . "Sloping E/W Canyon") (ldesc . "You are in an awkward sloping east/west canyon. ") (down . In_Debris_Room) (east . In_Debris_Room) (up . In_Bird_Chamber) (west . In_Bird_Chamber) (nodwarf)) ()) ;---------------------------------------------------------------------------- ; The little bird in its natural habitat ;---------------------------------------------------------------------------- (object In_Bird_Chamber nil (location) ((name . "Orange River Chamber") (ldesc . "You are in a splendid chamber thirty feet high. \ The walls are frozen rivers of orange stone. An \ awkward canyon and a good passage exit from east and \ west sides of the chamber. ") (east . In_Awkward_Sloping_E_W_Canyon) (west . At_Top_Of_Small_Pit) (nodwarf)) ()) (object little_bird In_Bird_Chamber (getable-object) ((name . "little bird") (nouns "bird") (adjectives "cheerful" "mournful" "little") (initial . "A cheerful little bird is sitting here singing. ")) ((do-drop (actptr) (cond ((contained-in? self (findobject 'wicker_cage)) (print "(The bird is released from the cage)\n") (do-release actptr)))) (do-catch (actptr) (do-get actptr)) (do-get (actptr) (let ((cage (findobject 'wicker_cage))) (cond ((contained-in? self cage) (print "You already have the little bird. If \ you take it out of the cage it will likely \ fly away from you.\n")) ((not (contained-in? cage actptr)) (print "You can catch the bird, but you cannot \ carry it.\n")) ((contained-in? (findobject 'black_rod) actptr) (print "The bird was unafraid when you entered, \ but as you approach it becomes disturbed \ and you cannot catch it.\n")) (t (move self cage) (setprop cage 'isclosed nil) (print "You catch the bird in the wicker cage.\n"))))) (do-release (actptr) (if (not (contained-in? self (findobject 'wicker_cage))) (print "The bird is not caged now.\n") (let ((snake (findobject 'Snake)) (loc (location-of self))) (delprop (findobject 'wicker_cage) 'isclosed) (move self loc) (cond ((contained-in? snake loc) (move snake *voidptr*) (print "The little bird attacks the green snake, \ and in an astounding flurry drives the snake \ away.\n")) ((contained-in? (findobject 'Dragon) loc) (move self *voidptr*) (print "The little bird attacks the green dragon, \ and in an astounding flurry gets burnt to a \ cinder. The ashes blow away.\n")) (t (print "The little bird flies free.\n")))))) (do-attack-with (actptr objptr) (do-attack actptr)) (do-attack (actptr) (cond ((contained-in? self (findobject 'wicker_cage)) (print "Oh, leave the poor unhappy bird alone.\n")) (t (move self *voidptr*) (print "The little bird is now dead. Its body \ disappears.\n")))) (descfull () (print (if (contained-in? self (findobject 'wicker_cage)) "The little bird looks unhappy in the cage.\n" "The cheerful little bird is sitting here singing.\n"))) (do-put-in (actptr objptr) (cond ((= (objectname objptr) 'wicker_cage) (do-get actptr)) ((subclassof objptr 'in-container) (print "Don't put the poor bird in " (method objptr get-name-art) "!\n")) (t (print "You can't put the poor bird in that!\n")))) (receive (actptr objptr) (print "It's not hungry. (It's merely pinin' for the fjords.) \ Besides, I suspect it would prefer bird seed.\n")) (do-order (actptr objptr) (print "Cheep! Chirp!\n")) (do-ask (actptr objptr) (print "Cheep! Chirp!\n")) (do-answer (actptr objptr) (print "Cheep! Chirp!\n")) )) (object At_Top_Of_Small_Pit nil (location) ((name . "At Top of Small Pit") (ldesc . "At your feet is a small pit breathing traces of white \ mist. A west passage ends here except for a small crack \ leading on. Rough stone steps lead down the pit. ") (east . In_Bird_Chamber) (west . "The crack is far too small for you to follow.") (nodwarf)) ((down-dir (actptr) (if (contained-in? (findobject 'large_gold_nugget) *player*) (begin (print "You are at the bottom of the pit \ with a broken neck.\n") (kill-player)) (findobject 'In_Hall_Of_Mists))) )) (object SmallPit At_Top_Of_Small_Pit (thing) ((name . "small pit") (nouns "pit") (adjectives "small") (ldesc . "The pit is breathing traces of white mist. ") (noshow)) ()) (object PitCrack At_Top_Of_Small_Pit (thing) ((name . "crack") (nouns "crack") (adjectives "small") (ldesc . "The crack is very small -- far too small \ for you to follow. ") (noshow)) ()) (object Mist scenery-objects (thing) ((name . "mist") (nouns "mist" "wisp" "vapor") (adjectives "white") (ldesc . "Mist is a white vapor, usually water, seen from time \ to time in caverns. It can be found anywhere but is \ frequently a sign of a deep pit leading down to water. ") (found_in At_Top_Of_Small_Pit In_Hall_Of_Mists On_East_Bank_Of_Fissure At_Window_On_Pit_1 At_West_End_Of_Hall_Of_Mists In_Misty_Cavern In_Mirror_Canyon At_Reservoir At_Window_On_Pit_2 On_Sw_Side_Of_Chasm)) ()) ;---------------------------------------------------------------------------- ; The caves open up: The Hall of Mists ;---------------------------------------------------------------------------- (object In_Hall_Of_Mists nil (location) ((name . "In Hall of Mists") (ldesc . "You are at one end of a vast hall stretching \ forward out of sight to the west. There are openings \ to either side. Nearby, a wide stone staircase leads \ downward. The hall is filled with wisps of white mist \ swaying to and fro almost as if alive. A cold wind blows \ up the staircase. There is a passage at the top of a \ dome behind you. Rough stone steps lead up the dome. ") (south . In_Nugget_Of_Gold_Room) (west . On_East_Bank_Of_Fissure) (down . In_Hall_Of_Mt_King) (north . In_Hall_Of_Mt_King)) ((up-dir (actptr) (if (contained-in? (findobject 'large_gold_nugget) *player*) "The dome is unclimbable." (findobject 'At_Top_Of_Small_Pit))) (upon-entry () (if (not (visited? *player*)) (set score (+ score 25)))) )) (object Staircase In_Hall_Of_Mists (thing) ((name . "wide stone staircase") (nouns "stair" "staircase") (adjectives "wide" "stone") (ldesc . "The staircase leads down. ") (noshow)) ()) (object DomeSteps In_Hall_Of_Mists (thing) ((name . "rough stone steps") (ldesc . "The rough stone steps lead up the dome. ") (nouns "stair" "staircase") (adjectives "rough" "stone") (noshow)) ()) (object Dome In_Hall_Of_Mists (thing) ((name . "dome") (nouns "dome") (noshow)) ((descfull () (print (if (contained-in? (findobject 'large_gold_nugget) *player*) "I'm not sure you'll be able to get up it \ with what you're carrying. " "It looks like you might be able to climb up it. "))) (do-climb (actptr) (move-to-location actptr (method (findobject 'In_Hall_Of_Mists) up-dir actptr))) )) (object In_Nugget_Of_Gold_Room nil (location) ((name . "Low Room") (ldesc . "This is a low room with a crude note on the \ wall: \"You won't get it up the steps.\" ") (north . In_Hall_Of_Mists)) ()) (object NuggetNote In_Nugget_Of_Gold_Room (thing) ((name . "note") (nouns "note" "writing") (adjectives "crude") (ldesc . "The note says, \"You won't get it up the steps.\" ") (noshow)) ()) (object large_gold_nugget In_Nugget_Of_Gold_Room (Treasure) ((name . "large gold nugget") (nouns "gold" "nugget") (adjectives "large" "heavy") (ldesc . "It's a large sparkling nugget of gold! ") (initial . "There is a large sparkling nugget of gold here! ") ) ()) (class FissureRoom (location) ((down . "The fissure is too terrifying! ")) ((do-jump (actptr) (cond ((contained-in? (findobject 'CrystalBridge1) *voidptr*) (print "You didn't make it.\n") (kill-player)) (t (print "I respectfully suggest you go across the \ bridge instead of jumping.\n")))) )) (object On_East_Bank_Of_Fissure nil (FissureRoom) ((name . "On East Bank of Fissure") (ldesc . "You are on the east bank of a fissure slicing \ clear across the hall. The mist is quite thick here, \ and the fissure is too wide to jump. ") (east . In_Hall_Of_Mists)) ((west-dir (actptr) (if (contained-in? (findobject 'CrystalBridge1) self) (findobject 'West_Side_Of_Fissure) "The fissure is too wide. ")) )) (object CrystalBridge1 the-void (thing) ((name . "crystal bridge") (nouns "bridge") (adjectives "crystal") (ldesc . "It spans the fissure, thereby providing you a way across. ") (initial . "A crystal bridge now spans the fissure. ") ) ()) (object West_Side_Of_Fissure nil (FissureRoom) ((name . "West Side of Fissure") (ldesc . "You are on the west side of the fissure in the \ hall of mists. ") (west . At_West_End_Of_Hall_Of_Mists)) ((north-dir (actptr) (print "You have crawled through a very low wide passage \ parallel to and north of the hall of mists.\n") (findobject 'At_West_End_Of_Hall_Of_Mists)) (east-dir (actptr) (if (contained-in? (findobject 'CrystalBridge2) self) (findobject 'On_East_Bank_Of_Fissure) "The fissure is too wide. ")) )) (object CrystalBridge2 the-void (thing) ((name . "crystal bridge") (nouns "bridge") (adjectives "crystal") (ldesc . "It spans the fissure, thereby providing you a way across. ") (initial . "A crystal bridge now spans the fissure. ") ) ()) (object BridgeFissure scenery-objects (thing) ((name . "fissure") (ldesc . "The fissure looks far too wide to jump. ") (found_in On_East_Bank_Of_Fissure West_Side_Of_Fissure)) ()) (object several_diamonds West_Side_Of_Fissure (Treasure) ((name . "diamonds") (article . "some") (nouns "diamond") (adjectives "several" "high" "quality") (ldesc . "They look to be of the highest quality! ") (initial . "There are diamonds here! ") ) ()) (object At_West_End_Of_Hall_Of_Mists nil (location) ((name . "At West End of Hall of Mists") (ldesc . "You are at the west end of the hall of mists. A low \ wide crawl continues west and another goes north. To \ the south is a little passage 6 feet off the floor. ") (south . Alike_Maze_1) (up . Alike_Maze_1) (east . West_Side_Of_Fissure) (west . At_East_End_Of_Long_Hall)) ((north-dir (actptr) (print "You have crawled through a very low wide passage \ parallel to and north of the hall of mists.\n") (findobject 'West_Side_Of_Fissure)) )) ;---------------------------------------------------------------------------- ; Long Hall to the west of the Hall of Mists ;---------------------------------------------------------------------------- (object At_East_End_Of_Long_Hall nil (location) ((name . "At East End of Long Hall") (ldesc . "You are at the east end of a very long hall \ apparently without side chambers. To the east a low \ wide crawl slants up. To the north a round two foot \ hole slants down. ") (east . At_West_End_Of_Hall_Of_Mists) (up . At_West_End_Of_Hall_Of_Mists) (west . At_West_End_Of_Long_Hall) (north . Crossover) (down . Crossover)) ()) (object At_West_End_Of_Long_Hall nil (location) ((name . "At West End of Long Hall") (ldesc . "You are at the west end of a very long \ featureless hall. The hall joins up with a narrow \ north/south passage. ") (east . At_East_End_Of_Long_Hall) (south . Different_Maze_1) (north . Crossover)) ()) (object Crossover nil (location) ((name . "N/S and E/W Crossover") (ldesc . "You are at a crossover of a high N/S passage \ and a low E/W one. ") (west . At_East_End_Of_Long_Hall) (north . Dead_End_7) (east . In_West_Side_Chamber) (south . At_West_End_Of_Long_Hall)) ()) (object TheCrossover Crossover (thing) ((name . "crossover") (nouns "crossover" "cross" "over") (ldesc . "You know as much as I do at this point. ") (noshow)) ()) (class DeadEndRoom (location) ((name . "Dead End") (ldesc . "You have reached a dead end. ") (baddir . "You'll have to go back the way you came. ")) ()) (object Dead_End_7 nil (DeadEndRoom) ((south . Crossover) (out . Crossover)) ()) ;---------------------------------------------------------------------------- ; The Hall of the Mountain King and side chambers ;---------------------------------------------------------------------------- (object In_Hall_Of_Mt_King nil (location) ((name . "Hall of the Mountain King") (ldesc . "You are in the hall of the mountain king, with \ passages off in all directions. ") (baddir . "Well, perhaps not quite all directions. ") (up . In_Hall_Of_Mists) (east . In_Hall_Of_Mists) (north . Low_N_S_Passage) (south . In_South_Side_Chamber) (west . In_West_Side_Chamber) (southwest . In_Secret_E_W_Canyon)) ((north-dir (actptr) (if (contained-in? (findobject 'Snake) self) "You can't get by the snake." (get-dir 'north))) (south-dir (actptr) (if (contained-in? (findobject 'Snake) self) "You can't get by the snake." (get-dir 'south))) (west-dir (actptr) (if (contained-in? (findobject 'Snake) self) "You can't get by the snake." (get-dir 'west))) (southwest-dir (actptr) (if (and (contained-in? (findobject 'Snake) self) (< (random 100) 35)) "You can't get by the snake." (get-dir 'southwest))) )) (object Snake In_Hall_Of_Mt_King (thing) ((name . "snake") (nouns "snake" "cobra" "asp") (adjectives "huge" "fierce" "green" "ferocious" "venemous" "venomous" "large" "big" "killer") (ldesc . "I wouldn't mess with it if I were you. ") (initial . "A huge green fierce snake bars the way! ")) ((do-attack-with (actptr objptr) (do-attack actptr) (move objptr (location-of self)) (print "The " (method objptr get-name) " is now laying on the ground.\n")) (do-attack (actptr) (print "Attacking the snake both doesn't work and is \ very dangerous.\n")) (do-order (actptr objptr) (print "Hiss!\n")) (do-ask (actptr objptr) (print "Hiss!\n")) (do-answer (actptr objptr) (print "Hiss!\n")) (receive (actptr objptr) (cond ((= (objectname objptr) 'little_bird) (move objptr *voidptr*) (print "The snake has now devoured your bird.\n")) (t (print "There's nothing here it wants to eat (except \ perhaps you).\n")))) (do-catch (actptr) (do-get actptr)) (do-get (actptr) (print "It takes you instead. Glrp!\n") (kill-player)) )) (object Low_N_S_Passage nil (location) ((name . "Low N/S Passage") (ldesc . "You are in a low N/S passage at a hole in the \ floor. The hole goes down to an E/W passage. ") (south . In_Hall_Of_Mt_King) (down . In_Dirty_Passage) (north . At_Y2)) ()) (object bars_of_silver Low_N_S_Passage (Treasure) ((name . "bars of silver") (article . "some") (nouns "silver" "bar") (ldesc . "They're probably worth a fortune! ") (initial . "There are bars of silver here! ")) ()) (object In_South_Side_Chamber nil (location) ((name . "In South Side Chamber") (ldesc . "You are in the south side chamber. ") (north . In_Hall_Of_Mt_King)) ()) (object precious_jewelry In_South_Side_Chamber (Treasure) ((name . "precious jewelry") (article . "some") (nouns "jewel" "jewelry") (adjectives "precious" "exquisite") (ldesc . "It's all quite exquisite! ") (initial . "There is precious jewelry here! ")) ()) (object In_West_Side_Chamber nil (location) ((name . "In West Side Chamber") (ldesc . "You are in the west side chamber of the hall of the \ mountain king. A passage continues west and up here. ") (west . Crossover) (up . Crossover) (east . In_Hall_Of_Mt_King)) ()) (object rare_coins In_West_Side_Chamber (Treasure) ((name . "rare coins") (article . "many") (nouns "coin") (adjectives "rare") (ldesc . "They're a numismatist's dream! ") (initial . "There are many coins here! ")) ()) ;---------------------------------------------------------------------------- ; The Y2 Rock Room and environs, slightly below ;---------------------------------------------------------------------------- (object At_Y2 nil (location) ((name . "At \"Y2\"") (ldesc . "You are in a large room, with a passage to the \ south, a passage to the west, and a wall of broken \ rock to the east. There is a large \"Y2\" on \ a rock in the room's center. ") (south . Low_N_S_Passage) (east . Jumble_Of_Rock) (west . At_Window_On_Pit_1)) ((upon-entry () (if (< (random 100) 25) (print "A hollow voice says, \"Plugh.\"\n"))) )) (object Y2Rock At_Y2 (on-container) ((name . "\"Y2\" rock") (nouns "rock" "y2") (ldesc . "There is a large \"Y2\" painted on the rock. ")) ()) (object Jumble_Of_Rock nil (location) ((name . "Jumble of Rock") (ldesc . "You are in a jumble of rock, with cracks everywhere. ") (baddir . "You are in a jumble of rock, with cracks everywhere. ") (down . At_Y2) (up . In_Hall_Of_Mists)) ()) (object At_Window_On_Pit_1 nil (location) ((name . "At Window on Pit") (ldesc . "You're at a low window overlooking a huge pit, \ which extends up out of sight. A floor is \ indistinctly visible over 50 feet below. Traces of \ white mist cover the floor of the pit, becoming \ thicker to the right. Marks in the dust around the \ window would seem to indicate that someone has been \ here recently. Directly across the pit from you and \ 25 feet away there is a similar window looking into a \ lighted room. A shadowy figure can be seen there \ peering back at you. ") (baddir . "The only passage is back east to Y2. ") (east . At_Y2)) ((do-wave-hands (actptr) (print "The shadowy figure waves back at you!\n")) )) (object Window scenery-objects (openable-object) ((name . "window") (nouns "window") (adjectives "low") (ldesc . "It looks like a regular window. ") (found_in At_Window_On_Pit_1 At_Window_On_Pit_2)) ()) (object WindowPit scenery-objects (thing) ((name . "huge pit") (ldesc . "It's so deep you can barely make out the floor below, \ and the top isn't visible at all. ") (nouns "pit") (adjectives "deep" "large") (found_in At_Window_On_Pit_1 At_Window_On_Pit_2)) ()) (object MarksInTheDust scenery-objects (thing) ((name . "marks in the dust") (nouns "mark" "dust") (ldesc . "Evidently you're not alone here. ") (found_in At_Window_On_Pit_1 At_Window_On_Pit_2)) ()) (object ShadowyFigure scenery-objects (thing) ((name . "shadowy figure") (nouns "figure" "shadow" "person" "individual") (adjectives "shadowy" "mysterious") (ldesc . "The shadowy figure seems to be trying to \ attract your attention. ") (found_in At_Window_On_Pit_1 At_Window_On_Pit_2)) ()) (object In_Dirty_Passage nil (location) ((name . "Dirty Passage") (ldesc . "You are in a dirty broken passage. To the east \ is a crawl. To the west is a large passage. Above \ you is a hole to another passage. ") (east . On_Brink_Of_Pit) (up . Low_N_S_Passage) (west . In_Dusty_Rock_Room)) ()) (object On_Brink_Of_Pit nil (location) ((name . "Brink of Pit") (ldesc . "You are on the brink of a small clean climbable \ pit. A crawl leads west. ") (west . In_Dirty_Passage) (down . In_Pit) (in . In_Pit)) ()) (object CleanPit On_Brink_Of_Pit (thing) ((name . "small pit") (nouns "pit") (adjectives "small" "clean" "climbable") (ldesc . "It looks like you might be able to climb down into it. ") (noshow)) ((do-enter (actptr) (move-to-location actptr (find-object 'In_Pit))) )) (object In_Pit nil (location) ((name . "In Pit") (ldesc . "You are in the bottom of a small pit with a little \ stream, which enters and exits through tiny slits. ") (up . On_Brink_Of_Pit) (out . On_Brink_Of_Pit) (down . "You don't fit through the tiny slits! ") (nodwarf)) ()) (object PitSlits In_Pit (thing) ((name . "tiny slits") (ldesc . "The slits form a complex pattern in the rock. ") (nouns "slit") (adjectives "tiny") (noshow)) ()) (object In_Dusty_Rock_Room nil (location) ((name . "In Dusty Rock Room") (ldesc . "You are in a large room full of dusty rocks. \ There is a big hole in the floor. There are cracks \ everywhere, and a passage leading east. ") (east . In_Dirty_Passage) (west . At_Complex_Junction)) ()) (object DustyRocks In_Dusty_Rock_Room (thing) ((name . "dusty rocks") (nouns "rock" "boulder" "stone") (adjectives "dusty" "dirty") (ldesc . "They're just rocks. (Dusty ones, that is.) ") (noshow)) ()) ;---------------------------------------------------------------------------- ; A maze of twisty little passages, all alike... ;---------------------------------------------------------------------------- (class MazeRoom (location) ((name . "Maze") (ldesc . "You are in a maze of twisty little passages, all alike. ") (out . "Easier said than done. ")) ()) (object Alike_Maze_1 nil (MazeRoom) ((up . At_West_End_Of_Hall_Of_Mists) (north . Alike_Maze_1) (east . Alike_Maze_2) (south . Alike_Maze_4) (west . Alike_Maze_11)) ()) (object Alike_Maze_2 nil (MazeRoom) ((west . Alike_Maze_1) (south . Alike_Maze_3) (east . Alike_Maze_4)) ()) (object Alike_Maze_3 nil (MazeRoom) ((east . Alike_Maze_2) (down . Dead_End_3) (south . Alike_Maze_6) (north . Dead_End_13)) ()) (object Alike_Maze_4 nil (MazeRoom) ((west . Alike_Maze_1) (north . Alike_Maze_2) (east . Dead_End_1) (south . Dead_End_2) (up . Alike_Maze_14) (down . Alike_Maze_14)) ()) (object Alike_Maze_5 nil (MazeRoom) ((east . Alike_Maze_6) (west . Alike_Maze_7)) ()) (object Alike_Maze_6 nil (MazeRoom) ((east . Alike_Maze_3) (west . Alike_Maze_5) (down . Alike_Maze_7) (south . Alike_Maze_8)) ()) (object Dead_End_1 nil (DeadEndRoom) ((west . Alike_Maze_4) (out . Alike_Maze_4)) ()) (object Dead_End_2 nil (DeadEndRoom) ((west . Alike_Maze_4) (out . Alike_Maze_4)) ()) (object Dead_End_3 nil (DeadEndRoom) ((up . Alike_Maze_3) (out . Alike_Maze_3)) ()) (object Alike_Maze_7 nil (MazeRoom) ((west . Alike_Maze_5) (up . Alike_Maze_6) (east . Alike_Maze_8) (south . Alike_Maze_9)) ()) (object Alike_Maze_8 nil (MazeRoom) ((west . Alike_Maze_6) (east . Alike_Maze_7) (south . Alike_Maze_8) (up . Alike_Maze_9) (north . Alike_Maze_10) (down . Dead_End_12)) ()) (object Alike_Maze_9 nil (MazeRoom) ((west . Alike_Maze_7) (north . Alike_Maze_8) (south . Dead_End_4)) ()) (object Dead_End_4 nil (DeadEndRoom) ((west . Alike_Maze_9) (out . Alike_Maze_9)) ()) (object Alike_Maze_10 nil (MazeRoom) ((west . Alike_Maze_8) (north . Alike_Maze_10) (down . Dead_End_5) (east . At_Brink_Of_Pit)) ()) (object Dead_End_5 nil (DeadEndRoom) ((up . Alike_Maze_10) (out . Alike_Maze_10)) ()) (object At_Brink_Of_Pit nil (location) ((name . "At Brink of Pit") (ldesc . "You are on the brink of a thirty foot pit with \ a massive orange column down one wall. You could \ climb down here but you could not get back up. The \ maze continues at this level. ") (down . In_Bird_Chamber) (west . Alike_Maze_10) (south . Dead_End_6) (north . Alike_Maze_12) (east . Alike_Maze_13)) ()) (object OrangeColumn At_Brink_Of_Pit (thing) ((name . "massive orange column") (nouns "column") (adjectives "massive" "orange" "big" "huge") (ldesc . "It looks like you could climb down it. ") (noshow)) ((do-climb () (print "You clamber down the orange column.\n") (move-to-location actptr (findobject 'In_Bird_Chamber))) )) (object ThirtyFootPit At_Brink_Of_Pit (thing) ((name . "pit") (nouns "pit") (adjectives "thirty" "foot" "thirty-foot") (ldesc . "You'll have to climb down to find out anything more... ") (noshow)) ((do-climb () (print "You clamber down the orange column.\n") (move-to-location actptr (findobject 'In_Bird_Chamber))) )) (object Dead_End_6 nil (DeadEndRoom) ((east . At_Brink_Of_Pit) (out . At_Brink_Of_Pit)) ()) ;---------------------------------------------------------------------------- ; A line of three vital junctions, east to west ;---------------------------------------------------------------------------- (object At_Complex_Junction nil (location) ((name . "At Complex Junction") (ldesc . "You are at a complex junction. A low hands and \ knees passage from the north joins a higher crawl from \ the east to make a walking passage going west. There \ is also a large room above. The air is damp here. ") (up . In_Dusty_Rock_Room) (west . In_Bedquilt) (north . In_Shell_Room) (east . In_Anteroom)) ()) (object In_Bedquilt nil (location) ((name . "Bedquilt") (ldesc . "You are in bedquilt, a long east/west passage \ with holes everywhere. To explore at random select \ north, south, up, or down. ") (east . At_Complex_Junction) (west . In_Swiss_Cheese_Room) (south . In_Slab_Room) (up . In_Dusty_Rock_Room) (north . At_Junction_Of_Three) (down . In_Anteroom)) ((south-dir (actptr) (if (< (random 100) 80) "You have crawled around in some little holes and \ wound up back in the main passage. " (get-dir 'south))) (down-dir (actptr) (if (< (random 100) 80) "You have crawled around in some little holes and \ wound up back in the main passage. " (get-dir 'down))) (up-dir (actptr) (cond ((< (random 100) 80) "You have crawled around in some little holes and \ wound up back in the main passage. ") ((< (random 100) 50) (findobject 'In_Secret_N_S_Canyon_1)) (t (get-dir 'up)))) (north-dir (actptr) (cond ((< (random 100) 60) "You have crawled around in some little holes and \ wound up back in the main passage. ") ((< (random 100) 75) (findobject 'In_Large_Low_Room)) (t (get-dir 'north)))) )) (object In_Swiss_Cheese_Room nil (location) ((name . "In Swiss Cheese Room") (ldesc . "You are in a room whose walls resemble swiss \ cheese. Obvious passages go west, east, northeast, \ and northwest. Part of the room is occupied by a large \ bedrock block. ") (west . At_East_End_Of_Twopit_Room) (south . In_Tall_E_W_Canyon) (northeast . In_Bedquilt) (northwest . In_Oriental_Room) (east . In_Soft_Room)) ((south-dir (actptr) (if (< (random 100) 80) "You have crawled around in some little holes and \ wound up back in the main passage. " (get-dir 'south))) (northwest-dir (actptr) (if (< (random 100) 50) "You have crawled around in some little holes and \ wound up back in the main passage. " (get-dir 'northwest))) )) (object BedrockBlock In_Swiss_Cheese_Room (thing) ((name . "bedrock block") (nouns "block" "bedrock") (adjectives "large") (ldesc . "It's just a huge block. ") (noshow)) ((do-look-under (actptr) (print "Surely you're joking.\n")) (do-push (actptr) (print "Surely you're joking.\n")) (do-pull (actptr) (print "Surely you're joking.\n")) (do-get (actptr) (print "Surely you're joking.\n")) )) ;---------------------------------------------------------------------------- ; The Twopit Room area ;---------------------------------------------------------------------------- (object At_West_End_Of_Twopit_Room nil (location) ((name . "At West End of Twopit Room") (ldesc . "You are at the west end of the twopit room. \ There is a large hole in the wall above the pit at \ this end of the room. ") (east . At_East_End_Of_Twopit_Room) (west . In_Slab_Room) (down . In_West_Pit) (in . In_West_Pit) (up . "It is too far up for you to reach. ")) ((descfull () (cond ((is-illuminated?) (describe-location self) (if (> (getprop (findobject 'Plant) 'number) 0) (method (findobject 'Plant) descfull)) (describe-contents self)) (t (print "It is too dark to see clearly.\n"))) (print "\n")) )) (object PlantStickingUp scenery-objects (thing) ((name . "beanstalk") (found_in At_West_End_Of_Twopit_Room At_East_End_Of_Twopit_Room) (nouns "plant" "beanstalk" "bean" "stalk") (adjectives "giant" "tiny" "little" "murmuring" "twelve" "foot" "tall" "bellowing") (noshow)) ((do-climb (actptr) (let ((plant (findobject 'Plant))) (cond ((= 1 (getprop plant 'number)) (print "It's too small to climb.\n")) ((= 2 (getprop plant 'number)) (method plant do-climb actptr)) (t (print "You cannot see the plant from here.\n"))))) (descfull () (print (cond ((= 1 (getprop (findobject 'Plant) 'number)) "The top of a 12-foot-tall beanstalk is \ poking out of the west pit.\n") ((= 2 (getprop (findobject 'Plant) 'number)) "There is a huge beanstalk growing out of the \ west pit up to the hole.\n") (t "You cannot see the plant from here.\n")))) (descpart () (descfull)) )) (object HoleAbovePit_1 scenery-objects (thing) ((name . "hole above pit") (nouns "hole") (adjectives "large" "above" "pit") (ldesc . "The hole is in the wall above the pit at \ this end of the room. ") (found_in In_West_Pit At_West_End_Of_Twopit_Room)) ((do-enter (actptr) (print "It is too far up for you to reach.\n")) )) (object In_West_Pit nil (location) ((name . "In West Pit") (ldesc . "You are at the bottom of the western pit in the \ twopit room. There is a large hole in the wall about \ 25 feet above you. ") (up . At_West_End_Of_Twopit_Room) (out . At_West_End_Of_Twopit_Room) (nodwarf)) ()) (object Plant In_West_Pit (thing) ((name . "plant") (nouns "plant" "beanstalk" "bean" "stalk") (adjectives "giant" "tiny" "little" "murmuring" "twelve" "foot" "tall" "bellowing") (number . 0)) ((descfull () (print (cond ((= 0 (getprop self 'number)) "There is a tiny little plant in the pit, \ murmuring \"Water, water, ...\" ") ((= 1 (getprop self 'number)) "There is a 12-foot-tall beanstalk stretching up \ out of the pit, bellowing \"Water!! Water!!\" ") ((= 2 (getprop self 'number)) "There is a gigantic beanstalk stretching all \ the way up to the hole. ")))) (descpart () (descfull)) (do-get (actptr) (print "The plant has exceptionally deep roots and \ cannot be pulled free.\n")) (do-climb (actptr) (cond ((= 2 (getprop self 'number)) (print "You clamber up the plant and scurry through \ the hole at the top.\n") (move-to-location actptr (findobject 'In_Narrow_Corridor))) ((= 1 (getprop self 'number)) (print "You have climbed up the plant and out of \ the pit.\n") (move-to-location actptr (findobject 'At_West_End_Of_Twopit_Room))) (t (print "It's just a little plant!\n")))) (do-water (actptr) (let ((conts (child (findobject 'bottle)))) (cond ((not (contained-in? (findobject 'bottle) *player*)) (print "You have nothing to water the plant with.\n")) ((null? conts) (print "The bottle is empty.\n")) ((= conts (findobject 'oil_in_the_bottle)) (move conts *voidptr*) (print "The plant indignantly shakes the oil \ off its leaves and asks, \"Water?\"\n")) ((= conts (findobject 'water_in_the_bottle)) (move conts *voidptr*) (setprop self 'number (1+ (getprop self 'number))) (if (= (getprop self 'number) 1) (print "The plant spurts into furious growth \ for a few seconds.\n")) (if (= (getprop self 'number) 2) (print "The plant grows explosively, almost \ filling the bottom of the pit.\n")) (if (> (getprop self 'number) 2) (begin (print "You've over-watered the plant! \ It's shriveling up! It's, it's...\n") (setprop self 'number 0))) (descfull))))) (do-oil (actptr) (do-water actptr)) )) (object At_East_End_Of_Twopit_Room nil (location) ((name . "At East End of Twopit Room") (ldesc . "You are at the east end of the twopit room. \ The floor here is littered with thin rock slabs, \ which make it easy to descend the pits. There is a \ path here bypassing the pits to connect passages from \ east and west. There are holes all over, but the \ only big one is on the wall directly over the west \ pit where you can't get to it. ") (east . In_Swiss_Cheese_Room) (west . At_West_End_Of_Twopit_Room) (in . In_East_Pit) (down . In_East_Pit)) ((descfull () (cond ((is-illuminated?) (describe-location self) (if (> (getprop (findobject 'Plant) 'number) 0) (method (findobject 'Plant) descfull)) (describe-contents self)) (t (print "It is too dark to see clearly.\n"))) (print "\n")) )) (object Slabs At_East_End_Of_Twopit_Room (thing) ((name . "thin rock slabs") (nouns "slab" "rock" "stair") (adjectives "thin") (ldesc . "They almost form natural stairs down into the pit. ") (noshow)) ((do-get (actptr) (print "Surely you're joking.\n")) (do-push (actptr) (print "Surely you're joking.\n")) (do-pull (actptr) (print "Surely you're joking.\n")) (do-look-under (actptr) (print "Surely you're joking.\n")) )) (object In_East_Pit nil (location) ((name . "In East Pit") (ldesc . "You are at the bottom of the eastern pit in the \ twopit room. There is a small pool of oil in one \ corner of the pit. ") (up . At_East_End_Of_Twopit_Room) (out . At_East_End_Of_Twopit_Room) (nodwarf)) ()) (object Oil In_East_Pit (thing) ((name . "pool of oil") (nouns "pool" "oil") (adjectives "small") (ldesc . "It looks like ordinary oil. ") (noshow)) ((do-drink (actptr) (print "Absolutely not.\n")) (do-get (actptr) (if (contained-in? (findobject 'bottle) actptr) (method (findobject 'bottle) do-fill actptr) (print "You have nothing in which to carry the oil.\n"))) (do-put-in (actptr objptr) (if (= (objectname objptr) 'bottle) (method (findobject 'bottle) do-fill actptr) (print "That will not hold the oil.\n"))) )) (object HoleAbovePit_2 nil (location) ((name . "hole above pit") (nouns "hole") (adjectives "large" "above" "pit") (ldesc . "The hole is in the wall above you. ") (found_in In_East_Pit At_East_End_Of_Twopit_Room)) ()) (object In_Slab_Room nil (location) ((name . "Slab Room") (ldesc . "You are in a large low circular chamber whose \ floor is an immense slab fallen from the ceiling \ (slab room). East and west there once were large \ passages, but they are now filled with boulders. Low \ small passages go north and south, and the south one \ quickly bends west around the boulders. ") (south . At_West_End_Of_Twopit_Room) (up . In_Secret_N_S_Canyon_0) (north . In_Bedquilt)) ()) (object Slab In_Slab_Room (thing) ((name . "slab") (nouns "slab") (adjectives "immense") (ldesc . "It is now the floor here. ") (noshow)) ((do-look-under (actptr) (print "Surely you're joking.\n")) (do-get (actptr) (print "Surely you're joking.\n")) (do-push (actptr) (print "Surely you're joking.\n")) (do-pull (actptr) (print "Surely you're joking.\n")) )) (object SlabBoulders In_Slab_Room (thing) ((name . "boulders") (nouns "boulder" "rock" "stone") (ldesc . "They're just ordinary boulders. ") (noshow)) ()) ;---------------------------------------------------------------------------- ; A small network of Canyons, mainly Secret ;---------------------------------------------------------------------------- (object In_Secret_N_S_Canyon_0 nil (location) ((name . "Secret N/S Canyon") (ldesc . "You are in a secret N/S canyon above a large room. ") (down . In_Slab_Room) (south . In_Secret_Canyon) (north . In_Mirror_Canyon)) ((north-dir (actptr) (set canyon_from (objectname self)) (get-dir 'north)) )) (object In_Secret_N_S_Canyon_1 nil (location) ((name . "Secret N/S Canyon") (ldesc . "You are in a secret N/S canyon above a sizable passage. ") (north . At_Junction_Of_Three) (down . In_Bedquilt) (south . Atop_Stalactite)) ()) (object At_Junction_Of_Three nil (location) ((name . "Junction of Three Secret Canyons") (ldesc . "You are in a secret canyon at a junction of \ three canyons, bearing north, south, and se. The \ north one is as tall as the other two combined. ") (southeast . In_Bedquilt) (south . In_Secret_N_S_Canyon_1) (north . At_Window_On_Pit_2)) ()) (object In_Large_Low_Room nil (location) ((name . "Large Low Room") (ldesc . "You are in a large low room. Crawls lead \ north, se, and sw. ") (southwest . In_Sloping_Corridor) (southeast . In_Oriental_Room) (north . Dead_End_Crawl)) ()) (object Dead_End_Crawl nil (location) ((name . "Dead End Crawl") (ldesc . "This is a dead end crawl. ") (south . In_Large_Low_Room) (out . In_Large_Low_Room)) ()) (object In_Secret_E_W_Canyon nil (location) ((name . "Secret E/W Canyon Above Tight Canyon") (ldesc . "You are in a secret canyon which here runs E/W. \ It crosses over a very tight canyon 15 feet below. \ If you go down you may not be able to get back up. ") (east . In_Hall_Of_Mt_King) (west . In_Secret_Canyon) (down . In_N_S_Canyon)) ((west-dir (actptr) (set canyon_from (objectname self)) (get-dir 'west)) )) (object In_N_S_Canyon nil (location) ((name . "N/S Canyon") (ldesc . "You are at a wide place in a very tight N/S canyon. ") (south . Canyon_Dead_End) (north . In_Tall_E_W_Canyon)) ()) (object Canyon_Dead_End nil (location) ((name . "Canyon Dead End") (ldesc . "The canyon here becomes too tight to go further south. ") (north . In_N_S_Canyon)) ()) (object In_Tall_E_W_Canyon nil (location) ((name . "In Tall E/W Canyon") (ldesc . "You are in a tall E/W canyon. A low tight \ crawl goes 3 feet north and seems to open up. ") (east . In_N_S_Canyon) (west . Dead_End_8) (north . In_Swiss_Cheese_Room)) ()) (object Atop_Stalactite nil (location) ((name . "Atop Stalactite") (ldesc . "A large stalactite extends from the roof and \ almost reaches the floor below. You could climb down \ it, and jump from it to the floor, but having done so \ you would be unable to reach it to climb back up. ") (north . In_Secret_N_S_Canyon_1)) ((down-dir (actptr) (cond ((< (random 100) 40) (findobject 'Alike_Maze_6)) ((< (random 100) 50) (findobject 'Alike_Maze_9)) (t (findobject 'Alike_Maze_4)))) (do-jump (actptr) (move-to-location actptr (down-dir))) (do-climb (actptr) (move-to-location actptr (down-dir))) )) (object Stalactite Atop_Stalactite (thing) ((name . "stalactite") (nouns "stalactite" "stalagtite" "stalagmite") (adjectives "large") (ldesc . "You could probably climb down it, but you can forget \ coming back up. ") (noshow)) ((do-look-under (actptr) (print "Do get a grip on yourself.\n")) (do-push (actptr) (print "Do get a grip on yourself.\n")) (do-pull (actptr) (print "Do get a grip on yourself.\n")) )) ;---------------------------------------------------------------------------- ; Here be dragons ;---------------------------------------------------------------------------- (object In_Secret_Canyon nil (location) ((name . "Secret Canyon") (ldesc . "You are in a secret canyon which exits to the \ north and east. ")) ((east-dir (actptr) (cond ((= canyon_from 'In_Secret_E_W_Canyon) (findobject canyon_from)) ((contained-in? (findobject 'Dragon) self) "The dragon looks rather nasty. You'd best not \ try to get by. ") (t (findobject 'In_Secret_E_W_Canyon)))) (north-dir (actptr) (cond ((= canyon_from 'In_Secret_N_S_Canyon_0) (findobject canyon_from)) ((contained-in? (findobject 'Dragon) self) "The dragon looks rather nasty. You'd best not \ try to get by. ") (t (findobject 'In_Secret_N_S_Canyon_0)))) (out-dir (actptr) (findobject canyon_from)) )) (object Dragon In_Secret_Canyon (thing) ((name . "dragon") (nouns "dragon" "monster" "beast" "lizard") (adjectives "huge" "green" "fierce" "scaly" "giant" "ferocious") (ldesc . "I wouldn't mess with it if I were you. ") (initial . "A huge green fierce dragon bars the way! ")) ((do-attack (actptr) (print "With what? Your bare hands?\n")) (do-attack-with (actptr objptr) (cond ((= objptr (findobject 'axe)) (move objptr (location-of actptr)) (print "The axe bounces harmlessly off the dragon's \ thick scales.\n")) (t (print "You'd probably be better off using your \ bare hands than that thing!\n")))) (receive (actptr objptr) (print "The dragon is implacable.\n")) )) (object persian_rug In_Secret_Canyon (Treasure) ((name . "Persian rug") (nouns "rug") (adjectives "persian" "fine" "finest" "dragon's") (depositpoints . 14)) ((descfull () (print (if (contained-in? (findobject 'Dragon) (location-of self)) "The dragon is sprawled out on the Persian rug! " "The Persian rug is spread out on the floor here. "))) (do-get (actptr) (cond ((equal? self actptr) (print "Picking yourself up accomplishes nothing.\n")) ((contained-in? self actptr) (print "You are already carrying it.\n")) ((same-location? actptr (findobject 'Dragon)) (print "You'll need to get the dragon to move first!\n")) ((> (+ (total-weight-contained actptr) (total-weight self)) (max-lift actptr)) (print "You are carrying too much.\n")) ((move self actptr) (if (= 'Inside_Building (objectname (location-of actptr))) (set score (- score (getprop self depositpoints)))) (set score (+ score 5)) (if (not (hasprop self 'istaken)) (begin (setprop self 'istaken nil) (set treasures_found (1+ treasures_found)) (set score (+ score 2)))) (setprop self 'istaken nil) (print "Taken.\n")) (t (print "Unable to comply.\n")))) )) (object DragonCorpse the-void (thing) ((name . "dragon's body") (nouns "dragon" "corpse" "body") (adjectives "dead" "dragon's") (ldesc . "It seems to have been strangled to death! ") (initial . "The body of a huge green dead dragon is lying off to \ one side. ")) ((do-attack-with (actptr objptr) (do-attack actptr)) (do-attack (actptr) (print "You've already done enough damage!\n")) )) ;---------------------------------------------------------------------------- ; And more of the Alike Maze ;---------------------------------------------------------------------------- (object Dead_End_8 nil (DeadEndRoom) ((ldesc . "The canyon runs into a mass of boulders -- dead end. ") (south . In_Tall_E_W_Canyon) (out . In_Tall_E_W_Canyon)) ()) (object Alike_Maze_11 nil (MazeRoom) ((north . Alike_Maze_1) (west . Alike_Maze_11) (south . Alike_Maze_11) (east . Dead_End_9)) ()) (object Dead_End_9 nil (DeadEndRoom) ((west . Alike_Maze_11) (out . Alike_Maze_11)) ()) (object Dead_End_10 nil (DeadEndRoom) ((south . Alike_Maze_3) (out . Alike_Maze_3)) ()) (object Alike_Maze_12 nil (MazeRoom) ((south . At_Brink_Of_Pit) (east . Alike_Maze_13) (west . Dead_End_11)) ()) (object Alike_Maze_13 nil (MazeRoom) ((north . At_Brink_Of_Pit) (west . Alike_Maze_12) (northwest . Dead_End_13)) ()) (object Dead_End_11 nil (DeadEndRoom) ((east . Alike_Maze_12) (out . Alike_Maze_12)) ()) (object Dead_End_12 nil (DeadEndRoom) ((up . Alike_Maze_8) (out . Alike_Maze_8)) ()) (object Alike_Maze_14 nil (MazeRoom) ((up . Alike_Maze_4) (down . Alike_Maze_4)) ()) (object Dead_End_13 nil (DeadEndRoom) ((southeast . Alike_Maze_13) (out . Alike_Maze_13) (ldesc . "This is the pirate's dead end. ") (nodwarf)) ((upon-entry (actptr) (setprop (findobject 'pirate) 'treasurefound t) (if (not (method (findobject 'treasure_chest) is-taken?)) (print "You've found the pirate's treasure chest!\n"))) )) (object treasure_chest Dead_End_13 (Treasure) ((name . "treasure chest") (nouns "chest" "box" "treasure") (adjectives "rich" "pirate" "pirate's") (depositpoints . 12) (ldesc . "It's the pirate's treasure chest, filled with \ riches of all kinds! ") (initial . "The pirate's treasure chest is here! ")) ()) ;---------------------------------------------------------------------------- ; Above the beanstalk: the Giant Room and the Waterfall ;---------------------------------------------------------------------------- (object In_Narrow_Corridor nil (location) ((name . "In Narrow Corridor") (ldesc . "You are in a long, narrow corridor stretching \ out of sight to the west. At the eastern end is a \ hole through which you can see a profusion of \ leaves. ") (down . In_West_Pit) (west . In_Giant_Room) (east . In_West_Pit)) ((do-jump (actptr) (print "You fall and break your neck!\n") (kill-player)) )) (object Leaves In_Narrow_Corridor (thing) ((name . "leaves") (article . "some") (nouns "leaf" "plant" "tree" "stalk" "beanstalk") (adjectives "profusion") (ldesc . "The leaves appear to be attached to the beanstalk \ you climbed to get here. ") (noshow)) ()) (object At_Steep_Incline nil (location) ((name . "Steep Incline Above Large Room") (ldesc . "You are at the top of a steep incline above a \ large room. You could climb down here, but you would \ not be able to climb up. There is a passage leading \ back to the north. ") (north . In_Cavern_With_Waterfall) (down . In_Large_Low_Room)) ()) (object In_Giant_Room nil (location) ((name . "Giant Room") (ldesc . "You are in the giant room. The ceiling here is \ too high up for your lamp to show it. Cavernous passages \ lead east, north, and south. On the west wall is \ scrawled the inscription, \"Fee fie foe foo\" [sic]. ") (south . In_Narrow_Corridor) (east . At_Recent_Cave_In) (north . In_Immense_N_S_Passage)) ()) (object Inscription In_Giant_Room (thing) ((name . "scrawled inscription") (ldesc . "It says, \"Fee fie foe foo [sic].\" ") (nouns "inscription" "writing" "scrawl") (adjectives "scrawled") (noshow)) ()) (object golden_eggs In_Giant_Room (Treasure) ((depositpoints . 14) (name . "nest of golden eggs") (nouns "egg" "nest") (adjectives "golden" "beautiful") (ldesc . "The nest is filled with beautiful golden eggs! ") (initial . "There is a large nest here, full of golden eggs! ")) ()) (object At_Recent_Cave_In nil (location) ((name . "Recent Cave-in") (ldesc . "The passage here is blocked by a recent cave-in. ") (south . In_Giant_Room)) ()) (object In_Immense_N_S_Passage nil (location) ((name . "Immense N/S Passage") (ldesc . "You are at one end of an immense north/south passage. ") (south . In_Giant_Room)) ((north-dir (actptr) (cond ((hasprop (findobject 'RustyDoor) 'islocked) "The way north is barred by a massive, rusty, iron door. ") (t (if (hasprop (findobject 'RustyDoor) 'isclosed) (begin (print "(first wrenching the door open)\n") (delprop (findobject 'RustyDoor) 'isclosed))) (findobject 'In_Cavern_With_Waterfall)))) )) (object RustyDoor In_Immense_N_S_Passage (openable-object lockable-object) ((name . "rusty door") (nouns "door" "hinge") (adjectives "massive" "rusty" "iron") (ldesc . "It's just a big iron door. ") (isclosed) (islocked)) ((descfull () (print (if (is-closed?) "The way north is barred by a massive, rusty, iron door. " "The way north leads through a massive, rusty, iron \ door. "))) (do-open (actptr) (cond ((not (is-closed?)) (print "The door is already open.\n")) ((is-locked?) (print "The hinges are quite thoroughly rusted now \ and won't budge.")) (t (delprop self 'isclosed) (print "The door heaves open with a shower of rust.\n")))) (do-close (actptr) (print (if (is-closed?) "No problem there -- it already is.\n" "With all the effort it took to get the door \ open, I wouldn't suggest closing it again.\n"))) (do-oil (actptr) (if (and (contained-in? (findobject 'bottle) *player*) (contained-in? (findobject 'oil_in_the_bottle) (findobject 'bottle))) (begin (move (findobject 'oil_in_the_bottle) *voidptr*) (delprop self 'islocked) (print "The oil has freed up the hinges so that \ the door will now move, although it \ requires some effort.\n")) (print "You have nothing to oil it with.\n"))) (do-water (actptr) (if (and (contained-in? (findobject 'bottle) *player*) (contained-in? (findobject 'water_in_the_bottle) (findobject 'bottle))) (begin (move (findobject 'water_in_the_bottle) *voidptr*) (setprop self 'islocked nil) (print "The hinges are quite thoroughly \ rusted now and won't budge.\n")) (print "You have nothing to water it with.\n"))) (do-lock (actptr) (print "The lock is too rusted to work.\n")) (do-lock-with (actptr) (do-lock actptr)) (do-unlock (actptr) (do-lock actptr)) (do-unlock-with (actptr) (do-lock actptr)) )) (object In_Cavern_With_Waterfall nil (location) ((name . "In Cavern With Waterfall") (ldesc . "You are in a magnificent cavern with a rushing \ stream, which cascades over a sparkling waterfall \ into a roaring whirlpool which disappears through a \ hole in the floor. Passages exit to the south and west. ") (south . In_Immense_N_S_Passage) (west . At_Steep_Incline)) ()) (object Waterfall In_Cavern_With_Waterfall (thing) ((name . "waterfall") (ldesc . "Wouldn't want to go down in in a barrel! ") (nouns "waterfall" "whirlpool") (adjectives "sparkling" "whirling") (noshow)) ()) (object trident In_Cavern_With_Waterfall (Treasure) ((name . "jeweled trident") (nouns "trident") (adjectives "jeweled" "jewel-encrusted" "fabulous") (ldesc . "The trident is covered with fabulous jewels! ") (initial . "There is a jewel-encrusted trident here! ") (depositpoints . 14)) ()) ;---------------------------------------------------------------------------- ; The caves around Bedquilt ;---------------------------------------------------------------------------- (object In_Soft_Room nil (location) ((name . "In Soft Room") (ldesc . "You are in the soft room. The walls are \ covered with heavy curtains, the floor with a thick \ pile carpet. Moss covers the ceiling. ") (west . In_Swiss_Cheese_Room)) ()) (object Carpet In_Soft_Room (thing) ((name . "carpet") (nouns "carpet") (adjectives "shag" "pile" "heavy" "thick") (ldesc . "The carpet is quite plush. ") (noshow)) ()) (object Curtains In_Soft_Room (thing) ((name . "curtains") (nouns "curtain") (adjectives "heavy" "thick") (ldesc . "They seem to absorb sound very well. ") (noshow)) ((do-get (actptr) (print "Now don't go ripping up the place!\n")) (do-look-under (actptr) (print "You don't find anything exciting behind the curtains.\n")) (do-search (actptr) (print "You don't find anything exciting behind the curtains.\n")) )) (object Moss In_Soft_Room (thing) ((name . "moss") (nouns "moss") (adjectives "typical" "everyday") (ldesc . "It just looks like your typical, everyday moss. ") (noshow)) ((do-get (actptr) (print "It crumbles to nothing in your hands.\n")) (do-eat (actptr) (print ""Eeeewwwww.\n")) )) (object velvet_pillow In_Soft_Room (getable-object) ((name . "velvet pillow") (nouns "pillow") (adjectives "velvet" "small") (ldesc . "It's just a small velvet pillow. ") (initial . "A small velvet pillow lies on the floor. ")) ((move-into (actptr objptr) (if (= (objectname objptr) 'ming_vase) (print "The vase comes to rest, delicately, on the \ velvet pillow.\n") (print "The velvet pillow does not seem made for that.\n"))) )) (object In_Oriental_Room nil (location) ((name . "Oriental Room") (ldesc . "This is the oriental room. Ancient oriental \ cave drawings cover the walls. A gently sloping \ passage leads upward to the north, another passage \ leads se, and a hands and knees crawl leads west. ") (west . In_Large_Low_Room) (southeast . In_Swiss_Cheese_Room) (up . In_Misty_Cavern) (north . In_Misty_Cavern)) ()) (object CaveDrawings In_Oriental_Room (thing) ((name . "ancient oriental drawings") (nouns "painting" "drawing" "art") (adjectives "cave" "ancient" "oriental") (ldesc . "They seem to depict people and animals. ") (noshow)) ()) (object ming_vase In_Oriental_Room (Treasure) ((name . "ming vase") (nouns "vase") (adjectives "ming" "delicate") (ldesc . "It's a delicate, precious, ming vase! ") (depositpoints . 14)) ((destroy-vase () (move self *voidptr*) (move (findobject 'shards) (location-of actptr)) (set score (- score 5))) (move-into (actptr objptr) (print "The vase is too fragile to use as a container.\n")) (do-fill (actptr) (cond ((or (contained-in? (findobject 'Spring) (location-of self)) (member (objectname (location-of self)) (getprop (findobject 'Stream) 'found_in))) (destroy-vase) (print "The sudden change in temperature \ has delicately shattered the vase.\n")) ((contained-in? (findobject 'Oil) (location-of self)) (destroy-vase) (print "The oil makes the vase slippery, and it slips from \ your grasp, shattering delicately.\n")) (t (print "There is nothing here with which to fill \ the vase.\n")))) (do-put-in (actptr objptr) (cond ((= (objectname objptr) 'Stream) (desctroy-vase) (print "The sudden change in temperature \ has delicately shattered the vase.\n")) ((= (objectname objptr) 'velvet_pillow) (move-into (findobject 'velvet_pillow) move-into actptr self)) (t (print "You can't put the vase there.\n")))) (do-drop (actptr) (if (contained-in? (findobject 'velvet_pillow) (location-of self)) (method (findobject 'velvet_pillow) move-into actptr self) (begin (destroy-vase) (print "The ming vase drops with a delicate crash.\n")))) (do-attack (actptr) (destroy-vase) (print "You have taken the vase and \ hurled it delicately to the ground.\n")) )) (object shards the-void (thing) ((name . "some worthless shards of pottery") (nouns "pottery" "shard" "remains" "vase") (adjectives "worthless") (ldesc . "They look to be the remains of what was once a \ beautiful vase. I guess some oaf must have dropped it. ") (initial . "The floor is littered with worthless shards of pottery. ") ) ()) (object In_Misty_Cavern nil (location) ((name . "Misty Cavern") (ldesc . "You are following a wide path around the outer \ edge of a large cavern. Far below, through a heavy \ white mist, strange splashing noises can be heard. \ The mist rises up through a fissure in the ceiling. \ The path exits to the south and west. ") (south . In_Oriental_Room) (west . In_Alcove)) ()) (object CeilingFissure In_Misty_Cavern (thing) ((name . "fissure") (nouns "fissure" "ceiling") (ldesc . "You can't really get close enough to examine it. ") (noshow)) ()) ;---------------------------------------------------------------------------- ; Plovers and pyramids ;---------------------------------------------------------------------------- (object In_Alcove nil (location) ((name . "Alcove") (ldesc . "You are in an alcove. A small northwest path seems \ to widen after a short distance. An extremely tight \ tunnel leads east. It looks like a very tight squeeze. \ An eerie light can be seen at the other end. ") (northwest . In_Misty_Cavern)) ((east-dir (actptr) (let ((egg (findobject 'egg_sized_emerald))) (if (or (null? (child *player*)) (and (= (child *player*) egg) (null? (sibling egg)))) (findobject 'In_Plover_Room) "Something you're carrying won't fit through the \ tunnel with you. You'd best take inventory and drop \ something.\n"))) )) (object In_Plover_Room nil (location) ((name . "Plover Room") (ldesc . "You're in a small chamber lit by an eerie green \ light. An extremely narrow tunnel exits to the west. \ A dark corridor leads northeast. ") (out . In_Alcove) (northeast . In_Dark_Room) (light)) ((west-dir (actptr) (let ((egg (findobject 'egg_sized_emerald))) (if (or (null? (child *player*)) (and (= (child *player*) egg) (null? (sibling egg)))) (findobject 'In_Alcove) "Something you're carrying won't fit through the \ tunnel with you. You'd best take inventory and drop \ something.\n"))) )) (object egg_sized_emerald In_Plover_Room (Treasure) ((name . "emerald the size of a plover's egg") (article . "an") (nouns "emerald") (adjectives "plover's" "egg-sized" "egg" "sized" "plover") (ldesc . "Plover's eggs, by the way, are quite large. ") (initial . "There is an emerald here the size of a plover's egg! ") (depositpoints . 14)) ()) (object In_Dark_Room nil (location) ((name . "The Dark Room") (ldesc . "You're in the dark-room. A corridor leading \ south is the only exit. ") (south . In_Plover_Room) (nodwarf)) ()) (object StoneTablet In_Dark_Room (thing) ((name . "stone tablet") (nouns "tablet") (adjectives "massive" "stone") (ldesc . "The stone tablet reads: \"Congratulations on bringing \ light into the dark-room!\" ") (initial . "A massive stone tablet imbedded in the wall reads: \ \"Congratulations on bringing light into the dark-room!\" ")) ()) (object platinum_pyramid In_Dark_Room (Treasure) ((name . "platinum pyramid") (nouns "platinum" "pyramid") (adjectives "pyramidal") (ldesc . "The platinum pyramid is 8 inches on a side! ") (initial . "There is a platinum pyramid here, 8 inches on a side! ") (depositpoints . 14)) ()) ;---------------------------------------------------------------------------- ; North of the complex junction: a long up-down corridor ;---------------------------------------------------------------------------- (object In_Arched_Hall nil (location) ((name . "Arched Hall") (ldesc . "You are in an arched hall. A coral passage \ once continued up and east from here, but is now \ blocked by debris. The air smells of sea water. ") (down . In_Shell_Room)) ()) (object In_Shell_Room nil (location) ((name . "Shell Room") (ldesc . "You're in a large room carved out of sedimentary rock. \ The floor and walls are littered with bits of shells \ imbedded in the stone. A shallow passage proceeds downward, \ and a somewhat steeper one leads up. A low hands and knees \ passage enters from the south. ") (up . In_Arched_Hall) (down . In_Ragged_Corridor)) ((south-dir (actptr) (if (contained-in? (findobject 'giant_bivalve) *player*) (if (hasprop (findobject 'giant_bivalve) 'opened) "You can't fit this five-foot oyster \ through that little passage!\n" "You can't fit this five-foot clam \ through that little passage!\n") (findobject 'At_Complex_Junction))) )) (object giant_bivalve In_Shell_Room (thing) ((name . "giant clam") (nouns "giant" "clam" "oyster" "bivalve")) ((do-attack-with (actptr objptr) (do-attack actptr)) (do-attack (actptr) (print "The shell is very strong and is impervious to attack.\n")) (do-open (actptr) (print "You aren't strong enough to open the clam \ with your bare hands.\n")) (do-open-with (objptr) (cond ((!= (objectname objptr) 'trident) (print "The " (method objptr get-name) " isn't strong enough to open the clam.\n")) ((hasprop self 'opened) (print "The oyster creaks open, revealing nothing but \ oyster inside. It promptly snaps shut again.\n")) (t (setprop self 'opened nil) (move-by-name 'pearl 'In_A_Cul_De_Sac) (print "A glistening pearl falls out of the clam \ and rolls away. Goodness, this must really \ be an oyster. (I never was very good at \ identifying bivalves.) Whatever it is, it \ has now snapped shut again.\n")))) (descfull () (print (if (or (contained-in? self (findobject 'At_Ne_End)) (contained-in? self (findobject 'At_Sw_End))) "Interesting. There seems to be something \ written on the underside of the oyster:\n\ \"There is something strange about this place, \ such that one of the words I've always known \ now has a new effect.\"\n" "A giant bivalve of some kind.\n"))) (descpart () (print "There is an enormous " (if (hasprop self 'opened) "oyster" "clam") " here with its shell tightly closed. ")) )) (object pearl the-void (Treasure) ((name . "glistening pearl") (nouns "pearl") (adjectives "glistening" "incredible" "incredibly" "large") (ldesc . "It's incredibly large! ") (initial . "Off to one side lies a glistening pearl! ") (depositpoints . 14)) ()) (object In_Ragged_Corridor nil (location) ((name . "Ragged Corridor") (ldesc . "You are in a long sloping corridor with ragged \ sharp walls. ") (up . In_Shell_Room) (down . In_A_Cul_De_Sac)) ()) (object In_A_Cul_De_Sac nil (location) ((name . "Cul-de-Sac") (ldesc . "You are in a cul-de-sac about eight feet across. ") (up . In_Ragged_Corridor) (out . In_Ragged_Corridor)) ()) ;---------------------------------------------------------------------------- ; Witt's End: Cave under construction ;---------------------------------------------------------------------------- (object In_Anteroom nil (location) ((name . "In Anteroom") (ldesc . "You are in an anteroom leading to a large \ passage to the east. Small passages go west and up. \ The remnants of recent digging are evident. ") (up . At_Complex_Junction) (west . In_Bedquilt) (east . At_Witts_End)) ()) (object WittSign In_Anteroom (thing) ((name . "sign") (initial . "A sign in midair here says \"Cave under construction \ beyond this point. Proceed at own risk. [Witt Construction \ Company]\" ") (nouns "sign") (adjectives "witt" "construction" "company")) ((do-get (actptr) (print "It's hanging way above your head.\n")) )) (object spelunker_today In_Anteroom (getable-object) ((name . "recent issues of \"Spelunker Today\"") (article . "a few") (nouns "magazine" "issue" "spelunker" "today") (adjectives "recent") (ldesc . "I'm afraid the magazines are written in Dwarvish. ") (initial . "There are a few recent issues of \"Spelunker Today\" \ magazine here. ")) ((before (actptr indptr actionname) (cond ((= 'do-drop actionname) (if (= (objectname (location-of actptr)) 'At_Witts_End) (begin (set score (1+ score)) (print "You really are at wit's end.\n")))) ((= 'do-get actionname) (if (= (objectname (location-of self)) 'At_Witts_End) (set score (1- score)))) ) t) )) (object At_Witts_End nil (location) ((name . "At Witt's End") (ldesc . "You are at Witt's End. Passages lead off in \ *all* directions. ") (west . "You have crawled around in some little holes and \ found your way blocked by a recent cave-in. You are \ now back in the main passage. ")) ((random-move () (if (< (random 100) 85) "You have crawled around in some little holes and \ wound up back in the main passage.\n" (findobject 'In_Anteroom))) (north-dir (actptr) (random-move)) (south-dir (actptr) (random-move)) (east-dir (actptr) (random-move)) (northeast-dir (actptr) (random-move)) (northwest-dir (actptr) (random-move)) (southeast-dir (actptr) (random-move)) (southwest-dir (actptr) (random-move)) (up-dir (actptr) (random-move)) (down-dir (actptr) (random-move)) (in-dir (actptr) (random-move)) (out-dir (actptr) (random-move)) )) ;---------------------------------------------------------------------------- ; North of the secret canyons, on the other side of the pit ;---------------------------------------------------------------------------- (object In_Mirror_Canyon nil (location) ((name . "In Mirror Canyon") (ldesc . "You are in a north/south canyon about 25 feet \ across. The floor is covered by white mist seeping \ in from the north. The walls extend upward for well \ over 100 feet. Suspended from some unseen point far \ above you, an enormous two-sided mirror is hanging \ parallel to and midway between the canyon walls. \ A small window can be seen in either wall, \ some fifty feet up. ") (south . In_Secret_N_S_Canyon_0) (north . At_Reservoir)) ()) (object CanyonMirror In_Mirror_Canyon (thing) ((name . "suspended mirror") (ldesc . "The mirror is obviously provided for the use of the \ dwarves who, as you know, are extremely vain. ") (initial . "The mirror is obviously provided for the use of the \ dwarves, who as you know, are extremely vain. ") (nouns "mirror") (adjectives "massive" "enormous" "hanging" "suspended" "dwarves'" "dwarf's" "two-sided" "two" "sided")) ((do-attack (actptr) (print ""You can't reach it from here.\n")) (do-attack-with (actptr objptr) (do-attack actptr)) (do-get (actptr) (print ""You can't reach it from here.\n")) )) (object At_Window_On_Pit_2 nil (location) ((name . "At Window on Pit") (ldesc . "You're at a low window overlooking a huge pit, \ which extends up out of sight. A floor is \ indistinctly visible over 50 feet below. Traces of \ white mist cover the floor of the pit, becoming \ thicker to the left. Marks in the dust around the \ window would seem to indicate that someone has been \ here recently. Directly across the pit from you and \ 25 feet away there is a similar window looking into a \ lighted room. A shadowy figure can be seen there \ peering back at you. ") (baddir . "The only passage is back west to the junction. ") (west . At_Junction_Of_Three)) ((do-jump (actptr) (print "You jump and break your neck!\n") (kill-player)) (do-wave-hands (actptr) (print "The shadowy figure waves back at you!\n")) )) (object At_Reservoir nil (location) ((name . "At Reservoir") (ldesc . "You are at the edge of a large underground \ reservoir. An opaque cloud of white mist fills the \ room and rises rapidly upward. The lake is fed by a \ stream, which tumbles out of a hole in the wall about \ 10 feet overhead and splashes noisily into the water \ somewhere within the mist. The only passage goes \ back toward the south. ") (south . In_Mirror_Canyon) (out . In_Mirror_Canyon)) ((do-swim (actptr) (print "The water is icy cold, and you would soon freeze \ to death.\n")) )) ;---------------------------------------------------------------------------- ; The Chasm and the Troll Bridge ;---------------------------------------------------------------------------- (object In_Sloping_Corridor nil (location) ((name . "Sloping Corridor") (ldesc . "You are in a long winding corridor sloping out \ of sight in both directions. ") (down . In_Large_Low_Room) (up . On_Sw_Side_Of_Chasm) (baddir . "The corridor slopes steeply up and down. ")) ()) (object On_Sw_Side_Of_Chasm nil (location) ((name . "On SW Side of Chasm") (ldesc . "You are on one side of a large, deep chasm. A \ heavy white mist rising up from below obscures all \ view of the far side. A southwest path leads away \ from the chasm into a winding corridor. ") (southwest . In_Sloping_Corridor) (down . In_Sloping_Corridor) (baddir . "The path winds southwest. ")) ((northeast-dir (actptr) (cross-bridge actptr)) (do-jump (actptr) (if (getprop (findobject 'RicketyBridge) 'is-broken) (print "I respectfully suggest you go across the \ bridge instead of jumping.\n") (begin (print "You didn't make it.\n") (kill-player)))) (descfull () (cond ((is-illuminated?) (describe-location self) (cond ((hasprop (findobject 'RicketyBridge) 'is-broken) (print "The wreckage of the troll bridge (and a \ dead bear) can be seen at the bottom of \ the chasm. ")) (t (print "A rickety wooden bridge extends across the \ chasm, vanishing into the mist.\b\ A sign posted on the bridge reads, \ \"Stop! Pay troll!\"\b") (if (!= (location-of (findobject 'Troll)) (location-of *player*)) (print "The troll is nowhere to be seen.\n")))) (describe-contents self)) (t (print "It is too dark to see clearly.\n"))) (print "\n")) )) (object RicketyBridge scenery-objects (thing) ((name . "rickety bridge") (nouns "bridge") (adjectives "rickety" "unstable" "wobbly" "rope") (ldesc . "It just looks like an ordinary, but unstable, bridge. ")) ((do-cross (actptr) (move-to-location actptr (cross-bridge actptr))) )) (function cross-bridge (actptr) (cond ((hasprop (findobject RicketyBridge) 'is-broken) "There is no longer a bridge to cross. ") ((getprop (findobject 'Troll) 'hastreasure) (cond ((hasprop (findobject 'Bear) 'isfollowing) (move (findobject 'Bear) *voidptr*) (delprop (findobject 'Bear) 'isfollowing) (move (findobject 'RicketyBridge) *voidptr*) (move (findobject 'Wreckage) (findobject 'scenery-objects)) (print "Just as you reach the other side, the \ bridge buckles beneath the weight of the \ bear, which is still following you around. \ You scrabble desperately for support, but as \ the bridge collapses you stumble back and \ fall into the chasm.\n") (kill-player) nil) (t (setprop (findobject 'Troll) 'hastreasure nil) (if (= (location-of actptr) (findobject 'On_Ne_Side_Of_Chasm)) (findobject 'On_Sw_Side_Of_Chasm) (findobject 'On_Ne_Side_Of_Chasm))))) ((= (location-of (findobject 'Troll)) (location-of *player*)) "The troll refuses to let you cross. ") (t "The troll steps out from beneath the bridge and \ blocks your way. "))) (object Wreckage the-void (thing) ((name . "wreckage of bridge") (nouns "wreckage" "wreck" "bridge" "bear") (adjectives "dead") (ldesc . "The wreckage of the troll bridge (and a dead bear) \ can be seen at the bottom of the chasm. ") (found_in On_Sw_Side_Of_Chasm On_Ne_Side_Of_Chasm)) ((before (actptr objptr actionname) (print "The wreckage is too far below.\n") nil) )) (object Troll the-void (thing) ((name . "burly troll") (nouns "troll") (adjectives "burly") (ldesc . "Trolls are close relatives with rocks and have skin \ as tough as that of a rhinoceros. ") (initial . "A burly troll stands by the bridge and insists you \ throw him a treasure before you may cross. ") (hastreasure . nil)) ((do-attack (actptr) (print "The troll laughs aloud at your pitiful attempt \ to injure him.\n")) (do-attack-with (actptr objptr) (do-attack actptr)) (do-order (actptr objptr) (print "You'll be lucky.\n")) (do-answer (actptr objptr) (print "Trolls make poor conversation.\n")) (do-ask (actptr objptr) (print "Trolls make poor conversation.\n")) (do-cross (actptr) (print "I wouldn't recommend that.\n")) (throw-target (actptr objptr) (cond ((subclassof? objptr 'Treasure) (set score (- score 5)) (move self *voidptr*) (setprop self 'hastreasure t) (print "The troll catches your treasure and scurries \ away out of sight.\n") *voidptr*) ((= 'tasty_food (objectname objptr)) (print "Gluttony is not one of the troll's vices. \ Avarice, however, is. The troll tosses the \ food back.\n") actptr) (t (print "The troll deftly catches the " (method objptr get-name) ", examines it carefully, and tosses it back, \ declaring, \"Good workmanship, but it's not \ valuable enough.\"\n") actptr))) )) (object On_Ne_Side_Of_Chasm nil (location) ((name . "On NE Side of Chasm") (ldesc . "You are on the far side of the chasm. A northeast \ path leads away from the chasm on this side. ") (northeast . In_Corridor) (nodwarf)) ((southwest-dir (actptr) (cross-bridge actptr)) (do-jump (actptr) (if (getprop (findobject 'RicketyBridge) 'is-broken) (print "I respectfully suggest you go across the \ bridge instead of jumping.\n") (begin (print "You didn't make it.\n") (kill-player)))) )) (object In_Corridor nil (location) ((name . "In Corridor") (ldesc . "You're in a long east/west corridor. A faint \ rumbling noise can be heard in the distance. ") (west . On_Ne_Side_Of_Chasm) (east . At_Fork_In_Path) (nodwarf)) ()) ;---------------------------------------------------------------------------- ; The Volcano ;---------------------------------------------------------------------------- (object At_Fork_In_Path nil (location) ((name . "At Fork in Path") (ldesc . "The path forks here. The left fork leads northeast. \ A dull rumbling seems to get louder in that direction. \ The right fork leads southeast down a gentle slope. The \ main corridor enters from the west. ") (west . In_Corridor) (northeast . At_Junction_With_Warm_Walls) (southeast . In_Limestone_Passage) (down . In_Limestone_Passage) (nodwarf)) ()) (object At_Junction_With_Warm_Walls nil (location) ((name . "At Junction With Warm Walls") (ldesc . "The walls are quite warm here. From the north \ can be heard a steady roar, so loud that the entire \ cave seems to be trembling. Another passage leads \ south, and a low crawl goes east. ") (south . At_Fork_In_Path) (north . At_Breath_Taking_View) (east . In_Chamber_Of_Boulders) (nodwarf)) ()) (object At_Breath_Taking_View nil (location) ((name. "At Breath-Taking View") (ldesc . "You are on the edge of a breath-taking view. Far \ below you is an active volcano, from which great \ gouts of molten lava come surging out, cascading back \ down into the depths. The glowing rock fills the \ farthest reaches of the cavern with a blood-red \ glare, giving everything an eerie, macabre \ appearance. The air is filled with flickering sparks \ of ash and a heavy smell of brimstone. The walls are \ hot to the touch, and the thundering of the volcano \ drowns out all other sounds. Embedded in the jagged \ roof far overhead are myriad twisted formations \ composed of pure white alabaster, which scatter the \ murky light into sinister apparitions upon the walls. \ To one side is a deep gorge, filled with a bizarre \ chaos of tortured rock which seems to have been \ crafted by the devil himself. An immense river of \ fire crashes out from the depths of the volcano, \ burns its way through the gorge, and plummets into a \ bottomless pit far off to your left. To the right, \ an immense geyser of blistering steam erupts \ continuously from a barren island in the center of a \ sulfurous lake, which bubbles ominously. The far \ right wall is aflame with an incandescence of its \ own, which lends an additional infernal splendor to \ the already hellish scene. A dark, forboding passage \ exits to the south. ") (south . At_Junction_With_Warm_Walls) (out . At_Junction_With_Warm_Walls) (down . "Don't be ridiculous! ") (light)) ((do-jump (actptr) (print "Don't be ridiculous!\n")) )) (object Volcano At_Breath_Taking_View (thing) ((name . "active volcano") (nouns "volcano" "rock" "blood") (adjectives "active" "glowing" "blood-red" "red" "eerie" "macbre") (ldesc . "Great gouts of molten lava come surging out of the \ volvano and go cascading back down into the depths. \ The glowing rock fills the farthest reaches of the \ cavern with a blood-red glare, giving everything an \ eerie, macabre appearance. ") (noshow)) ()) (object Sparks At_Breath_Taking_View (thing) ((name . "sparks of ash") (nouns "spark" "ash" "air") (adjectives "flickering") (ldesc . "The sparks are too far away for you to get a \ good look at them. ") (noshow)) ()) (object JaggedRoof At_Breath_Taking_View (thing) ((name . "jagged roof") (nouns "roof" "formation" "light" "apparition") (adjectives "jagged" "twisted" "murky" "sinister") (ldesc . "Embedded in the jagged roof far overhead are myriad \ twisted formations composed of pure white alabaster, \ which scatter the murky light into sinister \ apparitions upon the walls. ") (noshow)) ()) (object DeepGorge At_Breath_Taking_View (thing) ((name . "deep gorge") (nouns "gorge" "chaos" "rock") (adjectives "deep" "bizarre" "tortured") (ldesc . "The gorge is filled with a bizarre chaos of tortured \ rock which seems to have been crafted by the devil himself. ") (noshow)) ()) (object RiverOfFire At_Breath_Taking_View (thing) ((name . "river of fire") (nouns "river" "fire" "depth" "pit" "fire") (adjectives "fiery" "bottomless") (ldesc . "The river of fire crashes out from the depths of the \ volcano, burns its way through the gorge, and plummets \ into a bottomless pit far off to your left. ") (noshow)) ()) (object Geyser At_Breath_Taking_View (thing) ((name . "immense geyser") (nouns "geyser" "steam" "island" "lake") (adjectives "immense" "blistering" "barren" "sulfurous" "sulferous" "sulphurous" "sulpherous" "bubbling") (ldesc . "The geyser of blistering steam erupts continuously \ from a barren island in the center of a sulfurous \ lake, which bubbles ominously. ") (noshow)) ()) (object In_Chamber_Of_Boulders nil (location) ((name . "In Chamber of Boulders") (ldesc . "You are in a small chamber filled with large \ boulders. The walls are very warm, causing the air \ in the room to be almost stifling from the heat. The \ only exit is a crawl heading west, through which is \ coming a low rumbling. ") (west . At_Junction_With_Warm_Walls) (out . At_Junction_With_Warm_Walls) (nodwarf)) ()) (object ChamberBoulders In_Chamber_Of_Boulders (thing) ((name . "boulders") (nouns "boulder" "rock" "stone") (ldesc . "They're just ordinary boulders. They're warm. ") (noshow)) ()) (object rare_spices In_Chamber_Of_Boulders (Treasure) ((name . "rare spices") (article . "a selection of") (nouns "spice") (adjectives "rare" "exotic") (ldesc . "They smell wonderfully exotic! ") (depositpoints . 14)) ((do-smell (actptr) (print (getprop self 'ldesc) "\n")) )) (object In_Limestone_Passage nil (location) ((name . "In Limestone Passage") (ldesc . "You are walking along a gently sloping north/south \ passage lined with oddly shaped limestone formations. ") (north . At_Fork_In_Path) (up . At_Fork_In_Path) (south . In_Front_Of_Barren_Room) (down . In_Front_Of_Barren_Room) (nodwarf)) ()) (object LimestoneFormations In_Limestone_Passage (thing) ((name . "limestone formations") (nouns "formation" "shape" "lime" "stone" "limestone") (adjectives "oddly" "shaped" "oddly-shaped") (ldesc . "Every now and then a particularly strange shape \ catches your eye. ") (noshow)) ()) ;---------------------------------------------------------------------------- ; If you go down to the woods today... ;---------------------------------------------------------------------------- (object In_Front_Of_Barren_Room nil (location) ((name . "In Front of Barren Room") (ldesc . "You are standing at the entrance to a large, \ barren room. A sign posted above the entrance reads: \ \"Caution! Bear in room!\" ") (west . In_Limestone_Passage) (up . In_Limestone_Passage) (east . In_Barren_Room) (in . In_Barren_Room) (nodwarf)) ()) (object BarrenSign In_Front_Of_Barren_Room (thing) ((name . "caution sign") (nouns "sign") (adjectives "barren" "room" "caution") (ldesc . "The sign reads, \"Caution! Bear in room!\" ") (noshow)) ()) (object In_Barren_Room nil (location) ((name . "In Barren Room") (ldesc . "You are inside a barren room. The center of \ the room is completely empty except for some dust. \ Marks in the dust lead away toward the far end of the \ room. The only exit is the way you came in. ") (west . In_Front_Of_Barren_Room) (out . In_Front_Of_Barren_Room) (nodwarf)) ()) (object Dust In_Barren_Room (thing) ((name . "dust") (nouns "dust" "mark") (ldesc . "It just looks like ordinary dust. ") (noshow)) ()) (object Bear In_Barren_Room (thing) ((name . "large cave bear") (nouns "bear") (adjectives "large" "tame" "ferocious" "cave")) ((descfull () (print "The bear is extremely large, " (if (hasprop self 'scored) "but appears to be friendly.\n" "and seems quite ferocious!\n"))) (descpart () (print (cond ((hasprop self 'isfollowing) "You are being followed by a very large, tame bear. ") ((not (hadprop self 'scored)) "There is a ferocious cave bear eyeing \ you from the far end of the room! ") ((= (location-of self) (findobject 'In_Barren_Room)) "There is a gentle cave bear \ sitting placidly in one corner. ") (t "There is a contented-looking \ bear wandering about nearby. ")) "\n")) (do-throw (actptr) (print "You can't throw a 600 pound cave bear!\n")) (do-throw-at (actptr objptr) (do-throw actptr)) (do-attack (actptr) (cond ((contained-in? (findobject 'axe) actptr) (method (findobject 'axe) do-throw-at actptr self)) ((hasprop self 'scored) (print "The bear is confused; he only wants to be \ your friend.\n")) (t (print "With what? Your bare hands? Against *his* \ bear hands??\n")))) (do-attack-with (actptr objptr) (if (= (objectname objptr) 'axe) (method objptr do-throw-at actptr self) (print "Don't be silly.\n"))) (throw-target (actptr objptr) (cond ((!= 'axe (objectname objptr)) (receive actptr objptr) nil) ((hasprop self 'scored) (print "The bear is confused; he only wants to \ be your friend.\n") (setprop objptr 'ungetable nil) (print "The axe misses and lands near the bear \ where you can't get at it.\n") (location-of self)))) (receive (actptr objptr) (cond ((= (objectname objptr) 'tasty_food) (delprop (findobject 'axe) 'ungetable) (move objptr *voidptr*) (setprop self 'scored nil) (print "The bear eagerly wolfs down your food, after \ which he seems to calm down considerably and \ even becomes rather friendly.\n")) ((hasprop self 'scored) (print "The bear doesn't seem very interested in \ your offer.\n")) (t (print "Uh-oh -- your offer only makes the bear \ angrier!\n")))) (do-ask (actptr objptr) (print "This is a Bear of very little brain.\n")) (do-order (actptr objptr) (print "This is a Bear of very little brain.\n")) (do-answer (actptr objptr) (print "This is a Bear of very little brain.\n")) (do-get (actptr) (cond ((not (hasprop self 'scored)) (print "Surely you're joking!\n")) ((not (method (findobject 'golden_chain) is-locked?)) (print "The bear is still chained to the wall.\n")) (t (setprop self 'isfollowing) (print ""Ok, the bear's now following you around.\n")))) (do-drop (actptr) (cond ((not (hasprop self 'isfollowing)) (print "What?\n")) (t (setprop self 'isfollowing nil) (if (= (location-of self) (location-of (findobject 'Troll))) (begin (move (findobject 'Troll) *voidptr*) (print "The bear lumbers toward the troll, who \ lets out a startled shriek and \ scurries away. The bear soon gives \ up the pursuit and wanders back.\n")) (print "The bear wanders away from you.\n"))))) )) (daemon bear-daemon () (if (and (hasprop self 'isfollowing) (!= (location-of self) (location-of *player*))) (begin (move self (location-of *player*)) (if (= 'At_Breath_Taking_View (objectname (location-of self))) (print "\nThe bear roars with delight.\n") (print "\nThe bear lumbers along behind you.\n"))))) (spawn (findobject 'Bear) bear-daemon) (object golden_chain In_Barren_Room (Treasure lockable-object) ((name . "golden chain") (nouns "chain" "link" "shackle") (adjectives "solid" "gold" "golden" "thick") (depositpoints . 14) (ldesc . "The chain has thick links of solid gold! ") (islocked)) ((descpart () (if (is-locked?) (print "The bear is held back by a solid gold chain. ") (print "A solid golden chain lies in coils on the ground! "))) (do-lock (actptr) (print "The mechanism won't lock again.\n")) (do-lock-with (actptr objptr) (do-lock actptr)) (before (actptr objptr actionname) (cond ((= actionname 'do-get) (cond ((is-locked?) (if (hasprop (findobject 'Bear) 'scored) (print "It's locked to the friendly bear.\n") (print "A solid golden chain lies in coils \ on the ground!\n")) nil) (t))) ((= actionname 'do-unlock) (cond ((hasprop (findobject 'Bear) 'scored) (print "There is no way to get past the bear to \ unlock the chain, which is probably just as \ well.\n") nil) (t))) (t))) (after (actptr objptr actionname) (cond ((= actionname 'do-unlock) (print "You unlock the chain, and set the tame \ bear free.\n")) )) )) ;---------------------------------------------------------------------------- ; The Different Maze ;---------------------------------------------------------------------------- (class DiffMaze (location) ((name . "Maze") (ldesc . "You are in a maze of twisty little passages, \ all different. ")) ()) (object Different_Maze_1 nil (DiffMaze) ((south . Different_Maze_3) (southwest . Different_Maze_4) (northeast . wifferent_Maze_5) (southeast . Different_Maze_6) (up . Different_Maze_7) (northwest . Different_Maze_8) (east . Different_Maze_9) (west . Different_Maze_10) (north . Different_Maze_11) (down . At_West_End_Of_Long_Hall)) ()) (object Different_Maze_2 nil (DiffMaze) ((southwest . Different_Maze_3) (north . Different_Maze_4) (east . Different_Maze_5) (northwest . Different_Maze_6) (souteast . Different_Maze_7) (northeast . Different_Maze_8) (west . Different_Maze_9) (down . Different_Maze_10) (up . Different_Maze_11) (south . Dead_End_14)) ()) (object Different_Maze_3 nil (DiffMaze) ((west . Different_Maze_1) (southeast . Different_Maze_4) (northwest . Different_Maze_5) (southwest . Different_Maze_6) (northeast . Different_Maze_7) (up . Different_Maze_8) (down . Different_Maze_9) (north . Different_Maze_10) (south . Different_Maze_11) (east . Different_Maze_2)) ()) (object Different_Maze_4 nil (DiffMaze) ((northwest . Different_Maze_1) (up . Different_Maze_3) (north . Different_Maze_5) (south . Different_Maze_6) (west . Different_Maze_7) (southwest . Different_Maze_8) (northeast . Different_Maze_9) (east . Different_Maze_10) (down . Different_Maze_11) (southeast . Different_Maze_2)) ()) (object Different_Maze_5 nil (DiffMaze) ((up . Different_Maze_1) (down . Different_Maze_3) (west . Different_Maze_4) (northeast . Different_Maze_6) (southwest . Different_Maze_7) (east . Different_Maze_8) (north . Different_Maze_9) (norhtwest . Different_Maze_10) (southeast . Different_Maze_11) (south . Different_Maze_2)) ()) (object Different_Maze_6 nil (DiffMaze) ((northeast . Different_Maze_1) (north . Different_Maze_3) (norhtwest . Different_Maze_4) (southeast . Different_Maze_5) (east . Different_Maze_7) (down . Different_Maze_8) (south . Different_Maze_9) (up . Different_Maze_10) (west . Different_Maze_11) (southwest . Different_Maze_2)) ()) (object Different_Maze_7 nil (DiffMaze) ((north . Different_Maze_1) (southeast . Different_Maze_3) (down . Different_Maze_4) (south . Different_Maze_5) (east . Different_Maze_6) (west . Different_Maze_8) (southwest . Different_Maze_9) (northeast . Different_Maze_10) (northwest . Different_Maze_11) (up . Different_Maze_2)) ()) (object Different_Maze_8 nil (DiffMaze) ((east . Different_Maze_1) (west . Different_Maze_3) (up . Different_Maze_4) (southwest . Different_Maze_5) (down . Different_Maze_6) (south . Different_Maze_7) (northwest . Different_Maze_9) (southeast . Different_Maze_10) (northeast . Different_Maze_11) (north . Different_Maze_2)) ()) (object Different_Maze_9 nil (DiffMaze) ((southeast . Different_Maze_1) (northeast . Different_Maze_3) (south . Different_Maze_4) (down . Different_Maze_5) (up . Different_Maze_6) (northwest . Different_Maze_7) (north . Different_Maze_8) (southwest . Different_Maze_10) (east . Different_Maze_11) (west . Different_Maze_2)) ()) (object Different_Maze_10 nil (DiffMaze) ((down . Different_Maze_1) (east . Different_Maze_3) (northeast . Different_Maze_4) (up . Different_Maze_5) (west . Different_Maze_6) (north . Different_Maze_7) (south . Different_Maze_8) (southeast . Different_Maze_9) (southwest . Different_Maze_11) (northwest . Different_Maze_2)) ()) (object Different_Maze_11 nil (DiffMaze) ((southwest . Different_Maze_1) (northwest . Different_Maze_3) (east . Different_Maze_4) (west . Different_Maze_5) (north . Different_Maze_6) (down . Different_Maze_7) (southeast . Different_Maze_8) (up . Different_Maze_9) (south . Different_Maze_10) (northeast . Different_Maze_2)) ()) (object Dead_End_14 nil (DeadEndRoom) ((name . "Dead End, near Vending Machine") (ldesc . "You have reached a dead end. There is a massive \ vending machine here. ") (north . Different_Maze_2) (out . Different_Maze_2) (nodwarf)) ()) (object PirateMessage Dead_End_14 (thing) ((name . "message in the dust") (nouns "message" "scrawl" "writing" "script") (adjectives "scrawled" "flowery") (ldesc . "The message reads, \"This is not the maze where the \ pirate leaves his treasure chest.\" ") (initial . "Hmmm... There is a message here \ scrawled in the dust in a flowery script. ") (noshow)) ()) (object VendingMachine Dead_End_14 (thing) ((name . "vending machine") (nouns "machine") (adjectives "slot" "vending" "massive" "battery" "coin") (ldesc . "The instructions on the vending machine read, \ \"Insert coins to receive fresh batteries.\" ") (noshow)) ((do-look-under (actptr) (print "You don't find anything under the machine.\n")) (do-search (actptr) (print "You can't get inside the machine.\n")) (do-get (actptr) (print "The vending machine is far too heavy to move.\n")) (do-attack (actptr) (print "The machine is quite sturdy and survives your attack \ without getting so much as a scratch.\n")) (do-attack-with (actptr objptr) (do-attack actptr)) (move-into (actptr objptr) (cond ((= 'rare_coins (objectname objptr)) (move (findobject 'fresh_batteries) (location-of actptr)) (move objptr *voidptr) (print "Soon after you insert the coins in the coin slot, \ the vending machines makes a grinding sound, and a \ set of fresh batteries falls at your feet.\n")) (t (print "The machine seems to be designed to take coins.\n")) )) )) (object fresh_batteries VendingMachine (thing) ((name . "fresh batteries") (nouns "battery") (adjectives "fresh") (ldesc . "They look like ordinary batteries. (A sepulchral \ says, \"Still going!\") ") (initial . "There are fresh batteries here. ")) ()) (object old_batteries the-void (thing) ((name . "worn-out batteries") (nouns "battery") (adjectives "worn" "out" "worn-out") (ldesc . "They look like ordinary batteries. ") (initial . "Some worn-out batteries have been discarded nearby. ")) ()) ;---------------------------------------------------------------------------- ; Dwarves! ;---------------------------------------------------------------------------- (object dwarf the-void (thing) ((name . "threatening little dwarf") (nouns "dwarf") (adjectives "threatening" "nasty" "little" "mean") (ldesc . "It's probably not a good idea to get too close. Suffice \ it to say the little guy's pretty aggressive. ") (initial . "A threatening little dwarf hides in the shadows. ") (remaining . 5) (hasaxe)) ((do-kick (actptr) (print "You boot the dwarf across the room. He curses, then \ gets up and brushes himself off. Now he's madder \ than ever!\n")) (throw-target (actptr objptr) (cond ((= 'axe (objectname objptr)) (move objptr (location-of self)) (cond ((!= 1 (random 3)) (move self *voidptr*) (setprop self 'remaining (1- (getprop self 'remaining))) (print "You killed a little dwarf! The body \ vanishes in a cloud of greasy black smoke.\n")) (t (print "Missed! The little dwarf dodges out of \ the way of the axe.\n")))) (t (receive actptr objptr)))) (do-attack (actptr) (print "Not with your bare hands. No way.\n")) (do-attack-with (actptr objptr) (method objptr 'do-throw-at actptr self)) (receive (actptr objptr) (if (= 'tasty_food (objectname objptr)) (print "You fool, dwarves eat only coal! \ Now you've made him *really* mad!\n") (print "The dwarf is not at all interested in your offer. \ (The reason being, perhaps, that if he kills you \ he gets everything you have anyway.)\n"))) )) (daemon dwarf-daemon () (let ((locale (location-of *player*)) (number (getprop self 'remaining))) (cond ((<= number 0) (killdaemon)) ((not (method locale is-illuminated?)) (exit)) ((= (parent self) *voidptr*) (if (or (hasprop locale 'nodwarf) (hasprop locale 'light)) (exit)) (cond ((< (random 100) number) (if (or (= locale (location-of (findobject 'Bear))) (= locale (location-of (findobject 'Troll)))) (exit)) (if (= locale (location-of (findobject 'Dragon))) (begin (set number (1- number)) (setprop self 'remaining number) (print "\nA dwarf appears, but with one \ casual blast the dragon vapourises \ him!\n"))) (move self locale) (print "\nA threatening little dwarf comes out \ of the shadows!\n")))) ((!= locale (parent self)) (if (or (hasprop locale 'nodwarf) (hasprop locale 'light)) (exit)) (if (and (< (random 100) 96) (!= (parent self) (findobject 'In_Mirror_Canyon))) (begin (move self locale) (print "\nThe dwarf stalks after you...\n")) (move self *voidptr*))) ((< (random 100) 75) (cond ((hasprop self 'hasaxe) (move (findobject 'axe) locale) (delprop self 'hasaxe) (move self *voidptr*) (print "\nThe dwarf throws a nasty little axe at \ you, misses, curses, and runs away.\n")) ((= locale (findobject 'In_Mirror_Canyon)) (print "\nThe dwarf admires himself in the mirror.\n") (exit)) (t (print "\nThe dwarf throws a nasty little knife \ at you, ") (if (< (random 1000) 95) (begin (print "and hits!\n") (kill-player)) (print "but misses!\n"))))) ((= (random 3) 1) (move self *voidptr*) (print "\nTiring of this, the dwarf slips away.\n"))))) (spawn (findobject 'dwarf) dwarf-daemon) (object axe the-void (getable-object) ((name . "dwarvish axe") (nouns "axe") (adjectives "little" "dwarvish" "dwarven") (ldesc . "It's just a little axe. ") (initial . "There is a little axe here. ")) ((before (actptr objptr actionname) (cond ((= actionname 'do-get) (cond ((hasprop self 'ungetable) (print "No chance. It's lying beside the \ ferocious bear, quite within harm's way.\n") nil) (t))) ((= actionname 'do-examine) (print "It's lying beside the bear.\n") nil) (t))) (do-throw (actptr) (if (= (location-of actptr) (location-of (findobject 'dwarf))) (do-throw-at actptr (findobject 'dwarf)) (print "There is no dwarf here.\n"))) )) ;---------------------------------------------------------------------------- ; Piracy, twice over ;---------------------------------------------------------------------------- (object pirate the-void (thing) ((name . "pirate") (treasurefound . nil)) ()) (daemon pirate-daemon (general scored) (let ((location (location-of *player*)) (c 0) (objptr nil) (nextptr nil)) (if (or (and general scored) (getprop self 'treasurefound)) (killdaemon)) ; conditions under which the pirate will not appear (if (or (hasprop location 'light) (hasprop location 'nodwarf) (> (random 100) 2) (= (objectname location) 'In_Secret_Canyon)) (exit)) ; pirate is afraid of the dwarfs (if (= location (location-of (findobject 'dwarf))) (begin (print "\nA bearded pirate appears, catches sight of \ the dwarf and runs away.\n") (exit))) ; move valuables in player's location to the treasure room (set objptr (child (parent *player*))) (loop (if (null? objptr) (exit)) (set nextptr (sibling objptr)) (if (hasprop objptr 'valuable) (begin (move objptr (findobject 'Dead_End_13)) (set c (1+ c)))) (set objptr nextptr)) ; move valuables carried by player to treasure room (set objptr (child *player*)) (loop (if (null? objptr) (exit)) (set nextptr (sibling objptr)) (if (hasprop objptr 'valuable) (begin (move objptr (findobject 'Dead_End_13)) (set c (1+ c)))) (set objptr nextptr)) ; print appropriate message depending upon whether anything was ; stolen by the pirate (cond ((= c 0) (set general t) (print "There are faint rustling noises from the darkness \ behind you. As you turn toward them, you spot a \ bearded pirate. He is carrying a large chest.\n\ \"Shiver me timbers!\" he cries, \"I've been \ spotted! I'd best hie meself off to the maze to \ hide me chest!\"\nWith that, he vanishes into \ the gloom.\n")) (t (set scored t) (print "Out from the shadows behind you pounces a bearded \ pirate! \"Har, har,\" he chortles. \"I'll just take \ all this booty and hide it away with me chest deep \ in the maze!\" He snatches your treasure and vanishes \ into the gloom.\n"))) )) (spawn (findobject 'pirate) pirate-daemon nil nil) ;---------------------------------------------------------------------------- ; The cave is closing now... ;---------------------------------------------------------------------------- (daemon cave_closer () (if (< treasures_found MAX_TREASURES) (exit)) (set caves_closed t) (set score (+ score 25)) (move (findobject 'CrystalBridge1) *voidptr*) (move (findobject 'CrystalBridge2) *voidptr*) (move (findobject 'set_of_keys) *voidptr*) (move (findobject 'Troll) *voidptr*) (move (findobject 'Bear) *voidptr*) (move (findobject 'Dragon) *voidptr*) (setprop (findobject 'Grate) 'isclosed nil) (setprop (findobject 'Grate) 'islocked nil) ; ; StartTimer(endgame_timer, 25); ; (print "\nA sepulchral voice reverberating through the cave says, \ \"Cave closing soon. All adventurers exit immediately \ through main office.\"\n")) (spawn nil cave_closer) ; ; Object endgame_timer "endgame timer" ; with time_left 0, ; time_out ; [; score=score + 10; ; ; while (child(player)~=0) remove child(player); ; ; move bottle to At_Ne_End; ; if (child(bottle)~=0) remove child(bottle); ; ; move giant_bivalve to At_Ne_End; ; move brass_lantern to At_Ne_End; ; move black_rod to At_Ne_End; ; move little_bird to At_Sw_End; ; move velvet_pillow to At_Sw_End; ; ; print "^The sepulchral voice intones, ~The cave is now \ ; closed.~ As the echoes fade, there is a blinding flash of \ ; light (and a small puff of orange smoke). . .^^\ ; As your eyes refocus, you look around...^"; ; PlayerTo(At_Ne_End); ; ]; ; ;---------------------------------------------------------------------------- ; The End Game ;---------------------------------------------------------------------------- (object At_Ne_End nil (location) ((name . "NE End of Repository") (ldesc . "You are at the northeast end of an immense \ room, even larger than the giant room. It appears to \ be a repository for the \"Adventure\" program. \ Massive torches far overhead bathe the room with \ smoky yellow light. Scattered about you can be seen \ a pile of bottles (all of them empty), a nursery of \ young beanstalks murmuring quietly, a bed of oysters, \ a bundle of black rods with rusty stars on their \ ends, and a collection of brass lanterns. Off to one \ side a great many dwarves are sleeping on the floor, \ snoring loudly. A sign nearby reads: \"Do not \ disturb the dwarves!\" ") (south . At_Sw_End) (light)) ()) (object Mirror_2 scenery-objects (thing) ((name . "enormous mirror") (nouns "mirror") (adjectives "enormous" "huge" "big" "large" "suspended" "hanging" "vanity" "dwarvish") (ldesc . "It looks like an ordinary, albeit enormous, mirror. ") (initial . "An immense mirror is hanging against one wall, \ and stretches to the other end of the room, where \ various other sundry objects can be glimpsed dimly in \ the distance. ") (found_in At_Ne_End At_Sw_End)) ((do-attack-with (actptr objptr) (do-attack actptr)) (do-attack (actptr) (print "You strike the mirror a resounding blow, whereupon \ it shatters into a myriad tiny fragments.\b") (DwarvesWake)) )) (object RepositoryStuff_1 At_Ne_End (thing) ((name . "collection of adventure game materials") (nouns "stuff" "junk" "material" "torch" "object" "repository") (adjectives "adventure" "massive" "sundry") (ldesc . "You've seen everything in here already, albeit \ in somewhat different contexts. ") (noshow)) ()) ; before ; [; Take: "Realizing that by removing the loot here you'd be \ ; ruining the game for future players, you leave the \ ; Adventure materials where they are."; ; ], (object RepositoryDwarves At_Ne_End (thing) ((name . "sleeping dwarves") (article . "hundreds of angry") (nouns "dwarf") (adjectives "sleeping" "snoring" "dozing" "snoozing") (ldesc . "I wouldn't bother the dwarves if I were you. ")) ()) ; before ; [; ; Take: "What, all of them?"; ; ], ; life ; [; WakeOther: ; print "You prod the nearest dwarf, who wakes up grumpily, \ ; takes one look at you, curses, and grabs for his \ ; axe.^^"; ; DwarvesWake(); rtrue; ; Attack: DwarvesWake(); rtrue; ; ], (object At_Sw_End nil (location) ((name . "SW End of Repository") (ldesc . "You are at the southwest end of the repository. \ To one side is a pit full of fierce green snakes. On \ the other side is a row of small wicker cages, each \ of which contains a little sulking bird. In one \ corner is a bundle of black rods with rusty marks on \ their ends. A large number of velvet pillows are \ scattered about on the floor. A vast mirror stretches \ off to the northeast. At your feet is a large steel \ grate, next to which is a sign which reads, \ \"TREASURE VAULT. Keys in main office.\" ") (northeast . At_Ne_End) (down . "The grate is locked. ") (light)) ()) (object RepositoryGrate At_Sw_End (openable-object lockable-object) ((name . "steel grate") (nouns "grate" "grating") (adjectives "ordinary" "steel") (ldesc . "It just looks like an ordinary steel grate. ") (closed) (locked) (key . 0)) ((descfull () (print (if (is-open?) "The grate is open." "The grate is closed.") "\n")) (do-enter () (print "The grate is locked.\n")) )) (object RepositoryStuff_2 At_Sw_End (thing) ((name . "collection of adventure game materials") (nouns "pit" "snake" "stuff" "junk" "material" "repository") (adjectives "adventure" "fierce" "green" "massive" "sundry") (ldesc . "You've seen everything in here already, albeit \ in somewhat different contexts. ") (noshow)) ((do-get (actptr) (print "Realizing that by removing the loot here you'd be \ ruining the game for future players, you leave the \ \"Adventure\" materials where they are.\n")) )) (object black_mark_rod At_Sw_End (thing) ((name . "black rod with a rusty mark on the end") (nouns "rod" "mark" "explosive" "dynamite") (adjectives "black" "rusty" "three" "foot" "iron" "blast") (ldesc . "It's a three foot black rod with a rusty mark on an end. ") (initial . "A three foot black rod with a rusty mark on one end \ lies nearby. ")) ((do-wave (actptr) (print "Nothing happens.\n")) )) (function DwarvesWake () (print "The resulting ruckus has awakened the dwarves. There are \ now dozens of threatening little dwarves in the room with you! \ Most of them throw knives at you! All of them get you!\n") (kill-player)) ;---------------------------------------------------------------------------- ; Some entry points ;---------------------------------------------------------------------------- (set score 36) (function PrintRank () (print "Your score is " score " out of " MAX_SCORE ", earning you the rank of " (cond ((>= score 348) "Grandmaster Adventurer!") ((>= score 330) "Master, first class.") ((>= score 300) "Master, second class.") ((>= score 200) "Junior Master.") ((>= score 130) "Seasoned Adventurer.") ((>= score 100) "Experienced Adventurer.") ((>= score 35) "Adventurer.") ((>= score 10) "Novice.") (t "Amateur.")) "\n")) ; rewritten version of the function to allow for falling into pits ; (function move-to-location (actptr place) (cond ((object? place) (cond ((and (not (method place is-illuminated?)) (not (method (location-of actptr) is-illuminated?)) (= 1 (random 4))) (print "You fell into a pit and broke every bone \ in your body!\n") (kill-player)) (t (move actptr place) (method place upon-entry actptr) (method (location-of actptr) descfull) (if (not (method place is-illuminated?)) (print "If you proceed you will likely fall \ into a pit.\n")) (method (location-of actptr) visit actptr)))) ((string? place) (print place)) (t (print "You cannot move in that direction.\n")))) ;---------------------------------------------------------------------------- ; Menu-driven help ;---------------------------------------------------------------------------- ; ; [ HelpMenu; ; if (menu_item==0) { item_width=8; item_name="About Adventure"; ; if (deadflag==2) return 4; else return 3; ; } ; if (menu_item==1) { item_width=6; item_name="Instructions"; } ; if (menu_item==2) { item_width=4; item_name="History"; } ; if (menu_item==3) { item_width=6; item_name="Authenticity"; } ; if (menu_item==4) { item_width=7; item_name="Did you know..."; } ; ]; ; ; [ HelpInfo; ; if (menu_item==1) ; { ; print "I know of places, actions, and things. You can guide \ ; me using commands that are complete sentences. To move, try \ ; commands like ~enter,~ ~east,~ ~west,~ ~north,~ ~south,~ ~up,~ \ ; ~down,~ ~enter building,~ ~climb pole,~ etc.^^"; ; ; print "I know about a few special objects, like a black rod \ ; hidden in the cave. These objects can be manipulated using \ ; some of the action words that I know. Usually you will need \ ; to give a verb followed by an object (along with descriptive \ ; adjectives when desired), but sometimes I can infer the \ ; object from the verb alone. Some objects also imply verbs; \ ; in particular, ~inventory~ implies ~take inventory~, \ ; which causes me to give you a list of what you're carrying. \ ; The objects have side effects; for instance, the rod scares \ ; the bird.^^"; ; ; print "Many commands have abbreviations. For example, you can \ ; type ~i~ in place of ~inventory,~ ~x object~ instead of \ ; ~examine object,~ etc.^^"; ; ; print "Usually people having trouble moving just need to try a \ ; few more words. Usually people trying unsuccessfully to \ ; manipulate an object are attempting something beyond their \ ; (or my!) capabilities and should try a completely different \ ; tack.^^"; ; ; print "Note that cave passages turn a lot, and that leaving a room \ ; to the north does not guarantee \ ; entering the next from the south.^^"; ; ; print "If you want to end your adventure early, type ~quit~. \ ; To suspend your adventure such that you can continue later, \ ; type ~save,~ and to resume a saved game, type ~restore.~ \ ; To see how well you're doing, type ~score~. To get full \ ; credit for a treasure, you must have left it safely in the \ ; building, though you get partial credit just for locating it. \ ; You lose points for getting killed, or for quitting, though \ ; the former costs you more. There are also points based on how \ ; much (if any) of the cave you've managed to explore; in \ ; particular, there is a large bonus just for getting in (to \ ; distinguish the beginners from the rest of the pack), and \ ; there are other ways to determine whether you've been through \ ; some of the more harrowing sections.^^"; ; ; print "If you think you've found all the treasures, just keep \ ; exploring for a while. If nothing interesting happens, you \ ; haven't found them all yet. If something interesting *does* \ ; happen, it means you're getting a bonus and have an \ ; opportunity to garner many more points in the master's \ ; section.^^"; ; ; "Good luck!"; ; } ; if (menu_item==2) ; { ; print "This was the first adventure game ever written, based on a FORTRAN \ ; simulation of the Mammoth and Flint Ridge cave system by Willie \ ; Crowther. Crowther was one of its explorers: some of the game's \ ; locations are real, Bedquilt for instance. (And ~Y2~ is a reference \ ; to the cave-map notation for ~alternative entrance to caves~.)^^"; ; ; print "Adventure (sometimes called ~Colossal Cave~, another real place) \ ; was an extension largely by Don Woods, a colleague of Crowther's \ ; at a Massachusetts computing firm. Inspired by (a variant of) the \ ; role-playing game ~Dungeons and Dragons~, they added puzzles and \ ; magic to the caves.^^"; ; ; print "The game was spread from machine to machine, and (among others) \ ; DECUS, the Digital user group, issued tapes of it. Ever since, \ ; the game has been modified, ported, improved, extended and generally \ ; corrupted. The original is hard to find. Most of the extras tacked \ ; on are clearly inferior, and lose the spirit of the (certainly \ ; imperfect, but atmospheric and well-designed) original.^^"; ; ; print "This is a copy at third hand. It is a slight simplification of David \ ; M. Baggett's excellent 1993 version for Adventions, written in TADS: \ ; which in turn derived from Donald Ekman's PC port of the original \ ; FORTRAN source code.^^"; ; ; "And, even by modern standards, it is still a good game!"; ; } ; ; if (menu_item==3) ; { ; print "This port is fairly close to the original. The puzzles, items and places \ ; of the 1977 version are exactly those here.^^"; ; ; print "I have added a few helpful messages, such as ~This is a dead end.~, \ ; here and there: and restored some ~initial position~ messages from \ ; objects, such as the (rather lame)^\ ; ^ There is tasty food here.^^\ ; from source files which are certainly early but of doubtful \ ; provenance. They seem to sit well with the rest of the text.^^"; ; ; print "The scoring system is the original, except that you no longer lose 4 \ ; points for quitting (since you don't get the score if you quit an \ ; Inform game, this makes no difference) and, controversially, I award \ ; 5 points for currently carrying a treasure, as some early 1980s \ ; ports did. The rank names are tidied up a little. The only \ ; significant rule change is that one cannot use \ ; magic words until their destinations have been visited.^^"; ; ; print "The dwarves are simpler in their movements, but on the other hand I \ ; have added a very few messages to make them interact better with the \ ; rest of the game. The probabilities are as in the original game.^^"; ; ; print "In the original one could type the name of a room to visit it: for \ ; the sake of keeping the code small, I have omitted this feature, but \ ; with some regrets.^^"; ; ; print "The text itself is almost everywhere preserved intact, but I've \ ; corrected some spelling and grammatical mistakes (and altered a \ ; couple of utterly misleading and gnomic remarks). The instructions \ ; have been slightly altered (for obvious reasons) but are basically \ ; as written.^^"; ; ; "A good source for details is David Baggett's source code, which is \ ; circulated on the Internet."; ; } ; ; print "Did you know that...^^"; ; ; print "The five dwarves have a 96% chance of following you, except into \ ; light, down pits or when admiring themselves: and the nasty little \ ; knives are 9.5% accurate.^^"; ; ; print "Dragons burn up dwarves (perhaps because dwarves eat only coal).^^"; ; ; print "The bear (who likes the volcano) is too heavy for the bridge... \ ; and you can go back to the scene after being resurrected.^^"; ; ; print "You can slip past the snake into the secret E/W canyon, \ ; 35% of the time at any rate. And walking about in the dark \ ; is not all that gruesome: it carries only a 25% risk of falling \ ; down a pit.^^"; ; ; print "The vase does not like being immersed.^^"; ; ; print "Shadowy figures can wave to each other.^^"; ; ; print "Watering the hinges of the door rusts them up again.^^"; ; ; print "When the cave closes, the grate is locked and the keys are thrown \ ; away, creatures run off and the crystal bridge vanishes...^^"; ; ; print "...and a completely useless hint is written on the giant oyster's \ ; shell in the end game.^^"; ; ; "The last lousy point can be won by... but no. That would be telling."; ; ; ]; ; ; [ HelpSub; ; ; if (deadflag~=2) ; DoMenu("There is information provided on the following:^\ ; ^ Instructions for playing\ ; ^ The history of this game\ ; ^ How authentic is this edition?^", ; #r$HelpMenu, #r$HelpInfo); ; else ; DoMenu("There is information provided on the following:^\ ; ^ Instructions for playing\ ; ^ The history of this game\ ; ^ How authentic is this edition?\ ; ^ Did you know...^", ; #r$HelpMenu, #r$HelpInfo); ; ; ]; ; ; [ Amusing; HelpSub(); ]; ; ;---------------------------------------------------------------------------- ; New verbs (to add to the library stock) ;---------------------------------------------------------------------------- ; (action Release (("release" *subject*)) (valid-object? *subjectptr* *actorptr*) (perform-action 'do-drop *actorptr* *subjectptr* nil)) (action Free (("free" *subject*)) (valid-object? *subjectptr* *actorptr*) (perform-action 'do-drop *actorptr* *subjectptr* nil)) (action Fee (("fee")) t (fword 0)) (action Fie (("fie")) t (fword 1)) (action Foe (("foe")) t (fword 2)) (action Foo (("foo")) t (fword 3)) (set fcount 0) (function fword (num) (cond ((!= num fcount) (set fcount 0) (print "Get it right, dummy!\n")) (t (set fcount (1+ fcount)) (if (!= fcount 4) (print "Ok.\n") (let ((locname (objectname (location-of (findobject 'golden_eggs)))) (locptr (location-of (findobject 'golden_eggs)))) (if (= 'In_Giant_Room locname) (print "Nothing happens.\n") (begin (if (= locptr (location-of *player*)) (print "The nest of golden eggs has \ vanished!\n") (print "Done!\n")) (if (contained-in? locptr *player*) (set score (- score 5)) (if (= 'Inside_Building locname) (set score (- score (getprop (findobject 'golden_eggs) 'depositpoints))))) (set fcount 0) (move-by-name 'golden_eggs 'In_Giant_Room) (if (= 'In_Giant_Room (location-of *player*)) (print "\bA large nest full of golden eggs \ suddenly appears out of nowhere!\n")) ))))))) (action OldMagic (("sesame") ("shazam") ("hocus") ("abracadabra") ("foobar") ("open-sesame") ("frotz")) t (print "Good try, but that is an old worn-out magic word.\n")) (action BlastWith (("blast" "with" *subject*)) (valid-object? *subjectptr* *actorptr*) (if (= 'black_mark_rod (objectname subjecptr*)) (print "Been eating those funny brownies again?\n") (print "Blasting requires dynamite.\n"))) (action Blast (("blast")) t (let ((locale (location-of *player*))) (cond ((and (!= 'At_Sw_End (objectname locale)) (!= 'At_Ne_End (objectname locale))) (print "Frustrating, isn't it?\n")) ((and (= 'At_Sw_End (objectname locale)) (= 'At_Ne_End (objectname (location-of (findobject black_mark_rod))))) (set score (+ score 35)) (print "There is a loud explosion, and a twenty-foot \ hole appears in the far wall, burying the dwarves in \ the rubble. You march through the hole and find \ yourself in the main office, where a cheering band of \ friendly elves carry the conquering adventurer off \ into the sunset.\n") (exit-game)) ((and (= 'At_Ne_End (objectname locale)) (= 'At_Sw_End (objectname (location-of (findobject black_mark_rod))))) (set score (+ score 20)) (print "There is a loud explosion, and a twenty-foot \ hold appears in the far wall, burying the snakes in \ the rubble. A river of molten lava pours in through \ the hole, destroying everything in its path, \ including you!\n") (kill-player)) (t (print "There is a loud explosion, and you are suddenly \ splashed across the walls of the room.\n") (kill-player))))) ;---------------------------------------------------------------------------- ; Resurrection ;---------------------------------------------------------------------------- (set deaths 0) (function kill-player () (print "\n\n") (cond (caves_closed (print "It looks as though you're dead. Well, seeing as how \ it's so close to closing time anyway, I think we'll \ just call it a day.\n") (terminate)) ((= deaths 0) (print "Oh dear, you seem to have gotten yourself killed. I \ might be able to help you out, but I've never really \ done this before. Do you want me to try to \ reincarnate you?\b")) ((= deaths 1) (print "You clumsy oaf, you've done it again! I don't know \ how long I can keep this up. Do you want me to try \ reincarnating you again?\b")) ((= deaths 2) (print "Now you've really done it! I'm out of orange smoke! \ You don't expect me to do a decent reincarnation \ without any orange smoke, do you?\b"))) (cond ((not (yes-or-no)) (cond ((= 0 deaths) (print "Very well.\n")) ((= 1 deaths) (print "Probably a wise choice.\n")) (t (print "I thought not!\n"))) (exit-game)) (t (cond ((= 0 deaths) (print "All right. But don't blame me if something \ goes wr......\b\b\b\ --- POOF!! ---\b\ You are engulfed in a cloud of orange smoke. \ Coughing and gasping, you emerge from the smoke and \ find that you're...\b")) ((= 1 deaths) (print "Okay, now where did I put my orange smoke?.... \ >POOF!<\b\bEverything disappears in a dense cloud \ of orange smoke.\b")) (t (print "Okay, if you're so smart, do it yourself! I'm \ leaving!\b") (exit-game))) (set deaths (1+ deaths)) (set score (- score 10)) (if (hasprop (location-of *player*) 'light) (loop (if (null? (child *player*)) (exit)) (if (hasprop (child *player*) 'valuable) (set score (- score 5))) (move (child *player*) (location-of *player*))) (loop (if (null? (child *player*)) (exit)) (if (hasprop (child *player*) 'valuable) (set score (- score 5))) (move (child *player*) (findobject 'Below_The_Grate)))) (move-by-name 'brass_lantern 'At_End_Of_Road) (setprop (findobject 'brass_lantern) 'activated 'no) (move (findobject 'dwarf) *voidptr*) (move-to-location *player* (findobject 'Inside_Building))))) ;---------------------------------------------------------------------------- ; Grammar: the usual grammar and some extensions ;---------------------------------------------------------------------------- ; ; Include "Grammar"; ; ; Verb "on" ; * -> On; ; Verb "off" ; * -> Off; ; ; Verb "catch" "capture" ; * creature -> Catch ; * creature "with" held -> Catch; ; Verb "release" "free" ; * creature -> Release; ; Verb "pour" "douse" ; * noun -> Empty; ; Verb "water" * noun -> Water; ; Verb "oil" "grease" "lubricate" ; * noun -> Oil; ; Verb "fee" * -> Fee; ; Verb "fie" * -> Fie; ; Verb "foe" * -> Foe; ; Verb "foo" * -> Foo; ; ; Verb "help" * -> Help; ; Verb "kick" * noun -> Kick; ; Verb "count" * -> Count; ; Verb "use" * -> Use; ; Verb "blast" * -> Blast ; * noun "with" held -> BlastWith; ; ; #IFDEF TEST_VERSION; ; Verb "xdeterm" * -> Xdeterm; ; #ENDIF; ; ; end; (action Lwpi (("lwpi")) t (cond ;((not (method (findobject 'In_Soft_Room) visited? *actorptr*)) ; (print "Nothing happens.\n")) ((contained-in? *actorptr* (findobject 'Inside_Building)) (move (findobject' dwarf) *voidptr*) (move-to-location *actorptr* (findobject 'In_Soft_Room))) ((contained-in? *actorptr* (findobject 'In_Soft_Room)) (move (findobject' dwarf) *voidptr*) (move-to-location *actorptr* (findobject 'Inside_Building))) (t (print "Nothing happens.\n")))) (action Xyzzy (("xyzzy")) t (cond ((not (method (findobject 'In_Debris_Room) visited? *actorptr*)) (print "Nothing happens.\n")) ((contained-in? *actorptr* (findobject 'Inside_Building)) (move (findobject' dwarf) *voidptr*) (move-to-location *actorptr* (findobject 'In_Debris_Room))) ((contained-in? *actorptr* (findobject 'In_Debris_Room)) (move (findobject' dwarf) *voidptr*) (move-to-location *actorptr* (findobject 'Inside_Building))) (t (print "Nothing happens.\n")))) (action Plugh (("plugh")) t (cond ((not (method (findobject 'At_Y2) visited? *actorptr*)) (print "Nothing happens.\n")) ((contained-in? *actorptr* (findobject 'Inside_Building)) (move (findobject' dwarf) *voidptr*) (move-to-location *actorptr* (findobject 'At_Y2))) ((contained-in? *actorptr* (findobject 'At_Y2)) (move (findobject' dwarf) *voidptr*) (move-to-location *actorptr* (findobject 'Inside_Building))) (t (print "Nothing happens.\n")))) (action Plover (("plover")) t (cond ((not (method (findobject 'In_Plover_Room) visited? *actorptr*)) (print "Nothing happens.\n")) ((and (contained-in? *actorptr* (findobject 'At_Y2)) (contained-in? (findobject 'egg_sized_emerald) *actorptr*)) (move-by-name 'egg_sized_emerald 'In_Plover_Room) (move-to-location *actorptr* (findobject 'In_Plover_Room))) ((and (contained-in? *actorptr* (findobject 'In_Plover_Room)) (contained-in? (findobject 'egg_sized_emerald) *actorptr*)) (move-by-name 'egg_sized_emerald 'In_Plover_Room) (move-to-location *actorptr* (findobject 'At_Y2))) (t (print "Nothing happens.\n")))) (action Score (("score")) t (PrintRank)) (action No (("no")) t (print (if (contained-in? *actorptr* (findobject 'In_Secret_Canyon)) "I should think not.\n" "Such negatism!\n"))) (action Yes (("yes") ("y")) t (if (contained-in? *actorptr* (findobject 'In_Secret_Canyon)) (cond ((contained-in? (findobject 'Dragon) (findobject 'In_Secret_Canyon)) (move (findobject 'Dragon) *voidptr*) (move-by-name 'DragonCorpse 'In_Secret_Canyon) (print "Congratulations! You have just vanquished a \ dragon with your bare hands! (Unbelievable, \ isn't it?)\n")) (t (print "Amazing, wasn't it?\n"))) (print "Such optimism! You're going to need it.\n"))) ; define the player actor ; (object player-actor At_End_Of_Road (actor) ((name . "player")) nil) ; set the pointer to the player's actor so GINAS knows what actor is in use ; (set *player* (findobject 'player-actor)) ; spawn the controller daemon for the player ; (spawn *player* player-daemon) (function Initialize () (print "ADVENTURE\n\ The Interactive Original\n\ By Willie Crowther and Don Woods (1977)\n\ David M. Baggett's 1993 reconstruction for TADS\n\ ported to Inform by Graham Nelson (1994)\n\ ported to GINAS by Jeff Standish (1995)\b") (print "\bWelcome to Adventure!\b") ; explicitly describe the location in which the player starts (method (location-of *player*) descfull) )