| !% -~S | |
| !% $OMIT_UNUSED_ROUTINES=1 | |
| !% $ZCODE_LESS_DICT_DATA=1 | |
| !% $MAX_ABBREVS=96 | |
| !% $ZCODE_MAX_INLINE_STRING=1200 | |
| !% $LONG_DICT_FLAG_BUG=0 | |
| !% $ZCODE_COMPACT_GLOBALS=1 | |
| !% $TRANSCRIPT_FORMAT=1 | |
| !!% $OMIT_SYMBOL_TABLE=1 ! Saves space, only possible without DEBUG mode | |
| ! ------------------------------------------------------------------------------ | |
| ! Advent 060321 A classic and one of the standard Inform 6 example games | |
| ! | |
| ! | |
| ! Adapted to Inform 5: 17.05.1994 to 24.05.1994 | |
| ! Modernised to Inform 5.5 and library 5/12 or later: 20.12.1995 | |
| ! Modernised to Inform 6 and library 6/1 or later: 11.11.1996 | |
| ! A few bugs removed and companion text rewritten: 09.12.1996 | |
| ! Some very minor bugs indeed removed: 24.02.1997 | |
| ! And another two: 04.09.1997 | |
| ! [RF] Source reformatted and very minor bug removed: 02.09.2004 | |
| ! [RF] Added teleportation, also minor bug fixes: 21.03.2006 | |
| ! ------------------------------------------------------------------------------ | |
| ! PunyInform version notes: | |
| ! | |
| ! The gameplay should very similar to the Inform 6 version. Every room, | |
| ! object, actor, treasure and puzzle are there. However, some bugfixes and | |
| ! changes that bring the game closer to the original and the TADS2 port were | |
| ! made in Release 5, serial 251113. | |
| ! | |
| ! Zabbrev by Henrik Asman was used to make the game file as small as | |
| ! possible, to make the game perform well on 8-bit computers. | |
| ! | |
| ! [FR] Adapted to PunyInform v5.10: 24.11.2024 | |
| ! [FR] Updated to PunyInform v5.14.1: 04.07.2025 | |
| ! [FR] Updated to PunyInform v6.0: 09.08.2025 | |
| ! [FR] Updated to PunyInform v6.0.2, typing room name now teleports: 11.10.2025 | |
| ! [FR] Updated to PunyInform v6.1.1, fixed inherited 13.11.2025 | |
| ! bugs/exploits, and changed endgame: | |
| ! * Cage can now hold three small items (was unlimited) | |
| ! * Putting items in cage won't let player bring items where | |
| ! they shouldn't be able to, or avoid having them stolen | |
| ! * If lantern goes out and fresh batteries are in cage or | |
| ! on Y2 rock (if in scope), batteries are now switched | |
| ! automatically | |
| ! * Getting treasures out of cage in building won't mess up | |
| ! score anymore | |
| ! * If the player uses 'plover' in At_Y2 while carrying the | |
| ! emerald, they drop the emerald in At_Y2, before traveling | |
| ! to plover room (emerald used to be dropped in plover room) | |
| ! * Batteries and bars of silver now have pluralname | |
| ! * Added initial linefeed in describe routine for oyster, | |
| ! rickety bridge, bear, chain, beanstalk (2 objects), | |
| ! Persian rug. | |
| ! * When crystal bridge disappears at cave closing time, it | |
| ! doesn't reappear again | |
| ! * Going w from Witt's End now always fails, instead of | |
| ! leading to Ante room | |
| ! * When the lantern shows up in a room description, it is | |
| ! now described as glowing 'dimly' rather than 'brightly' | |
| ! if the batteries are almost exhausted | |
| ! * The game now simulates five dwarves moving around | |
| ! independently, instead of just one dwarf sometimes | |
| ! appearing | |
| ! * Teleporting has been changed so it can't be used to bypass | |
| ! rules where the nugget, the emerald and the clam can't be | |
| ! carried through certain passages - this brings back puzzles | |
| ! which could just be ignored by teleporting *and* avoids the | |
| ! pearl confusingly moving to Cul de Sac if the player opened | |
| ! the clam outside the area where it should be contained | |
| ! * Teleporting from or to a dark location or a location down | |
| ! in the proper cave system, now requires holding the lantern, | |
| ! which must be giving off light | |
| ! * Teleporting through the locked grate is now blocked | |
| ! * End game changed to mimic TADS2 version: | |
| ! * Cave starts closing 30 moves after last treasure is | |
| ! deposited. Countdown is paused when player is above | |
| ! ground or in first rooms of cave (before Hall of Mists) | |
| ! * When cave starts closing, magic words and teleportation | |
| ! stop working | |
| ! * After cave starts closing, it takes 20 moves until end | |
| ! game launches, 35 if player tries to exit through grate | |
| ! * Added debug verb 'cachepos' to show how many entries are | |
| ! currently used in the dwarf exit cache | |
| ! * Added debug verb 'gocave' to pick up everything in the | |
| ! house + bird and rod, and teleport to At Top of Small Pit | |
| ! * Added debug verb 'cavecloser' to show the current reading | |
| ! of cave_closer.time_left | |
| ! * Walking around using just direction words accidentally got | |
| ! slow in last release, now it's fast again | |
| ! * Assigned a new IFID, since so much was changed, and old ID | |
| ! was shared with Inform 6 version | |
| ! [FR] Updated to PunyInform v6.2, and fixed some issues: 26.11.2025 | |
| ! * Teleporting across troll bridge is now blocked, unless | |
| ! bridge is present, troll is gone, and bear isn't following | |
| ! * After dying from bringing the bear across the bridge, the | |
| ! bridge would break again and the player die again if player | |
| ! returned and tried to cross the chasm again - Fixed | |
| ! * If player dies beyond troll bridge, and is resurrected, | |
| ! belongings are now placed in On_Sw_Side_Of_Chasm so player | |
| ! can get to them | |
| ! * Unlocked teleporting anywhere by just typing room name in | |
| ! test version | |
| ! * Removed "dragon's" as a synonym for rug in z3, to get rid | |
| ! of disambiguation question for the noun "dragon" | |
| ! * Added synonyms 'small' and (sometimes) 'empty' for bottle | |
| ! [FR] Updated to PunyInform v6.3, and fixed some issues: 05.12.2025 | |
| ! * Made object name matching faster in z5, by using name | |
| ! property and no parse_name routine | |
| ! * Set moved for bird when catching it, so 'objects' shows it | |
| ! * Removed superfluous synonyms for z3, due to 6-character | |
| ! dictionary resolution, and some general duplicates | |
| ! ------------------------------------------------------------------------------ | |
| ! Build notes: | |
| ! This source was developed for use with Inform v6.44 and PunyInform v6.3. If | |
| ! moving to a later PunyInform version, read the release notes for all | |
| ! PunyInform releases up to the one you're using, to see if something needs to | |
| ! be adjusted in the source code of the game. | |
| ! | |
| ! Recommended build commands: | |
| ! inform6 +lib advent_punyinform.inf -v3eD advent_debug.z3 | |
| ! inform6 +lib advent_punyinform.inf -v5eD advent_debug.z5 | |
| ! inform6 +lib advent_punyinform.inf -v3e $OMIT_SYMBOL_TABLE=1 $#RUNTIME_ERRORS=0 advent.z3 | |
| ! inform6 +lib advent_punyinform.inf -v5e $OMIT_SYMBOL_TABLE=1 $#RUNTIME_ERRORS=0 advent.z5 | |
| #Ifv5; | |
| Zcharacter | |
| "abcdefghi.klmnop,rstuvwTy'" | |
| "ABCDEFGHIJKLMNOPxRSjUVWzYq" | |
| "0123456789[]!?`*;/>-:()"; | |
| Abbreviate "ack rod with a rusty "; | |
| Abbreviate "s, all different."; | |
| Abbreviate " Stephen Bishop"; | |
| Abbreviate "You are in a "; | |
| Abbreviate "looks like "; | |
| Abbreviate " batteries"; | |
| Abbreviate "You can't "; | |
| Abbreviate "There is "; | |
| Abbreviate "You have "; | |
| Abbreviate " already"; | |
| Abbreviate " through"; | |
| Abbreviate " to the "; | |
| Abbreviate " of the "; | |
| Abbreviate "ordinary"; | |
| Abbreviate "nothing "; | |
| Abbreviate " passage"; | |
| Abbreviate "You are "; | |
| Abbreviate "dventure"; | |
| Abbreviate " in the "; | |
| Abbreviate "dwarves"; | |
| Abbreviate " which "; | |
| Abbreviate ". The "; | |
| Abbreviate "hamber"; | |
| Abbreviate "little"; | |
| Abbreviate ", but "; | |
| Abbreviate "bridge"; | |
| Abbreviate " just "; | |
| Abbreviate " small"; | |
| Abbreviate " this "; | |
| Abbreviate " large"; | |
| Abbreviate " are "; | |
| Abbreviate "thing"; | |
| Abbreviate " with"; | |
| Abbreviate "north"; | |
| Abbreviate " that"; | |
| Abbreviate " from"; | |
| Abbreviate " away"; | |
| Abbreviate " the "; | |
| Abbreviate "anyon"; | |
| Abbreviate " down"; | |
| Abbreviate "floor"; | |
| Abbreviate " lead"; | |
| Abbreviate " not "; | |
| Abbreviate " into"; | |
| Abbreviate "bject"; | |
| Abbreviate " Room"; | |
| Abbreviate " and "; | |
| Abbreviate "You "; | |
| Abbreviate "n't "; | |
| Abbreviate "ing "; | |
| Abbreviate " for"; | |
| Abbreviate "tion"; | |
| Abbreviate "east"; | |
| Abbreviate " see"; | |
| Abbreviate " of "; | |
| Abbreviate " is "; | |
| Abbreviate "here"; | |
| Abbreviate "The "; | |
| Abbreviate "room"; | |
| Abbreviate "ound"; | |
| Abbreviate "side"; | |
| Abbreviate " to "; | |
| Abbreviate "one "; | |
| Abbreviate "ight"; | |
| Abbreviate " you"; | |
| Abbreviate "some"; | |
| Abbreviate "It's"; | |
| Abbreviate "ould"; | |
| Abbreviate "all"; | |
| Abbreviate " in"; | |
| Abbreviate " a "; | |
| Abbreviate "In "; | |
| Abbreviate "ly "; | |
| Abbreviate "ter"; | |
| Abbreviate "and"; | |
| Abbreviate "re "; | |
| Abbreviate " it"; | |
| Abbreviate "end"; | |
| Abbreviate "ear"; | |
| Abbreviate "ow "; | |
| Abbreviate "the"; | |
| Abbreviate " ex"; | |
| Abbreviate " ca"; | |
| Abbreviate "You"; | |
| Abbreviate "out"; | |
| Abbreviate "ver"; | |
| Abbreviate "est"; | |
| Abbreviate "es "; | |
| Abbreviate "rea"; | |
| Abbreviate "ent"; | |
| Abbreviate ". A"; | |
| Abbreviate "ing"; | |
| Abbreviate "ed "; | |
| Abbreviate " be"; | |
| Abbreviate "ave"; | |
| Abbreviate "^^"; | |
| #Ifnot; | |
| ! z3 | |
| Abbreviate "s, all different."; | |
| Abbreviate "t looks like "; | |
| Abbreviate "You are in a "; | |
| Abbreviate "You can't "; | |
| Abbreviate " batteries"; | |
| Abbreviate "There is "; | |
| Abbreviate "You have "; | |
| Abbreviate " in the "; | |
| Abbreviate "You are "; | |
| Abbreviate " through"; | |
| Abbreviate " passage"; | |
| Abbreviate "dventure"; | |
| Abbreviate "nothing "; | |
| Abbreviate " of the "; | |
| Abbreviate "ordinary"; | |
| Abbreviate " to the "; | |
| Abbreviate " which "; | |
| Abbreviate "dwarves"; | |
| Abbreviate " small "; | |
| Abbreviate " object"; | |
| Abbreviate " your "; | |
| Abbreviate ". The "; | |
| Abbreviate "bridge"; | |
| Abbreviate ", but "; | |
| Abbreviate " large"; | |
| Abbreviate "range "; | |
| Abbreviate "little"; | |
| Abbreviate "thing"; | |
| Abbreviate " from"; | |
| Abbreviate " are "; | |
| Abbreviate " that"; | |
| Abbreviate "north"; | |
| Abbreviate " with"; | |
| Abbreviate " and "; | |
| Abbreviate " lead"; | |
| Abbreviate " the "; | |
| Abbreviate "anyon"; | |
| Abbreviate " away"; | |
| Abbreviate " down"; | |
| Abbreviate "It's "; | |
| Abbreviate " Room"; | |
| Abbreviate "floor"; | |
| Abbreviate " into"; | |
| Abbreviate "tion"; | |
| Abbreviate "rate"; | |
| Abbreviate "his "; | |
| Abbreviate " in "; | |
| Abbreviate "You'"; | |
| Abbreviate "n't "; | |
| Abbreviate " to "; | |
| Abbreviate "here"; | |
| Abbreviate "side"; | |
| Abbreviate "You "; | |
| Abbreviate " you"; | |
| Abbreviate " of "; | |
| Abbreviate "ing "; | |
| Abbreviate "The "; | |
| Abbreviate "room"; | |
| Abbreviate "ound"; | |
| Abbreviate " is "; | |
| Abbreviate "one "; | |
| Abbreviate "ight"; | |
| Abbreviate "some"; | |
| Abbreviate "ould"; | |
| Abbreviate "all"; | |
| Abbreviate "'s "; | |
| Abbreviate "st "; | |
| Abbreviate " it"; | |
| Abbreviate " a "; | |
| Abbreviate ".^^"; | |
| Abbreviate "In "; | |
| Abbreviate "ter"; | |
| Abbreviate "en "; | |
| Abbreviate "ed "; | |
| Abbreviate "out"; | |
| Abbreviate "ly "; | |
| Abbreviate "ver"; | |
| Abbreviate "the"; | |
| Abbreviate "rea"; | |
| Abbreviate "es "; | |
| Abbreviate "ent"; | |
| Abbreviate ". A"; | |
| Abbreviate "for"; | |
| Abbreviate "ing"; | |
| Abbreviate " be"; | |
| Abbreviate "ow "; | |
| Abbreviate "ear"; | |
| Abbreviate "end"; | |
| Abbreviate "re "; | |
| Abbreviate "ave"; | |
| Abbreviate " ca"; | |
| Abbreviate "and"; | |
| Abbreviate "^^"; | |
| Abbreviate ", "; | |
| Abbreviate ". "; | |
| Abbreviate "e."; | |
| #Endif; | |
| Constant UNCLIMBABLE = "The dome is unclimbable."; | |
| Constant CRACK_TOO_SMALL = "The crack is far too small for you to follow."; | |
| Constant STREAM_FLOWS_OUT = "The stream flows out through a pair of 1 foot diameter sewer pipes."; | |
| Constant BEAR_IS_CONFUSED = "The bear is confused; he only wants to be your friend."; | |
| Constant YOU_DONT_FIT = "You don't fit through a two-inch slit!"; | |
| Constant HINGES_RUSTED = "The hinges are quite thoroughly rusted now and won't budge."; | |
| Constant DRAGON_NASTY = "The dragon looks rather nasty. You'd best not try to get by."; | |
| Constant WONT_FIT = "Something you're carrying won't fit through the tunnel with you. | |
| You'd best take inventory and drop something."; | |
| Constant LOUD_EXPLOSION = "There is a loud explosion, and a twenty-foot hole | |
| appears in the far wall, burying the "; | |
| Constant NOTHING_HAPPENS = "Nothing happens."; | |
| Constant CRAWLED_LITTLE_HOLES = "You have crawled around in some little holes | |
| and wound up back in the main passage."; | |
| Constant CRAWLED_PASSAGE = "You have crawled through a very low wide passage | |
| parallel to and north of the hall of mists.^"; | |
| Constant INFORMATION_PROVIDED = | |
| "There is information provided on the following: | |
| ^^ Instructions for playing | |
| ^ A historical preface | |
| ^ How authentic is this edition?^"; | |
| Constant CASCADING_BACK = | |
| "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."; | |
| Constant GO_ACROSS_BRIDGE = | |
| "I respectfully suggest you go across the bridge instead of jumping."; | |
| Constant BLISTERING_STEAM = | |
| "geyser of blistering steam erupts continuously from a barren island | |
| in the center of a sulfurous lake, which bubbles ominously."; | |
| Constant RIVER_OF_FIRE = | |
| "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."; | |
| Constant TORTURED_ROCK = | |
| "filled with a bizarre chaos of tortured rock which seems to have been | |
| crafted by the devil himself."; | |
| Constant SEEN_EVERYTHING = | |
| "You've seen everything in here already, albeit in somewhat different contexts."; | |
| Constant REMOVING_THE_LOOT = | |
| "Realizing that by removing the loot here you'd be ruining the game | |
| for future players, you leave the ~Adventure~ materials where they | |
| are."; | |
| Constant TWISTED_FORMATIONS = | |
| "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."; | |
| Constant AT_A_LOW_WINDOW = | |
| "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"; | |
| Constant MARKS_IN_THE_DUST = | |
| "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."; | |
| Constant MIRROR_PROVIDED = | |
| "The mirror is obviously provided for the use of the dwarves who, as | |
| you know, are extremely vain."; | |
| Constant NOTHING_TO_CARRY_WATER = | |
| "You have nothing in which to carry the water."; | |
| Constant NOTHING_TO_CARRY_OIL = | |
| "You have nothing in which to carry the oil."; | |
| Constant CRYSTAL_BRIDGE = | |
| "A crystal bridge now spans the fissure."; | |
| Constant WOULDNT_MESS = | |
| "I wouldn't mess with it if I were you."; | |
| Constant FIGURE_WAVES = | |
| "The shadowy figure waves back at you!"; | |
| Constant TOO_FAR_UP = | |
| "It is too far up for you to reach."; | |
| Constant FISSURE_TOO_WIDE = | |
| "The fissure is too wide."; | |
| Constant CHASM_TOO_WIDE = | |
| "The chasm is too wide."; | |
| Constant FISSURE_TOO_WIDE_TO_JUMP = | |
| "The fissure looks far too wide to jump."; | |
| Constant MIGHT_CLIMB = | |
| "It looks like you might be able to climb "; | |
| Constant Story "ADVENTURE"; | |
| Constant Headline | |
| "^The Interactive Original^ | |
| By Will Crowther (1976) and Don Woods (1977)^ | |
| Reconstructed in three steps by:^ | |
| Donald Ekman, David M. Baggett (1993) and Graham Nelson (1994)^ | |
| PunyInform version: Fredrik Ramsberg (2024)^ | |
| [In memoriam Stephen Bishop (1820?-1857): GN]^^"; | |
| Serial "251205"; | |
| Release 7; | |
| !Constant TEST_VERSION; ! Allows teleportation everywhere from the start, and enables the 'xdeterm' verb | |
| ! Adventure's IFID -- see http://babel.ifarchive.org/ | |
| Array UUID_ARRAY string "UUID://FD58E52B-C868-4BFA-B5FE-03C9E322FE08//"; #Ifdef UUID_ARRAY; #Endif; | |
| Constant STATUSLINE_SCORE; Statusline score; | |
| Constant CUSTOM_ABBREVIATIONS; | |
| Constant DIALECT_US; | |
| Constant OPTIONAL_LANGUAGE_NUMBER; | |
| Constant OPTIONAL_EXTENDED_VERBSET; | |
| Constant OPTIONAL_EXTENDED_METAVERBS; | |
| Constant OPTIONAL_FULL_DIRECTIONS; | |
| Constant OPTIONAL_FLEXIBLE_INVENTORY; | |
| Constant OPTIONAL_MANUAL_REACTIVE; ! The game has 1 reactive object! | |
| Constant OPTIONAL_MANUAL_SCOPE; | |
| Constant OPTIONAL_MANUAL_SCOPE_BOOST; | |
| ! While these constants make the parser assume you mean "with the set of keys" when unlocking | |
| ! the grate, they also make the game ~500 bytes larger, and that's a lot on 8-bit machines. | |
| ! I ended up disabling this feature, as the actual gain isn't great, considering the cost. | |
| !Constant OPTIONAL_GUESS_MISSING_NOUN; | |
| !Constant OPTIONAL_GUESS_KEY; | |
| !Constant RUNTIME_ERRORS = 0; | |
| !Constant DEBUG; | |
| #Ifv5; | |
| Constant OPTIONAL_PROVIDE_UNDO; | |
| Constant DEATH_MENTION_UNDO; | |
| #Endif; | |
| Constant INITIAL_LOCATION_VALUE = At_End_Of_Road; | |
| Constant MAX_SCOPE = 86; ! The number of rooms, which can be put in scope for "goto" | |
| Constant MAX_FLOATING_OBJECTS = 17; | |
| Constant MAX_TIMERS = 6; | |
| Constant AMUSING_PROVIDED; | |
| Constant MAX_CARRIED = 7; | |
| Constant MAX_SCORE = 350; | |
| Constant MAX_TREASURES = 15; | |
| ! ------------------------------------------------------------------------------ | |
| ! Including the first library file, defining globals, properties etc. | |
| ! ------------------------------------------------------------------------------ | |
| Include "globals.h"; | |
| ! Treasures | |
| Property depositpoints; | |
| ! Brass lantern | |
| Property replace_batteries; | |
| Property power_remaining; | |
| ! Cave closer | |
| Property close_caves alias replace_batteries; | |
| Property final_closing_time alias power_remaining; | |
| ! Dwarf rooms | |
| Property npc_exits alias power_remaining; | |
| Property dynamic_npc_exit alias depositpoints; | |
| ! Dwarf & In_Secret_Canyon | |
| Property number alias replace_batteries; | |
| ! Bear | |
| Property is_following_you alias replace_batteries; | |
| Property is_friendly alias power_remaining; | |
| ! Dwarf | |
| Property has_thrown_axe alias power_remaining; | |
| Property dwarves_present alias depositpoints; | |
| Property scatter alias door_dir; | |
| ! Pirate | |
| Property has_stolen_something alias replace_batteries; | |
| Property has_been_spotted alias power_remaining; | |
| Property has_been_opened alias replace_batteries; ! Giant clam | |
| Property has_caught_treasure alias replace_batteries; ! Troll | |
| Property have_been_used alias replace_batteries; ! Fresh batteries | |
| Property is_near_bear alias replace_batteries; ! Axe | |
| Property wake_up alias replace_batteries; ! Sleeping dwarves | |
| Property is_being_attacked alias replace_batteries; ! Dragon | |
| Property height alias replace_batteries; ! Plant | |
| #Ifv5; | |
| Property teleport_name; | |
| Property cheap_scenery; | |
| Property cheap_scenery_2; | |
| Property multi_name alias name; ! For z5, we use the name property, and no parse_name routine - faster! | |
| #Ifnot; | |
| ! These have to be individual in z3, to accomodate arrays with more than 4 values | |
| Property individual teleport_name; | |
| Property individual cheap_scenery; | |
| Property individual cheap_scenery_2; | |
| Property individual multi_name; | |
| #Endif; | |
| Attribute aboveground alias on; ! Room is above ground | |
| Attribute notfarin alias enterable; ! Room is not far into the cave | |
| Attribute beyond_troll_bridge alias openable; ! Room lies beyond the troll bridge | |
| Attribute dwarfroom alias worn; ! Room can be entered by dwarves | |
| Attribute depositpoints_awarded alias absent; ! Player has received deposit points for treasure | |
| Attribute treasure_found alias open; ! Treasure object has been found | |
| Attribute treasure_deposited; ! Treasure object is currently deposited | |
| Attribute multitude; ! Used only by COUNT | |
| Attribute tiny; ! Objects that fit in cage | |
| Global caves_closed; ! true when cave is closing | |
| !Global canyon_from; ! Which canyon to return to, this is now stored in In_Secret_Canyon.number instead | |
| Global treasures_deposited; ! Count of treasures currently deposited | |
| Global deaths; ! Counts of deaths/resurrections | |
| Global dark_warning; ! true after warning about dark pits | |
| Global feefie_count; ! fee/fie/foe/foo sequencer | |
| Global booty_nearby; ! Signal if there's treasure for the pirate to steal nearby | |
| Global dwarf_exit_cache_index; ! False start of the array (to save 84 empty bytes) | |
| Global mirror_distraction_turn; ! When was a dwarf last distracted in Mirror Canyon? | |
| ! ------------------------------------------------------------------------------ | |
| ! Some entry points | |
| ! ------------------------------------------------------------------------------ | |
| #Ifdef DEBUG; | |
| [ DebugParseNameObject obj; | |
| if(obj ofclass MultiNameObject) rtrue; | |
| rfalse; | |
| ]; | |
| #Endif; | |
| [ Amusing; HelpSub(); ]; | |
| [ PrintRank; | |
| print ", earning you the rank of "; | |
| if (score >= 348) "Grandmaster Adventurer!"; | |
| if (score >= 330) "Master, first class."; | |
| if (score >= 300) "Master, second class."; | |
| if (score >= 200) "Junior Master."; | |
| if (score >= 130) "Seasoned Adventurer."; | |
| if (score >= 100) "Experienced Adventurer."; | |
| if (score >= 35) "Adventurer."; | |
| if (score >= 10) "Novice."; | |
| "Amateur."; | |
| ]; | |
| [ DarkToDark; | |
| if (dark_warning == false) { | |
| dark_warning = true; | |
| "It is now pitch dark. If you proceed you will likely fall into a pit."; | |
| } | |
| if (random(4) == 1) { | |
| deadflag = GS_DEAD; | |
| "You fell into a pit and broke every bone in your body!"; | |
| } | |
| rfalse; | |
| ]; | |
| #Ifdef DEBUG; | |
| [ IsARoom p_obj p_verdict; | |
| if(p_obj == axe or water_in_the_bottle or oil_in_the_bottle or cave_closer) { | |
| p_verdict = 1; ! Get rid of warning for unused local | |
| return 2; ! Not a room | |
| } | |
| rfalse; ! Accept library's verdict | |
| ]; | |
| #Endif; | |
| ! ------------------------------------------------------------------------------ | |
| ! ParseNoun is used exclusively for teleportation | |
| ! ------------------------------------------------------------------------------ | |
| [ ParseNoun obj; | |
| if(obj provides teleport_name) return MatchNameList(obj, teleport_name); | |
| return -1; | |
| ]; | |
| ! UnknownVerb can be used for teleportation, i.e. the player can just type "END OF ROAD" to get back to At End of Road | |
| ! For the PunyInform version we have to put in some work to quickly decide if this is either of: | |
| ! (a) not a recognized word | |
| ! (b) only a compass direction | |
| ! and if it is, return false. | |
| #Ifv3; | |
| Array my_direction_dict_words static --> 'n//' 's//' 'e//' 'w//' 'ne' 'nw' 'se' 'sw' 'u//' 'd//' 0 0 | |
| 'north' 'south' 'east' 'west' 'northeast' 'northwest' 'southeast' 'southwest' 'up' 'down' 'in' 'out'; | |
| #Endif; | |
| [ UnknownVerb word obj max; | |
| if(word == 0) rfalse; | |
| if(NumberWords()==1 || _IsSentenceDivider(parse + 6)) { ! Check if second word is './/' 'then' etc. | |
| #Ifv5; | |
| max = 0; | |
| @scan_table word _direction_dict_words (DIRECTION_COUNT * 2) -> obj ?rfalse; | |
| #Ifnot; | |
| max = DIRECTION_COUNT + DIRECTION_COUNT - 1; | |
| .next_dir; | |
| if(my_direction_dict_words-->obj == word) | |
| rfalse; | |
| @inc_chk obj max ?~next_dir; | |
| #Endif; | |
| } | |
| #Ifdef TEST_VERSION; | |
| objectloop (obj provides teleport_name) { | |
| wn = verb_wordnum; | |
| if(MatchNameList(obj, teleport_name)) { | |
| verb_wordnum = 0; | |
| return 'go'; | |
| } | |
| } | |
| #Ifnot; | |
| objectloop (obj has visited && obj provides teleport_name) { | |
| wn = verb_wordnum; | |
| if(MatchNameList(obj, teleport_name)) { | |
| verb_wordnum = 0; | |
| return 'go'; | |
| } | |
| } | |
| #Endif; | |
| rfalse; | |
| ]; | |
| ! ------------------------------------------------------------------------------ | |
| ! Resurrection | |
| ! ------------------------------------------------------------------------------ | |
| [ AfterLife o loc; | |
| if (deadflag == GS_DEATHMESSAGE) { | |
| deadflag = GS_DEAD; | |
| rfalse; | |
| } | |
| print "^^"; | |
| if (caves_closed) | |
| "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."; | |
| switch (deaths) { | |
| 0: | |
| "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?^^"; | |
| 1: | |
| "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?^^"; | |
| 2: | |
| "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?^^"; | |
| } | |
| print "> "; | |
| if (YesOrNo() == false) { | |
| switch (deaths) { | |
| 0: "Very well."; | |
| 1: "Probably a wise choice."; | |
| 2: "I thought not!"; | |
| } | |
| } | |
| switch (deaths) { | |
| 0: | |
| "All right. But don't blame me if something goes wr...... | |
| ^^^^ | |
| --- POOF!! --- | |
| ^^ | |
| You are engulfed in a cloud of orange smoke. | |
| Coughing and gasping, you emerge from the smoke and find that you're....^"; | |
| 1: | |
| "Okay, now where did I put my orange smoke?.... >POOF!< | |
| ^^ | |
| Everything disappears in a dense cloud of orange smoke.^"; | |
| 2: | |
| "Okay, if you're so smart, do it yourself! I'm leaving!"; | |
| } | |
| deaths++; | |
| score = score - 10; | |
| loc = real_location; | |
| if(loc has beyond_troll_bridge && RicketyBridge has absent) | |
| loc = On_Sw_Side_Of_Chasm; ! Player can't to get to real_location | |
| while (child(player)) { | |
| o = child(player); | |
| move o to loc; | |
| if (o ofclass Treasure) score = score - 5; | |
| } | |
| move brass_lantern to At_End_Of_Road; | |
| give brass_lantern ~on ~light; | |
| remove Dwarf; | |
| deadflag = GS_PLAYING; | |
| PlayerTo(Inside_Building); ! Sets scope_modified | |
| ]; | |
| ! ------------------------------------------------------------------------------ | |
| ! The menu extension, providing menus in both z3 and z5 | |
| ! ------------------------------------------------------------------------------ | |
| Include "ext_menu.h"; | |
| ! ------------------------------------------------------------------------------ | |
| ! The cheap scenery extension, used here to decrease object count, to fit z3 | |
| ! ------------------------------------------------------------------------------ | |
| [ SceneryReply p_word1 p_word2 p_id_or_routine; | |
| Take: | |
| PrintMsg(MSG_TAKE_SCENERY); | |
| p_word1 = p_word2; p_word1 = p_id_or_routine; ! Get rid of warnings | |
| rtrue; | |
| Drop: | |
| PrintMsg(MSG_DROP_NOT_HOLDING); | |
| rtrue; | |
| Push, Pull, Turn: | |
| PrintMsg(MSG_PUSH_SCENERY); | |
| rtrue; | |
| Open, Close, Lock, Unlock: | |
| PrintMsg(MSG_OPEN_YOU_CANT, verb_word); | |
| rtrue; | |
| Enter: | |
| PrintMsg(MSG_OPEN_YOU_CANT, 'enter'); | |
| rtrue; | |
| default: | |
| rfalse; | |
| ]; | |
| Include "ext_cheap_scenery.h"; | |
| ! ------------------------------------------------------------------------------ | |
| ! Including the main library file | |
| ! ------------------------------------------------------------------------------ | |
| Replace PlayerTo; | |
| Include "puny.h"; | |
| Global magic_word_attempts = 0; | |
| ! We replace PlayerTo, to make floating objects become absent and non-absent as needed | |
| ! when moving to different rooms. We could wrap PlayerTo in a procedure of our own, but | |
| ! replacing it means it will also work for normal exits, and for the debug verb GOTO in | |
| ! the library. | |
| [ PlayerTo p_loc p_flag _old_loc _old_real_loc _old_lookmode _old_parent _vc _old_vc; | |
| ! --------------------------------------------------- | |
| ! Adding this procedure call is our only modification | |
| ! --------------------------------------------------- | |
| ModifyAbsent(p_loc); | |
| _old_loc = location; | |
| _old_real_loc = real_location; | |
| _old_vc = CalculateVisibilityCeiling(); | |
| move Player to p_loc; | |
| real_location = superparent(p_loc); | |
| location = real_location; | |
| MoveFloatingObjects(); ! Also sets scope_modified = true; | |
| _UpdateDarkness(true); | |
| ._recheck_visibility_ceil; | |
| _vc = CalculateVisibilityCeiling(); | |
| if(_vc == location && _vc ~= _old_vc) { | |
| if(location provides initial) { | |
| _old_parent = parent(player); | |
| location.initial(); | |
| if(parent(player) ~= _old_parent) | |
| jump _recheck_visibility_ceil; | |
| } | |
| #Ifdef NewRoom; | |
| if(location ~= thedark) | |
| RunEntryPointRoutine(NewRoom); | |
| #Endif; | |
| } | |
| #Ifdef DarkToDark; | |
| if(_old_real_loc ~= real_location && location == thedark && _old_loc == thedark) { | |
| ! we have moved between dark rooms | |
| ! give entry point a chance to react | |
| RunEntryPointRoutine(DarkToDark); | |
| } | |
| #Endif; | |
| _old_lookmode = lookmode; | |
| if(p_flag==false) | |
| lookmode = 2; | |
| if(p_flag~=true && deadflag == GS_PLAYING) | |
| Look(); | |
| lookmode = _old_lookmode; | |
| ]; | |
| [ MagicWordWhenClosed; | |
| if(TestScope(brass_lantern) && brass_lantern has light) { | |
| magic_word_attempts++; | |
| if(magic_word_attempts > 3) | |
| "You don't have the nerve."; | |
| print "The lantern flickers"; | |
| switch(magic_word_attempts) { | |
| 1: "."; | |
| 2: " and looks like it's about to go out, but then it slowly recovers."; | |
| 3: ". After a short while, it looks stable again, but it's considerably weaker now."; | |
| } | |
| } | |
| ]; | |
| ! ------------------------------------------------------------------------------ | |
| ! MultiNameObject class, to allow for many synonyms in z3 games | |
| ! ------------------------------------------------------------------------------ | |
| #Ifv5; | |
| [MatchNameList obj prop _w _matched _an _count _i; | |
| _an = obj.∝ | |
| if(_an == 0) return 0; | |
| _count = obj.#prop; | |
| @log_shift _count (-1) -> _count; ! Divide by 2 | |
| while(true) { | |
| _w = NextWord(); | |
| @scan_table _w _an _count -> _i ?_MNL_match; | |
| return _matched; | |
| ._MNL_match; | |
| _matched++; | |
| } | |
| ]; | |
| #Ifnot; | |
| [MatchNameList obj prop _w _matched _an _count _i _v; | |
| _an = obj.∝ | |
| @jz _an ?rfalse; ! if(_an == 0) rfalse; | |
| _count = obj.#prop / 2; | |
| _count--; | |
| .next_word; | |
| _w = NextWord(); | |
| _i = 0; | |
| .next_entry; | |
| _v = _an-->_i; | |
| if(_v ~= _w) { | |
| @inc_chk _i _count ?~next_entry; | |
| return _matched; ! Reached end of list, with no match | |
| } | |
| @inc_chk _matched 255 ?~next_word; ! Faster way to do: _matched++; jump next_word; | |
| ]; | |
| #Endif; | |
| Class MultiNameObject | |
| ! NOTE: Member objects must supply a multi_name property (array of dictionary words) | |
| with | |
| #Ifv3; | |
| parse_name [ ; | |
| return MatchNameList(self, multi_name); | |
| ] | |
| #Endif; | |
| ; | |
| ! ------------------------------------------------------------------------------ | |
| ! Rules for treasures, which will be scattered all over the game | |
| ! ------------------------------------------------------------------------------ | |
| Class Treasure | |
| with after [; | |
| Take, Remove: | |
| if(self has treasure_deposited) { | |
| treasures_deposited--; | |
| give self ~treasure_deposited; | |
| } | |
| if (self has depositpoints_awarded) { | |
| give self ~depositpoints_awarded; | |
| score = score - self.depositpoints; | |
| } | |
| score = score + 5; | |
| if (noun hasnt treasure_found) { | |
| give noun treasure_found; | |
| score = score + 2; | |
| } | |
| !#Ifdef DEBUG; | |
| ! print "TREASURES DEPOSITED: ", treasures_deposited, "^"; | |
| !#Endif; | |
| "Taken!"; | |
| Insert: | |
| score = score - 5; ! (in case put inside the wicker cage) | |
| Drop: | |
| score = score - 5; | |
| if (location == Inside_Building) { | |
| treasures_deposited++; | |
| give self treasure_deposited; | |
| if(self hasnt depositpoints_awarded) { | |
| score = score + self.depositpoints; | |
| give self depositpoints_awarded; | |
| if (treasures_deposited >= MAX_TREASURES) | |
| StartDaemon(cave_closer); | |
| } | |
| !#Ifdef DEBUG; | |
| ! print "TREASURES DEPOSITED: ", treasures_deposited, "^"; | |
| !#Endif; | |
| "Safely deposited."; | |
| } | |
| !#Ifdef DEBUG; | |
| ! print "TREASURES DEPOSITED: ", treasures_deposited, "^"; | |
| !#Endif; | |
| ], | |
| depositpoints 10; | |
| ! ------------------------------------------------------------------------------ | |
| ! The outside world | |
| ! ------------------------------------------------------------------------------ | |
| Object At_End_Of_Road "At End Of Road" | |
| with teleport_name 'end' 'of' 'road' 'street' 'path' 'gully', | |
| name 'end' 'gully', | |
| description | |
| "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.", | |
| w_to At_Hill_In_Road, | |
| u_to At_Hill_In_Road, | |
| e_to Inside_Building, | |
| d_to In_A_Valley, | |
| s_to In_A_Valley, | |
| n_to In_Forest_1, | |
| in_to Inside_Building, | |
| has proper light notfarin aboveground; | |
| Object WellHouse "well house" | |
| class MultiNameObject, | |
| with multi_name 'well' 'house' 'brick' 'building' 'small' 'wellhouse', | |
| description "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, | |
| before [; | |
| Enter: | |
| if (location == At_Hill_In_Road && Inside_Building hasnt visited) | |
| "It's too far away."; | |
| <<Teleport Inside_Building>>; | |
| ], | |
| has scenery; | |
| Object Stream "stream" | |
| class MultiNameObject, | |
| with multi_name 'stream' 'water' 'brook' 'river' 'lake' 'small' 'tumbling' | |
| 'splashing' 'babbling' 'rushing' 'reservoir', | |
| found_in [; | |
| if(location == At_End_Of_Road or In_A_Valley or At_Slit_In_Streambed | |
| or In_Pit or In_Cavern_With_Waterfall or At_Reservoir or Inside_Building) | |
| rtrue; | |
| ], | |
| before [; | |
| Drink: | |
| "You have taken a drink from the stream. | |
| The water tastes strongly of minerals, but is not unpleasant. | |
| It is extremely cold."; | |
| Take: | |
| if (bottle notin player) | |
| print_ret (string) NOTHING_TO_CARRY_WATER; | |
| <<Fill bottle>>; | |
| Insert: | |
| if (second == bottle) <<Fill bottle>>; | |
| print_ret (string) NOTHING_TO_CARRY_WATER; | |
| Receive: | |
| if (noun == ming_vase) { | |
| remove ming_vase; | |
| move shards to location; | |
| scope_modified = true; | |
| score = score - 5; | |
| "The sudden change in temperature has delicately shattered the vase."; | |
| } | |
| if (noun == bottle) <<Fill bottle>>; | |
| remove noun; | |
| scope_modified = true; | |
| if (noun ofclass Treasure) score = score - 5; | |
| print_ret (The) noun, " washes away with the stream."; | |
| ], | |
| has scenery; | |
| Object Road "road" | |
| with name 'road' 'street' 'path' 'dirt', | |
| description "The road is dirt, not yellow brick.", | |
| found_in At_End_Of_Road At_Hill_In_Road In_Forest_2, | |
| has scenery; | |
| Object Forest "forest" | |
| class MultiNameObject, | |
| with multi_name 'forest' 'tree' 'trees' 'oak' 'maple' 'grove' 'pine' 'spruce' | |
| 'birch' 'ash' 'saplings' 'bushes' 'leaves' 'berry' 'berries' | |
| 'hardwood', | |
| description | |
| "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 [; | |
| if(location has aboveground && | |
| location == At_End_Of_Road or At_Hill_In_Road or In_A_Valley or | |
| In_Forest_1 or In_Forest_2) | |
| rtrue; | |
| ], | |
| has scenery multitude; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Hill_In_Road "At Hill In Road" | |
| with teleport_name 'hill' 'in' 'road', | |
| description | |
| "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.", | |
| e_to At_End_Of_Road, | |
| n_to At_End_Of_Road, | |
| d_to At_End_Of_Road, | |
| s_to In_Forest_1, | |
| cheap_scenery | |
| 3 'hill' 'bump' 'incline' "It's just a typical hill." | |
| 4 'side' 'other' 'of' 'hill' "Why not explore it yourself?", | |
| has proper light notfarin aboveground; | |
| ! ------------------------------------------------------------------------------ | |
| Constant CS_SPRING 100; | |
| Constant CS_SEWER_PIPES 101; | |
| Object Inside_Building "Inside Building" | |
| with teleport_name 'inside' 'building' 'well' 'house' 'wellhouse', | |
| description | |
| "You are inside a building, a well house for a large spring.", | |
| cant_go [; | |
| print_ret (string) STREAM_FLOWS_OUT, " The only exit is to the west."; | |
| ], | |
| before [; | |
| Enter: | |
| if (noun == CheapScenery && cs_match_id == CS_SPRING or CS_SEWER_PIPES) | |
| print_ret (string) STREAM_FLOWS_OUT, " It would be advisable to use the exit."; | |
| Xyzzy: | |
| if (In_Debris_Room hasnt visited) rfalse; | |
| PlayerTo(In_Debris_Room); | |
| rtrue; | |
| Plugh: | |
| if (At_Y2 hasnt visited) rfalse; | |
| PlayerTo(At_Y2); | |
| rtrue; | |
| ], | |
| w_to At_End_Of_Road, | |
| out_to At_End_Of_Road, | |
| in_to "The pipes are too small.", | |
| cheap_scenery | |
| CS_SPRING 'large' 'spring' STREAM_FLOWS_OUT | |
| CS_SEWER_PIPES CS_THEM 8 'pipes' 'pipe' 'one' '1//' 'foot' 'diameter' 'sewer' 'sewer-pipes' | |
| "Too small. The only exit is to the west.", | |
| has proper light notfarin aboveground; | |
| Object -> set_of_keys "set of keys" | |
| class MultiNameObject, | |
| with multi_name 'keys' 'key' 'keyring' 'set' 'of' 'bunch', | |
| description "It's just a normal-looking set of keys.", | |
| initial "There are some keys on the ground here.", | |
| before [; | |
| Count: | |
| "A dozen or so keys."; | |
| ] | |
| has tiny; | |
| Object -> tasty_food "tasty food" | |
| class MultiNameObject, | |
| with | |
| #Ifv3; | |
| multi_name 'food' 'ration' 'tripe' 'yummy' 'tasty' 'delicious' 'scrumptious', | |
| #Ifnot; | |
| multi_name 'food' 'ration' 'rations' 'tripe' 'yummy' 'tasty' 'delicious' 'scrumptious', | |
| #Endif; | |
| article "some", | |
| description "Sure looks yummy!", | |
| initial "There is tasty food here.", | |
| after [; | |
| Eat: | |
| "Delicious!"; | |
| ], | |
| has edible tiny; | |
| Object -> brass_lantern "brass lantern" | |
| class MultiNameObject, | |
| with multi_name 'lamp' 'headlamp' 'headlight' 'lantern' 'light' 'shiny' 'brass', | |
| description [; | |
| print "It is a shiny brass lamp"; | |
| if (self hasnt on) ". It is not currently lit."; | |
| print ", glowing "; | |
| if (self.power_remaining < 30) "dimly."; | |
| "brightly."; | |
| ], | |
| describe [; | |
| if(self has on) { | |
| print "^Your lamp is here, gleaming "; | |
| if(self.power_remaining < 30) "dimly."; | |
| "brightly."; | |
| } | |
| "^There is a shiny brass lamp nearby."; | |
| ], | |
| daemon [ t; | |
| if (self hasnt on) { | |
| StopDaemon(self); | |
| rtrue; | |
| } | |
| t = --(self.power_remaining); | |
| if (t == 0) { | |
| give self ~on ~light; | |
| scope_modified = true; | |
| } | |
| if (t == 0 or 30 && TestScope(self)) { ! Check for t value for performance reasons | |
| if (t == 0) { | |
| print "Your lamp has run out of power."; | |
| if (fresh_batteries notin location && | |
| IndirectlyContains(player, fresh_batteries)==false && | |
| location hasnt light) { | |
| deadflag = GS_DEATHMESSAGE; | |
| " You can't explore the cave without a lamp. | |
| So let's just call it a day."; | |
| } | |
| else | |
| self.replace_batteries(); | |
| new_line; | |
| rtrue; | |
| } | |
| if (t == 30) { | |
| print "Your lamp is getting dim."; | |
| if (fresh_batteries.have_been_used) | |
| " You're also out of spare batteries. | |
| You'd best start wrapping this up."; | |
| if (fresh_batteries in VendingMachine && Dead_End_14 has visited) | |
| " 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."; | |
| if (fresh_batteries notin VendingMachine && TestScope(fresh_batteries)==false) | |
| " You'd best go back for those batteries."; | |
| new_line; | |
| rtrue; | |
| } | |
| } | |
| ], | |
| before [; | |
| Burn: | |
| <<SwitchOn self>>; | |
| Rub: | |
| "Rubbing the electric lamp is not particularly rewarding. | |
| Anyway, nothing exciting happens."; | |
| SwitchOn: | |
| if (self.power_remaining <= 0) | |
| "Unfortunately, the batteries seem to be dead."; | |
| Receive: | |
| if (noun == old_batteries) | |
| "Those batteries are dead; they won't do any good at all."; | |
| if (noun == fresh_batteries) { | |
| self.replace_batteries(); | |
| rtrue; | |
| } | |
| "The only thing you might successfully put in the lamp | |
| is a fresh pair of batteries."; | |
| ], | |
| after [; | |
| SwitchOn: | |
| give self light; | |
| scope_modified = true; | |
| StartDaemon(self); | |
| SwitchOff: | |
| give self ~light; | |
| scope_modified = true; | |
| ], | |
| replace_batteries [; | |
| if (fresh_batteries in location || IndirectlyContains(player, fresh_batteries)) { | |
| remove fresh_batteries; | |
| fresh_batteries.have_been_used = true; | |
| move old_batteries to location; | |
| self.power_remaining = 2500; | |
| scope_modified = true; | |
| "I'm taking the liberty of replacing the batteries."; | |
| } | |
| ], | |
| power_remaining 330, | |
| has switchable; | |
| Object -> bottle "small bottle" | |
| with parse_name [i w; | |
| while(true) { | |
| w = NextWord(); | |
| if(w == 'small' or 'bottle' or 'jar' or 'flask') i++; | |
| else if(w=='empty' && child(self) == 0) i++; | |
| else return i; | |
| } | |
| ], | |
| initial "There is an empty bottle here.", | |
| before [; | |
| LetGo: | |
| if (noun in bottle) | |
| "You're holding that already (in the bottle)."; | |
| Receive: | |
| if (noun == stream or Oil) | |
| <<Fill self>>; | |
| else | |
| "The bottle is only supposed to hold liquids."; | |
| Fill: | |
| if (child(bottle) ~= nothing) | |
| "The bottle is full already."; | |
| if (stream in location || location == Inside_Building) { | |
| move water_in_the_bottle to bottle; | |
| scope_modified = true; | |
| "The bottle is now full of water."; | |
| } | |
| if (Oil in location) { | |
| move oil_in_the_bottle to bottle; | |
| scope_modified = true; | |
| "The bottle is now full of oil."; | |
| } | |
| "There is nothing here with which to fill the bottle."; | |
| Empty: | |
| if (child(bottle) == nothing) | |
| "The bottle is already empty!"; | |
| remove child(bottle); | |
| scope_modified = true; | |
| "Your bottle is now empty and the ground is now wet."; | |
| ], | |
| has container open tiny; | |
| Object water_in_the_bottle "bottled water" | |
| with name 'bottled' 'water' 'h2o', | |
| article "some", | |
| description "It looks like ordinary water to me.", | |
| before [; | |
| Drink: | |
| remove water_in_the_bottle; | |
| scope_modified = true; | |
| <<Drink Stream>>; | |
| ]; | |
| Object oil_in_the_bottle "bottled oil" | |
| with name 'oil' 'bottled' 'lubricant' 'grease', | |
| article "some", | |
| description "It looks like ordinary oil to me.", | |
| before [; | |
| Drink: | |
| <<Drink Oil>>; | |
| ]; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Forest_1 "In Forest" | |
| with teleport_name 'forest', | |
| description "You are in open forest, with a deep valley to one side.", | |
| e_to In_A_Valley, | |
| d_to In_A_Valley, | |
| n_to In_Forest_1, | |
| w_to In_Forest_1, | |
| s_to In_Forest_1, | |
| initial [; | |
| if (random(2) == 1) PlayerTo(In_Forest_2, 1); | |
| ], | |
| has proper light notfarin aboveground; | |
| Object In_Forest_2 "In Forest" | |
| with description "You are in open forest near both a valley and a road.", | |
| n_to At_End_Of_Road, | |
| e_to In_A_Valley, | |
| w_to In_A_Valley, | |
| d_to In_A_Valley, | |
| s_to In_Forest_1, | |
| has proper light notfarin aboveground; | |
| Object In_A_Valley "In A Valley" | |
| with teleport_name 'valley', | |
| name 'valley', | |
| description | |
| "You are in a valley in the forest beside a stream tumbling along a rocky bed.", | |
| n_to At_End_Of_Road, | |
| e_to In_Forest_1, | |
| w_to In_Forest_1, | |
| u_to In_Forest_1, | |
| s_to At_Slit_In_Streambed, | |
| d_to At_Slit_In_Streambed, | |
| cheap_scenery | |
| 7 'bed' 'streambed' 'rock' 'small' 'rocky' 'bare' 'dry' | |
| "There is nothing special about the streambed.", | |
| has proper light notfarin aboveground; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Slit_In_Streambed "At Slit In Streambed" | |
| with teleport_name 'slit' 'in' 'streambed', | |
| name 'streambed', | |
| description | |
| "At your feet all the water of the stream splashes into a 2-inch slit in the rock. | |
| Downstream the streambed is bare rock.", | |
| n_to In_A_Valley, | |
| e_to In_Forest_1, | |
| w_to In_Forest_1, | |
| s_to Outside_Grate, | |
| d_to YOU_DONT_FIT, | |
| in_to YOU_DONT_FIT, | |
| cheap_scenery | |
| 5 'slit' 'two' '2//' 'inch' '2-inch' | |
| [; | |
| Examine: "It's just a 2-inch slit in the rock, through which the stream is flowing."; | |
| Enter: print_ret (string) YOU_DONT_FIT; | |
| ], | |
| has proper light notfarin aboveground; | |
| ! ------------------------------------------------------------------------------ | |
| Object Outside_Grate "Outside Grate" | |
| with teleport_name 'outside' 'grate', | |
| description | |
| "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.", | |
| e_to In_Forest_1, | |
| w_to In_Forest_1, | |
| s_to In_Forest_1, | |
| n_to At_Slit_In_Streambed, | |
| d_to [; | |
| if (Grate hasnt locked && Grate hasnt open) { | |
| print "(first opening the grate)^"; | |
| give Grate open; | |
| } | |
| return Grate; | |
| ], | |
| cheap_scenery | |
| 7 'depression' 'dirt' 'twenty' '20' 'foot' 'bare' '20-foot' | |
| "You're standing in it.", | |
| has proper light notfarin aboveground; | |
| Object -> Grate "steel grate" | |
| class MultiNameObject, | |
| with multi_name 'grate' 'lock' 'gate' 'grille' 'metal' 'strong' 'steel' 'grating', | |
| description "It just looks like an ordinary grate mounted in concrete.", | |
| with_key set_of_keys, | |
| door_dir [; | |
| if (location == Below_The_Grate) return u_to; | |
| return d_to; | |
| ], | |
| door_to [; | |
| if (location == Below_The_Grate) return Outside_Grate; | |
| return Below_The_Grate; | |
| ], | |
| describe [; | |
| if (self has open) "^The grate stands open."; | |
| if (self hasnt locked) "^The grate is unlocked but shut."; | |
| rtrue; | |
| ], | |
| found_in Below_The_Grate Outside_Grate, | |
| has static door openable lockable locked; | |
| ! ------------------------------------------------------------------------------ | |
| ! Facilis descensus Averno... | |
| ! ------------------------------------------------------------------------------ | |
| Object Below_The_Grate "Below the Grate" | |
| with teleport_name 'below' 'grate', | |
| description | |
| "You are in a small chamber beneath a 3x3 steel grate to the surface. | |
| A low crawl over cobbles leads inward to the west.", | |
| w_to In_Cobble_Crawl, | |
| u_to Grate, | |
| before [; | |
| Go: | |
| if(caves_closed && selected_direction == u_to) { | |
| cave_closer.final_closing_time = -35; | |
| "A mysterious recorded voice groans into life | |
| and announces, ~This exit is closed. Please | |
| leave via main office.~"; | |
| } | |
| ], | |
| has light proper notfarin; | |
| Object Cobbles "cobbles" | |
| with | |
| #Ifv3; | |
| name 'cobble' 'stones' 'stone', | |
| #Ifnot; | |
| name 'cobble' 'cobbles' 'cobblestone' 'stones' 'stone', | |
| #Endif; | |
| description "They're just ordinary cobbles.", | |
| found_in In_Cobble_Crawl In_Debris_Room Below_The_Grate, | |
| has scenery multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Cobble_Crawl "In Cobble Crawl" | |
| with teleport_name 'cobble' 'crawl', | |
| name 'cobble' 'crawl', | |
| description | |
| "You are crawling over cobbles in a low passage. | |
| There is a dim light at the east end of the passage.", | |
| e_to Below_The_Grate, | |
| w_to In_Debris_Room, | |
| has light proper notfarin; | |
| Object -> wicker_cage "wicker cage" | |
| with name 'cage' 'small' 'wicker', | |
| description "It's a small wicker cage.", | |
| initial "There is a small wicker cage discarded nearby.", | |
| before [; | |
| Receive: | |
| if(noun hasnt tiny || children(self) > 2) | |
| "The cage is too small."; | |
| ], | |
| after [; | |
| Open: | |
| if (little_bird notin self) rfalse; | |
| print "(releasing the little bird)^"; | |
| <<Release little_bird>>; | |
| ], | |
| has container open openable transparent; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Debris_Room "In Debris Room" | |
| with teleport_name 'debris' 'room', | |
| name 'room', | |
| description | |
| "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.~", | |
| e_to In_Cobble_Crawl, | |
| u_to In_Awkward_Sloping_E_W_Canyon, | |
| w_to In_Awkward_Sloping_E_W_Canyon, | |
| before [; | |
| Xyzzy: | |
| if(caves_closed) { | |
| MagicWordWhenClosed(); | |
| rtrue; | |
| } | |
| PlayerTo(Inside_Building); | |
| rtrue; | |
| ], | |
| cheap_scenery | |
| 3 'debris' 'stuff' 'mud' "Yuck." | |
| 1 'note' "The note says ~Magic word XYZZY~.", | |
| has proper notfarin; | |
| Object -> black_rod "black rod with a rusty star on the end" | |
| class MultiNameObject, | |
| with multi_name 'rod' 'star' 'black' 'rusty' 'three' 'foot' 'iron', | |
| description "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.", | |
| before [; | |
| Wave: | |
| if (location == West_Side_Of_Fissure or On_East_Bank_Of_Fissure) { | |
| if (caves_closed) "Peculiar. ", (string) NOTHING_HAPPENS; | |
| if (CrystalBridge notin nothing) { | |
| remove CrystalBridge; | |
| give CrystalBridge absent; | |
| scope_modified = true; | |
| West_Side_Of_Fissure.e_to = nothing; | |
| On_East_Bank_Of_Fissure.w_to = nothing; | |
| "The crystal bridge has vanished!"; | |
| } | |
| else { | |
| move CrystalBridge to location; | |
| give CrystalBridge ~absent; | |
| scope_modified = true; | |
| West_Side_Of_Fissure.e_to = CrystalBridge; | |
| On_East_Bank_Of_Fissure.w_to = CrystalBridge; | |
| print_ret (string) CRYSTAL_BRIDGE; | |
| } | |
| } | |
| print_ret (string) NOTHING_HAPPENS; | |
| ]; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Awkward_Sloping_E_W_Canyon "Sloping E/W Canyon" | |
| with teleport_name 'sloping' 'e/w' 'canyon', | |
| name 'sloping' 'e/w' 'canyon', | |
| description "You are in an awkward sloping east/west canyon.", | |
| d_to In_Debris_Room, | |
| e_to In_Debris_Room, | |
| u_to In_Bird_Chamber, | |
| w_to In_Bird_Chamber, | |
| has proper notfarin; | |
| ! ------------------------------------------------------------------------------ | |
| ! The little bird in its natural habitat | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Bird_Chamber "Orange River Chamber" | |
| with teleport_name 'orange' 'river' 'chamber', | |
| name 'orange' 'river' 'chamber', | |
| description | |
| "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.", | |
| e_to In_Awkward_Sloping_E_W_Canyon, | |
| w_to At_Top_Of_Small_Pit, | |
| has proper notfarin; | |
| Object -> little_bird "little bird" | |
| with name 'cheerful' 'mournful' 'little' 'bird', | |
| initial "A cheerful little bird is sitting here singing.", | |
| before [; | |
| Examine: | |
| if (self in wicker_cage) | |
| "The little bird looks unhappy in the cage."; | |
| "The cheerful little bird is sitting here singing."; | |
| Insert: | |
| if (second == wicker_cage) | |
| <<Catch self>>; | |
| else | |
| "Don't put the poor bird in ", (the) second, "!"; | |
| Drop, Remove: | |
| if (self in wicker_cage) { | |
| print "(The bird is released from the cage.)^^"; | |
| <<Release self>>; | |
| } | |
| Take, Catch: | |
| if (self in wicker_cage) | |
| "You already have the little bird. | |
| If you take it out of the cage it will likely fly away from you."; | |
| if (wicker_cage notin player) | |
| "You can catch the bird, but you cannot carry it."; | |
| if (black_rod in player) | |
| "The bird was unafraid when you entered, | |
| but as you approach it becomes disturbed and you cannot catch it."; | |
| if(children(wicker_cage)>2) | |
| "There is no room in the cage."; | |
| move self to wicker_cage; | |
| give wicker_cage ~open; | |
| give self moved; | |
| scope_modified = true; | |
| "You catch the bird in the wicker cage."; | |
| Release: | |
| if (self notin wicker_cage) | |
| "The bird is not caged now."; | |
| give wicker_cage open; | |
| move self to location; | |
| scope_modified = true; | |
| if (Snake in location) { | |
| remove Snake; | |
| "The little bird attacks the green snake, | |
| and in an astounding flurry drives the snake away."; | |
| } | |
| if (Dragon in location) { | |
| remove self; | |
| "The little bird attacks the green dragon, | |
| and in an astounding flurry gets burnt to a cinder. | |
| The ashes blow away."; | |
| } | |
| "The little bird flies free."; | |
| ], | |
| life [; | |
| Give: | |
| "It's not hungry. (It's merely pinin' for the fjords). | |
| Besides, I suspect it would prefer bird seed."; | |
| Order, Ask, Answer: | |
| "Cheep! Chirp!"; | |
| Attack: | |
| if (self in wicker_cage) | |
| "Oh, leave the poor unhappy bird alone."; | |
| remove self; | |
| scope_modified = true; | |
| "The little bird is now dead. Its body disappears."; | |
| ], | |
| has animate tiny; | |
| ! ------------------------------------------------------------------------------ | |
| Constant CS_PIT_CRACK 100; | |
| Object At_Top_Of_Small_Pit "At Top of Small Pit" | |
| with teleport_name 'top' 'of' 'small' 'pit', | |
| description | |
| "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.", | |
| e_to In_Bird_Chamber, | |
| w_to CRACK_TOO_SMALL, | |
| d_to [; | |
| if (large_gold_nugget in player) { | |
| deadflag = GS_DEAD; | |
| "You are at the bottom of the pit with a broken neck."; | |
| } | |
| return In_Hall_Of_Mists; | |
| ], | |
| before [; | |
| Enter: | |
| if (noun == CheapScenery && cs_match_id == CS_PIT_CRACK) | |
| print_ret (string) CRACK_TOO_SMALL; | |
| ], | |
| cheap_scenery | |
| 'pit' 'small' "The pit is breathing traces of white mist." | |
| CS_PIT_CRACK 'crack' 'small' "The crack is very small -- far too small for you to follow.", | |
| has proper notfarin; | |
| Object "mist" | |
| with name 'mist' 'vapor' 'wisps' 'white', | |
| description | |
| "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 [; | |
| if(location hasnt aboveground && | |
| location == At_Top_Of_Small_Pit or In_Hall_Of_Mists or On_East_Bank_Of_Fissure or | |
| At_Window_On_Pit_1 or At_West_End_Of_Hall_Of_Mists or In_Misty_Cavern or | |
| In_Mirror_Canyon or At_Reservoir or At_Window_On_Pit_2 or On_Sw_Side_Of_Chasm) | |
| rtrue; | |
| ], | |
| has scenery; | |
| ! ------------------------------------------------------------------------------ | |
| ! The caves open up: The Hall of Mists | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Hall_Of_Mists "In Hall of Mists" | |
| with teleport_name 'hall' 'of' 'mists', | |
| name 'hall' 'of' 'mists', | |
| description | |
| "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.", | |
| initial [; | |
| if (self has visited) rfalse; | |
| score = score + 25; | |
| ], | |
| s_to In_Nugget_Of_Gold_Room, | |
| w_to On_East_Bank_Of_Fissure, | |
| d_to In_Hall_Of_Mt_King, | |
| n_to In_Hall_Of_Mt_King, | |
| u_to [; | |
| if (large_gold_nugget in player) print_ret (string) UNCLIMBABLE; | |
| return At_Top_Of_Small_Pit; | |
| ], | |
| cheap_scenery | |
| 5 'stair' 'stairs' 'staircase' 'wide' 'stone' | |
| "The staircase leads down." | |
| 1 'dome' | |
| [; | |
| Examine: | |
| if (large_gold_nugget in player) | |
| "I'm not sure you'll be able to get up it with what you're | |
| carrying."; | |
| print_ret (string) MIGHT_CLIMB, "up it."; | |
| Climb: | |
| <<Go FAKE_U_OBJ>>; | |
| ], | |
| has proper dwarfroom; | |
| Object -> "rough stone steps" | |
| with name 'rough' 'stone' 'steps', | |
| description "The rough stone steps lead up the dome.", | |
| has scenery multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Nugget_Of_Gold_Room "Low Room" | |
| with teleport_name 'low' 'room', | |
| name 'low' 'room', | |
| description | |
| "This is a low room with a crude note on the wall: | |
| ^^ | |
| ~You won't get it up the steps~.", | |
| n_to In_Hall_Of_Mists, | |
| cheap_scenery | |
| 'note' 'crude' "The note says, ~You won't get it up the steps~.", | |
| has proper dwarfroom; | |
| Treasure -> large_gold_nugget "large gold nugget" | |
| with name 'gold' 'nugget' 'large' 'heavy', | |
| description "It's a large sparkling nugget of gold!", | |
| initial "There is a large sparkling nugget of gold here!"; | |
| ! ------------------------------------------------------------------------------ | |
| Class FissureRoom | |
| with before [; | |
| Jump: | |
| if (CrystalBridge hasnt absent) | |
| print_ret (string) GO_ACROSS_BRIDGE; | |
| deadflag = GS_DEAD; | |
| "You didn't make it."; | |
| ], | |
| d_to "The fissure is too terrifying!", | |
| has proper dwarfroom; | |
| FissureRoom On_East_Bank_Of_Fissure "On East Bank of Fissure" | |
| with teleport_name 'east' 'e//' 'bank' 'side' 'of' 'fissure', | |
| name 'east' 'bank', | |
| description | |
| "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.", | |
| e_to In_Hall_Of_Mists, | |
| w_to FISSURE_TOO_WIDE, | |
| dynamic_npc_exit [; | |
| if(CrystalBridge has absent) | |
| rfalse; | |
| return West_Side_Of_Fissure; | |
| ], | |
| cheap_scenery | |
| 'wide' 'fissure' FISSURE_TOO_WIDE_TO_JUMP; | |
| FissureRoom West_Side_Of_Fissure "West Side of Fissure" | |
| with teleport_name 'west' 'w//' 'bank' 'side' 'of' 'fissure', | |
| name 'west' 'side', | |
| description | |
| "You are on the west side of the fissure in the hall of mists.", | |
| w_to At_West_End_Of_Hall_Of_Mists, | |
| e_to FISSURE_TOO_WIDE, | |
| n_to At_West_End_Of_Hall_Of_Mists, | |
| before [; | |
| Go: | |
| if (selected_direction == n_to) | |
| print (string) CRAWLED_PASSAGE; | |
| ], | |
| dynamic_npc_exit [; | |
| if(CrystalBridge has absent) | |
| rfalse; | |
| return On_East_Bank_Of_Fissure; | |
| ], | |
| cheap_scenery | |
| 'wide' 'fissure' FISSURE_TOO_WIDE_TO_JUMP; | |
| Treasure -> "diamonds" | |
| with | |
| #Ifv3; | |
| name 'diamond' 'several' 'high' 'quality', | |
| #Ifnot; | |
| name 'diamond' 'diamonds' 'several' 'high' 'quality', | |
| #Endif; | |
| description "They look to be of the highest quality!", | |
| initial "There are diamonds here!", | |
| has multitude pluralname tiny; | |
| Object CrystalBridge "crystal bridge" | |
| with name 'crystal' 'bridge', | |
| description "It spans the fissure, thereby providing you a way across.", | |
| initial CRYSTAL_BRIDGE, | |
| door_dir [; | |
| if (location == West_Side_Of_Fissure) return e_to; | |
| return w_to; | |
| ], | |
| door_to [; | |
| if (location == West_Side_Of_Fissure) return On_East_Bank_Of_Fissure; | |
| return West_Side_Of_Fissure; | |
| ], | |
| found_in On_East_Bank_Of_Fissure West_Side_Of_Fissure, | |
| has static door open absent; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_West_End_Of_Hall_Of_Mists "At West End of Hall of Mists" | |
| with teleport_name 'west' 'w//' 'end' 'of' 'hall' 'mists', | |
| name 'west' 'end' 'hall' 'mists', | |
| description | |
| "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.", | |
| s_to Alike_Maze_1, | |
| u_to Alike_Maze_1, | |
| e_to West_Side_Of_Fissure, | |
| w_to At_East_End_Of_Long_Hall, | |
| n_to West_Side_Of_Fissure, | |
| before [; | |
| Go: | |
| if (selected_direction == n_to) | |
| print (string) CRAWLED_PASSAGE; | |
| ], | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| ! Long Hall to the west of the Hall of Mists | |
| ! ------------------------------------------------------------------------------ | |
| Object At_East_End_Of_Long_Hall "At East End of Long Hall" | |
| with teleport_name 'east' 'e//' 'end' 'of' 'long' 'hall', | |
| name 'east' 'end' 'hall' 'mists', | |
| description | |
| "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.", | |
| e_to At_West_End_Of_Hall_Of_Mists, | |
| u_to At_West_End_Of_Hall_Of_Mists, | |
| w_to At_West_End_Of_Long_Hall, | |
| n_to Crossover, | |
| d_to Crossover, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_West_End_Of_Long_Hall "At West End of Long Hall" | |
| with teleport_name 'west' 'w//' 'end' 'of' 'long' 'hall', | |
| name 'west' 'end' 'long' 'hall', | |
| description | |
| "You are at the west end of a very long featureless hall. | |
| The hall joins up with a narrow north/south passage.", | |
| e_to At_East_End_Of_Long_Hall, | |
| s_to Different_Maze_1, | |
| n_to Crossover, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object Crossover "N/S and E/W Crossover" | |
| with teleport_name 'n/s' 'and' 'e/w' 'crossover', | |
| name 'n/s' 'e/w', | |
| description | |
| "You are at a crossover of a high N/S passage and a low E/W one.", | |
| w_to At_East_End_Of_Long_Hall, | |
| n_to Dead_End_7, | |
| e_to In_West_Side_Chamber, | |
| s_to At_West_End_Of_Long_Hall, | |
| cheap_scenery | |
| 3 'crossover' 'over' 'cross' "You know as much as I do at this point.", | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| ! Many Dead Ends will be needed for the maze below, so define a class: | |
| ! ------------------------------------------------------------------------------ | |
| Class DeadendRoom | |
| with short_name "Dead End", | |
| description "You have reached a dead end.", | |
| cant_go "You'll have to go back the way you came.", | |
| has proper dwarfroom; | |
| DeadendRoom Dead_End_7 "e7" | |
| with s_to Crossover, | |
| out_to Crossover; | |
| ! ------------------------------------------------------------------------------ | |
| ! The Hall of the Mountain King and side chambers | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Hall_Of_Mt_King "Hall of the Mountain King" | |
| with teleport_name 'hall' 'of' 'mountain' 'king', | |
| name 'hall' 'mountain' 'king', | |
| description | |
| "You are in the hall of the mountain king, with passages off in all directions.", | |
| cant_go "Well, perhaps not quite all directions.", | |
| u_to In_Hall_Of_Mists, | |
| e_to In_Hall_Of_Mists, | |
| n_to Low_N_S_Passage, | |
| s_to In_South_Side_Chamber, | |
| w_to In_West_Side_Chamber, | |
| sw_to In_Secret_E_W_Canyon, | |
| before [; | |
| Go: | |
| if (Snake in self && (selected_direction == n_to or s_to or w_to || | |
| (selected_direction == sw_to && random(100) <= 35))) | |
| "You can't get by the snake."; | |
| ], | |
| has proper dwarfroom; | |
| Object -> Snake "snake" | |
| class MultiNameObject, | |
| with multi_name 'snake' 'cobra' 'asp' 'huge' 'fierce' 'green' 'ferocious' | |
| 'venemous' 'venomous' 'large' 'big' 'killer', | |
| description WOULDNT_MESS, | |
| initial "A huge green fierce snake bars the way!", | |
| life [; | |
| Order, Ask, Answer: | |
| "Hiss!"; | |
| ThrowAt: | |
| if (noun == axe) <<Attack self>>; | |
| <<Give noun self>>; | |
| Give: | |
| if (noun == little_bird) { | |
| remove little_bird; | |
| scope_modified = true; | |
| "The snake has now devoured your bird."; | |
| } | |
| "There's nothing here it wants to eat (except perhaps you)."; | |
| Attack: | |
| "Attacking the snake both doesn't work and is very dangerous."; | |
| Take: | |
| deadflag = GS_DEAD; | |
| "It takes you instead. Glrp!"; | |
| ], | |
| has animate; | |
| ! ------------------------------------------------------------------------------ | |
| Object Low_N_S_Passage "Low N/S Passage" | |
| with teleport_name 'low' 'n/s' 'passage', | |
| name 'low' 'n/s' 'passage', | |
| description | |
| "You are in a low N/S passage at a hole in the floor. | |
| The hole goes down to an E/W passage.", | |
| s_to In_Hall_Of_Mt_King, | |
| d_to In_Dirty_Passage, | |
| n_to At_Y2, | |
| has proper dwarfroom; | |
| Treasure -> "bars of silver" | |
| with name 'silver' 'bars', | |
| description "They're probably worth a fortune!", | |
| initial "There are bars of silver here!" | |
| has pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_South_Side_Chamber "In South Side Chamber" | |
| with teleport_name 'south' 's//' 'side' 'chamber', | |
| name 'south' 's//' 'chamber', | |
| description "You are in the south side chamber.", | |
| n_to In_Hall_Of_Mt_King, | |
| has proper dwarfroom; | |
| Treasure -> "precious jewelry" | |
| class MultiNameObject, | |
| with multi_name 'jewel' 'jewels' 'jewelry' 'precious' 'exquisite', | |
| article "some", | |
| description "It's all quite exquisite!", | |
| initial "There is precious jewelry here!" | |
| has tiny; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_West_Side_Chamber "In West Side Chamber" | |
| with teleport_name 'west' 'w//' 'side' 'chamber', | |
| name 'west' 'w//' 'chamber', | |
| description | |
| "You are in the west side chamber of the hall of the mountain king. | |
| A passage continues west and up here.", | |
| w_to Crossover, | |
| u_to Crossover, | |
| e_to In_Hall_Of_Mt_King, | |
| has proper dwarfroom; | |
| Treasure -> rare_coins "rare coins" | |
| with name 'coins' 'rare', | |
| article "many", | |
| description "They're a numismatist's dream!", | |
| initial "There are many coins here!", | |
| has multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| ! The Y2 Rock Room and environs, slightly below | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Y2 "At ~Y2~" | |
| with teleport_name 'y2', | |
| description | |
| "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.", | |
| after [; | |
| Look: | |
| if (random(100) <= 25) print "^A hollow voice says, ~Plugh.~^"; | |
| ], | |
| before [; | |
| Plugh: | |
| if(caves_closed) { | |
| MagicWordWhenClosed(); | |
| rtrue; | |
| } | |
| PlayerTo(Inside_Building); | |
| rtrue; | |
| Plover: | |
| if (In_Plover_Room hasnt visited) rfalse; | |
| if(caves_closed) { | |
| MagicWordWhenClosed(); | |
| rtrue; | |
| } | |
| if (egg_sized_emerald in player) { | |
| move egg_sized_emerald to At_Y2; | |
| scope_modified = true; | |
| score = score - 5; | |
| } | |
| PlayerTo(In_Plover_Room); | |
| rtrue; | |
| ], | |
| s_to Low_N_S_Passage, | |
| e_to Jumble_Of_Rock, | |
| w_to At_Window_On_Pit_1, | |
| has proper dwarfroom; | |
| Object -> "~Y2~ rock" | |
| with name 'rock' 'y2', | |
| description "There is a large ~Y2~ painted on the rock.", | |
| has scenery supporter; | |
| ! ------------------------------------------------------------------------------ | |
| Object Jumble_Of_Rock "Jumble of Rock" | |
| with teleport_name 'jumble' 'of' 'rock', | |
| name 'jumble' 'rock', | |
| description "You are in a jumble of rock, with cracks everywhere.", | |
| d_to At_Y2, | |
| u_to In_Hall_Of_Mists, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Window_On_Pit_1 "At Window on Pit" | |
| with teleport_name 'window' 'on' 'pit' 'east' 'e//', | |
| description [; | |
| print_ret (string) AT_A_LOW_WINDOW, " right. ", | |
| (string) MARKS_IN_THE_DUST; | |
| ], | |
| before [; | |
| WaveHands: | |
| print_ret (string) FIGURE_WAVES; | |
| ], | |
| cant_go "The only passage is back east to Y2.", | |
| e_to At_Y2, | |
| cheap_scenery | |
| 4 'pit' 'deep' 'large' 'huge' | |
| "It's so deep you can barely make out the floor below, | |
| and the top isn't visible at all." | |
| 6 'figure' 'shadow' 'person' 'individual' 'shadowy' 'mysterious' | |
| "The shadowy figure seems to be trying to attract your attention.", | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| ! The scenery which exist in the "At window on Pit" locations | |
| ! ------------------------------------------------------------------------------ | |
| Object Window "window" | |
| with name 'window' 'low', | |
| description "It looks like a regular window.", | |
| found_in At_Window_On_Pit_1 At_Window_On_Pit_2, | |
| add_to_scope MarksInDust, | |
| has scenery openable reactive; | |
| Object MarksInDust "marks in the dust" | |
| with name 'marks' 'in' 'the' 'dust', | |
| description "Evidently you're not alone here.", | |
| has scenery multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Dirty_Passage "Dirty Passage" | |
| with teleport_name 'dirty' 'passage', | |
| name 'dirty' 'passage', | |
| description | |
| "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.", | |
| e_to On_Brink_Of_Pit, | |
| u_to Low_N_S_Passage, | |
| w_to In_Dusty_Rock_Room, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object On_Brink_Of_Pit "Brink of Pit" | |
| with teleport_name 'brink' 'of' 'pit', | |
| name 'brink', | |
| description | |
| "You are on the brink of a small clean climbable pit. | |
| A crawl leads west.", | |
| w_to In_Dirty_Passage, | |
| d_to In_Pit, | |
| in_to In_Pit, | |
| cheap_scenery | |
| 4 'pit' 'small' 'clean' 'climbable' | |
| [; | |
| Examine: print_ret (string) MIGHT_CLIMB, "down into it."; | |
| Climb, Enter: | |
| <<Go FAKE_D_OBJ>>; | |
| ], | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Pit "In Pit" | |
| with teleport_name 'in' 'pit', | |
| name 'pit', | |
| description | |
| "You are in the bottom of a small pit with a little stream, | |
| which enters and exits through tiny slits.", | |
| u_to On_Brink_Of_Pit, | |
| d_to "You don't fit through the tiny slits!", | |
| has proper; | |
| Object -> "tiny slits" | |
| with name 'slit' 'slits' 'tiny', | |
| description "The slits form a complex pattern in the rock.", | |
| has scenery multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Dusty_Rock_Room "In Dusty Rock Room" | |
| with teleport_name 'dusty' 'rock' 'room', | |
| name 'room', | |
| description | |
| "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.", | |
| e_to In_Dirty_Passage, | |
| d_to At_Complex_Junction, | |
| has proper dwarfroom; | |
| Object -> "dusty rocks" | |
| class MultiNameObject, | |
| with | |
| #Ifv3; | |
| multi_name 'rocks' 'boulders' 'stones' 'rock' 'stone' 'dusty' 'dirty', | |
| #Ifnot; | |
| multi_name 'rocks' 'boulders' 'stones' 'rock' 'boulder' 'stone' 'dusty' 'dirty', | |
| #Endif; | |
| description "They're just rocks. (Dusty ones, that is.)", | |
| before [; | |
| LookUnder, Push, Pull: | |
| "You'd have to blast your way through."; | |
| ], | |
| has scenery multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| ! A maze of twisty little passages, all alike... | |
| ! ------------------------------------------------------------------------------ | |
| Class MazeRoom | |
| with short_name "Maze", | |
| description "You are in a maze of twisty little passages, all alike.", | |
| out_to "Easier said than done.", | |
| has proper dwarfroom; | |
| MazeRoom Alike_Maze_1 "a1" | |
| with u_to At_West_End_Of_Hall_Of_Mists, | |
| n_to Alike_Maze_1, | |
| e_to Alike_Maze_2, | |
| s_to Alike_Maze_4, | |
| w_to Alike_Maze_11; | |
| MazeRoom Alike_Maze_2 "a2" | |
| with w_to Alike_Maze_1, | |
| s_to Alike_Maze_3, | |
| e_to Alike_Maze_4; | |
| MazeRoom Alike_Maze_3 "a3" | |
| with e_to Alike_Maze_2, | |
| d_to Dead_End_3, | |
| s_to Alike_Maze_6, | |
| n_to Dead_End_13; | |
| MazeRoom Alike_Maze_4 "a4" | |
| with w_to Alike_Maze_1, | |
| n_to Alike_Maze_2, | |
| e_to Dead_End_1, | |
| s_to Dead_End_2, | |
| u_to Alike_Maze_14, | |
| d_to Alike_Maze_14; | |
| MazeRoom Alike_Maze_5 "a5" | |
| with e_to Alike_Maze_6, | |
| w_to Alike_Maze_7; | |
| MazeRoom Alike_Maze_6 "a6" | |
| with e_to Alike_Maze_3, | |
| w_to Alike_Maze_5, | |
| d_to Alike_Maze_7, | |
| s_to Alike_Maze_8; | |
| DeadendRoom Dead_End_1 "e1" | |
| with w_to Alike_Maze_4, | |
| out_to Alike_Maze_4; | |
| DeadendRoom Dead_End_2 "e2" | |
| with w_to Alike_Maze_4, | |
| out_to Alike_Maze_4; | |
| DeadendRoom Dead_End_3 "e3" | |
| with u_to Alike_Maze_3, | |
| out_to Alike_Maze_3; | |
| MazeRoom Alike_Maze_7 "a7" | |
| with w_to Alike_Maze_5, | |
| u_to Alike_Maze_6, | |
| e_to Alike_Maze_8, | |
| s_to Alike_Maze_9; | |
| MazeRoom Alike_Maze_8 "a8" | |
| with w_to Alike_Maze_6, | |
| e_to Alike_Maze_7, | |
| s_to Alike_Maze_8, | |
| u_to Alike_Maze_9, | |
| n_to Alike_Maze_10, | |
| d_to Dead_End_12; | |
| MazeRoom Alike_Maze_9 "a9" | |
| with w_to Alike_Maze_7, | |
| n_to Alike_Maze_8, | |
| s_to Dead_End_4; | |
| DeadendRoom Dead_End_4 "e4" | |
| with w_to Alike_Maze_9, | |
| out_to Alike_Maze_9; | |
| MazeRoom Alike_Maze_10 "aa" | |
| with w_to Alike_Maze_8, | |
| n_to Alike_Maze_10, | |
| d_to Dead_End_5, | |
| e_to At_Brink_Of_Pit; | |
| DeadendRoom Dead_End_5 "e5" | |
| with u_to Alike_Maze_10, | |
| out_to Alike_Maze_10; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Brink_Of_Pit "At Brink of Pit" | |
| with teleport_name 'brink' 'of' 'pit', | |
| name 'brink', | |
| description | |
| "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.", | |
| d_to In_Bird_Chamber, | |
| w_to Alike_Maze_10, | |
| s_to Dead_End_6, | |
| n_to Alike_Maze_12, | |
| e_to Alike_Maze_13, | |
| cheap_scenery | |
| 5 'column' 'massive' 'orange' 'big' 'huge' | |
| [; | |
| Examine: | |
| "It looks like you could climb down it."; | |
| Climb: | |
| <<Go FAKE_D_OBJ>>; | |
| ] | |
| 6 'pit' '30' 'thirty' 'foot' 'thirty-foot' '30-foot' | |
| [; | |
| Examine: | |
| "You'll have to climb down to find out anything more..."; | |
| Climb: | |
| <<Go FAKE_D_OBJ>>; | |
| ], | |
| has proper dwarfroom; | |
| DeadendRoom Dead_End_6 "e6" | |
| with e_to At_Brink_Of_Pit, | |
| out_to At_Brink_Of_Pit; | |
| ! ------------------------------------------------------------------------------ | |
| ! A line of three vital junctions, east to west | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Complex_Junction "At Complex Junction" | |
| with teleport_name 'complex' 'junction', | |
| name 'complex' 'junction', | |
| description | |
| "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.", | |
| u_to In_Dusty_Rock_Room, | |
| w_to In_Bedquilt, | |
| n_to In_Shell_Room, | |
| e_to In_Anteroom, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Bedquilt "Bedquilt" | |
| with teleport_name 'bedquilt', | |
| name 'bedquilt', | |
| description | |
| "You are in bedquilt, a long east/west passage with holes everywhere. | |
| To explore at random select north, south, up, or down.", | |
| e_to At_Complex_Junction, | |
| w_to In_Swiss_Cheese_Room, | |
| s_to In_Slab_Room, | |
| u_to In_Dusty_Rock_Room, | |
| n_to At_Junction_Of_Three, | |
| d_to In_Anteroom, | |
| before [ destiny; | |
| Go: | |
| if (selected_direction == s_to or d_to or u_to && random(100) <= 80) destiny = 1; | |
| if (selected_direction == u_to && random(100) <= 50) destiny = In_Secret_N_S_Canyon_1; | |
| if (selected_direction == n_to) { | |
| if(random(100) <= 60) destiny = 1; | |
| if(random(100) <= 75) destiny = In_Large_Low_Room; | |
| } | |
| if (destiny == 1) | |
| print_ret (string) CRAWLED_LITTLE_HOLES; | |
| if (destiny == 0) rfalse; | |
| PlayerTo(destiny); | |
| rtrue; | |
| ], | |
| npc_exits | |
| In_Secret_N_S_Canyon_1 | |
| In_Large_Low_Room | |
| ! Three NPC exits are present in TADS source, but already present as ordinary exits? | |
| ! In_Dusty_Rock_Room | |
| ! At_Junction_Of_Three | |
| ! In_Anteroom | |
| , | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Swiss_Cheese_Room "In Swiss Cheese Room" | |
| with teleport_name 'swiss' 'cheese' 'room', | |
| name 'swiss' 'cheese' 'room', | |
| description | |
| "You are in a room whose walls resemble swiss cheese. | |
| Obvious passages go west, east, ne, and nw. | |
| Part of the room is occupied by a large bedrock block.", | |
| w_to At_East_End_Of_Twopit_Room, | |
| s_to In_Tall_E_W_Canyon, | |
| ne_to In_Bedquilt, | |
| nw_to In_Oriental_Room, | |
| e_to In_Soft_Room, | |
| before [; | |
| Go: | |
| if ((selected_direction == s_to && random(100) <= 80) || | |
| (selected_direction == nw_to && random(100) <= 50)) | |
| print_ret (string) CRAWLED_LITTLE_HOLES; | |
| ], | |
| cheap_scenery | |
| 3 'block' 'bedrock' 'large' | |
| [; | |
| Examine: | |
| "It's just a huge block."; | |
| LookUnder, Push, Pull, Take: | |
| "Surely you're joking."; | |
| ], | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| ! The Twopit Room area | |
| ! ------------------------------------------------------------------------------ | |
| ! Possible heights for the plant: | |
| ! ------------------------------------------------------------------------------ | |
| Constant TINY_P = 0; | |
| Constant TALL_P = 1; | |
| Constant HUGE_P = 2; | |
| Object At_West_End_Of_Twopit_Room "At West End of Twopit Room" | |
| with teleport_name 'west' 'w//' 'end' 'of' 'twopit' 'room', | |
| name 'west' 'end' 'twopit' 'room', | |
| description | |
| "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.", | |
| e_to At_East_End_Of_Twopit_Room, | |
| w_to In_Slab_Room, | |
| d_to In_West_Pit, | |
| u_to TOO_FAR_UP, | |
| cheap_scenery | |
| 4 'hole' 'large' 'above' 'pit' | |
| [; | |
| Enter: | |
| print_ret (string) TOO_FAR_UP; | |
| Examine: | |
| "The hole is in the wall above the pit at this end of the room."; | |
| ], | |
| has proper dwarfroom; | |
| Object PlantStickingUp "beanstalk" | |
| class MultiNameObject, | |
| with multi_name 'plant' 'beanstalk' 'stalk' 'bean' 'giant' 'tiny' 'little' | |
| 'murmuring' 'twelve' 'foot' 'tall' 'bellowing', | |
| describe [; | |
| new_line; | |
| <<Examine self>>; | |
| ], | |
| description [; | |
| if (Plant.height == TALL_P) | |
| "The top of a 12-foot-tall beanstalk is poking out of the west pit."; | |
| "There is a huge beanstalk growing out of the west pit up to the hole."; | |
| ], | |
| before [; | |
| Climb: | |
| if (Plant.height == HUGE_P) <<Climb Plant>>; | |
| ], | |
| found_in At_West_End_Of_Twopit_Room At_East_End_Of_Twopit_Room, | |
| has absent static; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_West_Pit "In West Pit" | |
| with teleport_name 'in' 'west' 'pit', | |
| name 'west' 'pit', | |
| description | |
| "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.", | |
| before [; | |
| Climb: | |
| if (noun == Plant) rfalse; | |
| if (Plant.height == TINY_P) | |
| "There is nothing here to climb. | |
| Use ~up~ or ~out~ to leave the pit."; | |
| ], | |
| u_to At_West_End_Of_Twopit_Room, | |
| cheap_scenery | |
| CS_ADD_LIST At_West_End_Of_Twopit_Room (cheap_scenery), | |
| has proper; | |
| Object -> Plant "plant" | |
| class MultiNameObject, | |
| with multi_name 'plant' 'beanstalk' 'stalk' 'bean' 'giant' 'tiny' 'little' | |
| 'murmuring' 'twelve' 'foot' 'tall' 'bellowing', | |
| describe [; | |
| new_line; | |
| <<Examine self>>; | |
| ], | |
| description [; | |
| switch (self.height) { | |
| TINY_P: | |
| "There is a tiny little plant in the pit, murmuring ~Water, water, ...~"; | |
| TALL_P: | |
| "There is a 12-foot-tall beanstalk stretching up out of the pit, bellowing ~Water!! Water!!~"; | |
| HUGE_P: | |
| "There is a gigantic beanstalk stretching all the way up to the hole."; | |
| } | |
| ], | |
| before [; | |
| Climb: | |
| switch (self.height) { | |
| TINY_P: | |
| "It's just a little plant!"; | |
| TALL_P: | |
| "You have climbed up the plant and out of the pit.^"; | |
| PlayerTo(At_West_End_Of_Twopit_Room); | |
| rtrue; | |
| HUGE_P: | |
| "You clamber up the plant and scurry through the hole at the top.^"; | |
| PlayerTo(In_Narrow_Corridor); | |
| rtrue; | |
| } | |
| Take: | |
| "The plant has exceptionally deep roots and cannot be pulled free."; | |
| Water: | |
| if (bottle notin player) | |
| "You have nothing to water the plant with."; | |
| switch (child(bottle)) { | |
| nothing: | |
| "The bottle is empty."; | |
| oil_in_the_bottle: | |
| remove oil_in_the_bottle; | |
| scope_modified = true; | |
| "The plant indignantly shakes the oil off its leaves and asks, ~Water?~"; | |
| } | |
| remove water_in_the_bottle; | |
| scope_modified = true; | |
| switch ((self.height)++) { | |
| TINY_P: | |
| "The plant spurts into furious growth for a few seconds.^^"; | |
| give PlantStickingUp ~absent; | |
| TALL_P: | |
| "The plant grows explosively, almost filling the bottom of the pit.^^"; | |
| HUGE_P: | |
| "You've over-watered the plant! It's shriveling up! It's, it's...^^"; | |
| give PlantStickingUp absent; | |
| remove PlantStickingUp; | |
| self.height = TINY_P; | |
| } | |
| <<Examine self>>; | |
| Oil: | |
| <<Water self>>; | |
| ], | |
| height TINY_P; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_East_End_Of_Twopit_Room "At East End of Twopit Room" | |
| with teleport_name 'east' 'e//' 'end' 'of' 'twopit' 'room', | |
| name 'east' 'end' 'twopit' 'room', | |
| description | |
| "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.", | |
| e_to In_Swiss_Cheese_Room, | |
| w_to At_West_End_Of_Twopit_Room, | |
| d_to In_East_Pit, | |
| cheap_scenery | |
| 4 'hole' 'large' 'above' 'pit' | |
| "The hole is in the wall above you.", | |
| has proper dwarfroom; | |
| Object -> "thin rock slabs" | |
| class MultiNameObject, | |
| with multi_name 'slabs' 'slab' 'rocks' 'stairs' 'thin' 'rock', | |
| description "They almost form natural stairs down into the pit.", | |
| before [; | |
| LookUnder, Push, Pull, Take: | |
| "Surely you're joking. You'd have to blast them aside."; | |
| ], | |
| has scenery multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_East_Pit "In East Pit" | |
| with teleport_name 'in' 'east' 'e//' 'pit', | |
| name 'east' 'e//', | |
| description | |
| "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.", | |
| u_to At_East_End_Of_Twopit_Room, | |
| cheap_scenery | |
| CS_ADD_LIST At_East_End_Of_Twopit_Room (cheap_scenery), | |
| has proper; | |
| Object -> Oil "pool of oil" | |
| with name 'pool' 'oil' 'small', | |
| description "It looks like ordinary oil.", | |
| before [; | |
| Drink: | |
| "Absolutely not."; | |
| Take: | |
| if (bottle notin player) | |
| print_ret (string) NOTHING_TO_CARRY_OIL; | |
| <<Fill bottle>>; | |
| Insert: | |
| if (second == bottle) <<Fill bottle>>; | |
| print_ret (string) NOTHING_TO_CARRY_OIL; | |
| ], | |
| has scenery; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Slab_Room "Slab Room" | |
| with teleport_name 'slab' 'room', | |
| name 'room', | |
| description | |
| "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.", | |
| s_to At_West_End_Of_Twopit_Room, | |
| u_to In_Secret_N_S_Canyon_0, | |
| n_to In_Bedquilt, | |
| cheap_scenery | |
| 'slab' 'immense' | |
| [; | |
| Examine: | |
| "It is now the floor here."; | |
| LookUnder, Push, Pull, Take: | |
| "Surely you're joking."; | |
| ], | |
| has proper dwarfroom; | |
| Object -> "boulders" | |
| with | |
| #Ifv3; | |
| name 'boulders' 'rocks' 'stones', | |
| #Ifnot; | |
| name 'boulder' 'boulders' 'rocks' 'stones', | |
| #Endif; | |
| description "They're just ordinary boulders.", | |
| has scenery multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| ! A small network of Canyons, mainly Secret | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Secret_N_S_Canyon_0 "Secret N/S Canyon" | |
| with teleport_name 'secret' 'n/s' 'canyon' '0//', | |
| name 'secret' 'n/s' 'canyon', | |
| description | |
| "You are in a secret N/S canyon above a large room.", | |
| d_to In_Slab_Room, | |
| s_to In_Secret_Canyon, | |
| n_to In_Mirror_Canyon, | |
| before [; | |
| Go: | |
| if (selected_direction == s_to) In_Secret_Canyon.number = self; | |
| ], | |
| has proper dwarfroom; | |
| ! , | |
| ! npc_exits In_Secret_Canyon; | |
| Object In_Secret_N_S_Canyon_1 "Secret N/S Canyon" | |
| with teleport_name 'secret' 'n/s' 'canyon' '1//', | |
| name 'secret' 'n/s' 'canyon', | |
| description "You are in a secret N/S canyon above a sizable passage.", | |
| n_to At_Junction_Of_Three, | |
| d_to In_Bedquilt, | |
| s_to Atop_Stalactite, | |
| has proper dwarfroom; | |
| Object At_Junction_Of_Three "Junction of Three Secret Canyons" | |
| with teleport_name 'junction' 'of' 'three' 'secret' 'canyons', | |
| name 'junction' 'secret' 'canyons', | |
| description | |
| "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.", | |
| se_to In_Bedquilt, | |
| s_to In_Secret_N_S_Canyon_1, | |
| n_to At_Window_On_Pit_2, | |
| has proper dwarfroom; | |
| Object In_Large_Low_Room "Large Low Room" | |
| with teleport_name 'large' 'low' 'room', | |
| name 'large' 'low' 'room', | |
| description | |
| "You are in a large low room. Crawls lead north, se, and sw.", | |
| sw_to In_Sloping_Corridor, | |
| se_to In_Oriental_Room, | |
| n_to Dead_End_Crawl, | |
| has proper dwarfroom; | |
| Object Dead_End_Crawl "Dead End Crawl" | |
| with teleport_name 'dead' 'end' 'crawl', | |
| name 'dead' 'end' 'crawl', | |
| description "This is a dead end crawl.", | |
| s_to In_Large_Low_Room, | |
| out_to In_Large_Low_Room, | |
| has proper dwarfroom; | |
| Object In_Secret_E_W_Canyon "Secret E/W Canyon Above Tight Canyon" | |
| with teleport_name 'secret' 'e/w' 'canyon' 'above' 'tight', | |
| name 'secret' 'e/w' 'canyon', | |
| description | |
| "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.", | |
| e_to In_Hall_Of_Mt_King, | |
| w_to In_Secret_Canyon, | |
| before [; | |
| Go: | |
| if (selected_direction == w_to) In_Secret_Canyon.number = self; | |
| ], | |
| d_to In_N_S_Canyon, | |
| has proper dwarfroom; | |
| ! , | |
| ! npc_exits In_Secret_Canyon; | |
| Object In_N_S_Canyon "N/S Canyon" | |
| with teleport_name 'n/s' 'canyon', | |
| name 'n/s' 'canyon', | |
| description "You are at a wide place in a very tight N/S canyon.", | |
| s_to Canyon_Dead_End, | |
| n_to In_Tall_E_W_Canyon, | |
| has proper dwarfroom; | |
| Object Canyon_Dead_End "Canyon Dead End" | |
| with description "The canyon here becomes too tight to go further south.", | |
| name 'canyon' 'dead' 'end', | |
| n_to In_N_S_Canyon, | |
| has proper dwarfroom; | |
| Object In_Tall_E_W_Canyon "In Tall E/W Canyon" | |
| with teleport_name 'tall' 'e/w' 'canyon', | |
| name 'tall' 'e/w' 'canyon', | |
| description | |
| "You are in a tall E/W canyon. A low tight crawl goes 3 feet north | |
| and seems to open up.", | |
| e_to In_N_S_Canyon, | |
| w_to Dead_End_8, | |
| n_to In_Swiss_Cheese_Room, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object Atop_Stalactite "Atop Stalactite" | |
| with teleport_name 'atop' 'stalactite', | |
| description | |
| "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.", | |
| n_to In_Secret_N_S_Canyon_1, | |
| d_to [; | |
| if (random(100) <= 40) return Alike_Maze_6; | |
| if (random(100) <= 50) return Alike_Maze_9; | |
| return Alike_Maze_4; | |
| ], | |
| before [; | |
| Jump, Climb: | |
| <<Go FAKE_D_OBJ>>; | |
| ], | |
| cheap_scenery | |
| 4 'stalactite' 'stalagmite' 'stalagtite' 'large' | |
| [; | |
| Examine: | |
| "You could probably climb down it, but you can forget coming back up."; | |
| LookUnder, Push, Take: | |
| "Do get a grip on yourself."; | |
| ], | |
| npc_exits | |
| Alike_Maze_6 | |
| Alike_Maze_9 | |
| Alike_Maze_4, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| ! Here be dragons | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Secret_Canyon "Secret Canyon" | |
| with teleport_name 'secret' 'canyon', | |
| name 'secret' 'canyon', | |
| description | |
| "You are in a secret canyon which exits to the north and east.", | |
| e_to [; | |
| if (In_Secret_Canyon.number == In_Secret_E_W_Canyon) return In_Secret_E_W_Canyon; | |
| if (Dragon in location) | |
| print_ret (string) DRAGON_NASTY; | |
| return In_Secret_E_W_Canyon; | |
| ], | |
| n_to [; | |
| if (In_Secret_Canyon.number == In_Secret_N_S_Canyon_0) return In_Secret_N_S_Canyon_0; | |
| if (Dragon in location) | |
| print_ret (string) DRAGON_NASTY; | |
| return In_Secret_N_S_Canyon_0; | |
| ], | |
| number 0, | |
| out_to [; return self.number;], | |
| before [; | |
| if (action == ##Yes && Dragon.is_being_attacked) { | |
| remove Dragon; | |
| move DragonCorpse to location; | |
| scope_modified = true; | |
| Dragon.is_being_attacked = false; | |
| "Congratulations! You have just vanquished a dragon with your bare hands! | |
| (Unbelievable, isn't it?)"; | |
| } | |
| if (action == ##No && Dragon.is_being_attacked) { | |
| Dragon.is_being_attacked = false; | |
| "I should think not."; | |
| } | |
| Dragon.is_being_attacked = false; | |
| ], | |
| npc_exits In_Secret_N_S_Canyon_0 In_Secret_E_W_Canyon, | |
| has proper dwarfroom; | |
| Object -> Dragon "dragon" | |
| class MultiNameObject, | |
| with multi_name 'dragon' 'monster' 'beast' 'lizard' 'huge' 'green' 'fierce' 'scaly' | |
| 'giant' 'ferocious', | |
| description WOULDNT_MESS, | |
| initial "A huge green fierce dragon bars the way!", | |
| life [; | |
| Attack: | |
| self.is_being_attacked = true; | |
| "With what? Your bare hands?"; | |
| Give: | |
| "The dragon is implacable."; | |
| ThrowAt: | |
| if (noun ~= axe) | |
| "You'd probably be better off using your bare hands than that thing!"; | |
| move axe to location; | |
| scope_modified = true; | |
| "The axe bounces harmlessly off the dragon's thick scales."; | |
| ], | |
| is_being_attacked false, | |
| has animate; | |
| Treasure -> "Persian rug" | |
| with | |
| #Ifv5; | |
| name 'rug' 'persian' 'fine' 'finest' 'dragon^s', | |
| #Ifnot; | |
| name 'rug' 'persian' 'fine' 'finest', | |
| #Endif; | |
| describe [; | |
| if (Dragon in location) | |
| "^The dragon is sprawled out on the Persian rug!"; | |
| "^The Persian rug is spread out on the floor here."; | |
| ], | |
| before [; | |
| Take: | |
| if (Dragon in location) | |
| "You'll need to get the dragon to move first!"; | |
| ], | |
| depositpoints 14; | |
| Object DragonCorpse "dragon's body" | |
| with | |
| #Ifv3; | |
| name 'dragon' 'corpse' 'dead' 'body', | |
| #Ifnot; | |
| name 'dragon' 'corpse' 'dead' 'dragon^s' 'body', | |
| #Endif; | |
| initial "The body of a huge green dead dragon is lying off to one side.", | |
| before [; | |
| Attack: | |
| "You've already done enough damage!"; | |
| ], | |
| has static; | |
| ! ------------------------------------------------------------------------------ | |
| ! And more of the Alike Maze | |
| ! ------------------------------------------------------------------------------ | |
| DeadendRoom Dead_End_8 "e8" | |
| with description "The canyon runs into a mass of boulders -- dead end.", | |
| s_to In_Tall_E_W_Canyon, | |
| out_to In_Tall_E_W_Canyon; | |
| MazeRoom Alike_Maze_11 "ab" | |
| with n_to Alike_Maze_1, | |
| w_to Alike_Maze_11, | |
| s_to Alike_Maze_11, | |
| e_to Dead_End_9, | |
| ne_to Dead_End_10; | |
| DeadendRoom Dead_End_9 "e9" | |
| with w_to Alike_Maze_11, | |
| out_to Alike_Maze_11; | |
| DeadendRoom Dead_End_10 "ea" | |
| with s_to Alike_Maze_3, | |
| out_to Alike_Maze_3; | |
| MazeRoom Alike_Maze_12 "ac" | |
| with s_to At_Brink_Of_Pit, | |
| e_to Alike_Maze_13, | |
| w_to Dead_End_11; | |
| MazeRoom Alike_Maze_13 "ad" | |
| with n_to At_Brink_Of_Pit, | |
| w_to Alike_Maze_12, | |
| nw_to Dead_End_13; | |
| DeadendRoom Dead_End_11 "eb" | |
| with e_to Alike_Maze_12, | |
| out_to Alike_Maze_12; | |
| DeadendRoom Dead_End_12 "ec" | |
| with u_to Alike_Maze_8, | |
| out_to Alike_Maze_8; | |
| MazeRoom Alike_Maze_14 "ae" | |
| with u_to Alike_Maze_4, | |
| d_to Alike_Maze_4; | |
| DeadendRoom Dead_End_13 "ed" | |
| with teleport_name 'pirate^s' 'dead' 'end' 'treasure' 'chest', | |
| name 'dead' 'end', | |
| se_to Alike_Maze_13, | |
| out_to Alike_Maze_13, | |
| description "This is the pirate's dead end.", | |
| initial [; | |
| StopDaemon(Pirate); | |
| if (treasure_chest in self && treasure_chest hasnt moved) | |
| "You've found the pirate's treasure chest!"; | |
| ], | |
| has ~dwarfroom; | |
| Treasure -> treasure_chest "treasure chest" | |
| with | |
| #Ifv3; | |
| name 'chest' 'treasure' 'riches' 'pirate', | |
| #Ifnot; | |
| name 'chest' 'treasure' 'riches' 'pirate' 'pirate^s', | |
| #Endif; | |
| description | |
| "It's the pirate's treasure chest, filled with riches of all kinds!", | |
| initial "The pirate's treasure chest is here!", | |
| depositpoints 12; | |
| ! ------------------------------------------------------------------------------ | |
| ! Above the beanstalk: the Giant Room and the Waterfall | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Narrow_Corridor "In Narrow Corridor" | |
| with teleport_name 'narrow' 'corridor', | |
| name 'narrow' 'corridor', | |
| description | |
| "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.", | |
| d_to In_West_Pit, | |
| w_to In_Giant_Room, | |
| e_to In_West_Pit, | |
| before [; | |
| Jump: | |
| deadflag = GS_DEAD; | |
| "You fall and break your neck!"; | |
| ], | |
| cheap_scenery | |
| CS_THEM 7 'leaf' 'leaves' 'plant' 'tree' 'stalk' 'beanstalk' 'profusion' | |
| [; | |
| Examine: | |
| "The leaves appear to be attached to the beanstalk you climbed to get here."; | |
| Count: | |
| "69,105."; ! (I thank Rene Schnoor for counting them) | |
| ], | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Steep_Incline "Steep Incline Above Large Room" | |
| with teleport_name 'steep' 'incline' 'above' 'large' 'room', | |
| name 'steep' 'incline' 'large' 'room', | |
| description | |
| "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.", | |
| n_to In_Cavern_With_Waterfall, | |
| d_to In_Large_Low_Room, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Giant_Room "Giant Room" | |
| with teleport_name 'giant' 'room', | |
| name 'giant' 'room', | |
| description | |
| "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].", | |
| s_to In_Narrow_Corridor, | |
| e_to At_Recent_Cave_In, | |
| n_to In_Immense_N_S_Passage, | |
| cheap_scenery | |
| 4 'inscription' 'writing' 'scrawl' 'scrawled' | |
| "It says, ~Fee fie foe foo [sic].~", | |
| has proper dwarfroom; | |
| Treasure -> golden_eggs "nest of golden eggs" | |
| class MultiNameObject, | |
| with multi_name 'eggs' 'egg' 'nest' 'golden' 'beautiful', | |
| description "The nest is filled with beautiful golden eggs!", | |
| initial "There is a large nest here, full of golden eggs!", | |
| depositpoints 14, | |
| has multitude; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Recent_Cave_In "Recent Cave-in" | |
| with description "The passage here is blocked by a recent cave-in.", | |
| name 'recent' 'cave-in' 'cavein' 'cave', | |
| s_to In_Giant_Room, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Immense_N_S_Passage "Immense N/S Passage" | |
| with teleport_name 'immense' 'n/s' 'passage', | |
| name 'immense' 'n/s' 'passage', | |
| description "You are at one end of an immense north/south passage.", | |
| s_to In_Giant_Room, | |
| n_to [; | |
| if (RustyDoor has locked) <<Open RustyDoor>>; | |
| if (RustyDoor hasnt open) { | |
| give RustyDoor open; | |
| print "(first wrenching the door open)^"; | |
| } | |
| return RustyDoor; | |
| ], | |
| dynamic_npc_exit [; | |
| if(RustyDoor has locked) | |
| rfalse; | |
| return In_Cavern_With_Waterfall; | |
| ], | |
| has proper dwarfroom; | |
| Object -> RustyDoor "rusty door" | |
| class MultiNameObject, | |
| with multi_name 'door' 'hinge' 'hinges' 'massive' 'rusty' 'iron', | |
| description "It's just a big iron door.", | |
| when_closed "The way north is barred by a massive, rusty, iron door.", | |
| when_open "The way north leads through a massive, rusty, iron door.", | |
| door_to In_Cavern_With_Waterfall, | |
| door_dir n_to, | |
| before [; | |
| Open: | |
| if (self has locked) | |
| print_ret (string) HINGES_RUSTED; | |
| Close: | |
| if (self has open) | |
| "With all the effort it took to get the door open, | |
| I wouldn't suggest closing it again."; | |
| "No problem there -- it already is."; | |
| Oil: | |
| if (bottle in player && oil_in_the_bottle in bottle) { | |
| remove oil_in_the_bottle; | |
| scope_modified = true; | |
| give self ~locked openable; | |
| "The oil has freed up the hinges so that the door will now move, | |
| although it requires some effort."; | |
| } | |
| else | |
| "You have nothing to oil it with."; | |
| Water: | |
| if (bottle in player && water_in_the_bottle in bottle) { | |
| remove water_in_the_bottle; | |
| scope_modified = true; | |
| give self locked ~open; | |
| print_ret (string) HINGES_RUSTED; | |
| } | |
| else | |
| "You have nothing to water it with."; | |
| ], | |
| after [; | |
| Open: | |
| "The door heaves open with a shower of rust."; | |
| ], | |
| has static door locked; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Cavern_With_Waterfall "In Cavern With Waterfall" | |
| with teleport_name 'cavern' 'with' 'waterfall', | |
| name 'cavern', | |
| description | |
| "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.", | |
| s_to In_Immense_N_S_Passage, | |
| w_to At_Steep_Incline, | |
| cheap_scenery | |
| 4 'waterfall' 'whirlpool' 'sparkling' 'whirling' | |
| "Wouldn't want to go down in in a barrel!", | |
| has proper dwarfroom; | |
| Treasure -> trident "jeweled trident" | |
| class MultiNameObject, | |
| with multi_name 'trident' 'jeweled' 'jewel-encrusted' 'encrusted' 'fabulous', | |
| description "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 "In Soft Room" | |
| with teleport_name 'soft' 'room', | |
| name 'soft' 'room', | |
| description | |
| "You are in the soft room. | |
| The walls are covered with heavy curtains, the floor with a thick pile carpet. | |
| Moss covers the ceiling.", | |
| w_to In_Swiss_Cheese_Room, | |
| cheap_scenery | |
| 5 'carpet' 'shag' 'pile' 'heavy' 'thick' | |
| "The carpet is quite plush." | |
| CS_THEM 4 'curtain' 'curtains//p' 'heavy' 'thick' | |
| [; | |
| Examine: | |
| "They seem to absorb sound very well."; | |
| Take: | |
| "Now don't go ripping up the place!"; | |
| LookUnder, Search: | |
| "You don't find anything exciting behind the curtains."; | |
| ], | |
| has proper dwarfroom; | |
| Object -> "moss" | |
| with name 'moss' 'typical' 'everyday', | |
| description "It just looks like your typical, everyday moss.", | |
| before [; | |
| Take: | |
| "It crumbles to nothing in your hands."; | |
| ], | |
| has scenery edible; | |
| Object -> velvet_pillow "velvet pillow" | |
| with name 'pillow' 'velvet' 'small', | |
| description "It's just a small velvet pillow.", | |
| initial "A small velvet pillow lies on the floor."; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Oriental_Room "Oriental Room" | |
| with teleport_name 'oriental' 'room', | |
| name 'room', | |
| description | |
| "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.", | |
| w_to In_Large_Low_Room, | |
| se_to In_Swiss_Cheese_Room, | |
| u_to In_Misty_Cavern, | |
| n_to In_Misty_Cavern, | |
| has proper dwarfroom; | |
| Object -> "ancient oriental drawings" | |
| class MultiNameObject, | |
| with multi_name 'paintings' 'drawings' 'art' 'cave' 'ancient' 'oriental', | |
| description "They seem to depict people and animals.", | |
| has scenery multitude pluralname; | |
| Treasure -> ming_vase "ming vase" | |
| with name 'vase' 'ming' 'delicate', | |
| description "It's a delicate, precious, ming vase!", | |
| after [; | |
| Drop: | |
| if (velvet_pillow in location) { | |
| print "(coming to rest, delicately, on the velvet pillow)^"; | |
| rfalse; | |
| } | |
| remove ming_vase; | |
| move shards to location; | |
| scope_modified = true; | |
| "The ming vase drops with a delicate crash."; | |
| ], | |
| before [; | |
| Attack: | |
| remove ming_vase; | |
| move shards to location; | |
| scope_modified = true; | |
| "You have taken the vase and | |
| hurled it delicately to the ground."; | |
| Receive: | |
| "The vase is too fragile to use as a container."; | |
| ], | |
| depositpoints 14; | |
| Object shards "worthless shards of pottery" | |
| class MultiNameObject, | |
| with multi_name 'pottery' 'shards' 'of' 'remains' 'vase' 'worthless', | |
| description | |
| "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.", | |
| has multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Misty_Cavern "Misty Cavern" | |
| with teleport_name 'misty' 'cavern', | |
| name 'misty' 'cavern', | |
| description | |
| "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.", | |
| s_to In_Oriental_Room, | |
| w_to In_Alcove, | |
| cheap_scenery | |
| 'fissure' 'ceiling' "You can't really get close enough to examine it.", | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| ! Plovers and pyramids | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Alcove "Alcove" | |
| with teleport_name 'alcove', | |
| name 'alcove', | |
| description | |
| "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.", | |
| nw_to In_Misty_Cavern, | |
| e_to [ j; | |
| j = children(player); | |
| if (j == 0 || (j == 1 && egg_sized_emerald in player)) | |
| return In_Plover_Room; | |
| print_ret (string) WONT_FIT; | |
| ], | |
| npc_exits In_Plover_Room, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Plover_Room "Plover Room" | |
| with teleport_name 'plover' 'room', | |
| name 'plover' 'room', | |
| description | |
| "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.", | |
| ne_to In_Dark_Room, | |
| w_to [ j; | |
| j = children(player); | |
| if (j == 0 || (j == 1 && egg_sized_emerald in player)) | |
| return In_Alcove; | |
| print_ret (string) WONT_FIT; | |
| ], | |
| before [; | |
| Plover: | |
| if(caves_closed) { | |
| MagicWordWhenClosed(); | |
| rtrue; | |
| } | |
| if (egg_sized_emerald in player) { | |
| move egg_sized_emerald to In_Plover_Room; | |
| scope_modified = true; | |
| score = score - 5; | |
| } | |
| PlayerTo(At_Y2); | |
| rtrue; | |
| Go: | |
| if (selected_direction == out_to) | |
| <<Go FAKE_W_OBJ>>; | |
| ], | |
| npc_exits In_Alcove, | |
| has light proper dwarfroom; | |
| Treasure -> egg_sized_emerald "emerald the size of a plover's egg" | |
| class MultiNameObject, | |
| with multi_name 'emerald' 'egg-sized' 'egg' 'sized' 'plover^s', | |
| article "an", | |
| description "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 "The Dark Room" | |
| with teleport_name 'dark' 'room', | |
| name 'dark' 'room', | |
| description | |
| "You're in the dark-room. A corridor leading south is the only exit.", | |
| s_to In_Plover_Room, | |
| has proper; | |
| Object -> "stone tablet" | |
| with name 'tablet' 'massive' 'stone', | |
| initial | |
| "A massive stone tablet imbedded in the wall reads: | |
| ~Congratulations on bringing light into the dark-room!~", | |
| has static; | |
| Treasure -> "platinum pyramid" | |
| with | |
| #Ifv3; | |
| name 'platinum' 'pyramid', | |
| #Ifnot; | |
| name 'platinum' 'pyramid' 'pyramidal', | |
| #Endif; | |
| description "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 "Arched Hall" | |
| with teleport_name 'arched' 'hall', | |
| name 'arched' 'hall', | |
| description | |
| "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.", | |
| d_to In_Shell_Room, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| [ CantFitBivalve; | |
| if (giant_bivalve has open) | |
| "You can't fit this five-foot oyster through that little passage!"; | |
| else | |
| "You can't fit this five-foot clam through that little passage!"; | |
| ]; | |
| Object In_Shell_Room "Shell Room" | |
| with teleport_name 'shell' 'room', | |
| name 'shell' 'room', | |
| description | |
| "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.", | |
| u_to In_Arched_Hall, | |
| d_to In_Ragged_Corridor, | |
| s_to [; | |
| if (giant_bivalve in player) { | |
| CantFitBivalve(); | |
| rtrue; | |
| } | |
| return At_Complex_Junction; | |
| ], | |
| npc_exits At_Complex_Junction, | |
| has proper dwarfroom; | |
| Object -> giant_bivalve "giant clam" | |
| with name 'giant' 'clam' 'oyster' 'bivalve', | |
| describe [; | |
| if (self.has_been_opened) | |
| "^There is an enormous oyster here with its shell tightly closed."; | |
| "^There is an enormous clam here with its shell tightly closed."; | |
| ], | |
| before [; | |
| Examine: | |
| if (location == At_Ne_End or At_Sw_End) | |
| "Interesting. | |
| There seems to be something written on the underside of the oyster: | |
| ^^ | |
| ~There is something strange about this place, | |
| such that one of the curses I've always known now has a new effect.~"; | |
| "A giant bivalve of some kind."; | |
| Open: | |
| "You aren't strong enough to open the clam with your bare hands."; | |
| Unlock: | |
| if (second ~= trident) | |
| print_ret (The) second, " isn't strong enough to open the clam."; | |
| if (self.has_been_opened) | |
| "The oyster creaks open, revealing nothing but oyster inside. | |
| It promptly snaps shut again."; | |
| self.has_been_opened = true; | |
| move pearl to In_A_Cul_De_Sac; | |
| scope_modified = true; | |
| "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."; | |
| Attack: | |
| "The shell is very strong and is impervious to attack."; | |
| ], | |
| has_been_opened false; | |
| Treasure pearl "glistening pearl" | |
| class MultiNameObject, | |
| with multi_name 'pearl' 'glistening' 'incredibly' 'large', | |
| description "It's incredibly large!", | |
| initial "Off to one side lies a glistening pearl!", | |
| depositpoints 14 | |
| has tiny; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Ragged_Corridor "Ragged Corridor" | |
| with teleport_name 'ragged' 'corridor', | |
| name 'ragged' 'corridor', | |
| description "You are in a long sloping corridor with ragged sharp walls.", | |
| u_to In_Shell_Room, | |
| d_to In_A_Cul_De_Sac, | |
| has proper dwarfroom; | |
| Object In_A_Cul_De_Sac "Cul-de-Sac" | |
| with teleport_name 'cul-de-sac' 'cul' 'de' 'sac', | |
| name 'cul-de-sac' 'cul', | |
| description "You are in a cul-de-sac about eight feet across.", | |
| u_to In_Ragged_Corridor, | |
| out_to In_Ragged_Corridor, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| ! Witt's End: Cave under construction | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Anteroom "In Anteroom" | |
| with teleport_name 'anteroom', | |
| name 'anteroom', | |
| description | |
| "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.", | |
| u_to At_Complex_Junction, | |
| w_to In_Bedquilt, | |
| e_to At_Witts_End, | |
| has proper dwarfroom; | |
| Object -> "sign" | |
| with name 'sign' 'witt' 'company' 'construction', | |
| initial | |
| "A sign in midair here says ~Cave under construction beyond this point. | |
| Proceed at own risk. [Witt Construction Company]~", | |
| before [; | |
| Take: | |
| "It's hanging way above your head."; | |
| ], | |
| has static; | |
| Object -> "recent issues of ~Spelunker Today~" | |
| class MultiNameObject, | |
| with | |
| #Ifv3; | |
| multi_name 'magazines' 'issue' 'issues' 'spelunker' 'today', | |
| #Ifnot; | |
| multi_name 'magazines' 'magazine' 'issue' 'issues' 'spelunker' 'today', | |
| #Endif; | |
| article "a few", | |
| description "I'm afraid the magazines are written in Dwarvish.", | |
| initial "There are a few recent issues of ~Spelunker Today~ magazine here.", | |
| after [; | |
| Take: | |
| if (location == At_Witts_End) score--; | |
| Drop: | |
| if (location == At_Witts_End) { | |
| score++; | |
| "You really are at wit's end."; | |
| } | |
| ], | |
| has multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Witts_End "At Witt's End" | |
| with teleport_name 'witt^s' 'witts' 'end', | |
| name 'witt^s' 'witts' 'end', | |
| description | |
| "You are at Witt's End. Passages lead off in *all* directions.", | |
| w_to | |
| "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.", | |
| before [; | |
| Go: | |
| if (selected_direction == w_to) rfalse; | |
| if (random(100) <= 95) | |
| print_ret (string) CRAWLED_LITTLE_HOLES; | |
| PlayerTo(In_Anteroom); | |
| rtrue; | |
| ], | |
| npc_exits In_Anteroom, | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| ! North of the secret canyons, on the other side of the pit | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Mirror_Canyon "In Mirror Canyon" | |
| with teleport_name 'mirror' 'canyon', | |
| name 'canyon', | |
| description | |
| "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.", | |
| s_to In_Secret_N_S_Canyon_0, | |
| n_to At_Reservoir, | |
| has proper dwarfroom; | |
| Object -> "suspended mirror" | |
| class MultiNameObject, | |
| with multi_name 'mirror' 'massive' 'enormous' 'hanging' 'suspended' 'dwarves^' | |
| 'two-sided' 'two' 'sided', | |
| description MIRROR_PROVIDED, | |
| initial MIRROR_PROVIDED, | |
| before [; | |
| Attack, Remove: | |
| "You can't reach it from here."; | |
| ], | |
| has static; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Window_On_Pit_2 "At Window on Pit" | |
| with teleport_name 'window' 'on' 'pit' 'west' 'w//', | |
| description [; | |
| print_ret (string) AT_A_LOW_WINDOW, " left. ", | |
| (string) MARKS_IN_THE_DUST; | |
| ], | |
| w_to At_Junction_Of_Three, | |
| cant_go "The only passage is back west to the junction.", | |
| before [; | |
| Jump: | |
| deadflag = GS_DEAD; | |
| "You jump and break your neck!"; | |
| WaveHands: | |
| print_ret (string) FIGURE_WAVES; | |
| ], | |
| cheap_scenery | |
| CS_ADD_LIST At_Window_On_Pit_1 (cheap_scenery), | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Reservoir "At Reservoir" | |
| with teleport_name 'reservoir', | |
| name 'reservoir', | |
| description | |
| "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.", | |
| s_to In_Mirror_Canyon, | |
| out_to In_Mirror_Canyon, | |
| before [; | |
| Swim: | |
| "The water is icy cold, and you would soon freeze to death."; | |
| ], | |
| has proper dwarfroom; | |
| ! ------------------------------------------------------------------------------ | |
| ! The Chasm and the Troll Bridge | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Sloping_Corridor "Sloping Corridor" | |
| with teleport_name 'sloping' 'corridor', | |
| name 'sloping' 'corridor', | |
| description | |
| "You are in a long winding corridor sloping out of sight in both directions.", | |
| d_to In_Large_Low_Room, | |
| u_to On_Sw_Side_Of_Chasm, | |
| cant_go "The corridor slopes steeply up and down.", | |
| has proper dwarfroom; | |
| Object On_Sw_Side_Of_Chasm "On SW Side of Chasm" | |
| with teleport_name 'southwest' 'sw' 'side' 'of' 'chasm', | |
| name 'southwest' 'sw' 'side' 'chasm', | |
| description | |
| "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.", | |
| ne_to CrossRicketyBridge, | |
| sw_to In_Sloping_Corridor, | |
| d_to In_Sloping_Corridor, | |
| cant_go "The path winds southwest.", | |
| before [; | |
| Jump: | |
| if (RicketyBridge in self) | |
| print_ret (string) GO_ACROSS_BRIDGE; | |
| deadflag = GS_DEAD; | |
| "You didn't make it."; | |
| ], | |
| has proper dwarfroom; | |
| [ CrossRicketyBridge; | |
| if(RicketyBridge notin location) | |
| print_ret (string) CHASM_TOO_WIDE; | |
| if (Troll.has_caught_treasure || Troll in nothing) { | |
| Troll.has_caught_treasure = false; | |
| if (Bear in location && Bear.is_following_you) { | |
| Bear.is_following_you = false; | |
| remove Bear; | |
| remove self; | |
| give Wreckage ~absent; | |
| remove RicketyBridge; | |
| give RicketyBridge absent; | |
| scope_modified = true; | |
| StopDaemon(Bear); | |
| deadflag = GS_DEAD; | |
| "Just as you reach the other side, the bridge buckles beneath the weight of the bear, | |
| which was still following you around. | |
| You scrabble desperately for support, | |
| but as the bridge collapses you stumble back and fall into the chasm."; | |
| } | |
| return RicketyBridge; | |
| } | |
| if (Troll in location) "The troll refuses to let you cross."; | |
| move Troll to location; | |
| scope_modified = true; | |
| "The troll steps out from beneath the bridge and blocks your way."; | |
| ]; | |
| Object -> RicketyBridge "rickety bridge" | |
| class MultiNameObject, | |
| with multi_name 'bridge' 'rickety' 'unstable' 'wobbly' 'rope', | |
| description "It just looks like an ordinary, but unstable, bridge.", | |
| describe [; | |
| "^A rickety wooden bridge extends across the chasm, vanishing into the mist. | |
| ^^ | |
| A sign posted on the bridge reads, ~Stop! Pay troll!~^"; | |
| if (Troll notin location) | |
| "^The troll is nowhere to be seen."; | |
| rtrue; | |
| ], | |
| door_dir [; | |
| if (location == On_Sw_Side_Of_Chasm) return ne_to; | |
| return sw_to; | |
| ], | |
| door_to [; | |
| if (location == On_Sw_Side_Of_Chasm) return On_Ne_Side_Of_Chasm; | |
| return On_Sw_Side_Of_Chasm; | |
| ], | |
| found_in On_Sw_Side_Of_Chasm On_Ne_Side_Of_Chasm, | |
| has static door open; | |
| Object -> -> Troll "burly troll" | |
| with name 'troll' 'burly', | |
| description | |
| "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.", | |
| life [; | |
| Attack: | |
| "The troll laughs aloud at your pitiful attempt to injure him."; | |
| ThrowAt, Give: | |
| if (noun ofclass Treasure) { | |
| remove noun; | |
| move self to RicketyBridge; | |
| scope_modified = true; | |
| self.has_caught_treasure = true; | |
| score = score - 5; | |
| "The troll catches your treasure and scurries away out of sight."; | |
| } | |
| if (noun == tasty_food) | |
| "Gluttony is not one of the troll's vices. Avarice, however, is."; | |
| "The troll deftly catches ", (the) noun, | |
| ", examines it carefully, and tosses it back, declaring, | |
| ~Good workmanship, but it's not valuable enough.~"; | |
| Order: | |
| "You'll be lucky."; | |
| Answer, Ask: | |
| "Trolls make poor conversation."; | |
| ], | |
| has_caught_treasure false, | |
| has animate; | |
| Object Wreckage "wreckage of bridge" | |
| class MultiNameObject, | |
| with multi_name 'wreckage' 'wreck' 'bridge' 'dead' 'bear', | |
| initial | |
| "The wreckage of the troll bridge (and a dead bear) | |
| can be seen at the bottom of the chasm.", | |
| before [; | |
| "The wreckage is too far below."; | |
| ], | |
| found_in On_Sw_Side_Of_Chasm On_Ne_Side_Of_Chasm, | |
| has static absent; | |
| ! ------------------------------------------------------------------------------ | |
| Object On_Ne_Side_Of_Chasm "On NE Side of Chasm" | |
| with teleport_name 'northeast' 'ne' 'side' 'of' 'chasm', | |
| name 'northeast' 'ne' 'chasm', | |
| description | |
| "You are on the far side of the chasm. | |
| A northeast path leads away from the chasm on this side.", | |
| sw_to CrossRicketyBridge, | |
| ne_to In_Corridor, | |
| before [; | |
| Jump: | |
| if (RicketyBridge in self) | |
| print_ret (string) GO_ACROSS_BRIDGE; | |
| deadflag = GS_DEAD; | |
| "You didn't make it."; | |
| ], | |
| has proper beyond_troll_bridge; | |
| Object In_Corridor "In Corridor" | |
| with teleport_name 'corridor', | |
| name 'corridor', | |
| description | |
| "You're in a long east/west corridor. | |
| A faint rumbling noise can be heard in the distance.", | |
| w_to On_Ne_Side_Of_Chasm, | |
| e_to At_Fork_In_Path, | |
| has proper beyond_troll_bridge; | |
| ! ------------------------------------------------------------------------------ | |
| ! The Volcano | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Fork_In_Path "At Fork in Path" | |
| with teleport_name 'fork' 'in' 'path', | |
| name 'fork' 'path', | |
| description | |
| "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.", | |
| w_to In_Corridor, | |
| ne_to At_Junction_With_Warm_Walls, | |
| se_to In_Limestone_Passage, | |
| d_to In_Limestone_Passage, | |
| has proper beyond_troll_bridge; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Junction_With_Warm_Walls "At Junction With Warm Walls" | |
| with teleport_name 'junction' 'with' 'warm' 'walls', | |
| name 'junction' 'warm' 'walls', | |
| description | |
| "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.", | |
| s_to At_Fork_In_Path, | |
| n_to At_Breath_Taking_View, | |
| e_to In_Chamber_Of_Boulders, | |
| has proper beyond_troll_bridge; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Breath_Taking_View "At Breath-Taking View" | |
| with | |
| #Ifv3; | |
| teleport_name 'breath-taking' 'taking' 'view', | |
| name 'breath-taking' 'view', | |
| #Ifnot; | |
| teleport_name 'breath-taking' 'breathtaking' 'breath' 'taking' 'view', | |
| name 'breath-taking' 'breathtaking' 'breath' 'view', | |
| #Endif; | |
| description [; | |
| print_ret | |
| "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, ", | |
| (string) CASCADING_BACK, | |
| " 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. ", | |
| (string) TWISTED_FORMATIONS, | |
| " To one side is a deep gorge, ", (string) TORTURED_ROCK, | |
| " An immense ", (string) RIVER_OF_FIRE, | |
| " To the right, an immense ", (string) BLISTERING_STEAM, | |
| " 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."; | |
| ], | |
| s_to At_Junction_With_Warm_Walls, | |
| out_to At_Junction_With_Warm_Walls, | |
| d_to "Don't be ridiculous!", | |
| before [; | |
| Jump: | |
| <<Go FAKE_D_OBJ>>; | |
| ], | |
| cheap_scenery | |
| 9 'volcano' 'rock' 'active' 'glowing' 'blood' 'blood-red' 'red' 'eerie' 'macabre' | |
| [; | |
| Examine: | |
| print_ret | |
| "Great gouts of molten lava come surging out of the volcano | |
| and go ", (string) CASCADING_BACK; | |
| ] | |
| 8 'roof' 'formations' 'light' 'apparaitions' 'jagged' 'twisted' 'murky' 'sinister' | |
| TWISTED_FORMATIONS | |
| 6 'gorge' 'chaos' 'rock' 'deep' 'bizarre' 'tortured' | |
| [; | |
| Examine: | |
| "The gorge is ", (string) TORTURED_ROCK; | |
| ] | |
| CS_ADD_LIST At_Breath_Taking_View (cheap_scenery_2), | |
| cheap_scenery_2 | |
| 8 'river' 'of' 'fire' 'depth' 'pit' 'fire' 'fiery' 'bottomless' | |
| [; | |
| Examine: | |
| "The ", (string) RIVER_OF_FIRE; | |
| ] | |
| CS_PARSE_NAME | |
| [ count; | |
| while(NextWord() == 'geyser' or 'steam' or 'island' or 'lake' or | |
| 'immense' or 'blistering' or 'barren' or 'sulfrous' or | |
| 'sulferous' or 'sulpherous' or 'sulphrous' or 'bubbling') | |
| count++; | |
| return count; | |
| ] | |
| [; | |
| Examine: | |
| "The ", (string) BLISTERING_STEAM; | |
| ], | |
| has proper light beyond_troll_bridge; | |
| Object -> "sparks of ash" | |
| class MultiNameObject, | |
| with multi_name 'spark' 'sparks' 'of' 'ash' 'air' 'flickering', | |
| description | |
| "The sparks too far away for you to get a good look at them.", | |
| has scenery multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Chamber_Of_Boulders "In Chamber of Boulders" | |
| with teleport_name 'chamber' 'of' 'boulders', | |
| name 'chamber', | |
| description | |
| "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.", | |
| w_to At_Junction_With_Warm_Walls, | |
| out_to At_Junction_With_Warm_Walls, | |
| has proper beyond_troll_bridge; | |
| Object -> "boulders" | |
| with | |
| #Ifv3; | |
| name 'boulders' 'rocks' 'stones', | |
| #Ifnot; | |
| name 'boulder' 'boulders' 'rocks' 'stones', | |
| #Endif; | |
| description "They're just ordinary boulders. They're warm.", | |
| before [; | |
| LookUnder, Push, Pull: | |
| "You'd have to blast them aside."; | |
| ], | |
| has scenery multitude pluralname; | |
| Treasure -> "rare spices" | |
| with name 'spices' 'spice' 'rare' 'exotic', | |
| article "a selection of", | |
| before [; | |
| Smell, Examine: | |
| "They smell wonderfully exotic!"; | |
| ], | |
| depositpoints 14, | |
| has multitude pluralname tiny; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Limestone_Passage "In Limestone Passage" | |
| with teleport_name 'limestone' 'passage', | |
| name 'passage', | |
| description | |
| "You are walking along a gently sloping north/south passage | |
| lined with oddly shaped limestone formations.", | |
| n_to At_Fork_In_Path, | |
| u_to At_Fork_In_Path, | |
| s_to In_Front_Of_Barren_Room, | |
| d_to In_Front_Of_Barren_Room, | |
| has proper beyond_troll_bridge; | |
| Object -> "limestone formations" | |
| class MultiNameObject, | |
| with | |
| #Ifv3; | |
| multi_name 'formations' 'shape' 'shapes' 'lime' 'limestone' 'stone' 'oddly' | |
| 'shaped', | |
| #Ifnot; | |
| multi_name 'formations' 'shape' 'shapes' 'lime' 'limestone' 'stone' 'oddly' | |
| 'shaped' 'oddly-shaped', | |
| #Endif; | |
| description | |
| "Every now and then a particularly strange shape catches your eye.", | |
| has scenery multitude; | |
| ! ------------------------------------------------------------------------------ | |
| ! If you go down to the woods today... | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Front_Of_Barren_Room "In Front of Barren Room" | |
| with teleport_name 'front' 'of' 'entrance' 'to' 'barren' 'room', | |
| name 'front' 'entrance', | |
| description | |
| "You are standing at the entrance to a large, barren room. | |
| A sign posted above the entrance reads: ~Caution! Bear in room!~", | |
| w_to In_Limestone_Passage, | |
| u_to In_Limestone_Passage, | |
| e_to In_Barren_Room, | |
| in_to In_Barren_Room, | |
| cheap_scenery | |
| 4 'sign' 'barren' 'room' 'caution' | |
| "The sign reads, ~Caution! Bear in room!~", | |
| has proper beyond_troll_bridge; | |
| ! ------------------------------------------------------------------------------ | |
| Object In_Barren_Room "In Barren Room" | |
| with teleport_name 'in' 'barren' 'room', | |
| name 'barren' 'room', | |
| description | |
| "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.", | |
| w_to In_Front_Of_Barren_Room, | |
| out_to In_Front_Of_Barren_Room, | |
| cheap_scenery | |
| 'dust' 'marks' "It just looks like ordinary dust.", | |
| has proper beyond_troll_bridge; | |
| Object -> Bear "large cave bear" | |
| class MultiNameObject, | |
| with multi_name 'bear' 'large' 'tame' 'ferocious' 'cave', | |
| describe [; | |
| if (self.is_following_you) | |
| "^You are being followed by a very large, tame bear."; | |
| if (self.is_friendly == false) | |
| "^There is a ferocious cave bear eyeing you from the far end of the room!"; | |
| if (location == In_Barren_Room) | |
| "^There is a gentle cave bear sitting placidly in one corner."; | |
| "^There is a contented-looking bear wandering about nearby."; | |
| ], | |
| life [; | |
| Attack: | |
| if (axe in player) <<ThrowAt axe self>>; | |
| if (self.is_friendly) | |
| print_ret (string) BEAR_IS_CONFUSED; | |
| "With what? Your bare hands? Against *his* bear hands??"; | |
| ThrowAt: | |
| if (noun ~= axe) <<Give noun self>>; | |
| if (self.is_friendly) | |
| print_ret (string) BEAR_IS_CONFUSED; | |
| move axe to location; | |
| scope_modified = true; | |
| axe.is_near_bear = true; | |
| "The axe misses and lands near the bear where you can't get at it."; | |
| Give: | |
| if (noun == tasty_food) { | |
| axe.is_near_bear = false; | |
| remove tasty_food; | |
| scope_modified = true; | |
| self.is_friendly = true; | |
| "The bear eagerly wolfs down your food, after which he seems to calm down considerably | |
| and even becomes rather friendly."; | |
| } | |
| if (self.is_friendly) | |
| "The bear doesn't seem very interested in your offer."; | |
| "Uh-oh -- your offer only makes the bear angrier!"; | |
| Order, Ask, Answer: | |
| "This is a Bear of very little brain."; | |
| ], | |
| before [; | |
| Examine: | |
| print "The bear is extremely large, "; | |
| if (self.is_friendly) "but appears to be friendly."; | |
| "and seems quite ferocious!"; | |
| Take, Catch: | |
| if (self.is_friendly == false) "Surely you're joking!"; | |
| if (golden_chain has locked) | |
| "The bear is still chained to the wall."; | |
| self.is_following_you = true; | |
| StartDaemon(self); | |
| "Ok, the bear's now following you around."; | |
| Drop, Release: | |
| if (self.is_following_you == false) "What?"; | |
| self.is_following_you = false; | |
| StopDaemon(self); | |
| if (Troll in location) { | |
| remove Troll; | |
| scope_modified = true; | |
| "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."; | |
| } | |
| "The bear wanders away from you."; | |
| ], | |
| daemon [; | |
| if (location == thedark) rfalse; | |
| if (self in location) { | |
| if (location == At_Breath_Taking_View) | |
| "^The bear roars with delight."; | |
| rfalse; | |
| } | |
| move self to location; | |
| scope_modified = true; | |
| "^The bear lumbers along behind you."; | |
| ], | |
| is_following_you false, | |
| is_friendly false, | |
| has animate; | |
| Treasure -> golden_chain "golden chain" | |
| class MultiNameObject, | |
| with multi_name 'chain' 'links' 'shackles' 'solid' 'gold' 'golden' 'thick' 'chains', | |
| description "The chain has thick links of solid gold!", | |
| describe [; | |
| if (self has locked) | |
| "^The bear is held back by a solid gold chain."; | |
| "^A solid golden chain lies in coils on the ground!"; | |
| ], | |
| with_key set_of_keys, | |
| before [; | |
| Take: | |
| if (self has locked) { | |
| if (Bear.is_friendly) "It's locked to the friendly bear."; | |
| "It's locked to the ferocious bear!"; | |
| } | |
| Unlock: | |
| if (Bear.is_friendly == false) | |
| "There is no way to get past the bear to unlock the chain, | |
| which is probably just as well."; | |
| Lock: | |
| if (self hasnt locked) "The mechanism won't lock again."; | |
| ], | |
| after [; | |
| Unlock: | |
| "You unlock the chain, and set the tame bear free."; | |
| ], | |
| depositpoints 14, | |
| has lockable locked; | |
| ! ------------------------------------------------------------------------------ | |
| ! The Different Maze | |
| ! ------------------------------------------------------------------------------ | |
| Class DiffmazeRoom | |
| with short_name "Maze", | |
| has proper dwarfroom; | |
| DiffmazeRoom Different_Maze_1 "d1" | |
| with description "You are in a maze of twisty little passages, all different.", | |
| s_to Different_Maze_3, | |
| sw_to Different_Maze_4, | |
| ne_to Different_Maze_5, | |
| se_to Different_Maze_6, | |
| u_to Different_Maze_7, | |
| nw_to Different_Maze_8, | |
| e_to Different_Maze_9, | |
| w_to Different_Maze_10, | |
| n_to Different_Maze_11, | |
| d_to At_West_End_Of_Long_Hall; | |
| DiffmazeRoom Different_Maze_2 "d2" | |
| with description "You are in a little maze of twisting passages, all different.", | |
| sw_to Different_Maze_3, | |
| n_to Different_Maze_4, | |
| e_to Different_Maze_5, | |
| nw_to Different_Maze_6, | |
| se_to Different_Maze_7, | |
| ne_to Different_Maze_8, | |
| w_to Different_Maze_9, | |
| d_to Different_Maze_10, | |
| u_to Different_Maze_11, | |
| s_to Dead_End_14; | |
| DiffmazeRoom Different_Maze_3 "d3" | |
| with description "You are in a maze of twisting little passages, all different.", | |
| w_to Different_Maze_1, | |
| se_to Different_Maze_4, | |
| nw_to Different_Maze_5, | |
| sw_to Different_Maze_6, | |
| ne_to Different_Maze_7, | |
| u_to Different_Maze_8, | |
| d_to Different_Maze_9, | |
| n_to Different_Maze_10, | |
| s_to Different_Maze_11, | |
| e_to Different_Maze_2; | |
| DiffmazeRoom Different_Maze_4 "d4" | |
| with description "You are in a little maze of twisty passages, all different.", | |
| nw_to Different_Maze_1, | |
| u_to Different_Maze_3, | |
| n_to Different_Maze_5, | |
| s_to Different_Maze_6, | |
| w_to Different_Maze_7, | |
| sw_to Different_Maze_8, | |
| ne_to Different_Maze_9, | |
| e_to Different_Maze_10, | |
| d_to Different_Maze_11, | |
| se_to Different_Maze_2; | |
| DiffmazeRoom Different_Maze_5 "d5" | |
| with description "You are in a twisting maze of little passages, all different.", | |
| u_to Different_Maze_1, | |
| d_to Different_Maze_3, | |
| w_to Different_Maze_4, | |
| ne_to Different_Maze_6, | |
| sw_to Different_Maze_7, | |
| e_to Different_Maze_8, | |
| n_to Different_Maze_9, | |
| nw_to Different_Maze_10, | |
| se_to Different_Maze_11, | |
| s_to Different_Maze_2; | |
| DiffmazeRoom Different_Maze_6 "d6" | |
| with description "You are in a twisting little maze of passages, all different.", | |
| ne_to Different_Maze_1, | |
| n_to Different_Maze_3, | |
| nw_to Different_Maze_4, | |
| se_to Different_Maze_5, | |
| e_to Different_Maze_7, | |
| d_to Different_Maze_8, | |
| s_to Different_Maze_9, | |
| u_to Different_Maze_10, | |
| w_to Different_Maze_11, | |
| sw_to Different_Maze_2; | |
| DiffmazeRoom Different_Maze_7 "d7" | |
| with description "You are in a twisty little maze of passages, all different.", | |
| n_to Different_Maze_1, | |
| se_to Different_Maze_3, | |
| d_to Different_Maze_4, | |
| s_to Different_Maze_5, | |
| e_to Different_Maze_6, | |
| w_to Different_Maze_8, | |
| sw_to Different_Maze_9, | |
| ne_to Different_Maze_10, | |
| nw_to Different_Maze_11, | |
| u_to Different_Maze_2; | |
| DiffmazeRoom Different_Maze_8 "d8" | |
| with description "You are in a twisty maze of little passages, all different.", | |
| e_to Different_Maze_1, | |
| w_to Different_Maze_3, | |
| u_to Different_Maze_4, | |
| sw_to Different_Maze_5, | |
| d_to Different_Maze_6, | |
| s_to Different_Maze_7, | |
| nw_to Different_Maze_9, | |
| se_to Different_Maze_10, | |
| ne_to Different_Maze_11, | |
| n_to Different_Maze_2; | |
| DiffmazeRoom Different_Maze_9 "d9" | |
| with description "You are in a little twisty maze of passages, all different.", | |
| se_to Different_Maze_1, | |
| ne_to Different_Maze_3, | |
| s_to Different_Maze_4, | |
| d_to Different_Maze_5, | |
| u_to Different_Maze_6, | |
| nw_to Different_Maze_7, | |
| n_to Different_Maze_8, | |
| sw_to Different_Maze_10, | |
| e_to Different_Maze_11, | |
| w_to Different_Maze_2; | |
| DiffmazeRoom Different_Maze_10 "da" | |
| with description "You are in a maze of little twisting passages, all different.", | |
| d_to Different_Maze_1, | |
| e_to Different_Maze_3, | |
| ne_to Different_Maze_4, | |
| u_to Different_Maze_5, | |
| w_to Different_Maze_6, | |
| n_to Different_Maze_7, | |
| s_to Different_Maze_8, | |
| se_to Different_Maze_9, | |
| sw_to Different_Maze_11, | |
| nw_to Different_Maze_2; | |
| DiffmazeRoom Different_Maze_11 "db" | |
| with description "You are in a maze of little twisty passages, all different.", | |
| sw_to Different_Maze_1, | |
| nw_to Different_Maze_3, | |
| e_to Different_Maze_4, | |
| w_to Different_Maze_5, | |
| n_to Different_Maze_6, | |
| d_to Different_Maze_7, | |
| se_to Different_Maze_8, | |
| u_to Different_Maze_9, | |
| s_to Different_Maze_10, | |
| ne_to Different_Maze_2; | |
| ! ------------------------------------------------------------------------------ | |
| DeadendRoom Dead_End_14 "ee" | |
| with teleport_name 'dead' 'end' 'near' 'vending' 'machine', | |
| name 'dead' 'end', | |
| short_name "Dead End, near Vending Machine", | |
| description | |
| "You have reached a dead end. There is a massive vending machine here. | |
| ^^ | |
| Hmmm... There is a message here scrawled in the dust in a flowery script.", | |
| n_to Different_Maze_2, | |
| out_to Different_Maze_2, | |
| cheap_scenery | |
| 6 'message' 'scrawl' 'writing' 'script' 'scrawled' 'flowery' | |
| "The message reads, ~This is not the maze where the pirate leaves | |
| his treasure chest.~", | |
| has ~dwarfroom; | |
| Object -> VendingMachine "vending machine" | |
| class MultiNameObject, | |
| with multi_name 'machine' 'slot' 'vending' 'massive' 'battery' 'coin', | |
| description | |
| "The instructions on the vending machine read, | |
| ~Insert coins to receive fresh batteries.~", | |
| before [; | |
| Receive: | |
| if (noun == rare_coins) { | |
| move fresh_batteries to location; | |
| remove rare_coins; | |
| scope_modified = true; | |
| "Soon after you insert the coins in the coin slot, | |
| the vending machine makes a grinding sound, and a set of fresh batteries falls at your feet."; | |
| } | |
| "The machine seems to be designed to take coins."; | |
| Attack: | |
| "The machine is quite sturdy and survives your attack without getting so much as a scratch."; | |
| LookUnder: | |
| "You don't find anything under the machine."; | |
| Search: | |
| "You can't get inside the machine."; | |
| Take: | |
| "The vending machine is far too heavy to move."; | |
| ], | |
| has scenery; | |
| Object fresh_batteries "fresh batteries" VendingMachine | |
| with | |
| #Ifv3; | |
| name 'batteries' 'fresh', | |
| #Ifnot; | |
| name 'batteries' 'battery' 'fresh', | |
| #Endif; | |
| description | |
| "They look like ordinary batteries. (A sepulchral voice says, ~Still going!~)", | |
| initial "There are fresh batteries here.", | |
| before [; | |
| Count: | |
| "A pair."; | |
| ], | |
| have_been_used false, | |
| has pluralname tiny; | |
| Object old_batteries "worn-out batteries" | |
| with | |
| #Ifv3; | |
| name 'batteries' 'worn' 'out' 'worn-out', | |
| #Ifnot; | |
| name 'batteries' 'battery' 'worn' 'out' 'worn-out', | |
| #Endif; | |
| description "They look like ordinary batteries.", | |
| initial "Some worn-out batteries have been discarded nearby.", | |
| before [; | |
| Count: | |
| "A pair."; | |
| ], | |
| has pluralname tiny; | |
| ! ------------------------------------------------------------------------------ | |
| ! Dwarves! | |
| ! ------------------------------------------------------------------------------ | |
| Constant FIRST_DWARF_ROOM = In_Hall_Of_Mists; ! The room with the lowest Object ID where dwarves can go | |
| Constant DWARF_ATTACK = 750; ! Chance that a dwarf will throw a knife at player (Was 1000 in original) | |
| Constant DWARF_ACCURACY = 95; ! Chance that a dwarf's axe/knife will hit the player (Was 95 in original) | |
| Constant DWARF_HIT = 660; ! Chance that player will hit a dwarf with his axe (Was 330 in original) | |
| Constant DWARF_TENACITY = 960; ! Chance that a dwarf follows a player to the next room | |
| Array dwarf_location -> 5; ! The locations where the dwarves are right now | |
| Array dwarf_exit_temp -> 4; ! Cache exits for room with dynamic exit. Maximum we need is 3 | |
| Global cache_pos = 1; | |
| Constant DWARF_EXIT_CACHE_SIZE = 315; ! 305 is what's actually needed, but someone may add an exit or two for fun | |
| Constant LAST_DWARF_ROOM = Different_Maze_11; ! The room with the highest Object ID where dwarves can go | |
| #Ifdef DEBUG; | |
| Verb meta 'cachepos' | |
| * -> CachePos; | |
| [ CachePosSub; | |
| "Cache pos is ", cache_pos, "."; | |
| ]; | |
| #Endif; | |
| [ PopulateDwarfExitCache loc exit_count j k m val cache_room_start prop; | |
| exit_count = 0; | |
| cache_room_start = cache_pos; | |
| .next_prop; | |
| @get_next_prop loc prop -> prop; | |
| if(prop == 0) jump check_npc_exits; | |
| if(prop > OUT_TO_CONST) jump next_prop; | |
| if(prop < N_TO_CONST) jump check_npc_exits; | |
| val = loc.prop; | |
| if(val>Directions && val<top_object) { | |
| if(val hasnt dwarfroom) | |
| jump next_prop; | |
| #Ifv5; | |
| k = dwarf_exit_cache + cache_room_start; | |
| m = cache_pos - cache_room_start; | |
| @scan_table val k m 1 -> m ?next_prop; | |
| #Ifnot; | |
| for(k=cache_room_start:k<cache_pos:k++) | |
| if(dwarf_exit_cache->k == val) | |
| jump next_prop; | |
| #Endif; | |
| dwarf_exit_cache->cache_pos = val; | |
| cache_pos++; | |
| exit_count++; | |
| } | |
| jump next_prop; | |
| .check_npc_exits; | |
| j = loc.&npc_exits; | |
| if(j) { | |
| val = loc.#npc_exits / 2 - 1; | |
| k = 0; | |
| ! for(k=0:k<val:k++) { | |
| .next_npc_exit; | |
| dwarf_exit_cache->cache_pos = j-->k; | |
| cache_pos++; | |
| exit_count++; | |
| @inc_chk k val ?~next_npc_exit; | |
| ! } | |
| } | |
| #Ifv5; | |
| @log_shift exit_count 10 -> m; ! Multiply by 1024 | |
| #Ifnot; | |
| m = 1024 * exit_count; | |
| #Endif; | |
| dwarf_exit_cache_index-->loc = m + cache_room_start; | |
| ! print "LOC IS ", loc, ": ", (name) loc, ", CACHE_POS IS NOW ", cache_pos, "^"; | |
| ]; | |
| Array dwarf_exit_cache -> DWARF_EXIT_CACHE_SIZE; ! a 0-byte + 305 exits | |
| Array dwarf_exit_cache_index_actual --> (LAST_DWARF_ROOM - FIRST_DWARF_ROOM + 1); | |
| Array dwarf_start_rooms static string | |
| In_Hall_Of_Mists | |
| In_Nugget_Of_Gold_Room | |
| On_East_Bank_Of_Fissure | |
| West_Side_Of_Fissure | |
| At_West_End_Of_Hall_Of_Mists | |
| At_East_End_Of_Long_Hall | |
| At_West_End_Of_Long_Hall | |
| Crossover | |
| Dead_End_7 | |
| In_Hall_Of_Mt_King | |
| Low_N_S_Passage | |
| In_South_Side_Chamber | |
| In_West_Side_Chamber | |
| At_Y2 | |
| Jumble_Of_Rock | |
| At_Window_On_Pit_1 | |
| In_Dirty_Passage | |
| On_Brink_Of_Pit | |
| In_Dusty_Rock_Room | |
| At_Brink_Of_Pit | |
| At_Complex_Junction | |
| In_Bedquilt | |
| In_Swiss_Cheese_Room | |
| At_West_End_Of_Twopit_Room | |
| At_East_End_Of_Twopit_Room | |
| In_Slab_Room | |
| In_Secret_N_S_Canyon_0 | |
| In_Secret_N_S_Canyon_1 | |
| At_Junction_Of_Three | |
| In_Large_Low_Room | |
| Dead_End_Crawl | |
| In_Secret_E_W_Canyon | |
| In_N_S_Canyon | |
| Canyon_Dead_End | |
| In_Tall_E_W_Canyon | |
| Atop_Stalactite | |
| In_Secret_Canyon | |
| In_Narrow_Corridor | |
| At_Steep_Incline | |
| In_Giant_Room | |
| At_Recent_Cave_In | |
| In_Immense_N_S_Passage | |
| In_Cavern_With_Waterfall | |
| In_Soft_Room | |
| In_Oriental_Room | |
| In_Misty_Cavern | |
| In_Alcove | |
| In_Plover_Room | |
| In_Arched_Hall | |
| In_Shell_Room | |
| In_Ragged_Corridor | |
| In_A_Cul_De_Sac | |
| In_Anteroom | |
| At_Witts_End | |
| In_Mirror_Canyon | |
| At_Window_On_Pit_2 | |
| At_Reservoir | |
| In_Sloping_Corridor | |
| On_Sw_Side_Of_Chasm; | |
| Object Dwarf "threatening little dwarf" | |
| class MultiNameObject, | |
| with multi_name 'dwarf' 'threatening' 'nasty' 'little' 'mean', | |
| describe [; rtrue; ], ! Don't mention in room description, as daemon handles this | |
| description | |
| "It's probably not a good idea to get too close. | |
| Suffice it to say the little guy's pretty aggressive.", | |
| number 5, | |
| dwarves_present 0, | |
| has_thrown_axe false, | |
| scatter [ i; | |
| for(i=0:i<self.number:i++) | |
| if(dwarf_location->i == real_location) | |
| dwarf_location->i = 0; | |
| self.dwarves_present = 0; | |
| remove self; | |
| scope_modified = true; | |
| ], | |
| daemon [ i j k d dwarf_count loc exit_count present attackers base bear_loc troll_loc last_dwarf_loc; | |
| dwarf_count = self.number; | |
| if(real_location has notfarin && dwarf_count > 4) return; | |
| last_dwarf_loc = parent(self); | |
| bear_loc = parent(Bear); | |
| troll_loc = parent(Troll); | |
| if(dwarf_count == 0) { | |
| self.dwarves_present = 0; | |
| remove self; | |
| StopDaemon(self); | |
| return; | |
| } | |
| for(i=0:i<dwarf_count:i++) { | |
| loc = dwarf_location->i; | |
| exit_count = 0; | |
| if(loc == real_location) { | |
| present++; | |
| ! Dwarves who didn't move this turn can attack | |
| if(random(1000) <= DWARF_ATTACK) | |
| attackers++; | |
| continue; | |
| } | |
| if(loc==0) { | |
| j=5; | |
| while(--j > 0) { | |
| loc = dwarf_start_rooms->random(dwarf_start_rooms->0); | |
| if(loc ofclass Object && loc has dwarfroom && | |
| loc ~= real_location or bear_loc or troll_loc) { | |
| dwarf_location->i = loc; | |
| break; | |
| } | |
| } | |
| continue; | |
| } | |
| k = dwarf_exit_cache_index-->loc; | |
| if(k==0) { | |
| !#Ifdef DEBUG; | |
| PopulateDwarfExitCache(loc); | |
| k = dwarf_exit_cache_index-->loc; | |
| !#Ifnot; | |
| !#Iftrue RUNTIME_ERRORS > 0; | |
| ! print "Advent error: Dwarf stuck in room ", loc, "(",(name) loc, ") which is not in exit cache.^"; | |
| !#Endif; | |
| ! continue; ! Give up. Should never happen, if correct arrays have been given. | |
| !#Endif; | |
| } | |
| #Ifv5; | |
| @log_shift k (-10) -> exit_count; ! Divide by 1024 | |
| #Ifnot; | |
| exit_count = k/1024; | |
| #Endif; | |
| k = k & 1023; | |
| base = dwarf_exit_cache + k; | |
| ! Consider dynamic exit | |
| if(loc provides dynamic_npc_exit) { | |
| d = loc.dynamic_npc_exit(); | |
| if(d) { | |
| ! print "FOUND dynamic exit from ", (name) loc, " to ", (name) d, "!^"; | |
| dwarf_exit_temp->exit_count = d; | |
| #Ifv5; | |
| @copy_table base dwarf_exit_temp exit_count; | |
| exit_count++; | |
| #Ifnot; | |
| j = 0; | |
| if(exit_count) { | |
| exit_count--; | |
| .dyn_copy_exit; | |
| dwarf_exit_temp->j = base->j; | |
| @inc_chk j exit_count ?~dyn_copy_exit; | |
| exit_count = exit_count + 2; | |
| } | |
| #Endif; | |
| base = dwarf_exit_temp; | |
| } | |
| } | |
| if(exit_count < 1) | |
| continue; ! There are no exits | |
| ! Unless the player is in the company of the bear or troll, | |
| ! go to player location if possible | |
| if(real_location ~= bear_loc or troll_loc) { | |
| #Ifv5; | |
| @scan_table real_location base exit_count 1 -> j ?~real_loc_not_found; | |
| if(random(1000) <= DWARF_TENACITY) { | |
| dwarf_location->i = real_location; | |
| present++; | |
| jump moved_dwarf; | |
| } | |
| .real_loc_not_found; | |
| #Ifnot; | |
| k = exit_count - 1; | |
| j = 0; | |
| ! for(j=0:j<exit_count:j++) { | |
| .check_next_exit; | |
| if(base->j == real_location && random(1000) <= DWARF_TENACITY) { | |
| dwarf_location->i = real_location; | |
| present++; | |
| jump moved_dwarf; | |
| } | |
| @inc_chk j k ?~check_next_exit; | |
| ! } | |
| #Endif; | |
| } | |
| ! Pick a random exit | |
| if(exit_count>0) { | |
| j=base->(random(exit_count)-1); | |
| if(j ~= real_location or bear_loc or troll_loc) { | |
| dwarf_location->i = j; | |
| ! print "Moved dwarf ",i, " from ", (name) loc, " to ", (name) j, ".^"; | |
| } | |
| } | |
| .moved_dwarf; | |
| } | |
| if (self.has_thrown_axe == false && present > 0) { | |
| move axe to real_location; | |
| self.has_thrown_axe = true; | |
| ! scope_modified = true; ! This is set by scatter() | |
| self.scatter(); | |
| "^A little dwarf just walked around a corner, | |
| saw you, threw a little axe at you which | |
| missed, cursed, and ran away."; | |
| } | |
| self.dwarves_present = present; | |
| ! for(i=0:i<dwarf_count:i++) | |
| ! if(dwarf_location->i) | |
| ! print "Dwarf ", i, " is in ", (name) dwarf_location->i, "^"; | |
| if(present) { | |
| if(self notin location) { | |
| move self to real_location; | |
| scope_modified = true; | |
| } | |
| if(present) { | |
| if(present == 1) | |
| print "^There is a threatening little dwarf"; | |
| else | |
| print "^There are ", (LanguageNumber) present, " threatening little dwarves"; | |
| print " in the room with you."; | |
| if (Dragon in location) { | |
| self.number--; | |
| present=0; | |
| self.scatter(); | |
| print "^^With one casual blast the dragon vapourises "; | |
| if(present == 0) | |
| "him."; | |
| else { | |
| print "one of them. The other"; | |
| if(present > 1) | |
| print "s flee"; | |
| else | |
| print " one flees"; | |
| " in panic."; | |
| } | |
| } | |
| if(attackers) { | |
| if (location == In_Mirror_Canyon && mirror_distraction_turn ~= turns - 1) { | |
| mirror_distraction_turn = turns; | |
| if(attackers == 1) { | |
| if(present == 1) | |
| print " He"; | |
| else | |
| print " One of them"; | |
| print " admires himself"; | |
| } else { | |
| if(attackers == present) | |
| print " They"; | |
| else | |
| print " Some of them"; | |
| print " admire themselves"; | |
| } | |
| " in the mirror."; | |
| } | |
| if (attackers == 1) { | |
| if (present == 1) | |
| print " He throws a knife"; | |
| else | |
| print " One of them throws a knife"; | |
| } else if (attackers == present) { | |
| if (present == 2) | |
| print " Both of them throw knives"; | |
| else | |
| print " All of them throw knives"; | |
| } | |
| else { | |
| print (LanguageNumber) attackers, " of them throw knives"; | |
| } | |
| print " at you!^^"; | |
| k = 0; | |
| for(i=1:i<=attackers:i++) { | |
| if(random(1000) <= DWARF_ACCURACY) | |
| k++; | |
| } | |
| if (k) { | |
| if(k == attackers) { | |
| if(k == 1) | |
| print "It gets"; | |
| else if(k == 2) | |
| print "Both of them get"; | |
| else | |
| print "All of them get"; | |
| } else if(k == 1) { | |
| print "One of them gets"; | |
| } else { | |
| print (LanguageNumber) k, " of them get"; | |
| } | |
| deadflag = GS_DEAD; | |
| } else { | |
| if(attackers == 1) | |
| print "It misses"; | |
| else if (attackers == 2) | |
| print "Both of them miss"; | |
| else | |
| print "They all miss"; | |
| } | |
| print " you!"; | |
| } | |
| new_line; | |
| } | |
| } else { | |
| if(self in location) { | |
| remove self; | |
| scope_modified = true; | |
| } | |
| } | |
| ], | |
| before [; | |
| Kick: | |
| print "You boot "; | |
| if(self.dwarves_present > 1) | |
| print "one of the dwarves"; | |
| else | |
| print "the dwarf"; | |
| " across the room. He curses, then gets up and brushes himself off. | |
| Now he's madder than ever!"; | |
| ], | |
| life [ present; | |
| ThrowAt: | |
| if (noun == axe) { | |
| move axe to location; | |
| if (random(1000) <= DWARF_HIT) { | |
| present = self.dwarves_present; | |
| self.dwarves_present = 0; | |
| remove self; | |
| ! scope_modified = true; ! Set by scatter() | |
| self.number--; | |
| ! Since we scatter the dwarves present, it's not very important which one died | |
| self.scatter(); | |
| print "You killed a little dwarf! The body vanishes in a cloud of greasy black smoke."; | |
| if(present > 1) { | |
| print " The other dwar"; | |
| if(present > 2) | |
| print "ves flee"; | |
| else | |
| print "f flees"; | |
| " in panic."; | |
| } | |
| new_line; | |
| rtrue; | |
| } | |
| "Missed! The little dwarf dodges out of the way of the axe."; | |
| } | |
| <<Give noun second>>; | |
| Give: | |
| if (noun == tasty_food) | |
| "You fool, dwarves eat only coal! Now you've made him *really* mad!"; | |
| "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.)"; | |
| Attack: | |
| "Not with your bare hands. No way."; | |
| ], | |
| has animate; | |
| Object axe "dwarvish axe" | |
| with name 'axe' 'little' 'dwarvish' 'dwarven', | |
| description "It's just a little axe.", | |
| initial "There is a little axe here.", | |
| before [; | |
| if (~~self.is_near_bear) rfalse; | |
| Examine: | |
| "It's lying beside the bear."; | |
| Take: | |
| "No chance. It's lying beside the ferocious bear, quite within harm's way."; | |
| ], | |
| is_near_bear false; | |
| ! ------------------------------------------------------------------------------ | |
| ! Two brushes with piracy | |
| ! ------------------------------------------------------------------------------ | |
| [ CheckForBooty obj; | |
| if(obj ofclass Treasure) booty_nearby = true; | |
| ]; | |
| [ StealIfBooty obj; | |
| if(obj ofclass Treasure) { | |
| if (obj in player) score = score - 5; | |
| move obj to Dead_End_13; | |
| } | |
| ]; | |
| Object pirate "pirate" | |
| with daemon [; | |
| if (location hasnt dwarfroom || location has light || | |
| location == thedark or In_Secret_Canyon || random(100) > 2) | |
| return; | |
| if (Dwarf in location) | |
| "^A bearded pirate appears, catches sight of the dwarf and runs away."; | |
| booty_nearby = false; | |
| LoopOverScope(CheckForBooty); ! Sets booty_nearby if treasure is found | |
| if (booty_nearby == false) { | |
| if (self.has_been_spotted) return; | |
| self.has_been_spotted = true; | |
| if (self.has_stolen_something) StopDaemon(self); | |
| "^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. | |
| ^^ | |
| ~Shiver me timbers!~ he cries, ~I've been spotted! | |
| I'd best hie meself off to the maze to hide me chest!~ | |
| ^^ | |
| With that, he vanishes into the gloom."; | |
| } | |
| if (self.has_stolen_something) return; | |
| self.has_stolen_something = true; | |
| if (self.has_been_spotted) StopDaemon(self); | |
| LoopOverScope(StealIfBooty); ! Steals all treasures found | |
| scope_modified = true; | |
| "^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."; | |
| ], | |
| has_stolen_something false, | |
| has_been_spotted false, | |
| has animate; | |
| ! ---------------------------------------------------------------------------- | |
| ! The cave is closing now... | |
| ! ---------------------------------------------------------------------------- | |
| Object cave_closer "cav" | |
| with close_caves [; | |
| caves_closed = true; | |
| score = score + 25; | |
| remove CrystalBridge; | |
| give CrystalBridge absent; | |
| give Grate locked ~open; | |
| remove set_of_keys; | |
| StopDaemon(Dwarf); | |
| StopDaemon(pirate); | |
| remove Dwarf; | |
| remove Troll; | |
| remove Bear; | |
| remove Dragon; | |
| scope_modified = true; | |
| "^A sepulchral voice reverberating through the cave says, ~Cave | |
| closing soon. All adventurers exit immediately through main office.~"; | |
| ], | |
| time_left 30, | |
| final_closing_time -20, ! This is changed to -35 if player tries to go through grate | |
| daemon [; | |
| !#Ifdef DEBUG; | |
| ! print "CAVE_CLOSER DAEMON - TIME_LEFT=", self.time_left, "^"; | |
| !#Endif; | |
| if(self.time_left > 0) { | |
| ! Cave has not closed yet | |
| if(real_location hasnt notfarin && real_location ~= At_Y2) { | |
| self.time_left--; | |
| if(self.time_left < 1) | |
| self.close_caves(); | |
| } | |
| return; | |
| } | |
| ! Wait for final closing of caves | |
| self.time_left--; | |
| if(self.time_left > self.final_closing_time) | |
| return; | |
| ! Final closing of caves | |
| StopDaemon(self); | |
| score = score + 10; | |
| while (child(player)) remove child(player); | |
| move bottle to At_Ne_End; | |
| if (child(bottle)) 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; | |
| give EnormousMirror ~absent; | |
| ! scope_modified = true; ! Set by PlayerTo | |
| "^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 "NE End of Repository" | |
| with teleport_name 'northeast' 'ne' 'end' 'of' 'repository', | |
| name 'northeast' 'ne' 'end', | |
| description | |
| "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!~", | |
| sw_to At_Sw_End, | |
| cheap_scenery | |
| 7 'materials' 'torches' 'objects' 'adventure' 'repository' 'massive' 'sundry' | |
| [; | |
| Examine: | |
| print_ret (string) SEEN_EVERYTHING; | |
| Take: | |
| print_ret (string) REMOVING_THE_LOOT; | |
| ], | |
| has proper light; | |
| Object -> EnormousMirror "enormous mirror" | |
| class MultiNameObject, | |
| with multi_name 'mirror' 'enormous' 'huge' 'big' 'large' 'suspended' 'hanging' | |
| 'vanity' 'dwarvish', | |
| description "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.", | |
| before [; | |
| Attack: | |
| "You strike the mirror a resounding blow, | |
| whereupon it shatters into a myriad tiny fragments.^^"; | |
| SleepingDwarves.wake_up(); | |
| rtrue; | |
| ], | |
| found_in At_Ne_End At_Sw_End, | |
| has static absent; | |
| Object -> SleepingDwarves "sleeping dwarves" | |
| class MultiNameObject, | |
| with multi_name 'dwarf' 'dwarves' 'sleeping' 'snoring' 'dozing' 'snoozing', | |
| article "hundreds of angry", | |
| description "I wouldn't bother the dwarves if I were you.", | |
| before [; | |
| Take: | |
| "What, all of them?"; | |
| ], | |
| life [; | |
| WakeOther: | |
| "You prod the nearest dwarf, who wakes up grumpily, | |
| takes one look at you, curses, and grabs for his axe.^^"; | |
| self.wake_up(); | |
| rtrue; | |
| Attack: | |
| self.wake_up(); | |
| rtrue; | |
| ], | |
| wake_up [; | |
| deadflag = GS_DEAD; | |
| "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!"; | |
| ], | |
| has scenery animate multitude pluralname; | |
| ! ------------------------------------------------------------------------------ | |
| Object At_Sw_End "SW End of Repository" | |
| with teleport_name 'southwest' 'sw' 'end' 'of' 'repository', | |
| name 'southwest' 'sw' 'end', | |
| description | |
| "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.~", | |
| d_to RepositoryGrate, | |
| ne_to At_Ne_End, | |
| cheap_scenery | |
| CS_PARSE_NAME | |
| [n; | |
| while(NextWord() == 'pit' or 'snake' or 'snakes' or 'fierce' or 'green' | |
| or 'materials' or 'adventure' or 'repository' | |
| or 'massive' or 'sundry') n++; | |
| return n; | |
| ] | |
| [; | |
| Examine: | |
| print_ret (string) SEEN_EVERYTHING; | |
| Take: | |
| print_ret (string) REMOVING_THE_LOOT; | |
| ], | |
| has proper light; | |
| Object -> RepositoryGrate "steel grate" | |
| with name 'ordinary' 'steel' 'grate' 'grating', | |
| description "It just looks like an ordinary steel grate.", | |
| when_open "The grate is open.", | |
| when_closed "The grate is closed.", | |
| door_dir d_to, | |
| door_to Outside_Grate, | |
| with_key nothing, | |
| has static door locked openable; | |
| Object -> black_mark_rod "black rod with a rusty mark on the end" | |
| class MultiNameObject, | |
| with multi_name 'rod' 'black' 'rusty' 'mark' 'three' 'foot' 'iron' 'explosive' | |
| 'dynamite' 'blast', | |
| description "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.", | |
| before [; | |
| Wave: | |
| print_ret (string) NOTHING_HAPPENS; | |
| ]; | |
| Array notfarin_floats static string WellHouse Road Forest Grate Cobbles; | |
| [ ModifyAbsent p_loc i obj; | |
| ! Modify absent attribute for objects which are not far into the cave | |
| i = notfarin_floats->0; | |
| .absent_next; | |
| obj = notfarin_floats->i; | |
| if(p_loc has notfarin) | |
| give obj ~absent; | |
| else | |
| give obj absent; | |
| @dec_chk i 0 ?~absent_next; | |
| ! Modify absent attribute for objects which are far into the cave | |
| give Window ~absent; | |
| if(p_loc has notfarin) | |
| give Window absent; | |
| ]; | |
| ! ------------------------------------------------------------------------------ | |
| ! Initialise | |
| ! ------------------------------------------------------------------------------ | |
| [ Initialise i n loc; | |
| dwarf_exit_cache_index = dwarf_exit_cache_index_actual - FIRST_DWARF_ROOM - FIRST_DWARF_ROOM; | |
| n = dwarf_start_rooms->0; | |
| i = 1; | |
| .next_room; | |
| loc = dwarf_start_rooms->i; | |
| PopulateDwarfExitCache(loc); | |
| @inc_chk i n ?~next_room; | |
| score = 36; | |
| StartDaemon(Dwarf); | |
| StartDaemon(pirate); | |
| "^^^^Welcome to Adventure!^ | |
| (Please type HELP for instructions and information.)^^"; | |
| ]; | |
| ! ------------------------------------------------------------------------------ | |
| ! Menu-driven help (not really a part of the game itself) | |
| ! ------------------------------------------------------------------------------ | |
| [ HelpMenu; | |
| if (menu_item == 0) { | |
| item_width = 15; | |
| item_name = "About Adventure"; | |
| if (deadflag == GS_WIN) return 4; | |
| else return 3; | |
| } | |
| if (menu_item == 1) { | |
| item_width = 12; | |
| item_name = "Instructions"; | |
| } | |
| if (menu_item == 2) { | |
| item_width = 7; | |
| item_name = "History"; | |
| } | |
| if (menu_item == 3) { | |
| item_width = 12; | |
| item_name = "Authenticity"; | |
| } | |
| if (menu_item == 4) { | |
| item_width = 15; | |
| item_name = "Did you know..."; | |
| } | |
| ]; | |
| [ HelpInfo; | |
| if (menu_item == 1) { | |
| "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.^^"; | |
| "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.^^"; | |
| "Many commands have abbreviations. | |
| For example, you can type ~i~ in place of ~inventory,~ | |
| ~x object~ instead of ~examine object,~ etc.^^"; | |
| "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.^^"; | |
| "Note that cave passages turn a lot, and that leaving a room to the north | |
| does not guarantee entering the next from the south.^^"; | |
| "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.^^"; | |
| "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) { | |
| "Perhaps the first adventurer was a mulatto slave named Stephen Bishop, born about 1820: | |
| `slight, graceful, and very handsome'; a `quick, daring, enthusiastic' guide | |
| to the Mammoth Cave in the Kentucky karst. | |
| The story of the Cave is a curious microcosm of American history. | |
| Its discovery is a matter of legend dating back to the 1790s; | |
| it is said that a hunter, John Houchin, pursued a wounded bear to a large pit | |
| near the Green River and stumbled upon the entrance. | |
| The entrance was thick with bats and by the War of 1812 was intensively mined for guano, | |
| dissolved into nitrate vats to make saltpetre for gunpowder. | |
| After the war prices fell; but the Cave became a minor side-show when a dessicated | |
| Indian mummy was found nearby, sitting upright in a stone coffin, surrounded by talismans. | |
| In 1815, Fawn Hoof, as she was nicknamed after one of the charms, | |
| was taken away by a circus, drawing crowds across America | |
| (a tour rather reminiscent of Don McLean's song `The Legend of Andrew McCrew'). | |
| She ended up in the Smithsonian but by the 1820s the Cave was being called | |
| one of the wonders of the world, largely due to her posthumous efforts.^^"; | |
| "By the early nineteenth century European caves were big tourist attractions, | |
| but hardly anyone visited the Mammoth, `wonder of the world' or not. | |
| Nor was it then especially large (the name was a leftover from the miners, | |
| who boasted of their mammoth yields of guano). | |
| In 1838, Stephen Bishop's owner bought up the Cave. | |
| Stephen, as (being a slave) he was invariably called, was by any standards a remarkable man: | |
| self-educated in Latin and Greek, he became famous as the `chief ruler' of his underground realm. | |
| He explored and named much of the layout in his spare time, doubling the known map in a year. | |
| The distinctive flavour of the Cave's names -- half-homespun American, half-classical -- | |
| started with Stephen: the River Styx, the Snowball Room, Little Bat Avenue, the Giant Dome. | |
| Stephen found strange blind fish, snakes, silent crickets, the remains of cave bears | |
| (savage, playful creatures, five feet long and four high, which became extinct | |
| at the end of the last Ice Age), centuries-old Indian gypsum workings and ever more cave. | |
| His 1842 map, drafted entirely from memory, was still in use forty years later.^^"; | |
| "As a tourist attraction (and, since Stephen's owner was a philanthropist, | |
| briefly a sanatorium for tuberculosis, owing to a hopeless medical theory) | |
| the Cave became big business: for decades nearby caves were hotly seized | |
| and legal title endlessly challenged. | |
| The neighbouring chain, across Houchins Valley in the Flint Ridge, | |
| opened the Great Onyx Cave in 1912. | |
| By the 1920s, the Kentucky Cave Wars were in full swing. | |
| Rival owners diverted tourists with fake policemen, employed stooges | |
| to heckle each other's guided tours, burned down ticket huts, | |
| put out libellous and forged advertisements. | |
| Cave exploration became so dangerous and secretive that finally in 1941 the U.S. Government | |
| stepped in, made much of the area a National Park and effectively banned caving. | |
| The gold rush of tourists was, in any case, waning.^^"; | |
| "Convinced that the Mammoth and Flint Ridge caves were all linked in a huge chain, | |
| explorers tried secret entrances for years, eventually winning official backing. | |
| Throughout the 1960s all connections from Flint Ridge -- difficult and water-filled tunnels | |
| -- ended frustratingly in chokes of boulders. | |
| A `reed-thin' physicist, Patricia Crowther, made the breakthrough in 1972 | |
| when she got through the Tight Spot and found a muddy passage: | |
| it was a hidden way into the Mammoth Cave.^^"; | |
| "Under the terms of his owner's will, Stephen Bishop was freed in 1856, | |
| at which time the cave boasted 226 avenues, 47 domes, 23 pits and 8 waterfalls. | |
| He died a year later, before he could buy his wife and son. | |
| In the 1970s, Crowther's muddy passage was found on his map.^^"; | |
| "The Mammoth Cave is huge, its full extent still a matter of speculation | |
| (estimates vary from 300 to 500 miles). | |
| Although this game has often been called ~Colossal Cave~, | |
| it is actually a simulation of the Bedquilt Cave region. | |
| Here is Will Crowther's story of how it came about:^^"; | |
| "~I had been involved in a non-computer role-playing game called Dungeons and Dragons | |
| at the time, and also I had been actively exploring in caves -- | |
| Mammoth Cave in Kentucky in particular. | |
| Suddenly, I got involved in a divorce, and that left me a bit pulled apart in various ways. | |
| In particular I was missing my kids. | |
| Also the caving had stopped, because that had become awkward, | |
| so I decided I would fool around and write a program that was a re-creation | |
| in fantasy of my caving, and also would be a game for the kids, | |
| and perhaps some aspects of the Dungeons and Dragons that I had been playing.^^"; | |
| "~My idea was that it would be a computer game that would not be intimidating | |
| to non-computer people, and that was one of the reasons why I made it so that | |
| the player directs the game with natural language input, instead of more standardized commands. | |
| My kids thought it was a lot of fun.~ | |
| [Quoted in ~Genesis II: Creation and Recreation with Computers~, Dale Peterson (1983).]^^"; | |
| "Crowther's original FORTRAN program had five or so treasures, but no formal scoring. | |
| The challenge was really to explore, though there was opposition from for instance the snake. | |
| Like the real Bedquilt region, Crowther's simulation has a map on about four levels | |
| of depth and is rich in geological detail. | |
| A good example is the orange column which descends to the Orange River Rock room | |
| (where the bird lives): the real column is of orange travertine, | |
| a beautiful mineral found in wet limestone.^^"; | |
| "The game's language is loaded with references to caving, to `domes' and `crawls'. | |
| A `slab room', for instance, is a very old cave whose roof has begun to break away | |
| into sharp flakes which litter the floor in a crazy heap. | |
| The program's use of the word `room' for all manner of caves and places | |
| seems slightly sloppy in everyday English, but is widespread in American caving | |
| and goes back as far as Stephen Bishop: so the Adventure-games usage of the word `room' | |
| to mean `place' may even be bequeathed from him.^^"; | |
| "The game took its decisive step toward puzzle-solving when Don Woods, a student at Stanford, | |
| debugged and expanded it. | |
| He tripled the number of treasures and added the non-geological zones: | |
| everything from the Troll Bridge onward, together with most of the antechambers on the Bedquilt level. | |
| All of the many imitations and extensions of the original Adventure | |
| are essentially based on Woods's 350-point edition. | |
| (Many bloated, corrupted or enhanced -- it depends how you see it -- | |
| versions of the game are in Internet circulation, and the most useful way to identify them | |
| is by the maximum attainable score. | |
| Many versions exist scoring up to around the 400s and 500s, and one up to 1000. | |
| Woods himself continues to release new versions of his game; | |
| most of the other extenders haven't his talent.)^^"; | |
| "Although the game has veered away from pure simulation, a good deal of it remains realistic. | |
| Cavers do turn back when their carbide lamps flicker; | |
| there are indeed mysterious markings and initials on the cave walls, some left by the miners, | |
| some by Bishop, some by 1920s explorers. | |
| Of course there isn't an active volcano in central Kentucky, nor are there dragons and dwarves. | |
| But even these embellishments are, in a sense, derived from tradition: | |
| like most of the early role-playing games, `Adventure' owes much to J. R. R. Tolkien's | |
| `The Hobbit', and the passage through the mountains and Moria of `The Lord of the Rings' | |
| (arguably its most dramatic and atmospheric passage). | |
| Tolkien himself, the most successful myth-maker of the twentieth century, | |
| worked from the example of Icelandic, Finnish and Welsh sagas.^^"; | |
| "By 1977 tapes of `Adventure' were being circulated widely, by the Digital user group DECUS, | |
| amongst others: taking over lunchtimes and weekends wherever it went... but that's another story. | |
| (Tracy Kidder's fascinating book `The Soul of a New Machine', a journalist's-eye-view | |
| of a mainframe computer development group, catches it well.)^^"; | |
| "This is a copy at third or fourth hand: from Will Crowther's original | |
| to Donald Woods's 350-point edition to Donald Ekman's PC port to | |
| David M. Baggett's excellent TADS version (1993), to this."; | |
| } | |
| if (menu_item == 3) { | |
| "This port is fairly close to the original. | |
| The puzzles, items and places of Woods's original 350-point version are exactly those here.^^"; | |
| "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.^^"; | |
| "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.^^"; | |
| "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. [FR: PunyInform version, Release 5 | |
| brings back five simulated dwarves that move around randomly like in the TADS vesion]^^"; | |
| "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. | |
| [RF: this feature incorporated into Release 9.] [FR: this feature limited in PunyInform | |
| version Release 5, so it can't be used to get past obstacles like narrow passages]^^"; | |
| "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...^^"; | |
| "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).^^"; | |
| "The bear (who likes the volcano) is too heavy for the bridge... | |
| and you can go back to the scene after being resurrected.^^"; | |
| "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.^^"; | |
| "When the cave closes, the grate is locked and the keys are thrown away, | |
| creatures run off and the crystal bridge vanishes...^^"; | |
| "...and a completely useless hint is written on the giant oyster's shell in the end game. | |
| (To make this hint slightly fairer, I've altered one word and placed suggestions elsewhere in the game.)^^"; | |
| "The last lousy point can be won by... but no. That would be telling."; | |
| ]; | |
| ! INFORMATION_PROVIDED holds: | |
| ! "There is information provided on the following:^ | |
| ! ^ Instructions for playing | |
| ! ^ A historical preface | |
| ! ^ How authentic is this edition?^", | |
| [ MenuStringAfterWin; | |
| print_ret (string) INFORMATION_PROVIDED, " Did you know..."; | |
| ]; | |
| [ HelpSub; | |
| if (deadflag ~= GS_WIN) | |
| DoMenu( INFORMATION_PROVIDED, | |
| HelpMenu, HelpInfo); | |
| else | |
| DoMenu( | |
| MenuStringAfterWin, | |
| HelpMenu, HelpInfo); | |
| ]; | |
| Verb 'help' | |
| * -> Help; | |
| ! ------------------------------------------------------------------------------ | |
| ! Grammar: the usual grammar and some extensions | |
| ! ------------------------------------------------------------------------------ | |
| [ OffSub; | |
| if (brass_lantern notin player) "You have no lamp."; | |
| <<SwitchOff brass_lantern>>; | |
| ]; | |
| [ OnSub; | |
| if (brass_lantern notin player) "You have no lamp."; | |
| <<SwitchOn brass_lantern>>; | |
| ]; | |
| Verb 'off' | |
| * -> Off; | |
| Verb 'on' | |
| * -> On; | |
| ! ------------------------------------------------------------------------------ | |
| [ CatchSub; "You can't catch ", (the) noun, "."; ]; | |
| [ ReleaseSub; "You can't release ", (the) noun, "."; ]; | |
| Verb 'catch' 'capture' | |
| * creature -> Catch | |
| * creature 'with' held -> Catch; | |
| Verb 'release' 'free' | |
| * creature -> Release; | |
| ! ------------------------------------------------------------------------------ | |
| [ WaterSub; | |
| if (bottle in player) <<Empty bottle>>; | |
| "Water? What water?"; | |
| ]; | |
| [ OilSub; | |
| if (bottle in player) <<Empty bottle>>; | |
| "Oil? What oil?"; | |
| ]; | |
| Verb 'water' | |
| * noun -> Water; | |
| Verb 'oil' 'grease' 'lubricate' | |
| * noun -> Oil; | |
| Verb 'pour' 'douse' | |
| * 'water' 'on' noun -> Water | |
| * 'oil' 'on' noun -> Oil | |
| * noun -> Empty; | |
| ! ------------------------------------------------------------------------------ | |
| [ BlastSub; | |
| if (location ~= At_Sw_End or At_Ne_End) "Frustrating, isn't it?"; | |
| if (location == At_Sw_End && parent(black_mark_rod) == At_Ne_End) { | |
| score = score + 35; | |
| deadflag = GS_WIN; | |
| print_ret (string) LOUD_EXPLOSION, "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."; | |
| } | |
| if (location == At_Ne_End && parent(black_mark_rod) == At_Sw_End) { | |
| score = score + 20; | |
| deadflag = GS_DEAD; | |
| print_ret (string) LOUD_EXPLOSION, "snakes in the rubble. | |
| A river of molten lava pours in through the hole, destroying everything in its path, including you!"; | |
| } | |
| deadflag = GS_DEAD; | |
| "There is a loud explosion, and you are suddenly splashed across the walls of the room."; | |
| ]; | |
| [ BlastWithSub; | |
| if (second ~= black_mark_rod) "Blasting requires dynamite."; | |
| "Been eating those funny brownies again?"; | |
| ]; | |
| Verb 'blast' | |
| * -> Blast | |
| * noun 'with' held -> BlastWith; | |
| ! ------------------------------------------------------------------------------ | |
| [ XyzzySub; print_ret (string) NOTHING_HAPPENS; ]; | |
| [ PlughSub; print_ret (string) NOTHING_HAPPENS; ]; | |
| [ PloverSub; print_ret (string) NOTHING_HAPPENS; ]; | |
| [ FeeSub; FthingSub(0); ]; | |
| [ FieSub; FthingSub(1); ]; | |
| [ FoeSub; FthingSub(2); ]; | |
| [ FooSub; FthingSub(3); ]; | |
| [ FthingSub i; | |
| if (feefie_count ~= i) { | |
| feefie_count = 0; | |
| "Get it right, dummy!"; | |
| } | |
| if (feefie_count++ == 3) { | |
| feefie_count = 0; | |
| if (golden_eggs in In_Giant_Room) print_ret (string) NOTHING_HAPPENS; | |
| if ((golden_eggs in player) || (golden_eggs in location)) | |
| print "The nest of golden eggs has vanished!^"; | |
| else | |
| print "Done!"; | |
| if (golden_eggs in player) score = score - 5; | |
| if (golden_eggs has depositpoints_awarded) { | |
| score = score - golden_eggs.depositpoints; | |
| give golden_eggs ~depositpoints_awarded; | |
| } | |
| move golden_eggs to In_Giant_Room; | |
| scope_modified = true; | |
| if (location == In_Giant_Room) | |
| "^^A large nest full of golden eggs suddenly appears out of nowhere!"; | |
| } | |
| else | |
| "Ok."; | |
| ]; | |
| [ OldMagicSub; "Good try, but that is an old worn-out magic word."; ]; | |
| [ LookUnderSub; "You find nothing of interest."; ]; | |
| Extend 'look' first | |
| * 'under' noun -> LookUnder; | |
| Verb 'xyzzy' | |
| * -> Xyzzy; | |
| Verb 'plugh' | |
| * -> Plugh; | |
| Verb 'plover' | |
| * -> Plover; | |
| Verb 'fee' | |
| * -> Fee; | |
| Verb 'fie' | |
| * -> Fie; | |
| Verb 'foe' | |
| * -> Foe; | |
| Verb 'foo' | |
| * -> Foo; | |
| Verb 'sesame' 'shazam' 'hocus' 'abracadabra' 'foobar' 'open-sesame' 'frotz' | |
| * -> OldMagic; | |
| Extend 'say' first | |
| * 'blast' -> Blast | |
| * 'xyzzy' -> Xyzzy | |
| * 'plugh' -> Plugh | |
| * 'plover' -> Plover | |
| * 'fee' -> Fee | |
| * 'fie' -> Fie | |
| * 'foe' -> Foe | |
| * 'foo' -> Foo | |
| * 'sesame'/'shazam'/'hocus'/'abracadabra'/'foobar'/'open-sesame'/'frotz' | |
| -> OldMagic; | |
| ! ------------------------------------------------------------------------------ | |
| [ CountSub; | |
| if (noun has multitude) "There are a multitude."; | |
| "I see one (1) ", (name) noun, "."; | |
| ]; | |
| [ KickSub; <<Attack noun>>; ]; ! For kicking dwarves | |
| [ UseSub; "You'll have to be a bit more explicit than that."; ]; | |
| Verb 'count' | |
| * noun -> Count; | |
| Verb 'kick' | |
| * noun -> Kick; | |
| Verb 'use' | |
| * -> Use; | |
| ! ------------------------------------------------------------------------------ | |
| ! Teleportation (can also use UnknownVerb entry point) | |
| ! ------------------------------------------------------------------------------ | |
| [ TeleportScope obj; | |
| switch (scope_stage) { | |
| 1: rfalse; | |
| 2: | |
| #Ifdef TEST_VERSION; | |
| objectloop (obj provides teleport_name) | |
| PlaceInScope(obj, true); | |
| #Ifnot; | |
| objectloop (obj has visited && obj provides teleport_name) | |
| PlaceInScope(obj, true); | |
| #Endif; | |
| rtrue; | |
| 3: PrintMsg(MSG_GO_CANT_GO); | |
| } | |
| ]; | |
| #Ifndef TEST_VERSION; | |
| Constant GRATE_CLOSED = "The steel grate is closed."; | |
| Constant TELEPORT_NOT_SAFE = "It's not safe to walk around in the cave system | |
| without an active light source. You would likely fall into a pit."; | |
| Constant TROLL_BLOCKS = "You are supposed to pay the troll before passing the bridge."; | |
| [ BlockTeleport p_loc p_msg; | |
| if(real_location ~= p_loc) { | |
| PlayerTo(p_loc); | |
| new_line; | |
| } | |
| if(p_msg ofclass String) | |
| print_ret (string) p_msg; | |
| else | |
| p_msg(); | |
| ]; | |
| #Endif; | |
| [ TeleportSub emerald_loc emerald_dest emerald_load nugget_loc nugget_dest | |
| bridge_loc bridge_dest bivalve_loc bivalve_dest; | |
| if (noun == location) "But you're already here!"; | |
| #Ifdef TEST_VERSION; | |
| emerald_loc = emerald_dest + emerald_load + nugget_loc + nugget_dest + | |
| bridge_loc + bridge_dest + bivalve_loc + bivalve_dest; | |
| #Ifnot; | |
| if(caves_closed) | |
| "Nothing happens."; | |
| ! Can only climb down through grate if it's unlocked | |
| if(grate has locked && real_location has aboveground && noun hasnt aboveground) { | |
| BlockTeleport(Outside_Grate, GRATE_CLOSED); | |
| rtrue; | |
| } | |
| ! If the player's location or destination is dark and/or is down in the | |
| ! proper cave system, they'll need a lantern! | |
| if((brass_lantern notin player || brass_lantern hasnt on) && | |
| ((real_location hasnt light || noun hasnt light) || | |
| (real_location hasnt notfarin || noun hasnt notfarin))) { | |
| if(real_location has notfarin && real_location has light) { | |
| BlockTeleport(In_Cobble_Crawl, TELEPORT_NOT_SAFE); | |
| rtrue; | |
| } | |
| print_ret (string) TELEPORT_NOT_SAFE; | |
| } | |
| ! Check passages which can only be passed under certain | |
| ! conditions. If current location and the destination are on | |
| ! different sides of such a passage, and the conditions aren't met, | |
| ! stop before the passage (I.e. "teleportation" is considered as walking | |
| ! along known routes to the destination.). NOTE: We have to check these | |
| ! conditions in a specific order! | |
| ! Can only walk from rooms on far side of troll bridge, to near side, | |
| ! troll is gone, and not with bear. | |
| if(real_location has beyond_troll_bridge) | |
| bridge_loc++; | |
| if(noun hasnt beyond_troll_bridge) | |
| bridge_dest++; | |
| if(0 ~= bridge_loc or bridge_dest) { | |
| if(troll notin nothing) { | |
| BlockTeleport(On_Ne_Side_Of_Chasm, TROLL_BLOCKS); | |
| rtrue; | |
| } | |
| if(Bear in location && Bear.is_following_you) { | |
| BlockTeleport(On_Ne_Side_Of_Chasm, "The bridge looks weak, and the bear looks very heavy."); | |
| rtrue; | |
| } | |
| } | |
| ! Can only walk from Plover Room to Alcove if holding emerald or nothing | |
| if(real_location == In_Plover_Room or In_Dark_Room) | |
| emerald_loc++; | |
| if(noun ~= In_Plover_Room or In_Dark_Room) | |
| emerald_dest++; | |
| if(children(player) > 1 || child(player) ~= 0 or egg_sized_emerald) | |
| emerald_load++; | |
| if(0 ~= emerald_loc or emerald_load or emerald_dest) { | |
| BlockTeleport(In_Plover_Room, WONT_FIT); | |
| rtrue; | |
| } | |
| ! Can't pass from Shell Room to Complex Junction, if holding bivalve | |
| if(giant_bivalve in player) { | |
| if(real_location == In_Shell_Room or In_Arched_Hall or | |
| In_Ragged_Corridor or In_A_Cul_De_Sac) | |
| bivalve_loc++; | |
| if(noun ~= In_Shell_Room or In_Arched_Hall or | |
| In_Ragged_Corridor or In_A_Cul_De_Sac) | |
| bivalve_dest++; | |
| if(0 ~= bivalve_loc or bivalve_dest) { | |
| BlockTeleport(In_Shell_Room, CantFitBivalve); | |
| rtrue; | |
| } | |
| } | |
| ! Can't pass between Hall of Mists and Top of Small Pit, if holding nugget | |
| ! Use IndirectlyContains, in case we decide to allow the nugget to be carried in the cage | |
| if(IndirectlyContains(player, large_gold_nugget)) { | |
| if(real_location hasnt notfarin) | |
| nugget_loc++; | |
| if(noun has notfarin) | |
| nugget_dest++; | |
| if(0 ~= nugget_loc or nugget_dest) { | |
| BlockTeleport(In_Hall_Of_Mists, UNCLIMBABLE); | |
| rtrue; | |
| } | |
| if(1 ~= nugget_loc or nugget_dest) { | |
| BlockTeleport(At_Top_Of_Small_Pit, UNCLIMBABLE); | |
| rtrue; | |
| } | |
| } | |
| ! Can only walk from Alcove to Plover Room if holding emerald or nothing | |
| if(emerald_load && 1 ~= emerald_loc or emerald_dest) { | |
| BlockTeleport(In_Alcove, WONT_FIT); | |
| rtrue; | |
| } | |
| ! Can only walk to rooms on far side of troll bridge if bridge is | |
| ! present and troll is gone | |
| if(1 ~= bridge_loc or bridge_dest) { | |
| if(RicketyBridge has absent) { | |
| BlockTeleport(On_Sw_Side_Of_Chasm, CHASM_TOO_WIDE); | |
| rtrue; | |
| } | |
| if(troll notin nothing) { | |
| BlockTeleport(On_Sw_Side_Of_Chasm, TROLL_BLOCKS); | |
| rtrue; | |
| } | |
| } | |
| ! Can only climb up through grate if it's unlocked | |
| if(grate has locked && real_location hasnt aboveground && noun has aboveground) { | |
| BlockTeleport(Below_The_Grate, GRATE_CLOSED); | |
| rtrue; | |
| } | |
| #Endif; | |
| PlayerTo(noun); | |
| ]; | |
| Extend 'go' | |
| * scope=TeleportScope -> Teleport | |
| * 'to' scope=TeleportScope -> Teleport; | |
| #Ifndef DEBUG; | |
| Verb 'goto' | |
| * scope=TeleportScope -> Teleport; | |
| #Endif; | |
| #Ifdef DEBUG; | |
| Verb meta 'cavecloser' | |
| * -> CaveCloser; | |
| [CaveCloserSub; | |
| print "cave_closer.time_left is ", cave_closer.time_left, "^"; | |
| ]; | |
| Verb meta 'gocave' | |
| * -> GoCave; | |
| [GoCaveSub; | |
| move brass_lantern to player; | |
| move set_of_keys to player; | |
| move tasty_food to player; | |
| move bottle to player; | |
| move black_rod to player; | |
| move wicker_cage to player; | |
| move little_bird to wicker_cage; | |
| give wicker_cage ~open; | |
| give brass_lantern on light; | |
| give grate open ~locked; | |
| update_moved = true; | |
| PlayerTo(At_Top_Of_Small_Pit); | |
| ]; | |
| #Endif; | |
| ! ------------------------------------------------------------------------------ | |
| ! In the test version: no dwarves or pirates, and magic words work from the start | |
| ! ------------------------------------------------------------------------------ | |
| #Ifdef TEST_VERSION; | |
| [ XdetermSub; | |
| StopDaemon(Dwarf); | |
| StopDaemon(pirate); | |
| give In_Debris_Room visited; | |
| give At_Y2 visited; | |
| give In_Plover_Room visited; | |
| ]; | |
| Verb 'xdeterm' | |
| * -> Xdeterm; | |
| #Endif; | |
| ! ------------------------------------------------------------------------------ | |
Xet Storage Details
- Size:
- 212 kB
- Xet hash:
- 00878bacdfc3372f5939294f4715edd66df2e64c7f9c7a1015cc743615fa7007
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.