Inform - Resources - Examples

Back to List

Inventory
Complete

Plain
Coloured
Gaudy

Browsing Ruins.inf

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

001  Constant Story "RUINS";
002  Constant Headline "^An Interactive Worked Example^
003                      Copyright (c) 1999 by Angela M. Horns.^";
004   
005  ! ---------------------------------------------------------------------------- !
006  !       This version recreated by Roger Firth in May 2001, using the simple
007  !       (albeit time-consuming) process of combining the various fragments
008  !       of "Ruins" quoted in Edition 4/1 of the Inform Designer's Manual.
009  !       
010  !                       PLAYER
011  !                             lamp,dictionary,map
012  !                       GREAT PLAZA
013  !                           | mushroom,packing-case,camera,newspaper,steps
014  !                           |
015  !                           |
016  !                       SQUARE CHAMBER -------------------- WORMCAST
017  !                           | inscriptions,sunlight,(key)         eggsac
018  !                           |
019  !                           |
020  !                       STOOPED CORRIDOR
021  !                           | statuette,door
022  !                           |
023  !                           |
024  !   UPPER CANYON        SHRINE
025  !       | ball           /     \ paintings,altar,mask,(priest)
026  !       |     ----------         ----------
027  !       |   /                               \
028  !   XIBALBÁ                                 ANTECHAMBER
029  !       | stela                                 | cage,skeletons,(warthog)
030  !       |                                       |
031  !       |                                       |
032  !   LOWER CANYON                            BURIAL SHAFT
033  !       | chasm                                   honeycomb
034  !       |
035  !       |
036  !   PUMICE LEDGE
037  !         bone
038  !
039  ! ---------------------------------------------------------------------------- !
040   
041  Constant MAX_CARRIED = 7;       ! Defined in DM4 §22
042  Constant MAX_SCORE = 30;        ! Defined in DM4 §22
043   
044  Include "Parser";
045  Include "VerbLib";
046   
047  ! ---------------------------------------------------------------------------- !
048  !       The TREASURE class definition.
049  !
050  !       Defined in DM4 §5, modified in §23
051  Class   Treasure
052    with  before [;
053              Take, Remove:
054                  if (self in packing_case)
055                      "Unpacking such a priceless artifact had best wait until
056                       the Carnegie Institution can do it.";
057                  if (self.photographed_in_situ == false)
058                      "This is the 1930s, not the bad old days. Taking an
059                       artifact without recording its context is simply looting.";
060              Photograph:
061                  if (self has moved) "What, and fake the archaeological record?";
062                  if (self.photographed_in_situ) "Not again.";
063              ],
064          after [;
065              Insert:
066                  if (second == packing_case) {
067                      score = score + self.cultural_value;
068                      if (score == MAX_SCORE) {
069                          deadflag = 2;
070                          print_ret "As you carefully pack away ",
071                                    (the) noun,
072                                    " a red-tailed macaw flutters down from the
073                                     tree-tops, feathers heavy in the recent rain,
074                                     the sound of its beating wings almost
075                                     deafening, stone falling against stone...
076                                     As the skies clear, a crescent moon rises
077                                     above a peaceful jungle. It is the end of
078                                     March, 1938, and it is time to go home.";
079                          }
080                      "Safely packed away.";
081                      }
082              Photograph:
083                  self.photographed_in_situ = true;
084              ],
085          cultural_value 5,
086          photographed_in_situ false;
087   
088  ! ---------------------------------------------------------------------------- !
089  !       The game beings in the GRAND PLAZA.
090  !
091  !       Defined in DM4 §4, modified in §8, §9 and §23
092  Object  Forest "~Great Plaza~"
093    with  description
094              "Or so your notes call this low escarpment of limestone, but the
095               rainforest has claimed it back. Dark olive trees crowd in on all
096               sides, the air steams with the mist of a warm recent rain, midges
097               hang in the air. ~Structure 10~ is a shambles of masonry which
098               might once have been a burial pyramid, and little survives
099               except stone-cut steps leading down into darkness below.",
100          d_to steps,
101          in_to steps,
102          u_to
103              "The trees are spiny and you'd cut your hands to ribbons
104               trying to climb them.",
105          cant_go
106              "The rainforest is dense, and you haven't hacked through it for days
107               to abandon your discovery now. Really, you need a good few
108               artifacts to take back to civilization before you can justify
109               giving up the expedition.",
110          before [; Listen: "Howler monkeys, bats, parrots, macaw."; ],
111    has   light;
112   
113  !       Defined in DM4 §4, modified in Exercise 1 and §23
114  Object  -> mushroom "speckled mushroom"
115    with  name 'speckled' 'mushroom' 'fungus' 'toadstool',
116          initial
117              "A speckled mushroom grows out of the sodden earth, on
118               a long stalk.",
119          description
120              "The mushroom is capped with blotches, and you aren't
121               at all sure it's not a toadstool.",
122          after [;
123              Take:
124                  if (self.mushroom_picked)
125                      "You pick up the slowly-disintegrating mushroom.";
126                  self.mushroom_picked = true;
127                  "You pick the mushroom, neatly cleaving its thin stalk.";
128              Drop:
129                  "The mushroom drops to the ground, battered slightly.";
130              Eat:
131                  steps.rubble_filled = false;
132                  "You nibble at one corner, unable to trace the source of an
133                   acrid taste, distracted by the flight of a macaw overhead
134                   which seems to burst out of the sun, the sound of the beating
135                   of its wings almost deafening, stone falling against stone.";
136              ],
137          mushroom_picked false,
138    has   edible;
139   
140  !       Defined in DM4 §12
141  Object  -> packing_case "packing case"
142    with  name 'packing' 'case' 'box' 'strongbox',
143          initial
144              "Your packing case rests here, ready to hold any important
145               cultural finds you might make, for shipping back to civilisation.",
146          before [;
147              Take, Remove, PushDir:
148                  "The case is too heavy to bother moving, as long as your
149                   expedition is still incomplete.";
150              ],
151    has   static container open openable;
152   
153  !       Defined in DM4 §6
154  Object  -> -> camera "wet-plate camera"
155    with  name 'wet-plate' 'plate' 'wet' 'camera',
156          description
157              "A cumbersome, sturdy, stubborn wooden-framed wet plate
158               model: like all archaeologists, you have a love-hate
159               relationship with your camera.";
160   
161  !       Defined in DM4 §23
162  Object  -> -> newspaper "month-old newspaper"
163    with  name 'times' 'newspaper' 'paper' 'month-old' 'old',
164          description
165              "~The Times~ for 26 February, 1938, at once damp and brittle
166               after a month's exposure to the climate, which is much the way you
167               feel yourself. Perhaps there is fog in London.
168               Perhaps there are bombs.";
169   
170  !       Defined in DM4 §4, modified in §5 and §23
171  Object  -> steps "stone-cut steps"
172    with  name 'steps' 'stone' 'stairs' 'stone-cut' 'pyramid' 'burial'
173               'structure' 'ten' '10',
174          description [;
175              if (self.rubble_filled)
176                  "Rubble blocks the way after only a few steps.";
177              print "The cracked and worn steps descend into a dim
178                     chamber. Yours might ";
179              if (Square_Chamber hasnt visited)
180                  print "be the first feet to tread";
181              else
182                  print "have been the first feet to have trodden";
183              " them for five hundred years. On the top step is
184               inscribed the glyph Q1.";
185              ],
186          door_to [;
187              if (self.rubble_filled)
188                  "Rubble blocks the way after only a few steps.";
189              return Square_Chamber;
190              ],
191          door_dir d_to,
192          rubble_filled true,
193    has   scenery door open;
194   
195  ! ---------------------------------------------------------------------------- !
196  !       The SQUARE CHAMBER.
197  !
198  !       Defined in DM4 Exercise 2, modified in $8 and $9
199  Object  Square_Chamber "Square Chamber"
200    with  name 'lintelled' 'lintel' 'lintels' 'east' 'south' 'doorways',
201          description
202              "A sunken, gloomy stone chamber, ten yards across. A shaft of
203               sunlight cuts in from the steps above, giving the chamber a
204               diffuse light, but in the shadows low lintelled doorways to
205               east and south lead into the deeper darkness of the Temple.",
206          u_to Forest,
207          e_to Wormcast,
208          s_to Corridor,
209          before [;
210              Insert:
211                  if (noun == eggsac && second == sunlight) {
212                      remove eggsac;
213                      move stone_key to self;
214                      "You drop the eggsac into the glare of the shaft of
215                       sunlight. It bubbles obscenely, distends and then bursts
216                       into a hundred tiny insects which run in all directions
217                       into the darkness. Only spatters of slime and a curious
218                       yellow-stone key remain on the chamber floor.";
219                      }
220              ],
221    has   light;
222   
223  !       Defined in DM4 §8
224  Object  -> "carved inscriptions"
225    with  name 'carved' 'inscriptions' 'carvings' 'marks' 'markings' 'symbols'
226               'moving' 'scuttling' 'crowd' 'of',
227          initial
228              "Carved inscriptions crowd the walls, floor and ceiling.",
229          description
230              "Each time you look at the carvings closely, they seem to be still.
231               But you have the uneasy feeling when you look away that they're
232               scuttling, moving about.
233               Two glyphs are prominent: Arrow and Circle.",
234    has   static pluralname;
235   
236  !       Defined in DM4 §8
237  Object  -> sunlight "shaft of sunlight"
238    with  name 'shaft' 'of' 'sunlight' 'sun' 'light' 'beam' 'sunbeam'
239               'ray' 'rays' 'sun^s' 'sunlit' 'air' 'motes' 'dust',
240          description
241              "Motes of dust glimmer in the shaft of sunlit air, so that it seems
242               almost solid.",
243          before [;
244              Examine, Search:
245                  ;
246              default:
247                  "It's only an insubstantial shaft of sunlight.";
248              ],
249    has   scenery;
250   
251  ! ---------------------------------------------------------------------------- !
252  !       The STOOPED CORRIDOR.
253  !
254  !       Defined in DM4 §13
255  Object  Corridor "Stooped Corridor"
256    with  description
257              "A low, square-cut corridor, running north to south,
258               stooping you over.",
259          n_to Square_Chamber,
260          s_to StoneDoor;
261   
262  !       Defined in DM4 §5
263  Treasure -> statuette "pygmy statuette"
264    with  name 'snake' 'mayan' 'pygmy' 'spirit' 'precious' 'statuette',
265          initial
266              "A precious Mayan statuette rests here!",
267          description
268              "A menacing, almost cartoon-like statuette of a pygmy spirit
269               with a snake around its neck.";
270   
271  !       Defined in DM4 §13
272  Object  -> StoneDoor "stone door"
273    with  name 'door' 'massive' 'big' 'stone' 'yellow',
274          description
275              "It's just a big stone door.",
276          when_closed
277              "The passage is barred by a massive door of yellow stone.",
278          when_open
279              "The great yellow stone door is open.",
280          door_to [; if (self in Corridor) return Shrine; return Corridor; ],
281          door_dir [; if (self in Shrine) return n_to; return s_to; ],
282          with_key stone_key,
283          found_in Corridor Shrine,
284    has   static door openable lockable locked;
285   
286  ! ---------------------------------------------------------------------------- !
287  !       The SHRINE.
288  !
289  !       Defined in DM4 §23
290  Object  Shrine "Shrine"
291    with  description
292              "This magnificent Shrine shows signs of being hollowed out from
293               already-existing limestone caves, especially in the western of the
294               two long eaves to the south.",
295          n_to StoneDoor,
296          se_to Antechamber,
297          sw_to
298              "The eaves taper out into a crevice which would wind further if it
299               weren't jammed tight with icicles. The glyph of the Crescent is
300               not quite obscured by ice.";
301   
302  !       Defined in DM4 §23
303  Object  -> paintings "paintings"
304    with  name 'painting' 'paintings' 'lord' 'captive',
305          initial
306              "Vividly busy paintings, of the armoured Lord trampling on a
307               captive, are almost too bright to look at, the graffiti of an
308               organised mob.",
309          description
310              "The flesh on the bodies is blood-red. The markers of the Long Count
311               date the event to 10 baktun 4 katun 0 tun 0 uinal 0 kin, the sort
312               of anniversary when one Lord would finally decapitate a captured
313               rival who had been ritually tortured over a period of some years,
314               in the Balkanised insanity of the Maya city states.",
315    has   static;
316   
317  !       Defined in DM4 §12 and §15
318  Object  -> stone_table "slab altar"
319    with  name 'stone' 'table' 'slab' 'altar' 'great',
320          initial
321              "A great stone slab of a table, or altar, dominates the Shrine.",
322    has   enterable supporter static;
323   
324  !       Defined in DM4 §11
325  Treasure -> -> mask "jade mosaic face-mask"
326    with  name 'jade' 'mosaic' 'face-mask' 'mask' 'face',
327          initial
328              "Resting on the altar is a jade mosaic face-mask.",
329          description
330              "How exquisite it would look in the Museum.",
331          after [;
332              Wear:
333                  move priest to Shrine;
334                  if (location == Shrine)
335                      "Looking through the obsidian eyeslits of the mosaic mask,
336                       a ghostly presence reveals itself: a mummified calendrical
337                       priest, attending your word.";
338              Disrobe:
339                  remove priest;
340              ],
341          cultural_value 10,
342    has   clothing;
343   
344  ! ---------------------------------------------------------------------------- !
345  !       The UPPER/NORTH CANYON.
346  !
347  !       Defined in DM4 §23
348  Object  Canyon_N "Upper End of Canyon"
349    with  description
350              "The higher, broader northern end of the canyon rises only to an
351               uneven wall of volcanic karst.",
352          s_to Junction,
353          d_to Junction,
354    has   light;
355   
356  !       Defined in DM4 §15, modified in Exercise 24 and §23
357  Object  -> huge_ball "huge pumice-stone ball"
358    with  name 'huge' 'pumice' 'pumice-stone' 'stone' 'ball',
359          initial
360              "A huge pumice-stone ball rests here, eight feet wide.",
361          description
362              "A good eight feet across, though fairly lightweight.",
363          before [;
364              PushDir:
365                  if (location == Junction && second == ne_obj)
366                      "The Shrine entrance is far less than eight feet wide.";
367                  AllowPushDir();
368                  rtrue;
369              Pull, Push, Turn:
370                  "It wouldn't be so very hard to get rolling.";
371              Take, Remove:
372                  "There's a lot of stone in an eight-foot sphere.";
373              ],
374          after [;
375              PushDir:
376                  if (second == n_obj) "You strain to push the ball uphill.";
377                  if (second == u_obj) <<PushDir self n_obj>>;
378                  if (second == s_obj) "The ball is hard to stop once underway.";
379                  if (second == d_obj) <<PushDir self s_obj>>;
380              ],
381    has   static;
382   
383  ! ---------------------------------------------------------------------------- !
384  !       The XIBALBÁ/JUNCTION.
385   
386  !       Defined in DM4 §23
387  Object  Junction "Xibalb@'a"
388    with  description
389              "Fifty metres beneath rainforest, and the sound of water is
390               everywhere: these deep, eroded limestone caves extend like
391               taproots. A slither northeast by a broad collapsed column of
392               ice-covered rock leads back to the Shrine, while a kind of canyon
393               floor extends uphill to the north and downwards to south,
394               pale white like shark's teeth in the diffused light from the
395               sodium lamp above.",
396          ne_to Shrine,
397          n_to Canyon_N,
398          u_to Canyon_N,
399          s_to Canyon_S,
400          d_to Canyon_S,
401   has    light;
402   
403  !       Defined in DM4 §23
404  Treasure -> stela "stela"
405    with  name 'stela' 'boundary' 'stone' 'marker',
406          initial
407              "A modest-sized stela, or boundary stone, rests on a ledge
408               at head height.",
409          description
410              "The carvings appear to warn that the boundary of Xibalb@'a,
411               Place of Fright, is near. The Bird glyph is prominent.";
412   
413  ! ---------------------------------------------------------------------------- !
414  !       The LOWER/SOUTH CANYON.
415  !
416  !       Defined in DM4 §23
417  Object  Canyon_S "Lower End of Canyon"
418    with  description
419              "At the lower, and narrower, southern end, the canyon stops dead at
420               a chasm of vertiginous blackness. Nothing can be seen or heard
421               from below.",
422          n_to Junction,
423          u_to Junction,
424          s_to "Into the chasm?",
425          d_to nothing,
426    has   light;
427   
428  !       Defined in DM4 §12, modified in §21 and §23
429  Object  -> chasm "horrifying chasm"
430    with  name 'blackness' 'chasm' 'pit' 'horrifying' 'bottomless',
431          before [;
432              Enter:
433                  deadflag = 3;
434                  "You plummet through the silent void of darkness, cracking
435                   your skull against an outcrop of rock. Amidst the pain and
436                   redness, you dimly make out the God with the Owl-Headdress...";
437              JumpOver:
438                  "It's far too wide.";
439              ],
440          after [;
441              Receive:
442                  remove noun;
443                  print_ret (The) noun,
444                            " tumbles silently into the darkness of the chasm.";
445              Search:
446                  "The chasm is deep and murky.";
447              ],
448          react_before [;
449              Jump:
450                  <<Enter self>>;
451              Go:
452                  if (noun == d_obj) <<Enter self>>;
453              ],
454          each_turn [;
455              if (huge_ball in parent(self)) {
456                  remove huge_ball;
457                  Canyon_S.s_to = On_Ball;
458                  Canyon_S.description =
459                      "The southern end of the canyon now continues onto the
460                       pumice-stone ball, wedged into the chasm.";
461                  "^The pumice-stone ball rolls out of control down the last few
462                   feet of the canyon before shuddering into the jaws of the
463                   chasm, bouncing back a little and catching you a blow on the
464                   side of the forehead. You slump forward, bleeding, and...
465                   the pumice-stone shrinks, or else your hand grows, because you
466                   seem now to be holding it, staring at Alligator, son of
467                   seven-Macaw, across the ball-court of the Plaza, the heads of
468                   his last opponents impaled on spikes, a congregation baying
469                   for your blood, and there is nothing to do but to throw anyway,
470                   and... but this is all nonsense,
471                   and you have a splitting headache.";
472                  }
473              ],
474    has   scenery open container;
475   
476  ! ---------------------------------------------------------------------------- !
477  !       The PUMICE LEDGE.
478  !
479  !       Defined in DM4 §23
480  Object  On_Ball "Pumice-Stone Ledge"
481    with  description
482              "An impromptu ledge formed by the pumice-stone ball, wedged into
483               place in the chasm. The canyon nevertheless ends here.",
484          n_to Canyon_S,
485          d_to Canyon_S,
486          u_to Canyon_S,
487    has   light;
488   
489  !       Defined in DM4 §23
490  Treasure -> "incised bone"
491    with  name 'incised' 'carved' 'bone',
492          initial
493              "Of all the sacrificial goods thrown into the chasm, perhaps
494               nothing will be reclaimed: nothing but an incised bone, lighter
495               than it looks, which projects from a pocket of wet silt in the
496               canyon wall.",
497          description
498              "A hand holding a brush pen appears from the jaws of Itzamn@'a,
499               inventor of writing, in his serpent form.";
500   
501  ! ---------------------------------------------------------------------------- !
502  !       The ANTECHAMBER.
503  !
504  !       Defined in DM4 §23
505  Object  Antechamber "Antechamber"
506    with  description
507              "The southeastern eaves of the Shrine make a curious antechamber.",
508          nw_to Shrine;
509   
510  !       Defined in DM4 Exercise 22, modified in Exercise 55
511  Object  -> cage "iron cage"
512    with  name 'iron' 'cage' 'bars' 'barred' 'frame' 'glyphs',
513          description
514              "The glyphs read: Bird Arrow Warthog.",
515          inside_description [;
516              if (self.floor_open)
517                  "From the floor of the cage, an open earthen pit cuts
518                   down into the burial chamber.";
519              "The bars of the cage surround you.";
520              ],
521          when_open
522              "An iron-barred cage, large enough to stoop over inside, looms
523               ominously here, its door open. There are some glyphs on the
524               frame.",
525          when_closed
526              "The iron cage is closed.",
527          after [;
528              Enter:
529                  print "The skeletons inhabiting the cage come alive, locking
530                         bony hands about you, crushing and pummelling. You lose
531                         consciousness, and when you recover something grotesque
532                         and impossible has occurred...^";
533                  move warthog to Antechamber;
534                  remove skeletons;
535                  give self ~open;
536                  give warthog light;
537                  self.after = 0;
538                  ChangePlayer(warthog, 1);
539                  <<Look>>;
540              ],
541          react_before [;
542              Go:
543                  if (noun == d_obj && self.floor_open) {
544                      PlayerTo(Burial_Shaft);
545                      rtrue;
546                      }
547              ],
548          floor_open false,
549    has   enterable transparent container openable open static;
550   
551  !       Defined in Exercise 55
552  Object  -> -> skeletons "skeletons"
553    with  name 'skeletons' 'skeleton' 'bone' 'skull' 'bones' 'skulls',
554          article "deranged",
555    has   pluralname static;
556   
557  ! ---------------------------------------------------------------------------- !
558  !       The BURIAL SHAFT.
559  !
560  !       Defined in Exercise 55
561  Object  Burial_Shaft "Burial Shaft"
562    with  description
563              "In your eventual field notes, this will read:
564               ~A corbel-vaulted crypt with an impacted earthen plug as seal
565               above, and painted figures conjecturally representing the Nine
566               Lords of the Night. Dispersed bones appear to be those of one
567               elderly man and several child sacrifices, while other funerary
568               remains include jaguar paws.~ (In field notes, it is essential
569               not to give any sense of when you are scared witless.)",
570          n_to Wormcast,
571          u_to [;
572              cage.floor_open = true;
573              self.u_to = self.opened_u_to;
574              move selfobj to self;
575              print "Making a mighty warthog-leap, you butt at the earthen-plug
576                     seal above the chamber, collapsing your world in ashes and
577                     earth. Something lifeless and terribly heavy falls on top of
578                     you: you lose consciousness, and when you recover, something
579                     impossible and grotesque has happened...^";
580              ChangePlayer(selfobj);
581              give warthog ~light;
582              <<Look>>;
583              ],
584          cant_go
585              "The architects of this chamber were less than generous in
586               providing exits. Some warthog seems to have burrowed in from the
587               north, though.",
588          before [; Jump: <<Go u_obj>>; ],
589          opened_u_to [; PlayerTo(cage); rtrue; ],
590    has   light;
591   
592  !       Defined in DM4 §5
593  Treasure -> honeycomb "ancient honeycomb"
594    with  name 'ancient' 'old' 'honey' 'honeycomb',
595          article "an",
596          initial
597              "An exquisitely preserved, ancient honeycomb rests here!",
598          description
599              "Perhaps some kind of funerary votive offering.",
600          after [;
601              Eat:
602                  "Perhaps the most expensive meal of your life. The honey tastes
603                   odd, perhaps because it was used to store the entrails of the
604                   Lord buried here, but still like honey.";
605              ],
606    has   edible;
607   
608  ! ---------------------------------------------------------------------------- !
609  !       The WORMCAST.
610  !
611  !       Defined in DM4 Exercises 7 and 8, modified in Exercise 54
612  Object  Wormcast "Wormcast"
613    with  description
614              "A disturbed place of hollows carved like a spider's web, strands of
615               empty space hanging in stone. The only burrows wide enough to crawl
616               through begin by running northeast, south and upwards.",
617          w_to Square_Chamber,
618          s_to [;
619              print "The wormcast becomes slippery around you, as though your
620                     body-heat is melting long hardened resins, and you shut your
621                     eyes tightly as you burrow through darkness.^";
622              if (eggsac in player) return Square_Chamber;
623              return random(Square_Chamber, Corridor, Forest);
624              ],
625          ne_to [; return self.s_to(); ],
626          u_to [; return self.s_to(); ],
627          cant_go [;
628              if (player ~= warthog)
629                  "Though you begin to feel certain that something lies behind
630                   and through the wormcast, this way must be an animal-run at
631                   best: it's far too narrow for your armchair-archaeologist's
632                   paunch.";
633              print "The wormcast becomes slippery around your warthog body, and
634                     you squeal involuntarily as you burrow through the darkness,
635                     falling finally southwards to...^";
636              PlayerTo(Burial_Shaft);
637              rtrue;
638              ],
639          after [;
640              Drop:
641                  move noun to Square_Chamber;
642                  print_ret (The) noun,
643                            " slips through one of the burrows and is quickly
644                             lost from sight.";
645              ],
646    has   light;
647   
648  !       Defined in DM4 §23
649  Object  -> eggsac "glistening white eggsac",
650    with  name 'egg' 'sac' 'eggs' 'eggsac',
651          initial
652              "A glistening white eggsac, like a clump of frogspawn the size of a
653               beach ball, has adhered itself to something in a crevice in one
654               wall.",
655          after [; Take: "Oh my."; ],
656          react_before [;
657              Go:
658                  if (location == Square_Chamber && noun == u_obj) {
659                      deadflag = true;
660                      "The moment that natural light falls upon the eggsac, it
661                       bubbles obscenely and distends. Before you can throw it
662                       away, it bursts into a hundred tiny, birth-hungry
663                       insects...";
664                      }
665              ];
666   
667  ! ---------------------------------------------------------------------------- !
668  !       These objects are moved into place as the game proceeds.
669  !
670  !       Defined in DM4 §14, modified in §23
671  Object  sodium_lamp "sodium lamp"
672    with  name 'sodium' 'lamp' 'heavy',
673          describe [;
674              if (self has on)
675                  "^The sodium lamp squats on the ground, burning away.";
676              "^The sodium lamp squats heavily on the ground.";
677              ],
678          before [;
679              Examine:
680                  print "It is a heavy-duty archaeologist's lamp, ";
681                  if (self hasnt on) "currently off.";
682                  if (self.battery_power < 10) "glowing a dim yellow.";
683                  "blazing with brilliant yellow light.";
684              Burn:
685                  <<SwitchOn self>>;
686              SwitchOn:
687                  if (self.battery_power <= 0)
688                      "Unfortunately, the battery seems to be dead.";
689                  if (parent(self) hasnt supporter && self notin location)
690                      "The lamp must be securely placed before being lit.";
691              Take, Remove:
692                  if (self has on)
693                      "The bulb's too delicate and the metal handle's too hot
694                       to lift the lamp while it's switched on.";
695              PushDir:
696                  if (location == Shrine && second == sw_obj)
697                      "The nearest you can do is to push the sodium lamp to the
698                       very lip of the Shrine, where the cave floor falls away.";
699                  AllowPushDir();
700                  rtrue;
701              ],
702          after [;
703              SwitchOn:
704                  give self light;
705              SwitchOff:
706                  give self ~light;
707              ],
708          daemon [;
709              if (self hasnt on) return;
710              if (--self.battery_power == 0) give self ~light ~on;
711              if (self in location) {
712                  switch (self.battery_power) {
713                      10: "^The sodium lamp is getting dimmer!";
714                      5:  "^The sodium lamp can't last much longer.";
715                      0:  "^The sodium lamp fades and suddenly dies.";
716                      }
717                  }
718              ],
719          battery_power 100,
720    has   switchable;
721   
722  !       Defined in DM4 §16
723  Object  dictionary "Waldeck's Mayan dictionary"
724    with  name 'dictionary' 'local' 'guide' 'book' 'mayan' 'waldeck'
725               'waldeck^s',
726          description
727              "Compiled from the unreliable lithographs of the legendary raconteur
728               and explorer ~Count~ Jean Frederic Maximilien Waldeck
729               (1766??-1875), this guide contains what little is known of the
730               glyphs used in the local ancient dialect.",
731          before [ w1 w2 glyph;
732              Consult:
733                  wn = consult_from;
734                  w1 = NextWord(); ! First word of subject
735                  w2 = NextWord(); ! Second word (if any) of subject
736                  if (consult_words==1 && w1~='glyph' or 'glyphs') glyph = w1;
737                  else if (consult_words==2 && w1=='glyph') glyph = w2;
738                  else if (consult_words==2 && w2=='glyph') glyph = w1;
739                  else "Try ~look up  in book~.";
740                  switch (glyph) {
741                      'q1':       "(This is one glyph you have memorised!)^^
742                                   Q1: ~sacred site~.";
743                      'crescent': "Crescent: believed pronounced ~xibalba~,
744                                   though its meaning is unknown.";
745                      'arrow':    "Arrow: ~journey; becoming~.";
746                      'skull':    "Skull: ~death, doom; fate (not nec. bad)~.";
747                      'circle':   "Circle: ~the Sun; also life, lifetime~.";
748                      'jaguar':   "Jaguar: ~lord~.";
749                      'monkey':   "Monkey: ~priest?~.";
750                      'bird':     if (self.correct) "Bird: ~dead as a stone~.";
751                                  "Bird: ~rich, affluent?~.";
752                      default:    "That glyph is so far unrecorded.";
753                  }
754              ],
755          correct false,
756    has   proper;
757   
758  !       Defined in DM4 §23
759  Object  map "sketch-map of Quintana Roo"
760    with  name 'map' 'sketch' 'sketch-map' 'quintana' 'roo',
761          description
762              "This map marks little more than the creek which brought you
763               here, off the south-east edge of Mexico and into deepest
764               rainforest, broken only by this raised plateau.";
765   
766  !       Defined in DM4 §23
767  Object  stone_key "stone key"
768    with  name 'stone' 'key';
769   
770  !       Defined in DM4 §17, modified in §18 and §23
771  Object  priest "mummified priest"
772    with  name 'mummified' 'priest',
773          initial
774              "Behind the slab, a mummified priest stands waiting,
775               barely alive at best, impossibly venerable.",
776          description
777              "He is desiccated and hangs together only by will-power. Though his
778               first language is presumably local Mayan, you have the curious
779               instinct that he will understand your speech.",
780          life [;
781              Answer:
782                  "The priest coughs, and almost falls apart.";
783              Ask: switch (second) {
784                  'dictionary', 'book':
785                      if (dictionary.correct == false)
786                          "~The ~bird~ glyph... very funny.~";
787                      "~A dictionary? Really?~";
788                  'glyph', 'glyphs', 'mayan', 'dialect':
789                      "~In our culture, the Priests are ever literate.~";
790                  'lord', 'tomb', 'shrine', 'temple':
791                      "~This is a private matter.~";
792                  'paintings':
793                      "The calendrical priest frowns. ~10 baktun, 4 katun,
794                       that makes 1,468,800 days since the beginning of time:
795                       in your calendar 19 January 909.~";
796                  'ruins':
797                      "~The ruins will ever defeat thieves. In the underworld,
798                       looters are tortured throughout eternity.~ A pause.
799                       ~As are archaeologists.~";
800                  'web', 'wormcast':
801                      "~No man can pass the Wormcast.~";
802                  'xibalba':
803                      if (Shrine.sw_to == Junction)
804                          "The priest shakes his bony finger.";
805                      Shrine.sw_to = Junction;
806                      "The priest extends one bony finger southwest toward the
807                       icicles, which vanish like frost as he speaks. ~Xibalb@'a,
808                       the Underworld.~";
809                      }
810                  "~You must find your own answer.~";
811              Tell:
812                  "The priest has no interest in your sordid life.";
813              Attack, Kiss:
814                  remove self;
815                  "The priest desiccates away into dust until nothing remains,
816                   not a breeze nor a bone.";
817              ThrowAt:
818                  move noun to location; <<Attack self>>;
819              Show, Give:
820                  if (noun == dictionary && dictionary.correct == false) {
821                      dictionary.correct = true;
822                      "The priest reads a little of the book, laughing in a
823                       hollow, whispering way. Unable to restrain his mirth,
824                       he scratches in a correction somewhere before returning
825                       the book.";
826                      }
827                  if (noun == newspaper)
828                      "He looks at the date. ~12 baktun 16 katun 4 tun 1 uinal
829                       12 kin~, he declares before browsing the front page.
830                       ~Ah. Progress, I see.~";
831                  "The priest is not interested in earthly things.";
832              ],
833          orders [;
834              Go:
835                  "~I must not leave the Shrine.~";
836              NotUnderstood:
837                  "~You speak in riddles.~";
838              default:
839                  "~It is not your orders I serve.~";
840              ],
841    has   animate;
842   
843  !       Defined in DM4 Exercise 53
844  Object  warthog "Warthog"
845    with  name 'wart' 'hog' 'warthog',
846          initial
847              "A warthog snuffles and grunts about in the ashes.",
848          description
849              "Muddy and grunting.",
850          orders [;
851              Go, Look, Examine, Smell, Taste, Touch, Search,Jump, Enter:
852                  rfalse;
853              Eat:
854                  "You haven't the knack of snuffling up to food yet.";
855              default:
856                  "Warthogs can't do anything so involved. If it weren't for the
857                   nocturnal eyesight and the lost weight, they'd be worse off
858                   all round than people.";
859              ],
860    has   animate proper;
861   
862  !       Defined in DM4 §8
863  Object  low_mist "low mist"
864    with  name 'low' 'swirling' 'mist',
865          description "The mist has an aroma reminiscent of tortilla.",
866          before [;
867              Examine, Search:
868                  ;
869              Smell:
870                  <<Examine self>>;
871              default:
872                  "The mist is too insubstantial.";
873              ],
874          react_before [; Smell: if (noun == nothing) <<Smell self>>; ],
875          found_in Square_Chamber Forest,
876    has   scenery;
877   
878  !       Defined in DM4 Exercise 46
879  Object  tiny_claws "sound of tiny claws" thedark
880    with  name 'tiny' 'claws' 'sound' 'of' 'scuttling' 'scuttle' 'things'
881               'creatures' 'monsters' 'insects',
882          article "the",
883          initial
884              "Somewhere, tiny claws are scuttling.",
885          before [;
886              Listen:
887                  "How intelligent they sound, for mere insects.";
888              Touch, Taste:
889                  "You wouldn't want to. Really.";
890              Smell:
891                  "You can only smell your own fear.";
892              Attack:
893                  "They easily evade your flailing about.";
894              default:
895                  "The creatures evade you, chittering.";
896              ],
897          each_turn [; StartDaemon(self); ],
898          daemon [;
899              if (location ~= thedark) {
900                  self.turns_active = 0;
901                  StopDaemon(self);
902                  rtrue;
903                  }
904              switch (++(self.turns_active)) {
905                  1:  "^The scuttling draws a little nearer, and your breathing
906                       grows loud and hoarse.";
907                  2:  "^The perspiration of terror runs off your brow. The
908                       creatures are almost here!";
909                  3:  "^You feel a tickling at your extremities and kick outward,
910                       shaking something chitinous off. Their sound alone is a
911                       menacing rasp.";
912                  4:  deadflag = true;
913                      "^Suddenly there is a tiny pain, of a hypodermic-sharp fang
914                       at your calf. Almost at once your limbs go into spasm, your
915                       shoulders and knee-joints lock, your tongue swells...";
916                  }
917              ],
918          turns_active 0;
919   
920  ! ---------------------------------------------------------------------------- !
921  !       Utility routines.
922   
923  !       Defined in DM4 §4, modified in §21 and §23
924  [ Initialise;
925          TitlePage();
926          location = Forest;
927          move map to player;
928          move sodium_lamp to player;
929          move dictionary to player;
930          StartDaemon(sodium_lamp);
931          thedark.description =
932              "The darkness of ages presses in on you, and you feel
933               claustrophobic.";
934          "^^^Days of searching, days of thirsty hacking through the briars of
935           the forest, but at last your patience was rewarded. A discovery!^";
936          ];
937   
938  !       Defined in DM4 Exercise 123
939  [ TitlePage i;
940          @erase_window -1; print "^^^^^^^^^^^^^";
941          i = 0->33; if (i > 30) i = (i-30)/2;
942          style bold; font off; spaces(i);
943          print " RUINS^";
944          style roman; print "^^"; spaces(i);
945          print "[Please press SPACE to begin.]^";
946          font on;
947          box "But Alligator was not digging the bottom of the hole"
948              "Which was to be his grave,"
949              "But rather he was digging his own hole"
950              "As a shelter for himself."
951              ""
952              "-- from the Popol Vuh";
953          @read_char 1 -> i;
954          @erase_window -1;
955          ];
956   
957  !       Defined in DM4 §22
958  [ PrintRank;
959          print ", earning you the rank of ";
960          if (score == 30) "Director of the Carnegie Institution.";
961          if (score >= 20) "Archaeologist.";
962          if (score >= 10) "Curiosity-seeker.";
963          if (score >= 5) "Explorer.";
964          "Tourist.";
965          ];
966   
967  !       Defined in DM4 §21
968  [ DeathMessage;
969          if (deadflag == 3) print "You have been captured";
970          ];
971   
972  ! ---------------------------------------------------------------------------- !
973   
974  Include "Grammar";
975   
976  !       Defined in DM4 §6
977  [ PhotographSub;
978          if (camera notin player) "Not without the use of your camera.";
979          if (noun == player) "Best not. You haven't shaved since Mexico.";
980          if (children(player) > 1)
981              "Photography is a cumbersome business, needing the use of both
982               hands. You'll have to put everything else down.";
983          if (location == Forest) "In this rain-soaked forest, best not.";
984          if (location == thedark) "It is far too dark.";
985          if (AfterRoutines()) return;
986          print_ret "You set up the elephantine, large-format, wet-plate camera,
987                     adjust the sodium lamp and make a patient exposure of ",
988                     (the) noun, ".";
989          ];
990   
991  Verb 'photograph'
992          * noun          -> Photograph;
993   
994  ! ---------------------------------------------------------------------------- !


Last updated 23 June 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.