~ubuntu-branches/ubuntu/vivid/inform/vivid

« back to all changes in this revision

Viewing changes to inform-6.31.1/demos/ruins1.inf

  • Committer: Bazaar Package Importer
  • Author(s): Jan Christoph Nordholz
  • Date: 2008-05-26 22:09:44 UTC
  • mfrom: (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080526220944-ba7phz0d1k4vo7wx
Tags: 6.31.1+dfsg-1
* Remove a considerable number of files from the package
  due to unacceptable licensing terms.
* Repair library symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
!==============================================================================!
 
2
!   The Inform Designer's Manual (16May97) includes various references to a
 
3
!   sample game called "Ruins", which unfortunately is not supplied with the
 
4
!   compiler. This file attempts to knit together several of the fragments from
 
5
!   the DM into a small but complete game, intended primarily as an example for
 
6
!   novices of a typical way to use Inform features, and as a starting point
 
7
!   for experimentation.
 
8
!
 
9
!   In order to keep the game manageably small, the following references from
 
10
!   the DM have been omitted:
 
11
!       parrot, low mist, chasm, pumice-stone ball, glyphs, dictionary,
 
12
!       food rations, sodium lamp, cage.
 
13
!   Other items have been changed as necessary for simplicity and consistency.
 
14
!
 
15
!   Object definitions explicitly state the name of their parent object (if
 
16
!   appropriate), rather than using the "->" construct.
 
17
!
 
18
!   Once you've played the game and (hopefully) understood how it works, you
 
19
!   are strongly encouraged to try modifying or extending it. For instance:
 
20
!   - add the low mist in the Forest and Square_Chamber. In the DM it smells of
 
21
!     broth, so perhaps you should provide a source for the smell (or just
 
22
!     change the description)?
 
23
!   - implement the parrot, perhaps having it fly into the Forest once the plane
 
24
!     has departed?
 
25
!   - extend the number of rooms. There's a suggestion that you could Down from
 
26
!     the Shrine, or perhaps you could add a dark passage leading West from the
 
27
!     Corridor?
 
28
!   - if the passage is dark, perhaps a lamp would be useful?
 
29
!   - if you've got a lamp, the maze in the Web becomes much less daunting
 
30
!     (and the descriptions will need beefing up too). So perhaps it's the lamp
 
31
!     rather than the bangle which you find on your exit from the darkened Web?
 
32
!   - the DM is a bit unclear about the role(!) of the pumice-stone ball, but
 
33
!     it seems to need pushing into the chasm. Maybe it blocks the gap and
 
34
!     allows you to cross to the other side (in order to reach the bangle)?
 
35
!   - there are a couple of daemons in the example, but no timer. How about
 
36
!     extending the Honeycomb so that if dropped it prints a warning and starts
 
37
!     a timer causing itself to melt unless picked up again within two turns?
 
38
!
 
39
!   Of course, it isn't worth spending too long on Ruins, since it's only a
 
40
!   somewhat dull and well-visited example. As soon as you start to feel
 
41
!   comfortable with the way that an Inform game is constructed...
 
42
!
 
43
!   ...have a go at writing one of your own. Good luck!
 
44
 
 
45
!==============================================================================!
 
46
!   Every game needs a Story and Headline, and must include Parser and VerbLib.
 
47
!   As DM ��7 except: Release, Serial and MAX_SCORE defined.
 
48
!
 
49
Constant Story "RUINS";
 
50
Constant Headline
 
51
        "^An Interactive Worked Example^
 
52
         Copyright (c) 1995 by Graham Nelson.^
 
53
         Revisited 1998 by Roger Firth.^";
 
54
 
 
55
Release  2;
 
56
Serial  "981117";
 
57
Constant MAX_SCORE 100;
 
58
 
 
59
Include "Parser";
 
60
Include "VerbLib";
 
61
 
 
62
!==============================================================================!
 
63
!   Every game needs an Initialise routine, whose primary role is to set the
 
64
!   player's location (i.e. you) at the start of the game.
 
65
!   As DM ��7 and 19 except: StartDaemon() call added, no TitlePage().
 
66
!
 
67
[ Initialise;
 
68
    location = Forest;
 
69
    thedark.description =
 
70
        "The darkness of ages presses in on you, and you feel claustrophobic.";
 
71
    StartDaemon(Packing_Case);
 
72
    "^^^^^Days of searching, days of thirsty hacking through the briars of
 
73
     the forest, but at last your patience was rewarded. A discovery!^";
 
74
    ];
 
75
 
 
76
!==============================================================================!
 
77
!   As DM ��20. PrintRank, if defined, is called when printing the score.
 
78
!
 
79
[ PrintRank;
 
80
    print ", earning you the rank of ";
 
81
    switch (score) {
 
82
        0 to 9:     "humble rainforest Tourist.";
 
83
        10 to 39:   "Investigator.";
 
84
        40 to 69:   "Acquisitor.";
 
85
        70 to 99:   "Archaeologist.";
 
86
        100:        "Master Archaeologist.";
 
87
        }
 
88
    ];
 
89
 
 
90
!==============================================================================!
 
91
!   As DM ��11 except: daemon added, to bring the immovable crate at the start,
 
92
!   and take it (and you) away at the end.
 
93
!
 
94
Object  Packing_Case "packing case"
 
95
  with  name 'packing' 'case' 'crate' 'box' 'strongbox',
 
96
        initial
 
97
            "Your packing case rests here, ready for you to hold any important
 
98
             cultural finds you might make, for shipping back to civilisation.",
 
99
        description
 
100
            "A stout wooden crate, only slightly battered by its fall through
 
101
             the branches.",
 
102
        before [;
 
103
            PushDir, Remove, Take:
 
104
                "The case is too heavy to bother moving, as long as your
 
105
                 expedition is still incomplete.
 
106
                 It'll probably have to be taken out by helicopter.";
 
107
            ],
 
108
        number 0,   ! <-- used by the daemon
 
109
        daemon [;
 
110
            switch (++self.number) {
 
111
                !-- Start of game
 
112
                1:  "^You hear the distant drone of an aeroplane.";
 
113
                2:  "^The plane is much louder, and seems to be flying very
 
114
                     low. Terrified birds rise in screeching flocks.";
 
115
                3:  move self to Forest;
 
116
                    if (location == Forest)
 
117
                        "^You involuntarily crouch as the plane flies directly
 
118
                         overhead, seemingly only inches above the treetops.
 
119
                         With a loud thump, something drops heavily to the
 
120
                         ground.";
 
121
                    "^Even underground, the engine roar is deafening.
 
122
                     Then there's a dull thump overhead and a little dust
 
123
                     falls from the ceiling.";
 
124
                4:  StopDaemon(self);
 
125
                    "^The roar dies away; calm returns to the forest.";
 
126
                !-- End of game
 
127
                5:  "^A deep throbbing noise can be heard.";
 
128
                6:  "^A helicopter appears, hovering overhead.";
 
129
                7:  StopDaemon(self);
 
130
                    remove self;
 
131
                    deadflag = 2;   ! <-- You win!
 
132
                    "^The helicopter lowers a rope; you tie it around the
 
133
                     packing case, which is hauled up into the air,
 
134
                     then a rope ladder comes dangling down.
 
135
                     With one last look around the clearing, you climb the
 
136
                     ladder into the waiting craft.
 
137
                     Back to civilisation, and a decent pint of Brakspear's!";
 
138
                }
 
139
            ],
 
140
  has   container open openable static;
 
141
 
 
142
!==============================================================================!
 
143
!   As DM ��8 except: started endgame processing when all treasure has been
 
144
!   found. Added Bangle and Ruby treasures. "Undiscovered" is useful when
 
145
!   ensuring that treasures can't be found twice.
 
146
!
 
147
Class   Treasure
 
148
  with  cultural_value 10,
 
149
        before [;
 
150
            Remove, Take:
 
151
                if (self in Packing_Case)
 
152
                    "Unpacking such a priceless artifact had best wait
 
153
                     until the Metropolitan Museum can do it.";
 
154
            ],
 
155
        after [;
 
156
            Insert:
 
157
                if (second == Packing_Case) {
 
158
                    score = score + self.cultural_value;
 
159
                    print "Safely packed away.^";
 
160
                    }
 
161
                if (score == MAX_SCORE) {
 
162
                    StartDaemon(Packing_Case);
 
163
                    "^The case is full, and you're feeling really homesick.
 
164
                     Now, how to get out of here?";
 
165
                    }
 
166
                rtrue;  ! <-- print nothing further
 
167
            ];
 
168
 
 
169
Object  Undiscovered "hidden treasure room"
 
170
  with  description "How the heck did you get here!?.";
 
171
 
 
172
Treasure Statuette "pygmy statuette" Undiscovered
 
173
  with  name 'pygmy' 'statuette' 'statue' 'mayan' 'snake' 'spirit',
 
174
        description
 
175
            "A menacing, almost cartoon-like statuette of a pygmy spirit
 
176
             with an enormous snake around its neck.";
 
177
 
 
178
Treasure Bangle "silver bangle" Undiscovered
 
179
  with  name 'silver' 'bangle' 'bracelet' 'ring',
 
180
        cultural_value 20,
 
181
        description "An intricately chased piece of jewellery.";
 
182
 
 
183
Treasure Ruby "blood-red ruby" Undiscovered
 
184
  with  name 'blood' 'red' 'blood-red' 'ruby' 'stone' 'jewel',
 
185
        cultural_value 30,
 
186
        description "A vivid red jewel, as large as a hen's egg.";
 
187
 
 
188
Treasure Honeycomb "lump of wax" Undiscovered
 
189
  with  name 'ancient' 'honeycomb' 'old' 'honey' 'comb' 'wax' 'lump',
 
190
        cultural_value 40,
 
191
        description
 
192
            "On closer examination, the lump appears to be an old honeycomb.",
 
193
        after [;
 
194
            Eat:
 
195
                "Perhaps the most expensive meal of your life.
 
196
                 The honey tastes odd, perhaps because it was used to store the
 
197
                 entrails of the king buried here, but still like honey.";
 
198
            ],
 
199
  has   edible;
 
200
 
 
201
!==============================================================================!
 
202
!   Not in the DM as such, but useful (a) to distinguish room definitions from
 
203
!   those of ordinary objects in the file, and (b) to provide light everywhere
 
204
!   (unless overruled). See DM ��3.8.
 
205
!
 
206
Class   Room
 
207
  has   light;
 
208
 
 
209
!==============================================================================!
 
210
!   As DM ��7 and 10.
 
211
!
 
212
Room    Forest "Dark Forest"
 
213
  with  name 'forest' 'jungle' 'clearing' 'olive' 'tree' 'trees' 'midges',
 
214
        description
 
215
            "In this tiny clearing, the pine-needle carpet is broken by
 
216
             stone-cut steps leading down into the darkness.
 
217
             Dark olive trees crowd in on all sides, the air steams with
 
218
             warm recent rain, midges hang in the air.",
 
219
        d_to Stone_Steps,
 
220
        u_to
 
221
            "The trees are spiny and you'd cut your hands to ribbons
 
222
             trying to climb them.",
 
223
        cant_go
 
224
            "The rainforest-jungle is dense, and you haven't hacked through it
 
225
             for days to abandon your discovery now.
 
226
             Really, you need a good few artifacts to take back to civilisation
 
227
             before you can justify giving up the expedition.";
 
228
 
 
229
!==============================================================================!
 
230
!   As DM ��7 and 8 except: added discovery of Statuette on picking the
 
231
!   mushroom.
 
232
!
 
233
Object Mushroom "speckled mushroom" Forest
 
234
  with  name 'speckled' 'mushroom' 'fungus' 'toadstool',
 
235
        initial
 
236
            "A speckled mushroom grows out of the sodden earth,
 
237
             on a long stalk.",
 
238
        description
 
239
            "The mushroom is capped with blotches,
 
240
             and you aren't at all sure it's not a toadstool.",
 
241
        before [;
 
242
            Eat:
 
243
                if (random(100) > 30)
 
244
                    "You nibble at one corner,
 
245
                     but the curious taste repels you.";
 
246
                deadflag = 1;   ! <-- You die!
 
247
                "The tiniest nibble is enough.
 
248
                 It was a toadstool, and a poisoned one at that!";
 
249
            ],
 
250
        after [;
 
251
            Drop:
 
252
                "The mushroom drops to the ground, battered slightly.";
 
253
            Take:
 
254
                if (self has general)
 
255
                    "You pick up the slowly-disintegrating mushroom.";
 
256
                give self general;
 
257
                move Statuette to location;
 
258
                "You stoop to pick the mushroom, neatly cleaving its thin stalk.
 
259
                 As you straighten up, you notice what looks like a
 
260
                 snake in the grass.";
 
261
            ],
 
262
  has   edible;
 
263
 
 
264
!==============================================================================!
 
265
!   As DM ��7 and 8 except: replaced "first feet" by cobwebs.
 
266
!
 
267
Object  Stone_Steps "stone-cut steps" Forest
 
268
  with  name 'stone' 'stone-cut' 'steps' 'stairs' 'cobwebs',
 
269
        description [;
 
270
            print "The cracked and worn steps descend into a dim chamber. ";
 
271
            if (Square_Chamber has visited)
 
272
                "The filmy cobwebs which once spanned the entrance
 
273
                 now hang in tatters.";
 
274
            else
 
275
                "Cobwebs form a flimsy barrier,
 
276
                 unlikely to impede your descent.";
 
277
            ],
 
278
        door_to Square_Chamber, door_dir d_to,
 
279
  has   door open scenery;
 
280
 
 
281
!==============================================================================!
 
282
!   As DM ��10 except: added examination of floor, word on east lintel,
 
283
!   insect trails when mushroom bursts.
 
284
!
 
285
Room    Square_Chamber "Square Chamber"
 
286
  with  name 'square' 'chamber' 'sand' 'dust' 'lintel' 'lintels' 'lintelled'
 
287
            'east' 'south' 'doorways' 'doors' 'steps',
 
288
        description
 
289
            "A sunken, gloomy stone chamber, ten yards across,
 
290
             whose floor is covered with fine sandy dust.
 
291
             A shaft of sunlight cuts in from the steps above,
 
292
             giving the chamber a diffuse light, but in the shadows low
 
293
             lintelled doorways to east and south
 
294
             lead into the deeper darkness of the Temple.",
 
295
        before [;
 
296
            Drop:
 
297
                if (noun == mushroom)
 
298
                    <<Insert Mushroom Sunlight>>;
 
299
            Examine:
 
300
                if (noun == d_obj) {
 
301
                    if (Trails in location)
 
302
                        <<Examine Trails>>;
 
303
                    "Only your own footprints disturb the dust.";
 
304
                    }
 
305
            Go: if (noun == e_obj) {
 
306
                    print "As you move into the eastern shadows, you seem to
 
307
                        glimpse the word SENE scratched on the lintel,
 
308
                        but before you can stop to inspect it more closely,
 
309
                        you find yourself in...^";
 
310
                    rfalse; ! <-- continue with the regular action
 
311
                    }
 
312
            Insert:
 
313
                if ((noun == Mushroom) && (second == Sunlight)) {
 
314
                    remove Mushroom;
 
315
                    move Trails to location;
 
316
                    "You drop the mushroom on the floor, in the glare of the
 
317
                     shaft of sunlight.
 
318
                     It bubbles obscenely, distends and then bursts into a
 
319
                     hundred tiny insects which run for the darkness in every
 
320
                     direction, leaving strange trails in the sandy floor.
 
321
                     No trace of fungus remain.";
 
322
                }
 
323
            ],
 
324
        u_to Forest,
 
325
        e_to Inner_Web,
 
326
        s_to Corridor;
 
327
 
 
328
!==============================================================================!
 
329
!   As DM ��10.
 
330
!
 
331
Object  Sunlight "shaft of sunlight" Square_Chamber
 
332
  with  name 'shaft' 'of' 'sunlight' 'sun' 'light' 'beam' 'sunbeam' 'ray'
 
333
            'rays' 'sun^s',
 
334
        description
 
335
            "The shaft of sunlight glimmers motes of dust in the air,
 
336
             making it seem almost solid.",
 
337
        before [;
 
338
            Examine, Search:
 
339
                ;
 
340
            default:
 
341
                "It's only an insubstantial shaft of sunlight.";
 
342
            ],
 
343
  has   scenery;
 
344
 
 
345
!==============================================================================!
 
346
!   Not in the DM as such, but useful because employed twice. It seemed easier
 
347
!   to have two sets of carvings rather just one plus a lot of if... tests.
 
348
!   See DM ��3.8.
 
349
!
 
350
Class   Carved
 
351
  with  name 'carved' 'inscription' 'inscriptions' 'carving' 'carvings'
 
352
            'group' 'of',
 
353
        initial "Carved inscriptions crowd the walls and ceiling.",
 
354
  has   container open pluralname static;
 
355
 
 
356
!==============================================================================!
 
357
!   As DM ��10 except: changed to include insect trails suggesting a carving,
 
358
!   and pressable carving which reveals cavity.
 
359
!
 
360
Carved  Carvings "carved inscriptions" Square_Chamber
 
361
  with  description [;
 
362
            print "The carvings cut deep into the rocks from which the
 
363
                chamber is built, forming swirling sinuous patterns.";
 
364
            if (cavity in self)
 
365
                print " In the middle of one wall, a small cavity can be seen.";
 
366
            new_line;
 
367
            ],
 
368
        before [;
 
369
            Push:
 
370
                "Pressing the carved rock walls at random is unlikely
 
371
                 to be revealing.";
 
372
            Touch:
 
373
                "The carvings are warm and smooth to the touch.";
 
374
            ];
 
375
 
 
376
Carved  Other_Carvings "carved inscriptions"
 
377
  with  description
 
378
            "You stare at a group of carvings in the middle of one wall,
 
379
             uncannily resembling the insects' trail left in the sand,
 
380
             and feel your hand reaching out in that direction.",
 
381
        before [;
 
382
            Push:
 
383
                remove Other_Carvings;
 
384
                move Carvings to location;
 
385
                move Cavity to Carvings;
 
386
                "The carvings slide inwards, revealing a small cavity.";
 
387
            Touch:
 
388
                "The carvings seems to shift slightly under your hand.
 
389
                 Perhaps with a little more pressure...?";
 
390
            ];
 
391
 
 
392
Object  Cavity "cavity among the carvings"
 
393
  with  name 'cavity' 'hole' 'deep' 'gloomy',
 
394
        description
 
395
            "The cavity, a few inches across, is deep and gloomy.",
 
396
  has   container open static;
 
397
 
 
398
Object  Trails "trails in the sand"
 
399
  with  name 'trail' 'trails' 'sand' 'sandy' 'pattern' 'insect' 'insects',
 
400
        initial "Strange trails swirl on the sandy floor.",
 
401
        description [;
 
402
            if (self has general) {
 
403
                remove Carvings;
 
404
                move Other_Carvings to location;
 
405
                give self ~general;
 
406
                }
 
407
            "The insect trails seem to resemble one particular group of
 
408
             carvings on the wall.";
 
409
            ],
 
410
  has   general pluralname static;
 
411
 
 
412
!==============================================================================!
 
413
!   A Web room is implied at DM ��10, but not defined.  Here, it's implemented
 
414
!   as a simple dark maze of two rooms, once of which is home to the
 
415
!   scuttling claws described in Example 37. The Bangle is here.
 
416
!
 
417
Class   Maze
 
418
  class Room,
 
419
  with  name 'dark' 'darkness' 'web',
 
420
        description "Without a light, you'll never see anything here!",
 
421
        cant_go
 
422
            "Blundering around in the dark, it's impossible to tell
 
423
             which direction is which.",
 
424
  has   ~light;
 
425
 
 
426
Maze    Inner_Web "Web of Darkness"
 
427
  with  se_to Outer_Web,
 
428
        ne_to Inner_Web,
 
429
        n_to Inner_Web, s_to Inner_Web, e_to Inner_Web, w_to Inner_Web,
 
430
        nw_to Inner_Web, sw_to Inner_Web,
 
431
        u_to Inner_Web, d_to Inner_Web;
 
432
 
 
433
Maze    Outer_Web "Web of Darkness"
 
434
  with  se_to Outer_Web,
 
435
        ne_to Square_Chamber,
 
436
        n_to Inner_Web, s_to Inner_Web, e_to Inner_Web, w_to Inner_Web,
 
437
        nw_to Inner_Web, sw_to Inner_Web,
 
438
        u_to Inner_Web, d_to Inner_Web,
 
439
        before [;
 
440
            Go: if ((noun == ne_obj) && (Bangle in Undiscovered)) {
 
441
                    move Bangle to player;
 
442
                    print "Sensing a slight draught you move in that direction,
 
443
                        stumbling over something lying on the ground in the dark.
 
444
                        Almost inadvertently you grab it before gratefully
 
445
                        emerging into the gloomy chamber.^";
 
446
                    rfalse; ! <-- continue with the regular action
 
447
                }
 
448
            ];
 
449
 
 
450
!==============================================================================!
 
451
!   As DM Ex.37 except: daemon runs only in the Inner_Web room.
 
452
!
 
453
Object  Tiny_Claws "sound of tiny claws" thedark
 
454
  with  name 'tiny' 'claws' 'sound' 'of' 'scuttling' 'scuttle' 'things'
 
455
            'creatures' 'insects' 'monsters',
 
456
        article "the",
 
457
        initial "Somewhere, tiny claws are scuttling.",
 
458
        description "Without a light, you'll never see anything here!",
 
459
        before [;
 
460
            Attack: "They easily avoid your flailing about in the dark.";
 
461
            Listen: "How intelligent they sound, for mere insects.";
 
462
            Smell:  "You can smell only your own fear.";
 
463
            Taste, Touch:
 
464
                "You wouldn't want to. Really.";
 
465
            default:
 
466
                "The creatures evade you, chittering.";
 
467
            ],
 
468
        number 0,   ! <-- used by the daemon
 
469
        each_turn [; StartDaemon(self); ],
 
470
        daemon [;
 
471
            if (real_location ~= Inner_Web) {   ! location just has "thedark"
 
472
                self.number = 0;
 
473
                StopDaemon(self);
 
474
                rtrue;  ! <-- ?
 
475
                }
 
476
            switch(++self.number) {
 
477
                1:  "^The scuttling draws a little nearer,
 
478
                     and your breathing grows load and hoarse.";
 
479
                2:  "^The perspiration of terror runs off your brow.
 
480
                     The creatures are almost here!";
 
481
                3:  "^You feel a tickling at your extremities and kick outward,
 
482
                     shaking something chitinous off.
 
483
                     Their sound alone is a menacing rasp.";
 
484
                4:  deadflag = 1;   ! <-- You die!
 
485
                    "^Suddenly there is a tiny pain, of a hypodermic-sharp
 
486
                     fang at your calf.
 
487
                     Almost at once your limbs go into spasm, your shoulders
 
488
                     and knee-joints lock, your tongue swells...";
 
489
                }
 
490
            ];
 
491
 
 
492
!==============================================================================!
 
493
!   As DM ��12 except: added the moss concealing the Ruby.
 
494
!
 
495
Room    Corridor "Stooped Corridor"
 
496
  with  name 'low' 'stooped' 'corridor',
 
497
        description
 
498
            "A low, square-cut corridor, running north to south,
 
499
             stooping over you.
 
500
             Patches of moss emit a faint green fluorescent glow,
 
501
             just enough that you can see your surroundings.",
 
502
        n_to Square_Chamber,
 
503
        s_to Stone_Door,
 
504
  has   ;
 
505
 
 
506
Object  Moss "mossy patches" Corridor
 
507
  with  name 'moss' 'mossy' 'patches' 'green' 'fluorescent' 'glow' 'clumps',
 
508
        description [;
 
509
            if (Ruby in Undiscovered)
 
510
                "The moss grows in rough clumps, surprisingly thick in places.
 
511
                 Is that a hint of red hidden among all the greenery?";
 
512
            "The moss, now somewhat raggy, grows in rough clumps.";
 
513
            ],
 
514
        before [;
 
515
            Search:
 
516
            if (Ruby in Undiscovered) {
 
517
                    move Ruby to location;
 
518
                    "Something rolls from the moss onto the ground.";
 
519
                }
 
520
            ],
 
521
  has   pluralname scenery;
 
522
 
 
523
!==============================================================================!
 
524
!   As DM ��12. The key isn't actually defined in the DM.
 
525
!
 
526
Object  Stone_Door "stone door"
 
527
  with  name 'stone' 'door' 'big' 'massive' 'yellow',
 
528
        description "It's just a big stone door.",
 
529
        when_closed "The passage is barred by a massive door of yellow stone.",
 
530
        when_open "The massive yellow stone door is open.",
 
531
        door_to
 
532
            [; if (location == Corridor) return Shrine; return Corridor; ],
 
533
        door_dir
 
534
            [; if (location == Corridor) return s_to; return n_to; ],
 
535
        with_key Stone_Key,
 
536
        found_in Corridor Shrine,
 
537
  has   door lockable locked openable static;
 
538
 
 
539
Object  Stone_Key "huge iron key" Cavity
 
540
  with  name 'huge' 'iron' 'key',
 
541
        description "It must be a pretty big door to need a key like this.";
 
542
 
 
543
!==============================================================================!
 
544
!   A Shrine room is implied at DM ��10, but not defined.
 
545
!
 
546
Room    Shrine "Lofty Shrine"
 
547
  with  name 'lofty' 'shrine' 'haze' 'hazy' 'craggy' 'walls' 'quartz',
 
548
        description
 
549
            "For an underground chamber, the Shrine is remarkably high,
 
550
             though its upper half is hazy and difficult to see clearly.
 
551
             The craggy walls are polished natural rock, in which tiny
 
552
             flecks of quartz catch the light of the flickering candle.",
 
553
        n_to Stone_Door;
 
554
 
 
555
!==============================================================================!
 
556
!   As DM ��14 except: added processing of objects placed on the altar.
 
557
!
 
558
Object  Stone_Table "slab altar" Shrine
 
559
  with  name 'stone' 'table' 'slab' 'altar' 'great',
 
560
        initial "A great stone slab of a table dominates the Shrine.",
 
561
        description
 
562
            "It's big enough to lie on, though in the circumstances
 
563
             that might prove to be a A Really Bad Idea.",
 
564
        after [;
 
565
            Enter:
 
566
                deadflag = 1;   ! <-- You die!
 
567
                "With astonishing speed, the horror-struck priest plucks
 
568
                 a bronze dagger from his tattered robe, and stabs you
 
569
                 in your sacrilegious heart.";
 
570
            Receive:
 
571
                remove noun;
 
572
                switch (noun) {
 
573
                    Stone_Key:
 
574
                        move Honeycomb to player;
 
575
                        "His eyes dimly agleam with gratitude, the priest takes
 
576
                         the key and conceals it among his rags.
 
577
                         Then, lifting the candle, he carefully detaches a large
 
578
                         lump of the mottled wax, and gives it to you.";
 
579
                    Honeycomb:
 
580
                        move Honeycomb to player;
 
581
                        "~For returning the key, that is yours to keep.~";
 
582
                    }
 
583
                print "The priest takes ", (the) noun, " and conceals it
 
584
                    among his rags.^";
 
585
                rtrue;  ! <-- print nothing further
 
586
            ],
 
587
  has   enterable supporter static;
 
588
 
 
589
!==============================================================================!
 
590
!   Not in the DM as such, but added to provide light, and as a source for
 
591
!   the Honeycomb.
 
592
!
 
593
Object  Candle "flickering candle" Stone_Table
 
594
  with  name 'flickering' 'candle' 'flame',
 
595
        initial
 
596
            "A flickering candle at one end of the slab casts
 
597
             grotesque shadows on the walls.",
 
598
        description
 
599
            "The candle is little more than a crudely moulded lump of wax.
 
600
             Its texture is vaguely crystalline, with small fragments
 
601
             embedded within.",
 
602
  has   static;
 
603
 
 
604
!==============================================================================!
 
605
!   As DM ��16 except: the priest deal in objects, not the dictionary.
 
606
!
 
607
Object  Priest "mummified priest" Shrine
 
608
  with  name 'mummified' 'priest' 'old' 'ancient' 'dessicated',
 
609
        initial
 
610
            "Behind the slab, a mummified priest stands waiting,
 
611
             barely alive at best, impossibly venerable.",
 
612
        description
 
613
            "He is dessicated and hangs together only by will-power.
 
614
             Though his first language is presumably local Mayan, you have
 
615
             the curious instinct that he will understand your speech.",
 
616
        life [;
 
617
            Answer:
 
618
                switch (noun) {
 
619
                    'hello', 'hi', 'bye', 'goodbye', 'good-bye', 'cheerio',
 
620
                    'thanks', 'thank', 'thankyou', 'you', 'cheers', 'ta':
 
621
                        "Silently, carefully, the priest nods his head.";
 
622
                    }
 
623
                "The priest coughs, and almost falls apart.";
 
624
            Ask:
 
625
                switch (second) {
 
626
                    'king', 'tomb', 'shrine', 'temple', 'altar', 'slab':
 
627
                        "~The King (life! propserity! happiness!) is buried
 
628
                         deep under this Shrine, where you will never go.~";
 
629
                    'silver', 'bangle', 'bracelet', 'ring',
 
630
                    'blood', 'red', 'blood-red', 'ruby', 'stone', 'jewel',
 
631
                    'pygmy', 'statuette', 'statue', 'mayan', 'snake', 'spirit':
 
632
                        "~That is one of my people's sacred relics.~";
 
633
                    'ancient', 'honeycomb', 'old', 'honey', 'comb', 'wax',
 
634
                    'lump':
 
635
                        "~That is the most sacred of all my people's relics.~";
 
636
                    'huge', 'iron', 'key':
 
637
                        if (parent(Stone_Key) == nothing)
 
638
                            "~Now my people will be able to visit the Shrine.~";
 
639
                        "~That has been lost for generations.
 
640
                         My gratitude to anyone who returns it will be
 
641
                         overwhelming.~";
 
642
                    }
 
643
                "~You must find your own answer.~";
 
644
            Attack, Kiss:
 
645
                remove self;
 
646
                "The priest desiccates away into dust until nothing remains,
 
647
                 not a breeze or a bone.";
 
648
            Give, Show:
 
649
                switch (noun) {
 
650
                    Bangle, Ruby, Statuette:
 
651
                        "~I would be grateful if you placed that before me.~";
 
652
                    Honeycomb:
 
653
                        "~For returning the key, that is yours to keep.~";
 
654
                    Stone_Key:
 
655
                        "~I would be profoundly grateful if you placed that
 
656
                         before me.~";
 
657
                    }
 
658
                "The priest is indifferent to earthly things.";
 
659
            Tell:
 
660
                "The priest has no interest in your sordid life.";
 
661
            ThrowAt:
 
662
                move noun to location;
 
663
                <<Attack self>>;
 
664
            ],
 
665
        orders [;
 
666
            Go: "~I must not leave the Shrine.~";
 
667
            NotUnderstood:
 
668
                switch (noun) {
 
669
                    'hello', 'hi', 'bye', 'goodbye', 'good-bye', 'cheerio',
 
670
                    'thanks', 'thank', 'thankyou', 'you', 'cheers', 'ta':
 
671
                        "Silently, carefully, the priest nods his head.";
 
672
                    }
 
673
                "~You speak in riddles~";
 
674
            default:
 
675
                "~It is not your orders that I serve.~";
 
676
            ],
 
677
  has   animate;
 
678
 
 
679
!==============================================================================!
 
680
!   Every game needs to include the Grammar.
 
681
!
 
682
Include "Grammar";
 
683
 
 
684
!==============================================================================!
 
685
!   Added to enable you to "pick" the mushroom (as well as the usual "take",
 
686
!   "get", "pick up", etc). See DM ��26.
 
687
!
 
688
Extend "pick" * edible -> Take;
 
689
 
 
690
!==============================================================================!
 
691