Inform - Resources - Examples

Back to List

Inventory
Complete

Plain
Coloured
Gaudy

Browsing Advent.inf

This is the complete source code of the example game Advent.inf.

0001  !% -S~D
0002   
0003  ! ------------------------------------------------------------------------------
0004  !  Advent 060321        A classic and one of the standard Inform 6 example games
0005  !
0006  !
0007  !                                  Adapted to Inform 5: 17.05.1994 to 24.05.1994
0008  !                 Modernised to Inform 5.5 and library 5/12 or later: 20.12.1995
0009  !                    Modernised to Inform 6 and library 6/1 or later: 11.11.1996
0010  !                    A few bugs removed and companion text rewritten: 09.12.1996
0011  !                                Some very minor bugs indeed removed: 24.02.1997
0012  !                                                    And another two: 04.09.1997
0013  !                 [RF] Source reformatted and very minor bug removed: 02.09.2004
0014  !                     [RF] Added teleportation, also minor bug fixes: 21.03.2006
0015  ! ------------------------------------------------------------------------------
0016   
0017  ! Constant TEST_VERSION;
0018   
0019  Constant Story "ADVENTURE";
0020  Constant Headline
0021      "^The Interactive Original^
0022        By Will Crowther (1976) and Don Woods (1977)^
0023        Reconstructed in three steps by:^
0024        Donald Ekman, David M. Baggett (1993) and Graham Nelson (1994)^
0025        [In memoriam Stephen Bishop (1820?-1857): GN]^^";
0026  Serial "060321";
0027  Release 9;
0028   
0029  ! Adventure's IFID -- see http://babel.ifarchive.org/
0030  Array UUID_ARRAY string "UUID://E9FD3D87-DD2F-4005-B332-23557780B64E//"; #Ifdef UUID_ARRAY; #Endif;
0031   
0032  Constant AMUSING_PROVIDED;
0033  Constant MAX_CARRIED   = 7;
0034  Constant MAX_SCORE     = 350;
0035  Constant MAX_TREASURES = 15;
0036   
0037  Include "Parser";
0038  Include "VerbLib";
0039   
0040  Attribute nodwarf;                      ! Room is no-go area for dwarves
0041  Attribute treasure_found;               ! Treasure object has been found
0042  Attribute multitude;                    ! Used only by COUNT
0043   
0044  Global caves_closed;                    ! true when cave is closing
0045  Global canyon_from;                     ! Which canyon to return to
0046  Global treasures_found;                 ! Count of treasures found
0047  Global deaths;                          ! Counts of deaths/resurrections
0048  Global dark_warning;                    ! true after warning about dark pits
0049  Global feefie_count;                    ! fee/fie/foe/foo sequencer
0050   
0051  ! ------------------------------------------------------------------------------
0052  !   Rules for treasures, which will be scattered all over the game
0053  ! ------------------------------------------------------------------------------
0054   
0055  Class   Treasure
0056    with  after [;
0057            Take:
0058              if (location == Inside_Building)
0059                  score = score - self.depositpoints;
0060              score = score + 5;
0061              if (noun hasnt treasure_found) {
0062                  give noun treasure_found;
0063                  treasures_found++;
0064                  score = score + 2;
0065              }
0066              "Taken!";
0067            Insert:
0068              score = score - 5;  ! (in case put inside the wicker cage)
0069            Drop:
0070              score = score - 5;
0071              if (location == Inside_Building) {
0072                  score = score + self.depositpoints;
0073                  "Safely deposited.";
0074              }
0075          ],
0076          depositpoints 10;
0077   
0078  ! ------------------------------------------------------------------------------
0079  !   The outside world
0080  ! ------------------------------------------------------------------------------
0081   
0082  Class   Room;
0083   
0084  Class   Aboveground
0085    class Room
0086    has   light nodwarf;
0087   
0088  Class   Scenic
0089    has   scenery;
0090   
0091  Aboveground At_End_Of_Road "At End Of Road"
0092    with  name 'end' 'of' 'road' 'street' 'path' 'gully',
0093          description
0094              "You are standing at the end of a road before a small brick building.
0095               Around you is a forest.
0096               A small stream flows out of the building and down a gully.",
0097          w_to At_Hill_In_Road,
0098          u_to At_Hill_In_Road,
0099          e_to Inside_Building,
0100          d_to In_A_Valley,
0101          s_to In_A_Valley,
0102          n_to In_Forest_1,
0103          in_to Inside_Building;
0104   
0105  Scenic  "well house"
0106    with  name 'well' 'house' 'brick' 'building' 'small' 'wellhouse',
0107          description "It's a small brick building. It seems to be a well house.",
0108          found_in At_End_Of_Road At_Hill_In_Road Inside_Building,
0109          before [;
0110            Enter:
0111              if (location == At_Hill_In_Road && Inside_Building hasnt visited)
0112                  "It's too far away.";
0113              <<Teleport Inside_Building>>;
0114          ];
0115   
0116  Scenic  Stream "stream"
0117    with  name 'stream' 'water' 'brook' 'river' 'lake' 'small' 'tumbling'
0118               'splashing' 'babbling' 'rushing' 'reservoir',
0119          found_in At_End_Of_Road In_A_Valley At_Slit_In_Streambed In_Pit
0120                   In_Cavern_With_Waterfall At_Reservoir Inside_Building,
0121          before [;
0122            Drink:
0123              "You have taken a drink from the stream.
0124               The water tastes strongly of minerals, but is not unpleasant.
0125               It is extremely cold.";
0126            Take:
0127              if (bottle notin player)
0128                  "You have nothing in which to carry the water.";
0129              <<Fill bottle>>;
0130            Insert:
0131              if (second == bottle) <<Fill bottle>>;
0132              "You have nothing in which to carry the water.";
0133            Receive:
0134              if (noun == ming_vase) {
0135                  remove ming_vase;
0136                  move shards to location;
0137                  score = score - 5;
0138                  "The sudden change in temperature has delicately shattered the vase.";
0139              }
0140              if (noun == bottle) <<Fill bottle>>;
0141              remove noun;
0142              if (noun ofclass Treasure) score = score - 5;
0143              print_ret (The) noun, " washes away with the stream.";
0144          ];
0145   
0146  Scenic  "road"
0147    with  name 'road' 'street' 'path' 'dirt',
0148          description "The road is dirt, not yellow brick.",
0149          found_in At_End_Of_Road At_Hill_In_Road In_Forest_2;
0150   
0151  Scenic  "forest"
0152    with  name 'forest' 'tree' 'trees' 'oak' 'maple' 'grove' 'pine' 'spruce'
0153               'birch' 'ash' 'saplings' 'bushes' 'leaves' 'berry' 'berries'
0154               'hardwood',
0155          description
0156              "The trees of the forest are large hardwood oak and maple,
0157               with an occasional grove of pine or spruce.
0158               There is quite a bit of undergrowth,
0159               largely birch and ash saplings plus nondescript bushes of various sorts.
0160               This time of year visibility is quite restricted by all the leaves,
0161               but travel is quite easy if you detour around the spruce and berry bushes.",
0162          found_in At_End_Of_Road At_Hill_In_Road In_A_Valley In_Forest_1 In_Forest_2,
0163    has   multitude;
0164   
0165  ! ------------------------------------------------------------------------------
0166   
0167  Aboveground At_Hill_In_Road "At Hill In Road"
0168    with  name 'hill' 'in' 'road',
0169          description
0170              "You have walked up a hill, still in the forest.
0171               The road slopes back down the other side of the hill.
0172               There is a building in the distance.",
0173          e_to At_End_Of_Road,
0174          n_to At_End_Of_Road,
0175          d_to At_End_Of_Road,
0176          s_to In_Forest_1;
0177   
0178  Scenic  -> "hill"
0179    with  name 'hill' 'bump' 'incline',
0180          description "It's just a typical hill.";
0181   
0182  Scenic  -> "other side of hill"
0183    with  name 'side' 'other' 'of',
0184          article "the",
0185          description "Why not explore it yourself?";
0186   
0187  ! ------------------------------------------------------------------------------
0188   
0189  Aboveground Inside_Building "Inside Building"
0190    with  name 'inside' 'building' 'well' 'house' 'wellhouse',
0191          description
0192              "You are inside a building, a well house for a large spring.",
0193          cant_go
0194              "The stream flows out through a pair of 1 foot diameter sewer pipes.
0195               The only exit is to the west.",
0196          before [;
0197            Enter:
0198              if (noun == Spring or SewerPipes)
0199                  "The stream flows out through a pair of 1 foot diameter sewer pipes.
0200                   It would be advisable to use the exit.";
0201            Xyzzy:
0202              if (In_Debris_Room hasnt visited) rfalse;
0203              PlayerTo(In_Debris_Room);
0204              rtrue;
0205            Plugh:
0206              if (At_Y2 hasnt visited) rfalse;
0207              PlayerTo(At_Y2);
0208              rtrue;
0209          ],
0210          w_to At_End_Of_Road,
0211          out_to At_End_Of_Road,
0212          in_to "The pipes are too small.";
0213   
0214  Scenic  -> Spring "spring"
0215    with  name 'spring' 'large',
0216          description
0217              "The stream flows out through a pair of 1 foot diameter sewer pipes.";
0218   
0219  Scenic  -> SewerPipes "pair of 1 foot diameter sewer pipes"
0220    with  name 'pipes' 'pipe' 'one' 'foot' 'diameter' 'sewer' 'sewer-pipes',
0221          description "Too small. The only exit is to the west.";
0222   
0223  Object  -> set_of_keys "set of keys"
0224    with  name 'keys' 'key' 'keyring' 'set' 'of' 'bunch',
0225          description "It's just a normal-looking set of keys.",
0226          initial "There are some keys on the ground here.",
0227          before [;
0228            Count:
0229              "A dozen or so keys.";
0230          ];
0231   
0232  Object  -> tasty_food "tasty food"
0233    with  name 'food' 'ration' 'rations' 'tripe' 'yummy' 'tasty' 'delicious' 'scrumptious',
0234          article "some",
0235          description "Sure looks yummy!",
0236          initial "There is tasty food here.",
0237          after [;
0238            Eat:
0239              "Delicious!";
0240          ],
0241    has   edible;
0242   
0243  Object  -> brass_lantern "brass lantern"
0244    with  name 'lamp' 'headlamp' 'headlight' 'lantern' 'light' 'shiny' 'brass',
0245          when_off "There is a shiny brass lamp nearby.",
0246          when_on "Your lamp is here, gleaming brightly.",
0247          daemon [ t;
0248              if (self hasnt on) {
0249                  StopDaemon(self);
0250                  rtrue;
0251              }
0252              t = --(self.power_remaining);
0253              if (t == 0) give self ~on ~light;
0254              if (self in player || self in location) {
0255                  if (t == 0) {
0256                      print "Your lamp has run out of power.";
0257                      if (fresh_batteries notin player && location hasnt light) {
0258                          deadflag = 3;
0259                          " You can't explore the cave without a lamp.
0260                           So let's just call it a day.";
0261                      }
0262                      else
0263                          self.replace_batteries();
0264                      new_line;
0265                      rtrue;
0266                  }
0267                  if (t == 30) {
0268                      print "Your lamp is getting dim.";
0269                      if (fresh_batteries.have_been_used)
0270                          " You're also out of spare batteries.
0271                           You'd best start wrapping this up.";
0272                      if (fresh_batteries in VendingMachine && Dead_End_14 has visited)
0273                          " You'd best start wrapping this up,
0274                           unless you can find some fresh batteries.
0275                           I seem to recall there's a vending machine in the maze.
0276                           Bring some coins with you.";
0277                      if (fresh_batteries notin VendingMachine or player or location)
0278                          " You'd best go back for those batteries.";
0279                      new_line;
0280                      rtrue;
0281                  }
0282              }
0283          ],
0284          before [;
0285            Examine:
0286              print "It is a shiny brass lamp";
0287              if (self hasnt on) ". It is not currently lit.";
0288              if (self.power_remaining < 30) ", glowing dimly.";
0289              ", glowing brightly.";
0290            Burn:
0291              <<SwitchOn self>>;
0292            Rub:
0293              "Rubbing the electric lamp is not particularly rewarding.
0294               Anyway, nothing exciting happens.";
0295            SwitchOn:
0296              if (self.power_remaining <= 0)
0297                  "Unfortunately, the batteries seem to be dead.";
0298            Receive:
0299              if (noun == old_batteries)
0300                  "Those batteries are dead; they won't do any good at all.";
0301              if (noun == fresh_batteries) {
0302                  self.replace_batteries();
0303                  rtrue;
0304              }
0305              "The only thing you might successfully put in the lamp
0306               is a fresh pair of batteries.";
0307          ],
0308          after [;
0309            SwitchOn:
0310              give self light;
0311              StartDaemon(self);
0312            SwitchOff:
0313              give self ~light;
0314          ],
0315          replace_batteries [;
0316              if (fresh_batteries in player or location) {
0317                  remove fresh_batteries;
0318                  fresh_batteries.have_been_used = true;
0319                  move old_batteries to location;
0320                  self.power_remaining = 2500;
0321                  "I'm taking the liberty of replacing the batteries.";
0322              }
0323          ],
0324          power_remaining 330,
0325    has   switchable;
0326   
0327  Object  -> bottle "small bottle"
0328    with  name 'bottle' 'jar' 'flask',
0329          initial "There is an empty bottle here.",
0330          before [;
0331            LetGo:
0332              if (noun in bottle)
0333                  "You're holding that already (in the bottle).";
0334            Receive:
0335              if (noun == stream or Oil)
0336                  <<Fill self>>;
0337              else
0338                  "The bottle is only supposed to hold liquids.";
0339            Fill:
0340              if (child(bottle) ~= nothing)
0341                  "The bottle is full already.";
0342              if (stream in location || Spring in location) {
0343                  move water_in_the_bottle to bottle;
0344                  "The bottle is now full of water.";
0345              }
0346              if (Oil in location) {
0347                  move oil_in_the_bottle to bottle;
0348                  "The bottle is now full of oil.";
0349              }
0350              "There is nothing here with which to fill the bottle.";
0351            Empty:
0352              if (child(bottle) == nothing)
0353                  "The bottle is already empty!";
0354              remove child(bottle);
0355              "Your bottle is now empty and the ground is now wet.";
0356          ],
0357    has   container open;
0358   
0359  Object  water_in_the_bottle "bottled water"
0360    with  name 'bottled' 'water' 'h2o',
0361          article "some",
0362          description "It looks like ordinary water to me.",
0363          before [;
0364            Drink:
0365              remove water_in_the_bottle;
0366              <<Drink Stream>>;
0367          ];
0368   
0369  Object  oil_in_the_bottle "bottled oil"
0370    with  name 'oil' 'bottled' 'lubricant' 'grease',
0371          article "some",
0372          description "It looks like ordinary oil to me.",
0373          before [;
0374            Drink:
0375              <<Drink Oil>>;
0376          ];
0377   
0378  ! ------------------------------------------------------------------------------
0379   
0380  Aboveground In_Forest_1 "In Forest"
0381    with  name 'forest',
0382          description "You are in open forest, with a deep valley to one side.",
0383          e_to In_A_Valley,
0384          d_to In_A_Valley,
0385          n_to In_Forest_1,
0386          w_to In_Forest_1,
0387          s_to In_Forest_1,
0388          initial [;
0389              if (random(2) == 1) PlayerTo(In_Forest_2, 1);
0390          ];
0391   
0392  Aboveground In_Forest_2 "In Forest"
0393    with  description "You are in open forest near both a valley and a road.",
0394          n_to At_End_Of_Road,
0395          e_to In_A_Valley,
0396          w_to In_A_Valley,
0397          d_to In_A_Valley,
0398          s_to In_Forest_1;
0399   
0400  Aboveground In_A_Valley "In A Valley"
0401    with  description
0402              "You are in a valley in the forest beside a stream tumbling along a rocky bed.",
0403          n_to At_End_Of_Road,
0404          e_to In_Forest_1,
0405          w_to In_Forest_1,
0406          u_to In_Forest_1,
0407          s_to At_Slit_In_Streambed,
0408          d_to At_Slit_In_Streambed,
0409          name 'valley';
0410   
0411  Scenic  -> "streambed"
0412    with  name 'bed' 'streambed' 'rock' 'small' 'rocky' 'bare' 'dry';
0413   
0414  ! ------------------------------------------------------------------------------
0415   
0416  Aboveground At_Slit_In_Streambed "At Slit In Streambed"
0417    with  name 'slit' 'in' 'streambed',
0418          description
0419              "At your feet all the water of the stream splashes into a 2-inch slit in the rock.
0420               Downstream the streambed is bare rock.",
0421          n_to In_A_Valley,
0422          e_to In_Forest_1,
0423          w_to In_Forest_1,
0424          s_to Outside_Grate,
0425          d_to "You don't fit through a two-inch slit!",
0426          in_to "You don't fit through a two-inch slit!";
0427   
0428  Scenic  -> "2-inch slit"
0429    with  name 'slit' 'two' 'inch' '2-inch',
0430          description
0431              "It's just a 2-inch slit in the rock, through which the stream is flowing.",
0432          before [;
0433            Enter:
0434              "You don't fit through a two-inch slit!";
0435          ];
0436   
0437  ! ------------------------------------------------------------------------------
0438   
0439  Aboveground Outside_Grate "Outside Grate"
0440    with  name 'outside' 'grate',
0441          description
0442              "You are in a 20-foot depression floored with bare dirt.
0443               Set into the dirt is a strong steel grate mounted in concrete.
0444               A dry streambed leads into the depression.",
0445          e_to In_Forest_1,
0446          w_to In_Forest_1,
0447          s_to In_Forest_1,
0448          n_to At_Slit_In_Streambed,
0449          d_to [;
0450              if (Grate hasnt locked && Grate hasnt open) {
0451                  print "(first opening the grate)^";
0452                  give Grate open;
0453              }
0454              return Grate;
0455          ];
0456   
0457  Scenic  -> "20-foot depression"
0458    with  name 'depression' 'dirt' 'twenty' 'foot' 'bare' '20-foot',
0459          description "You're standing in it.";
0460   
0461  Object  -> Grate "steel grate"
0462    with  name 'grate' 'lock' 'gate' 'grille' 'metal' 'strong' 'steel' 'grating',
0463          description "It just looks like an ordinary grate mounted in concrete.",
0464          with_key set_of_keys,
0465          door_dir [;
0466              if (location == Below_The_Grate) return u_to;
0467              return d_to;
0468          ],
0469          door_to [;
0470              if (location == Below_The_Grate) return Outside_Grate;
0471              return Below_The_Grate;
0472          ],
0473          describe [;
0474              if (self has open) "^The grate stands open.";
0475              if (self hasnt locked) "^The grate is unlocked but shut.";
0476              rtrue;
0477          ],
0478          found_in Below_The_Grate Outside_Grate,
0479    has   static door openable lockable locked;
0480   
0481  ! ------------------------------------------------------------------------------
0482  !   Facilis descensus Averno...
0483  ! ------------------------------------------------------------------------------
0484   
0485  Room    Below_The_Grate "Below the Grate"
0486    with  name 'below' 'grate',
0487          description
0488              "You are in a small chamber beneath a 3x3 steel grate to the surface.
0489               A low crawl over cobbles leads inward to the west.",
0490          w_to In_Cobble_Crawl,
0491          u_to Grate,
0492    has   light;
0493   
0494  Scenic  "cobbles"
0495    with  name 'cobble' 'cobbles' 'cobblestones' 'cobblestone' 'stones' 'stone',
0496          description "They're just ordinary cobbles.",
0497          found_in In_Cobble_Crawl In_Debris_Room Below_The_Grate,
0498    has   multitude;
0499   
0500  ! ------------------------------------------------------------------------------
0501   
0502  Room    In_Cobble_Crawl "In Cobble Crawl"
0503    with  name 'cobble' 'crawl',
0504          description
0505              "You are crawling over cobbles in a low passage.
0506               There is a dim light at the east end of the passage.",
0507          e_to Below_The_Grate,
0508          w_to In_Debris_Room,
0509    has   light;
0510   
0511  Object  -> wicker_cage "wicker cage"
0512    with  name 'cage' 'small' 'wicker',
0513          description "It's a small wicker cage.",
0514          initial "There is a small wicker cage discarded nearby.",
0515          after [;
0516            Open:
0517              if (little_bird notin self) rfalse;
0518              print "(releasing the little bird)^";
0519              <<Release little_bird>>;
0520          ],
0521    has   container open openable transparent;
0522   
0523  ! ------------------------------------------------------------------------------
0524   
0525  Room    In_Debris_Room "In Debris Room"
0526    with  name 'debris' 'room',
0527          description
0528              "You are in a debris room filled with stuff washed in from the surface.
0529               A low wide passage with cobbles becomes plugged with mud and debris here,
0530               but an awkward canyon leads upward and west.
0531               ^^
0532               A note on the wall says, ~Magic word XYZZY.~",
0533          e_to In_Cobble_Crawl,
0534          u_to In_Awkward_Sloping_E_W_Canyon,
0535          w_to In_Awkward_Sloping_E_W_Canyon,
0536          before [;
0537            Xyzzy:
0538              PlayerTo(Inside_Building);
0539              rtrue;
0540          ],
0541    has   nodwarf;
0542   
0543  Scenic  -> "debris"
0544    with  name 'debris' 'stuff' 'mud',
0545          description "Yuck.";
0546   
0547  Scenic  -> "note"
0548    with  name 'note',
0549          description "The note says ~Magic word XYZZY~.";
0550   
0551  Object  -> black_rod "black rod with a rusty star on the end"
0552    with  name 'rod' 'star' 'black' 'rusty' 'star' 'three' 'foot' 'iron',
0553          description "It's a three foot black rod with a rusty star on an end.",
0554          initial
0555              "A three foot black rod with a rusty star on one end lies nearby.",
0556          before [;
0557            Wave:
0558              if (location == West_Side_Of_Fissure or On_East_Bank_Of_Fissure) {
0559                  if (caves_closed) "Peculiar. Nothing happens.";
0560                  if (CrystalBridge notin nothing) {
0561                      remove CrystalBridge;
0562                      give CrystalBridge absent;
0563                      West_Side_Of_Fissure.e_to = nothing;
0564                      On_East_Bank_Of_Fissure.w_to = nothing;
0565                      "The crystal bridge has vanished!";
0566                  }
0567                  else {
0568                      move CrystalBridge to location;
0569                      give CrystalBridge ~absent;
0570                      West_Side_Of_Fissure.e_to = CrystalBridge;
0571                      On_East_Bank_Of_Fissure.w_to = CrystalBridge;
0572                      "A crystal bridge now spans the fissure.";
0573                  }
0574              }
0575              "Nothing happens.";
0576          ];
0577   
0578  ! ------------------------------------------------------------------------------
0579   
0580  Room    In_Awkward_Sloping_E_W_Canyon "Sloping E/W Canyon"
0581    with  name 'sloping' 'e/w' 'canyon',
0582          description "You are in an awkward sloping east/west canyon.",
0583          d_to In_Debris_Room,
0584          e_to In_Debris_Room,
0585          u_to In_Bird_Chamber,
0586          w_to In_Bird_Chamber,
0587    has   nodwarf;
0588   
0589  ! ------------------------------------------------------------------------------
0590  !   The little bird in its natural habitat
0591  ! ------------------------------------------------------------------------------
0592   
0593  Room    In_Bird_Chamber "Orange River Chamber"
0594    with  name 'orange' 'river' 'chamber',
0595          description
0596              "You are in a splendid chamber thirty feet high.
0597               The walls are frozen rivers of orange stone.
0598               An awkward canyon and a good passage exit from east and west sides of the chamber.",
0599          e_to In_Awkward_Sloping_E_W_Canyon,
0600          w_to At_Top_Of_Small_Pit,
0601    has   nodwarf;
0602   
0603  Object  -> little_bird "little bird"
0604    with  name 'cheerful' 'mournful' 'little' 'bird',
0605          initial "A cheerful little bird is sitting here singing.",
0606          before [;
0607            Examine:
0608              if (self in wicker_cage)
0609                  "The little bird looks unhappy in the cage.";
0610              "The cheerful little bird is sitting here singing.";
0611            Insert:
0612              if (second == wicker_cage)
0613                  <<Catch self>>;
0614              else
0615                  "Don't put the poor bird in ", (the) second, "!";
0616            Drop, Remove:
0617              if (self in wicker_cage) {
0618                  print "(The bird is released from the cage.)^^";
0619                  <<Release self>>;
0620              }
0621            Take, Catch:
0622              if (self in wicker_cage)
0623                  "You already have the little bird.
0624                   If you take it out of the cage it will likely fly away from you.";
0625              if (wicker_cage notin player)
0626                  "You can catch the bird, but you cannot carry it.";
0627              if (black_rod in player)
0628                  "The bird was unafraid when you entered,
0629                   but as you approach it becomes disturbed and you cannot catch it.";
0630              move self to wicker_cage;
0631              give wicker_cage ~open;
0632              "You catch the bird in the wicker cage.";
0633            Release:
0634              if (self notin wicker_cage)
0635                  "The bird is not caged now.";
0636              give wicker_cage open;
0637              move self to location;
0638              if (Snake in location) {
0639                  remove Snake;
0640                  "The little bird attacks the green snake,
0641                   and in an astounding flurry drives the snake away.";
0642              }
0643              if (Dragon in location) {
0644                  remove self;
0645                  "The little bird attacks the green dragon,
0646                   and in an astounding flurry gets burnt to a cinder.
0647                   The ashes blow away.";
0648              }
0649              "The little bird flies free.";
0650          ],
0651          life [;
0652            Give:
0653              "It's not hungry. (It's merely pinin' for the fjords).
0654               Besides, I suspect it would prefer bird seed.";
0655            Order, Ask, Answer:
0656              "Cheep! Chirp!";
0657            Attack:
0658              if (self in wicker_cage)
0659                  "Oh, leave the poor unhappy bird alone.";
0660              remove self;
0661              "The little bird is now dead. Its body disappears.";
0662          ],
0663    has   animate;
0664   
0665  ! ------------------------------------------------------------------------------
0666   
0667  Room    At_Top_Of_Small_Pit "At Top of Small Pit"
0668    with  name 'top' 'of' 'small' 'pit',
0669          description
0670              "At your feet is a small pit breathing traces of white mist.
0671               A west passage ends here except for a small crack leading on.
0672               ^^
0673               Rough stone steps lead down the pit.",
0674          e_to In_Bird_Chamber,
0675          w_to "The crack is far too small for you to follow.",
0676          d_to [;
0677              if (large_gold_nugget in player) {
0678                  deadflag = 1;
0679                  "You are at the bottom of the pit with a broken neck.";
0680              }
0681              return In_Hall_Of_Mists;
0682          ],
0683          before [;
0684            Enter:
0685              if (noun == PitCrack)
0686                  "The crack is far too small for you to follow.";
0687          ],
0688    has   nodwarf;
0689   
0690  Scenic  -> "small pit"
0691    with  name 'pit' 'small',
0692          description "The pit is breathing traces of white mist.";
0693   
0694  Scenic  -> PitCrack "crack"
0695    with  name 'crack' 'small',
0696          description "The crack is very small -- far too small for you to follow.";
0697   
0698  Scenic  "mist"
0699    with  name 'mist' 'vapor' 'wisps' 'white',
0700          description
0701              "Mist is a white vapor, usually water, seen from time to time in caverns.
0702               It can be found anywhere but is frequently a sign of a deep pit leading down to water.",
0703          found_in
0704              At_Top_Of_Small_Pit In_Hall_Of_Mists On_East_Bank_Of_Fissure
0705              At_Window_On_Pit_1 At_West_End_Of_Hall_Of_Mists In_Misty_Cavern
0706              In_Mirror_Canyon At_Reservoir At_Window_On_Pit_2 On_Sw_Side_Of_Chasm;
0707   
0708  ! ------------------------------------------------------------------------------
0709  !   The caves open up: The Hall of Mists
0710  ! ------------------------------------------------------------------------------
0711   
0712  Room    In_Hall_Of_Mists "In Hall of Mists"
0713    with  name 'hall' 'of' 'mists',
0714          description
0715              "You are at one end of a vast hall stretching forward out of sight to the west.
0716               There are openings to either side.
0717               Nearby, a wide stone staircase leads downward.
0718               The hall is filled with wisps of white mist swaying to and fro almost as if alive.
0719               A cold wind blows up the staircase.
0720               There is a passage at the top of a dome behind you.
0721               ^^
0722               Rough stone steps lead up the dome.",
0723          initial [;
0724              if (self has visited) rfalse;
0725              score = score + 25;
0726          ],
0727          s_to In_Nugget_Of_Gold_Room,
0728          w_to On_East_Bank_Of_Fissure,
0729          d_to In_Hall_Of_Mt_King,
0730          n_to In_Hall_Of_Mt_King,
0731          u_to [;
0732              if (large_gold_nugget in player) "The dome is unclimbable.";
0733              return At_Top_Of_Small_Pit;
0734          ];
0735   
0736  Scenic  -> "wide stone staircase"
0737    with  name 'stair' 'stairs' 'staircase' 'wide' 'stone',
0738          description "The staircase leads down.";
0739   
0740  Scenic  -> "rough stone steps"
0741    with  name 'stair' 'stairs' 'staircase' 'rough' 'stone',
0742          description "The rough stone steps lead up the dome.",
0743    has   multitude;
0744   
0745  Scenic  -> "dome"
0746    with  name 'dome',
0747          before [;
0748            Examine:
0749              if (large_gold_nugget in player)
0750                  "I'm not sure you'll be able to get up it with what you're
0751                   carrying.";
0752              "It looks like you might be able to climb up it.";
0753            Climb:
0754              MovePlayer(u_obj);
0755              rtrue;
0756          ];
0757   
0758  ! ------------------------------------------------------------------------------
0759   
0760  Room    In_Nugget_Of_Gold_Room "Low Room"
0761    with  name 'low' 'room',
0762          description
0763              "This is a low room with a crude note on the wall:
0764               ^^
0765               ~You won't get it up the steps~.",
0766          n_to In_Hall_Of_Mists;
0767   
0768  Scenic  -> "note"
0769    with  name 'note' 'crude',
0770          description "The note says, ~You won't get it up the steps~.";
0771   
0772  Treasure -> large_gold_nugget "large gold nugget"
0773    with  name 'gold' 'nugget' 'large' 'heavy',
0774          description "It's a large sparkling nugget of gold!",
0775          initial "There is a large sparkling nugget of gold here!";
0776   
0777  ! ------------------------------------------------------------------------------
0778   
0779  Class   FissureRoom
0780    class Room
0781    with  before [;
0782            Jump:
0783              if (CrystalBridge hasnt absent)
0784                  "I respectfully suggest you go across the bridge instead of jumping.";
0785              deadflag = 1;
0786              "You didn't make it.";
0787          ],
0788          d_to "The fissure is too terrifying!";
0789   
0790  FissureRoom On_East_Bank_Of_Fissure "On East Bank of Fissure"
0791    with  name 'east' 'e//' 'bank' 'side' 'of' 'fissure',
0792          description
0793              "You are on the east bank of a fissure slicing clear across the hall.
0794               The mist is quite thick here, and the fissure is too wide to jump.",
0795          e_to In_Hall_Of_Mists,
0796          w_to "The fissure is too wide.";
0797   
0798  FissureRoom West_Side_Of_Fissure "West Side of Fissure"
0799    with  name 'west' 'w//' 'bank' 'side' 'of' 'fissure',
0800          description
0801              "You are on the west side of the fissure in the hall of mists.",
0802          w_to At_West_End_Of_Hall_Of_Mists,
0803          e_to "The fissure is too wide.",
0804          n_to At_West_End_Of_Hall_Of_Mists,
0805          before [;
0806            Go:
0807              if (location == West_Side_Of_Fissure && noun == n_obj)
0808                  print
0809                      "You have crawled through a very low wide passage
0810                       parallel to and north of the hall of mists.^";
0811          ];
0812   
0813  Treasure -> "diamonds"
0814    with  name 'diamond' 'diamonds' 'several' 'high' 'quality',
0815          article "some",
0816          description "They look to be of the highest quality!",
0817          initial "There are diamonds here!",
0818    has   multitude;
0819   
0820  Object  CrystalBridge "crystal bridge"
0821    with  name 'crystal' 'bridge',
0822          description "It spans the fissure, thereby providing you a way across.",
0823          initial "A crystal bridge now spans the fissure.",
0824          door_dir [;
0825              if (location == West_Side_Of_Fissure) return e_to;
0826              return w_to;
0827          ],
0828          door_to [;
0829              if (location == West_Side_Of_Fissure) return On_East_Bank_Of_Fissure;
0830              return West_Side_Of_Fissure;
0831          ],
0832          found_in On_East_Bank_Of_Fissure West_Side_Of_Fissure,
0833    has   static door open absent;
0834   
0835  Scenic  "fissure"
0836    with  name 'wide' 'fissure',
0837          description "The fissure looks far too wide to jump.",
0838          found_in On_East_Bank_Of_Fissure West_Side_Of_Fissure;
0839   
0840  ! ------------------------------------------------------------------------------
0841   
0842  Room    At_West_End_Of_Hall_Of_Mists "At West End of Hall of Mists"
0843    with  name 'west' 'w//' 'end' 'of' 'hall' 'mists',
0844          description
0845              "You are at the west end of the hall of mists.
0846               A low wide crawl continues west and another goes north.
0847               To the south is a little passage 6 feet off the floor.",
0848          s_to Alike_Maze_1,
0849          u_to Alike_Maze_1,
0850          e_to West_Side_Of_Fissure,
0851          w_to At_East_End_Of_Long_Hall,
0852          n_to West_Side_Of_Fissure,
0853          before [;
0854            Go:
0855              if (noun == n_obj)
0856                  print
0857                      "You have crawled through a very low wide passage
0858                       parallel to and north of the hall of mists.^";
0859          ];
0860   
0861  ! ------------------------------------------------------------------------------
0862  !   Long Hall to the west of the Hall of Mists
0863  ! ------------------------------------------------------------------------------
0864   
0865  Room    At_East_End_Of_Long_Hall "At East End of Long Hall"
0866    with  name 'east' 'e//' 'end' 'of' 'long' 'hall',
0867          description
0868              "You are at the east end of a very long hall apparently without side chambers.
0869               To the east a low wide crawl slants up.
0870               To the north a round two foot hole slants down.",
0871          e_to At_West_End_Of_Hall_Of_Mists,
0872          u_to At_West_End_Of_Hall_Of_Mists,
0873          w_to At_West_End_Of_Long_Hall,
0874          n_to Crossover,
0875          d_to Crossover;
0876   
0877  ! ------------------------------------------------------------------------------
0878   
0879  Room    At_West_End_Of_Long_Hall "At West End of Long Hall"
0880    with  name 'west' 'w//' 'end' 'of' 'long' 'hall',
0881          description
0882              "You are at the west end of a very long featureless hall.
0883               The hall joins up with a narrow north/south passage.",
0884          e_to At_East_End_Of_Long_Hall,
0885          s_to Different_Maze_1,
0886          n_to Crossover;
0887   
0888  ! ------------------------------------------------------------------------------
0889   
0890  Room    Crossover "N/S and E/W Crossover"
0891    with  name 'n/s' 'and' 'e/w' 'crossover',
0892          description
0893              "You are at a crossover of a high N/S passage and a low E/W one.",
0894          w_to At_East_End_Of_Long_Hall,
0895          n_to Dead_End_7,
0896          e_to In_West_Side_Chamber,
0897          s_to At_West_End_Of_Long_Hall;
0898   
0899  Scenic  -> "crossover"
0900    with  name 'crossover' 'over' 'cross',
0901          description "You know as much as I do at this point.";
0902   
0903  ! ------------------------------------------------------------------------------
0904  !   Many Dead Ends will be needed for the maze below, so define a class:
0905  ! ------------------------------------------------------------------------------
0906   
0907  Class   DeadendRoom
0908    with  short_name "Dead End",
0909          description "You have reached a dead end.",
0910          cant_go "You'll have to go back the way you came.";
0911   
0912  DeadendRoom Dead_End_7
0913    with  s_to Crossover,
0914          out_to Crossover;
0915   
0916  ! ------------------------------------------------------------------------------
0917  !   The Hall of the Mountain King and side chambers
0918  ! ------------------------------------------------------------------------------
0919   
0920  Room    In_Hall_Of_Mt_King "Hall of the Mountain King"
0921    with  name 'hall' 'of' 'mountain' 'king',
0922          description
0923              "You are in the hall of the mountain king, with passages off in all directions.",
0924          cant_go "Well, perhaps not quite all directions.",
0925          u_to In_Hall_Of_Mists,
0926          e_to In_Hall_Of_Mists,
0927          n_to Low_N_S_Passage,
0928          s_to In_South_Side_Chamber,
0929          w_to In_West_Side_Chamber,
0930          sw_to In_Secret_E_W_Canyon,
0931          before [;
0932            Go:
0933              if (Snake in self && (noun == n_obj or s_obj or w_obj ||
0934                                   (noun == sw_obj && random(100) <= 35)))
0935                  "You can't get by the snake.";
0936          ];
0937   
0938  Object  -> Snake "snake"
0939    with  name 'snake' 'cobra' 'asp' 'huge' 'fierce' 'green' 'ferocious'
0940               'venemous' 'venomous' 'large' 'big' 'killer',
0941          description "I wouldn't mess with it if I were you.",
0942          initial "A huge green fierce snake bars the way!",
0943          life [;
0944            Order, Ask, Answer:
0945              "Hiss!";
0946            ThrowAt:
0947              if (noun == axe) <<Attack self>>;
0948              <<Give noun self>>;
0949            Give:
0950              if (noun == little_bird) {
0951                  remove little_bird;
0952                  "The snake has now devoured your bird.";
0953              }
0954              "There's nothing here it wants to eat (except perhaps you).";
0955            Attack:
0956              "Attacking the snake both doesn't work and is very dangerous.";
0957            Take:
0958              deadflag = 1;
0959              "It takes you instead. Glrp!";
0960          ],
0961    has   animate;
0962   
0963  ! ------------------------------------------------------------------------------
0964   
0965  Room    Low_N_S_Passage "Low N/S Passage"
0966    with  name 'low' 'n/s' 'passage',
0967          description
0968              "You are in a low N/S passage at a hole in the floor.
0969               The hole goes down to an E/W passage.",
0970          s_to In_Hall_Of_Mt_King,
0971          d_to In_Dirty_Passage,
0972          n_to At_Y2;
0973   
0974  Treasure -> "bars of silver"
0975    with  name 'silver' 'bars',
0976          article "some",
0977          description "They're probably worth a fortune!",
0978          initial "There are bars of silver here!";
0979   
0980  ! ------------------------------------------------------------------------------
0981   
0982  Room    In_South_Side_Chamber "In South Side Chamber"
0983    with  name 'south' 's//''side' 'chamber',
0984          description "You are in the south side chamber.",
0985          n_to In_Hall_Of_Mt_King;
0986   
0987  Treasure -> "precious jewelry"
0988    with  name 'jewel' 'jewels' 'jewelry' 'precious' 'exquisite',
0989          article "some",
0990          description "It's all quite exquisite!"