advent.zil 175 KB
Newer Older
1
2
3
;"Main file for ADVENTURE"
;"Ported to ZIL by Jesse McGrew, July 2015"

Jesse McGrew's avatar
Jesse McGrew committed
4
5
6
;"TODO: DESCRIBE-OBJECTS should mention special LOCAL-GLOBALS?"
;"TODO: Add CANT-GO property?"

7
8
9
10
;----------------------------------------------------------------------
"General directives"
;----------------------------------------------------------------------

Jesse McGrew's avatar
Jesse McGrew committed
11
<VERSION ZIP>
Jesse McGrew's avatar
Jesse McGrew committed
12
<CONSTANT RELEASEID 0>
Jesse McGrew's avatar
Jesse McGrew committed
13
<CONSTANT IFID-ARRAY <PTABLE (STRING) "UUID://0E123F50-20A2-4F5B-8F01-264678ED419D//">>
Jesse McGrew's avatar
Jesse McGrew committed
14

15
<COMPILATION-FLAG DEBUG <>>
16
<COMPILATION-FLAG DEBUGGING-VERBS T>
17

18
19
20
21
;"BETA and DBMAZE are defined by this game. Do not comment out these lines -- that will
  leave the options stuck *on*."
<COMPILATION-FLAG BETA T>      ;"Transcript prompt, lucky number, beta title/credits"
<COMPILATION-FLAG DBMAZE <>>   ;"Gives the maze rooms unique names"
Jesse McGrew's avatar
Jesse McGrew committed
22

23
24
25
26
<CONSTANT GAME-BANNER
    <STRING
        <IFFLAG (BETA "ADVENTURE (beta)|") (ELSE "ADVENTURE|")>
        "A Modern Classic|
Jesse McGrew's avatar
Jesse McGrew committed
27
Based on Adventure by Willie Crowther and Don Woods (1977)|
28
And prior adaptations by David M. Baggett (1993), Graham Nelson (1994), and others|
Jesse McGrew's avatar
Jesse McGrew committed
29
Adapted once more by Jesse McGrew (2015)">>
Jesse McGrew's avatar
Jesse McGrew committed
30

31
32
33
34
;----------------------------------------------------------------------
"Main entry point"
;----------------------------------------------------------------------

Jesse McGrew's avatar
Jesse McGrew committed
35
36
37
<ROUTINE GO ()
    <SETG HERE ,AT-END-OF-ROAD>
    <SETG SCORE 36>
38
    <IF-BETA <SEED-RANDOM>>
39
40
41
42
43
    <SETG MODE ,VERBOSE>
    <CRLF> <CRLF>
    <TELL "Welcome to Adventure! Do you need instructions?">
    <COND (<YES?> <CRLF> <SHOW-HINT ,HNT?INSTRUCTIONS> <CRLF>)>
    <CRLF>
44
    <SETG PREV-SCORE ,SCORE>
45
    <INIT-STATUS-LINE>
46
    <V-VERSION> <CRLF>
Jesse McGrew's avatar
Jesse McGrew committed
47
48
49
    <QUEUE I-DWARF -1>
    <QUEUE I-PIRATE -1>
    <QUEUE I-CAVE-CLOSER -1>
50
    <QUEUE I-OFFER-HINT -1>
Jesse McGrew's avatar
Jesse McGrew committed
51
    <MOVE ,PLAYER ,HERE>
Jesse McGrew's avatar
Jesse McGrew committed
52
    <PUTP ,PLAYER ,P?CAPACITY 35> ;"7 objects at default size 5"
53
    <PUTP ,PLAYER ,P?ACTION ,ADVENT-PLAYER-F>
Jesse McGrew's avatar
Jesse McGrew committed
54
55
56
57
58
59
    <V-LOOK>
    <REPEAT ()
        <COND (<PARSER>
               <PERFORM ,PRSA ,PRSO ,PRSI>
               <COND (<NOT <GAME-VERB?>>
                      <APPLY <GETP ,HERE ,P?ACTION> ,M-END>
60
61
62
63
64
65
                      <CLOCKER>)>
               ;"UPDATE-SCORE-AND-NOTIFY is called explicitly instead of using the interrupt
                 queue: first, because we need to make sure it runs after all other interrupts,
                 since they might affect the score. Second, because we want it to run even on
                 GAME-VERB turns, since debugging verbs can move treasures and affect the score."
               <UPDATE-SCORE-AND-NOTIFY>)>
Jesse McGrew's avatar
Jesse McGrew committed
66
67
        <SETG HERE <LOC ,WINNER>>>>

Jesse McGrew's avatar
Jesse McGrew committed
68
69
70
71
72
73
74
75
76
77
<IF-BETA
    <CONSTANT FORTUNES
        <PLTABLE "Watch out for bugs!"
                 "Full batteries make empty pits."
                 "A bearded man will steal your treasure."
                 "A savage beast will become your friend."
                 "A group of visitors will surprise you with shiny gifts."
                 "Not all questions are rhetorical.">>

    <ROUTINE SEED-RANDOM ("AUX" S)
78
79
        <TELL "Hello, beta tester! Do you want to start transcripting now?">
        <COND (<YES?> <V-SCRIPT>)>
Jesse McGrew's avatar
Jesse McGrew committed
80
81
82
        <SET S <RANDOM 32767>>
        <TELL "[Your fortune for today: \""
              <PICK-ONE-R ,FORTUNES>
83
84
              " Lucky number " N .S ".\"" CR
              "Use XLUCKY " N .S " to replay this game next time.]" CR>
Jesse McGrew's avatar
Jesse McGrew committed
85
86
        <RANDOM <- .S>>>>

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<ROUTINE ADVENT-PLAYER-F (ARG "AUX" F)
    <COND (<=? .ARG ,M-WINNER>
           <COND (<VERB? SWIM>
                  ;"Change the default response, but give the location a chance to override it."
                  <COND (<NOT <AND <SET F <GETP ,HERE ,P?ACTION>>
                                   <APPLY .F ,M-BEG>>>
                         <TELL "You don't know how." CR>)>
                  <RTRUE>)
                 (<AND <VERB? CLIMB> <NOT ,PRSO>>
                  <COND (<OR <VISIBLE? <SET F ,PLANT>>
                             <VISIBLE? <SET F ,PLANT-STICKING-UP>>
                             <VISIBLE? <SET F ,SMALL-CLIMBABLE-PIT>>
                             <VISIBLE? <SET F ,MASSIVE-ORANGE-COLUMN>>
                             <VISIBLE? <SET F ,PIT>>>
                         <SETG PRSO .F>
                         <RFALSE>)>)
                 (<AND <VERB? DROP>
                       <=? ,HERE ,INSIDE-BUILDING>
                       <FSET? ,PRSO ,TREASUREBIT>>
                  <COND (<PRE-DROP>)
                        (<AND <SET F <GETP ,PRSO ,P?ACTION>> <APPLY .F>>)
108
109
                        (ELSE
                         <MOVE ,PRSO ,HERE>
110
111
                         <FSET ,PRSO ,TOUCHBIT>
                         <FCLEAR ,PRSO ,WORNBIT>
112
113
                         <COND (<SHORT-REPORT?> <TELL "Safely deposited." CR>)
                               (ELSE <TELL "You safely deposit " T ,PRSO "." CR>)>)>
114
115
116
117
118
119
120
                  <RTRUE>)
                 (<VERB? QUIT>
                  <V-SCORE T>
                  <CRLF>
                  <V-QUIT>
                  <RTRUE>)
                 (<AND <VERB? DROP>
121
122
123
124
125
126
127
                       <OR <AND <PRSO? ,LITTLE-BIRD>
                                <IN? ,LITTLE-BIRD ,WICKER-CAGE>
                                <HELD? ,WICKER-CAGE>>
                           <AND <PRSO? ,BEAR>
                                ,BEAR-FOLLOWING>>>
                  ;"DROP BIRD/BEAR is normally blocked by PRE-DROP, so we intercept it here
                    and redirect to RELEASE BIRD/BEAR."
128
129
                  <PERFORM ,V?RELEASE ,PRSO>
                  <RTRUE>)>)>
130
131
132
    ;"Fall back to the library's handler."
    <PLAYER-F>>

133
134
135
136
137
;----------------------------------------------------------------------
"Include the standard library"
;----------------------------------------------------------------------

;"This affects the definition of GAME-VERB?."
138
<SETG EXTRA-GAME-VERBS '(SCORE HELP INFO CREDITS)>
139
<IF-BETA <SETG EXTRA-GAME-VERBS (!,EXTRA-GAME-VERBS XLUCKY XLOOT)>>
140

141
142
;"This is used by the debugging verbs.
  Note: TREASUREBIT isn't listed because it's a bit synonym."
143
<SETG EXTRA-FLAGS
144
    '(SACREDBIT MULTITUDEBIT SPRINGBIT LIQUIDBIT SPONGEBIT)>
145

146
147
148
149
;"Override the HAVE check to allow PUT, HAVE, and DROP in a few special situations."
<REPLACE-DEFINITION FAILS-HAVE-CHECK?
    <ROUTINE FAILS-HAVE-CHECK? (OBJ)
        <NOT <OR <HELD? .OBJ>
150
151
                 ;"Allow PUT BIRD IN CAGE, PUT BOTTLED WATER/OIL ON <any>, or
                   PUT [POOL OF] WATER/OIL IN BOTTLE."
152
153
                 <AND <VERB? PUT-IN>
                      <OR <PRSO? ,WATER-IN-BOTTLE ,OIL-IN-BOTTLE>
154
155
                          <AND <PRSO? ,LITTLE-BIRD> <PRSI? ,WICKER-CAGE>>
                          <AND <PRSO? ,STREAM ,OIL> <PRSI? ,BOTTLE>>>>
156
157
158
159
160
                 ;"Allow DROP BIRD and DROP BEAR."
                 <AND <VERB? DROP>
                      <PRSO? ,LITTLE-BIRD ,BEAR>>>>>>

;"We replace a few more library sections below."
161
<DELAY-DEFINITION DARKNESS-F>
162
163
<DELAY-DEFINITION PRINT-GAME-OVER>
<DELAY-DEFINITION RESURRECT?>
164

Jesse McGrew's avatar
Jesse McGrew committed
165
166
<INSERT-FILE "parser">

167
168
169
170
;----------------------------------------------------------------------
"Utilities, properties, globals, and constants"
;----------------------------------------------------------------------

Jesse McGrew's avatar
Jesse McGrew committed
171
172
173
174
175
176
177
;"Utility macro for randomness"
<DEFMAC PROB ('N)
    <FORM L=? '<RANDOM 100> .N>>

;"Properties"
<PROPDEF DEPOSIT-POINTS 10>

178
179
180
181
182
183
;"We're almost over the limit of flags for Z-machine version 3, but we
  can save one flag by making TREASUREBIT a synonym of SACREDBIT. This
  works because SACREDBIT is only for rooms and TREASUREBIT is only for
  things."
<BIT-SYNONYM SACREDBIT TREASUREBIT>

184
185
186
187
188
189
190
191
192
193
194
195
196
;----------------------------------------------------------------------
"Scoring and treasure counting"
;----------------------------------------------------------------------

;"Treasures"
<CONSTANT MAX-TREASURES 15>

<CONSTANT TR-UNFOUND 0>
<CONSTANT TR-TOUCHED 1>
<CONSTANT TR-CARRIED 2>
<CONSTANT TR-DEPOSITED 3>

<CONSTANT ALL-TREASURES
197
    <TABLE %<VERSION? (ZIP '(BYTE)) (ELSE #SPLICE ())>
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
        LARGE-GOLD-NUGGET TR-UNFOUND
        DIAMONDS          TR-UNFOUND
        BARS-OF-SILVER    TR-UNFOUND
        PRECIOUS-JEWELRY  TR-UNFOUND
        RARE-COINS        TR-UNFOUND
        PERSIAN-RUG       TR-UNFOUND
        TREASURE-CHEST    TR-UNFOUND
        GOLDEN-EGGS       TR-UNFOUND
        TRIDENT           TR-UNFOUND
        MING-VASE         TR-UNFOUND
        EGG-SIZED-EMERALD TR-UNFOUND
        PLATINUM-PYRAMID  TR-UNFOUND
        PEARL             TR-UNFOUND
        RARE-SPICES       TR-UNFOUND
        GOLDEN-CHAIN      TR-UNFOUND>>
        
<CONSTANT MAX-SCORE 350>
<GLOBAL PREV-SCORE 0>

<CONSTANT RANKS
    <PLTABLE
        349 "All of adventuredom gives tribute to you, Adventurer Grandmaster!"
        330 "Your score puts you in Master Adventurer Class A."
        300 "Your score puts you in Master Adventurer Class B."
        250 "Your score puts you in Master Adventurer Class C."
        200 "You have reached \"Junior Master\" status."
        130 "You may now consider yourself a \"Seasoned Adventurer\"."
        100 "You have achieved the rating: \"Experienced Adventurer\"."
        35  "Your score qualifies you as a Novice Class Adventurer."
        10  "You are obviously a Rank Amateur. Better luck next time.">>

<SYNTAX SCORE = V-SCORE>

231
<ROUTINE V-SCORE ("OPT" DEAD "AUX" MAX NR)
232
    <TELL "In ">
233
    <COND (<1? ,MOVES> <TELL "1 turn">) (ELSE <TELL N ,MOVES " turns">)>
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
    <TELL ", you">
    <COND (<NOT .DEAD> <TELL "'ve">)>
    <TELL " scored ">
    <COND (<1? ,SCORE> <TELL "1 point">) (ELSE <TELL N ,SCORE " points">)>
    <TELL " out of a possible " N ,MAX-SCORE "." CR>
    <COND (.DEAD
           ;"Announce the player's rating based on their score."
           <SET MAX <GET ,RANKS 0>>
           <DO (I 1 .MAX 2)
               (END ;"Too low for any rating."
                <TELL "Wow." CR>
                <SET NR <- .MAX 1>>)
               <COND (<G? ,SCORE <GET ,RANKS .I>>
                      <TELL <GET ,RANKS <+ .I 1>> CR>
                      <SET I <- .I 2>>
                      <COND (<L? .I 1> <SET NR 0>)
                            (ELSE <SET NR .I>)>
                      <RETURN>)>>
           <TELL "To achieve the next higher rating">
           <COND (.NR
                  <SET NR <+ <- <GET ,RANKS .NR> ,SCORE> 1>>
                  <TELL ", you need " N .NR " more point">
                  <COND (<1? .NR> <TELL "." CR>) (ELSE <TELL "s." CR>)>)
                 (ELSE
                  <TELL " would be a neat trick!|Congratulations!!" CR>)>)>>

260
<ROUTINE UPDATE-SCORE-AND-NOTIFY ("AUX" D T OS NS)
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
    ;"Note any changes in treasure status"
    <DO (I 0 %<* <- ,MAX-TREASURES 1> 2> 2)
        <SET T <GET/B ,ALL-TREASURES .I>>
        <SET OS <GET/B ,ALL-TREASURES <+ .I 1>>>
        <COND (<IN? .T ,INSIDE-BUILDING> <SET NS ,TR-DEPOSITED>)
              (<IN? .T ,WINNER> <SET NS ,TR-CARRIED>)
              (<FSET? .T ,TOUCHBIT> <SET NS ,TR-TOUCHED>)
              (ELSE <SET NS ,TR-UNFOUND>)>
        <COND (<N=? .OS .NS>
               ;"A permanent 2 points for taking it in the first place"
               <COND (<=? .OS ,TR-UNFOUND> <SETG SCORE <+ ,SCORE 2>>)>
               ;"A revocable 5 points for carrying it"
               <COND (<=? .NS ,TR-CARRIED> <SETG SCORE <+ ,SCORE 5>>)
                     (<=? .OS ,TR-CARRIED> <SETG SCORE <- ,SCORE 5>>)>
               ;"A revocable ${DEPOSIT-POINTS} points for placing it in INSIDE-BUILDING"
               <COND (<=? .NS ,TR-DEPOSITED>
                      <SETG SCORE <+ ,SCORE <GETP .T ,P?DEPOSIT-POINTS>>>)
                     (<=? .OS ,TR-DEPOSITED>
                      <SETG SCORE <- ,SCORE <GETP .T ,P?DEPOSIT-POINTS>>>)>
               <PUT/B ,ALL-TREASURES <+ .I 1> .NS>)>>
    ;"Notify player if score has changed"
    <SET D <- ,SCORE ,PREV-SCORE>>
    <COND (.D
           <TELL CR "[Your score has gone">
           <COND (<G? .D 0>
                  <TELL " up">)
                 (ELSE
                  <SET D <- .D>>
                  <TELL " down">)>
           <TELL " by " N .D " point">
           <COND (<NOT <1? .D>> <TELL !\s>)>
           <TELL ".]" CR>)>
    <SETG PREV-SCORE ,SCORE>
    <T? .D>>

Jesse McGrew's avatar
Jesse McGrew committed
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
;----------------------------------------------------------------------
"The outside world"
;----------------------------------------------------------------------

<ROOM AT-END-OF-ROAD
    (DESC "At End Of Road")
    (IN ROOMS)
    (GLOBAL WELL-HOUSE STREAM ROAD FOREST)
    (LDESC "You are standing at the end of a road before a small brick building.
Around you is a forest.
A small stream flows out of the building and down a gully.")
    (WEST TO AT-HILL-IN-ROAD)
    (UP TO AT-HILL-IN-ROAD)
    (EAST TO INSIDE-BUILDING)
    (DOWN TO IN-A-VALLEY)
    (SOUTH TO IN-A-VALLEY)
    (NORTH PER RANDOM-FOREST)
    (IN TO INSIDE-BUILDING)
    (FLAGS LIGHTBIT SACREDBIT)>

<OBJECT WELL-HOUSE
    (DESC "well house")
    (IN LOCAL-GLOBALS)
    (SYNONYM WELL HOUSE BUILDING WELLHOUSE)
    (ADJECTIVE WELL BRICK SMALL)
    (TEXT "It's a small brick building. It seems to be a well house.")
    (ACTION WELL-HOUSE-F)>

<ROUTINE WELL-HOUSE-F ()
    <COND (<VERB? ENTER>
           <COND (<AND <IN? ,WINNER ,AT-HILL-IN-ROAD>
                       <NOT <FSET? ,INSIDE-BUILDING ,TOUCHBIT>>>
                  <TELL "It's too far away." CR>)
                 (ELSE <GOTO ,INSIDE-BUILDING>)>)>>

<OBJECT STREAM
    (DESC "stream")
    (IN LOCAL-GLOBALS)
334
    (SYNONYM STREAM WATER ;BROOK ;RIVER LAKE RESERVOIR)
Jesse McGrew's avatar
Jesse McGrew committed
335
    (ADJECTIVE SMALL TUMBLING SPLASHING BABBLING RUSHING)
336
    (ACTION STREAM-F)
337
    (GENERIC WATER-GENERIC)
338
    (FLAGS SPRINGBIT)>
Jesse McGrew's avatar
Jesse McGrew committed
339

340
<ROUTINE STREAM-F ("AUX" ENDS-HERE? OUTSIDE?)
Jesse McGrew's avatar
Jesse McGrew committed
341
    <COND (<VERB? DRINK>
342
           <TELL "The water tastes strongly of ">
343
344
345
346
347
           ;"Inspired by a typo that was too amusing to take out..."
           <COND (<PROB 95> <TELL "minerals">)
                 (<PROB 50> <TELL "animals">)
                 (ELSE <TELL "vegetables">)>
           <TELL ", but is not unpleasant. It is extremely cold." CR>)
Jesse McGrew's avatar
Jesse McGrew committed
348
349
          (<VERB? TAKE>
           <COND (<HELD? ,BOTTLE>
350
                  <PERFORM ,V?FILL-WITH ,BOTTLE ,STREAM>
Jesse McGrew's avatar
Jesse McGrew committed
351
352
353
                  <RTRUE>)
                 (ELSE <TELL "You have nothing in which to carry the water." CR>)>)
          (<AND <VERB? PUT-IN> <PRSI? ,STREAM>>
354
355
           <SET ENDS-HERE? <=? ,HERE ,IN-PIT ,AT-SLIT-IN-STREAMBED>>
           <SET OUTSIDE? <AND <FSET? ,HERE ,LIGHTBIT> <FSET? ,HERE ,SACREDBIT>>>
Jesse McGrew's avatar
Jesse McGrew committed
356
357
           <COND (<PRSO? ,MING-VASE>
                  <REMOVE ,PRSO>
358
359
360
361
362
363
364
                  <TELL "The sudden change in temperature has delicately shattered the vase">
                  <COND (.ENDS-HERE?
                         <MOVE ,SHARDS ,HERE>
                         <TELL "." CR>)
                        (ELSE
                         <COND (.OUTSIDE? <MOVE ,SHARDS ,AT-SLIT-IN-STREAMBED>)>
                         <TELL ", and the shards wash away with the stream." CR>)>)
Jesse McGrew's avatar
Jesse McGrew committed
365
                 (<PRSO? ,BOTTLE>
366
                  <PERFORM ,V?FILL-WITH ,BOTTLE ,STREAM>
Jesse McGrew's avatar
Jesse McGrew committed
367
                  <RTRUE>)
368
369
370
371
                 (<PRSO? ,LITTLE-BIRD>
                  <FSET ,WICKER-CAGE ,OPENBIT>
                  <MOVE ,LITTLE-BIRD ,HERE>
                  <TELL CT ,LITTLE-BIRD " splashes cheerfully, then flies out of the water." CR>)
372
373
374
                 (.ENDS-HERE?
                  <PERFORM ,V?DROP ,PRSO>
                  <RTRUE>)
Jesse McGrew's avatar
Jesse McGrew committed
375
                 (ELSE
376
377
                  <COND (.OUTSIDE? <MOVE ,PRSO ,AT-SLIT-IN-STREAMBED>)
                        (ELSE <REMOVE ,PRSO>)>
378
379
380
381
382
                  <COND (<SHORT-REPORT?> <TELL "Washed away." CR>)
                        (ELSE
                         <TELL CT ,PRSO " wash">
                         <COND (<NOT <FSET? ,PRSO ,PLURALBIT>> <TELL "es">)>
                         <TELL " away with the stream." CR>)>)>)
383
384
          (<VERB? ENTER>
           <TELL "Your feet are now wet." CR>)>>
Jesse McGrew's avatar
Jesse McGrew committed
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417

<OBJECT ROAD
    (DESC "road")
    (IN LOCAL-GLOBALS)
    (SYNONYM ROAD STREET PATH DIRT)
    (TEXT "The road is dirt, not yellow brick.")>

<OBJECT FOREST
    (DESC "forest")
    (IN LOCAL-GLOBALS)
    (SYNONYM FOREST TREE TREES ;OAK ;MAPLE ;GROVE ;PINE ;SPRUCE ;BIRCH ;ASH
             ;SAPLINGS ;BUSHES ;LEAVES ;BERRY ;BERRIES ;HARDWOOD)
    (TEXT "The trees of the forest are large hardwood oak and maple, with an
occasional grove of pine or spruce.
There is quite a bit of undergrowth, largely birch and ash saplings plus
nondescript bushes of various sorts.
This time of year visibility is quite restricted by all the leaves, but travel
is quite easy if you detour around all the spruce and berry bushes.")
    (FLAGS MULTITUDEBIT)>

;----------------------------------------------------------------------

<ROOM AT-HILL-IN-ROAD
    (DESC "At Hill In Road")
    (IN ROOMS)
    (GLOBAL WELL-HOUSE ROAD FOREST)
    (LDESC "You have walked up a hill, still in the forest.
The road slopes back down the other side of the hill.
There is a building in the distance.")
    (EAST TO AT-END-OF-ROAD)
    (NORTH TO AT-END-OF-ROAD)
    (DOWN TO AT-END-OF-ROAD)
    (SOUTH PER RANDOM-FOREST)
418
419
    (THINGS <>    (HILL BUMP INCLINE) "It's just a typical hill."
            OTHER SIDE                "Why not explore it yourself?")
Jesse McGrew's avatar
Jesse McGrew committed
420
421
422
423
424
425
426
    (FLAGS LIGHTBIT SACREDBIT)>

;----------------------------------------------------------------------

<ROOM INSIDE-BUILDING
    (DESC "Inside Building")
    (IN ROOMS)
427
    (GLOBAL WELL-HOUSE STREAM)
Jesse McGrew's avatar
Jesse McGrew committed
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
    (LDESC "You are inside a building, a well house for a large spring.")
    (ACTION INSIDE-BUILDING-F)
    (WEST TO AT-END-OF-ROAD)
    (OUT TO AT-END-OF-ROAD)
    (IN SORRY "The pipes are too small.")
    (FLAGS LIGHTBIT SACREDBIT)>

<CONSTANT STREAM-FLOWS-OUT
    "The stream flows out through a pair of 1 foot diameter sewer pipes.">

<ROUTINE INSIDE-BUILDING-F (RARG)
    <COND (<=? .RARG ,M-BEG>
           <COND (<AND <VERB? WALK> <0? <GETPT ,HERE ,PRSO>>>
                  <TELL ,STREAM-FLOWS-OUT CR "The only exit is to the west." CR>)
                 (<AND <VERB? ENTER> <PRSO? ,SPRING ,SEWER-PIPES>>
                  <TELL ,STREAM-FLOWS-OUT CR "It would be advisable to use the exit." CR>)
                 (<VERB? XYZZY>
                  <GOTO ,IN-DEBRIS-ROOM>
                  <RTRUE>)
                 (<VERB? PLUGH>
                  <GOTO ,AT-Y2>
                  <RTRUE>)>)>>

<OBJECT SPRING
    (DESC "spring")
    (IN INSIDE-BUILDING)
454
    (SYNONYM SPRING)
Jesse McGrew's avatar
Jesse McGrew committed
455
456
    (ADJECTIVE LARGE)
    (TEXT ,STREAM-FLOWS-OUT)
457
    (FLAGS NDESCBIT SPRINGBIT)
458
459
460
461
    (ACTION SPRING-F)>

<ROUTINE SPRING-F ()
    <COND (<VERB? DRINK> <TELL ,STREAM-FLOWS-OUT CR>)>>
Jesse McGrew's avatar
Jesse McGrew committed
462
463
464
465

<OBJECT SEWER-PIPES
    (DESC "pair of 1 foot diameter sewer pipes")
    (IN INSIDE-BUILDING)
466
    (SYNONYM PAIR PIPES PIPE)
Jesse McGrew's avatar
Jesse McGrew committed
467
    (ADJECTIVE PAIR FOOT DIAMETER SEWER)
468
469
    (TEXT "Too small to fit inside.")
    (ACTION SEWER-PIPES-F)
Jesse McGrew's avatar
Jesse McGrew committed
470
471
    (FLAGS NDESCBIT)>

472
473
474
475
476
<ROUTINE SEWER-PIPES-F ()
    <COND (<AND <VERB? PUT-IN> <PRSI? ,SEWER-PIPES>>
           <PERFORM ,V?PUT-IN ,PRSO ,STREAM>
           <RTRUE>)>>

Jesse McGrew's avatar
Jesse McGrew committed
477
478
479
480
<OBJECT SET-OF-KEYS
    (DESC "set of keys")
    (SYNONYM KEY KEYS KEYRING SET)
    (ADJECTIVE SET)
481
    (PRONOUN IT THEM)
Jesse McGrew's avatar
Jesse McGrew committed
482
483
484
485
    (IN INSIDE-BUILDING)
    (FDESC "There are some keys on the ground here.")
    (TEXT "It's just a normal-looking set of keys.")
    (ACTION SET-OF-KEYS-F)
486
    (FLAGS TAKEBIT TOOLBIT)>
Jesse McGrew's avatar
Jesse McGrew committed
487
488
489
490
491
492
493

<ROUTINE SET-OF-KEYS-F ()
    <COND (<VERB? COUNT> <TELL "A dozen or so keys." CR>)>>

<OBJECT TASTY-FOOD
    (DESC "tasty food")
    (IN INSIDE-BUILDING)
494
    (SYNONYM FOOD RATION TRIPE RATIONS)
Jesse McGrew's avatar
Jesse McGrew committed
495
    (ADJECTIVE YUMMY TASTY DELICIOUS SCRUMPTIOUS)
Jesse McGrew's avatar
Jesse McGrew committed
496
    (ARTICLE "some")
Jesse McGrew's avatar
Jesse McGrew committed
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
    (FDESC "There is tasty food here.")
    (TEXT "Sure looks yummy!")
    (ACTION TASTY-FOOD-F)
    (FLAGS TAKEBIT EDIBLEBIT)>

<ROUTINE TASTY-FOOD-F ()
    <COND (<VERB? EAT>
           <TELL "Delicious!" CR>
           <REMOVE ,TASTY-FOOD>)>>

<OBJECT BRASS-LANTERN
    (DESC "brass lantern")
    (IN INSIDE-BUILDING)
    (SYNONYM LAMP HEADLAMP LANTERN LIGHT)
    (ADJECTIVE SHINY BRASS)
    (DESCFCN BRASS-LANTERN-DESCFCN)
    (ACTION BRASS-LANTERN-F)
    (FLAGS TAKEBIT DEVICEBIT)>

<ROUTINE BRASS-LANTERN-DESCFCN (ARG)
    <COND (<=? .ARG ,M-OBJDESC?> <RTRUE>)
          (<FSET? ,BRASS-LANTERN ,LIGHTBIT>
519
520
           <TELL "Your lamp is here, gleaming brightly." CR>)
          (ELSE <TELL "There is a shiny brass lamp nearby." CR>)>>
Jesse McGrew's avatar
Jesse McGrew committed
521
522
523
524

<ROUTINE BRASS-LANTERN-F ()
    <COND (<VERB? EXAMINE>
           <TELL "It is a shiny brass lamp">
525
           <COND (<NOT <FSET? ,PRSO ,LIGHTBIT>>
Jesse McGrew's avatar
Jesse McGrew committed
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
                  <TELL ". It is not currently lit." CR>)
                 (<L? ,LANTERN-POWER 30>
                  <TELL ", glowing dimly." CR>)
                 (ELSE <TELL ", glowing brightly." CR>)>)
          (<VERB? BURN>
           <PERFORM ,V?TURN-ON ,PRSO>
           <RTRUE>)
          (<VERB? RUB>
           <TELL "Rubbing the electric lamp is not particularly rewarding.
Anyway, nothing happens." CR>)
          (<VERB? TURN-ON>
           <COND (<L=? ,LANTERN-POWER 0>
                  <TELL "Unfortunately, the batteries seem to be dead." CR>
                  <RTRUE>)>
           <FSET ,PRSO ,LIGHTBIT>
           <OR <RUNNING? ,I-BRASS-LANTERN> <QUEUE I-BRASS-LANTERN -1>>
           <V-TURN-ON>
           <NOW-LIT?>
           <RTRUE>)
          (<VERB? TURN-OFF>
           <FCLEAR ,PRSO ,LIGHTBIT>
           <V-TURN-OFF>
           <NOW-DARK?>
           <RTRUE>)
          (<AND <VERB? PUT-IN> <PRSI? ,BRASS-LANTERN>>
           <COND (<PRSO? ,OLD-BATTERIES>
                  <TELL "Those batteries are dead; they won't do any good at all." CR>)
                 (<PRSO? ,FRESH-BATTERIES>
                  <REPLACE-LANTERN-BATTERIES>
                  <RTRUE>)
                 (ELSE
                  <TELL "The only thing you might successfully put in the lamp is a fresh pair of batteries." CR>)>)>>

<GLOBAL LANTERN-POWER 330>

<ROUTINE REPLACE-LANTERN-BATTERIES ()
    <COND (<OR <IN? ,FRESH-BATTERIES ,HERE> <HELD? ,FRESH-BATTERIES>>
           <REMOVE ,FRESH-BATTERIES>
           <SETG FRESH-BATTERIES-USED T>
           <MOVE ,OLD-BATTERIES ,HERE>
           <SETG LANTERN-POWER 2500>
           <TELL "I'm taking the liberty of replacing the batteries." CR>)>>

<ROUTINE I-BRASS-LANTERN ()
    ;"Dequeue the event if the lantern is off"
    <COND (<NOT <FSET? ,BRASS-LANTERN ,LIGHTBIT>>
           <DEQUEUE I-BRASS-LANTERN>
           <RFALSE>)>
    ;"Drain power and turn lamp off if dead"
    <COND (<DLESS? LANTERN-POWER 1>
           <FCLEAR ,BRASS-LANTERN ,LIGHTBIT>
577
578
           <FCLEAR ,BRASS-LANTERN ,ONBIT>
           <NOW-DARK?>)>
Jesse McGrew's avatar
Jesse McGrew committed
579
580
581
582
583
584
    ;"Report anything interesting"
    <COND (<VISIBLE? ,BRASS-LANTERN>
           <COND (<0? ,LANTERN-POWER>
                  <TELL "Your lamp has run out of power.">
                  <COND (<NOT <OR <HELD? ,FRESH-BATTERIES>
                                  <FSET? ,HERE ,LIGHTBIT>>>
585
                         <SETG LAMP-RAN-OUT T>
Jesse McGrew's avatar
Jesse McGrew committed
586
587
588
589
590
591
592
593
594
                         <JIGS-UP " You can't explore the cave without a lamp. So let's just call it a day.">)
                        (ELSE <REPLACE-LANTERN-BATTERIES>)>
                  <CRLF>
                  <RTRUE>)
                 (<=? ,LANTERN-POWER 30>
                  <TELL "Your lamp is getting dim.">
                  <COND (,FRESH-BATTERIES-USED
                         <TELL " You're also out of spare batteries. You'd best start wrapping this up." CR>)
                        (<AND <IN? ,FRESH-BATTERIES ,VENDING-MACHINE>
595
                              <FSET? ,VENDING-DEAD-END ,TOUCHBIT>>
Jesse McGrew's avatar
Jesse McGrew committed
596
597
598
599
600
601
602
603
604
605
606
607
608
                         <TELL " You'd best start wrapping this up, unless you can find some fresh batteries.
I seem to recall there's a vending machine in the maze. Bring some coins with you.">)
                        (<NOT <OR <IN? ,FRESH-BATTERIES ,VENDING-MACHINE>
                                  <IN? ,FRESH-BATTERIES ,HERE>
                                  <HELD? ,FRESH-BATTERIES>>>
                         <TELL " You'd best go back for those batteries.">)>
                  <CRLF>
                  <RTRUE>)>)>>

<OBJECT BOTTLE
    (DESC "bottle")
    (IN INSIDE-BUILDING)
    (SYNONYM BOTTLE JAR FLASK)
609
    (ADJECTIVE EMPTY)
610
    (DESCFCN BOTTLE-DESCFCN)
Jesse McGrew's avatar
Jesse McGrew committed
611
612
613
614
    (ACTION BOTTLE-F)
    (CONTFCN BOTTLE-CONTFCN)
    (FLAGS TAKEBIT CONTBIT OPENBIT)>

615
<ROUTINE BOTTLE-F ("AUX" F S)
616
    <COND (<AND <VERB? FILL-WITH> <PRSO? ,BOTTLE>>
Jesse McGrew's avatar
Jesse McGrew committed
617
618
           <COND (<FIRST? ,PRSO>
                  <TELL CT ,PRSO " is full already." CR>)
619
                 (<PRSI? ,STREAM ,SPRING>
Jesse McGrew's avatar
Jesse McGrew committed
620
621
                  <MOVE ,WATER-IN-BOTTLE ,PRSO>
                  <TELL CT ,PRSO " is now full of water." CR>)
622
                 (<PRSI? ,OIL>
Jesse McGrew's avatar
Jesse McGrew committed
623
624
                  <MOVE ,OIL-IN-BOTTLE ,PRSO>
                  <TELL CT ,PRSO " is now full of oil." CR>)
625
626
627
628
                 (ELSE
                  <TELL CT ,PRSO " is only supposed to hold liquids." CR>)>)
          (<AND <VERB? FILL> <SET F <FIND-IN ,HERE ,SPRINGBIT "from">>>
           <PERFORM ,V?FILL-WITH ,PRSO .F>)
Jesse McGrew's avatar
Jesse McGrew committed
629
630
631
          (<VERB? EMPTY>
           <COND (<NOT <SET F <FIRST? ,PRSO>>>
                  <TELL CT ,PRSO " is already empty!" CR>)
632
633
                 (<SET S <FIND-IN ,HERE ,SPONGEBIT "onto">>
                  <PERFORM ,V?POUR .F .S>)
Jesse McGrew's avatar
Jesse McGrew committed
634
635
636
637
                 (ELSE
                  <REMOVE .F>
                  <TELL "Your " D ,PRSO " is now empty and the ground is now wet." CR>)>)
          (<AND <VERB? PUT-IN> <PRSI? ,BOTTLE>>
638
           <PERFORM ,V?FILL-WITH ,PRSI ,PRSO>)>>
Jesse McGrew's avatar
Jesse McGrew committed
639

640
641
642
643
644
645
646
<ROUTINE BOTTLE-DESCFCN (ARG "AUX" F)
    <COND (<=? .ARG ,M-OBJDESC?> <RTRUE>)
          (<SET F <FIRST? ,BOTTLE>>
           <TELL "There is a bottle here, containing " A .F "." CR>)
          (ELSE
           <TELL "There is an empty bottle here." CR>)>>

Jesse McGrew's avatar
Jesse McGrew committed
647
648
649
650
651
<ROUTINE BOTTLE-CONTFCN ()
    <COND (<VERB? TAKE> <TELL "You're holding that already (in " T ,BOTTLE ")." CR>)>>

<OBJECT WATER-IN-BOTTLE
    (DESC "bottled water")
652
    (IN BOTTLE)
Jesse McGrew's avatar
Jesse McGrew committed
653
    (ARTICLE "some")
Jesse McGrew's avatar
Jesse McGrew committed
654
    (SYNONYM WATER H2O)
655
    (ADJECTIVE BOTTLED)
Jesse McGrew's avatar
Jesse McGrew committed
656
    (TEXT "It looks like ordinary water to me.")
657
    (SIZE 0)    ;"Doesn't count against inventory limit"
658
    (ACTION WATER-IN-BOTTLE-F)
659
    (GENERIC WATER-GENERIC)
660
    (FLAGS LIQUIDBIT)>
Jesse McGrew's avatar
Jesse McGrew committed
661
662
663
664
665

<ROUTINE WATER-IN-BOTTLE-F ()
    <COND (<VERB? DRINK>
           <REMOVE ,PRSO>
           <PERFORM ,V?DRINK ,STREAM>
666
667
668
           <RTRUE>)
          (<AND <VERB? PUT-ON> <PRSO? ,WATER-IN-BOTTLE>>
           <PERFORM ,V?POUR ,PRSO ,PRSI>
Jesse McGrew's avatar
Jesse McGrew committed
669
670
           <RTRUE>)>>

671
672
673
674
<ROUTINE WATER-GENERIC (TBL)
    <COND (<VERB? DRINK POUR> ,WATER-IN-BOTTLE)
          (<VERB? PUT-IN> ,STREAM)>>

Jesse McGrew's avatar
Jesse McGrew committed
675
676
<OBJECT OIL-IN-BOTTLE
    (DESC "bottled oil")
Jesse McGrew's avatar
Jesse McGrew committed
677
    (ARTICLE "some")
Jesse McGrew's avatar
Jesse McGrew committed
678
    (SYNONYM OIL LUBRICANT GREASE)
679
    (ADJECTIVE BOTTLED)
Jesse McGrew's avatar
Jesse McGrew committed
680
    (TEXT "It looks like ordinary oil to me.")
681
    (SIZE 0)    ;"Doesn't count against inventory limit"
682
    (ACTION OIL-IN-BOTTLE-F)
683
    (GENERIC OIL-GENERIC)
684
    (FLAGS LIQUIDBIT)>
Jesse McGrew's avatar
Jesse McGrew committed
685
686
687
688
689

<ROUTINE OIL-IN-BOTTLE-F ()
    <COND (<VERB? DRINK>
           ;"The response to DRINK OIL is to refuse, so we don't remove the object."
           <PERFORM ,V?DRINK ,OIL>
690
691
692
           <RTRUE>)
          (<AND <VERB? PUT-ON> <PRSO? ,OIL-IN-BOTTLE>>
           <PERFORM ,V?POUR ,PRSO ,PRSI>
Jesse McGrew's avatar
Jesse McGrew committed
693
694
           <RTRUE>)>>

695
696
697
698
<ROUTINE OIL-GENERIC (TBL)
    <COND (<VERB? DRINK POUR> ,OIL-IN-BOTTLE)
          (<VERB? PUT-IN> ,OIL)>>

Jesse McGrew's avatar
Jesse McGrew committed
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
;----------------------------------------------------------------------

<ROOM IN-FOREST-1
    (DESC "In Forest")
    (IN ROOMS)
    (GLOBAL FOREST)
    (LDESC "You are in open forest, with a deep valley to one side.")
    (EAST TO IN-A-VALLEY)
    (DOWN TO IN-A-VALLEY)
    (NORTH PER RANDOM-FOREST)
    (WEST PER RANDOM-FOREST)
    (SOUTH PER RANDOM-FOREST)
    (FLAGS LIGHTBIT SACREDBIT)>

<ROOM IN-FOREST-2
    (DESC "In Forest")
    (IN ROOMS)
    (GLOBAL ROAD FOREST)
    (LDESC "You are in open forest near both a valley and a road.")
    (NORTH TO AT-END-OF-ROAD)
    (EAST TO IN-A-VALLEY)
    (WEST TO IN-A-VALLEY)
    (DOWN TO IN-A-VALLEY)
    (SOUTH PER RANDOM-FOREST)
    (FLAGS LIGHTBIT SACREDBIT)>

<ROUTINE RANDOM-FOREST ()
    <COND (<=? <RANDOM 2> 1> ,IN-FOREST-1)
          (ELSE ,IN-FOREST-2)>>

<ROOM IN-A-VALLEY
    (DESC "In A Valley")
    (IN ROOMS)
    (GLOBAL STREAM FOREST)
    (LDESC "You are in a valley in the forest beside a stream tumbling along a rocky bed.")
    (NORTH TO AT-END-OF-ROAD)
    (EAST PER RANDOM-FOREST)
    (WEST PER RANDOM-FOREST)
    (UP PER RANDOM-FOREST)
    (SOUTH TO AT-SLIT-IN-STREAMBED)
    (DOWN TO AT-SLIT-IN-STREAMBED)
740
741
742
    ;"In V3, STREAMBED collides with STREAM, but real objects are matched before
      pseudo-objects so there's no ambiguity."
    (THINGS (SMALL ROCKY BARE DRY STREAM) (BED ROCK STREAMBED) "It's a typical streambed.")
Jesse McGrew's avatar
Jesse McGrew committed
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
    (FLAGS LIGHTBIT SACREDBIT)>

;----------------------------------------------------------------------

<CONSTANT YOU-DONT-FIT "You don't fit through a two-inch slit!">

<ROOM AT-SLIT-IN-STREAMBED
    (DESC "At Slit In Streambed")
    (IN ROOMS)
    (GLOBAL STREAM)
    (LDESC "At your feet all the water of the stream splashes into a 2-inch slit in the rock.
Downstream the streambed is bare rock.")
    (NORTH TO IN-A-VALLEY)
    (EAST PER RANDOM-FOREST)
    (WEST PER RANDOM-FOREST)
    (SOUTH TO OUTSIDE-GRATE)
    (DOWN SORRY ,YOU-DONT-FIT)
    (IN SORRY ,YOU-DONT-FIT)
761
    (THINGS (TWO INCH 2-INCH) SLIT 2-INCH-SLIT-F)
Jesse McGrew's avatar
Jesse McGrew committed
762
763
764
    (FLAGS LIGHTBIT SACREDBIT)>

<ROUTINE 2-INCH-SLIT-F ()
765
766
767
    <COND (<VERB? EXAMINE>
           <TELL "It's just a 2-inch slit in the rock, through which the stream is flowing." CR>)
          (<VERB? ENTER> <TELL ,YOU-DONT-FIT CR>)>>
Jesse McGrew's avatar
Jesse McGrew committed
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783

;----------------------------------------------------------------------

<ROOM OUTSIDE-GRATE
    (DESC "Outside Grate")
    (IN ROOMS)
    (GLOBAL GRATE)
    (LDESC "You are in a 20-foot depression floored with bare dirt.
Set into the dirt is a strong steel grate mounted in concrete.
A dry streambed leads into the depression.")
    (EAST PER RANDOM-FOREST)
    (WEST PER RANDOM-FOREST)
    (SOUTH PER RANDOM-FOREST)
    (NORTH TO AT-SLIT-IN-STREAMBED)
    (DOWN TO BELOW-THE-GRATE IF GRATE IS OPEN)
    (ACTION OUTSIDE-GRATE-F)
784
    (THINGS (TWENTY FOOT BARE 20-FOOT) (DEPRESSION DIRT) "You're standing in it.")
Jesse McGrew's avatar
Jesse McGrew committed
785
786
787
    (FLAGS LIGHTBIT SACREDBIT)>

<ROUTINE OUTSIDE-GRATE-F (RARG)
788
    <COND (<=? .RARG ,M-FLASH>
Jesse McGrew's avatar
Jesse McGrew committed
789
           ;"Since the grate isn't actually in the room, describe it here"
790
           <MAYBE-DESCRIBE-GRATE>)
Jesse McGrew's avatar
Jesse McGrew committed
791
792
793
794
795
796
797
798
799
800
          (<AND <=? .RARG ,M-BEG>
                <VERB? WALK>
                <PRSO? ,P?DOWN>
                <NOT <FSET? ,GRATE ,LOCKEDBIT>>
                <NOT <FSET? ,GRATE ,OPENBIT>>>
           <TELL "[first opening " T ,GRATE "]" CR>
           <FSET ,GRATE ,OPENBIT>
           ;"Return false to continue handling WALK"
           <RFALSE>)>>

801
802
803
804
805
806
807
808
<ROUTINE MAYBE-DESCRIBE-GRATE ()
    <COND (<FSET? ,GRATE ,OPENBIT>
           <THIS-IS-IT ,GRATE>
           <TELL CR "The grate stands open." CR>)
          (<NOT <FSET? ,GRATE ,LOCKEDBIT>>
           <THIS-IS-IT ,GRATE>
           <TELL CR "The grate is unlocked but shut." CR>)>>

Jesse McGrew's avatar
Jesse McGrew committed
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
<OBJECT GRATE
    (DESC "steel grate")
    (IN LOCAL-GLOBALS)
    (SYNONYM GRATE LOCK GATE GRATING)
    (ADJECTIVE METAL STRONG STEEL)
    (TEXT "It just looks like an ordinary grate mounted in concrete.")
    (ACTION GRATE-F)
    (FLAGS DOORBIT OPENABLEBIT LOCKEDBIT)>

<ROUTINE GRATE-F ()
    <COND (<AND <VERB? LOCK UNLOCK> <PRSO? ,GRATE>>
           <COND (<NOT <PRSI? ,SET-OF-KEYS>>
                  <TELL CT ,PRSI " won't fit the lock." CR>)
                 (<VERB? LOCK>
                  <COND (<FSET? ,PRSO ,LOCKEDBIT>
                         <TELL "It's already locked." CR>)
                        (ELSE
                         <FSET ,PRSO ,LOCKEDBIT>
                         <TELL "Locked." CR>)>)
                 (ELSE
                  <COND (<FSET? ,PRSO ,LOCKEDBIT>
                         <FCLEAR ,PRSO ,LOCKEDBIT>
                         <TELL "Unlocked." CR>)
                        (ELSE <TELL "It's already unlocked." CR>)>)>)>>

;----------------------------------------------------------------------
"Facilis descensus Averno..."
;----------------------------------------------------------------------

<ROOM BELOW-THE-GRATE
    (DESC "Below the Grate")
    (IN ROOMS)
    (LDESC "You are in a small chamber beneath a 3x3 steel grate to the surface.
A low crawl over cobbles leads inward to the west.")
    (GLOBAL GRATE COBBLES)
    (WEST TO IN-COBBLE-CRAWL)
    (UP TO OUTSIDE-GRATE IF GRATE IS OPEN)
846
    (ACTION BELOW-THE-GRATE-F)
Jesse McGrew's avatar
Jesse McGrew committed
847
848
    (FLAGS LIGHTBIT)>

849
850
851
<ROUTINE BELOW-THE-GRATE-F (RARG)
    <COND (<=? .RARG ,M-FLASH>
           ;"Since the grate isn't actually in the room, describe it here"
852
           <MAYBE-DESCRIBE-GRATE>)>>
853

Jesse McGrew's avatar
Jesse McGrew committed
854
855
856
<OBJECT COBBLES
    (DESC "cobbles")
    (IN LOCAL-GLOBALS)
857
858
859
860
    (SYNONYM COBBLE STONES STONE
        ;"V3 property size is limited to 8 bytes, and these collide anyway"
        %<VERSION? (ZIP #SPLICE ())
                   (ELSE #SPLICE (COBBLES COBBLESTONES))>)
Jesse McGrew's avatar
Jesse McGrew committed
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
    (TEXT "They're just ordinary cobbles.")
    (FLAGS PLURALBIT MULTITUDEBIT)>

;----------------------------------------------------------------------

<ROOM IN-COBBLE-CRAWL
    (DESC "In Cobble Crawl")
    (IN ROOMS)
    (LDESC "You are crawling over cobbles in a low passage.
There is a dim light at the east end of the passage.")
    (GLOBAL COBBLES)
    (EAST TO BELOW-THE-GRATE)
    (WEST TO IN-DEBRIS-ROOM)
    (FLAGS LIGHTBIT)>

<OBJECT WICKER-CAGE
    (DESC "wicker cage")
    (IN IN-COBBLE-CRAWL)
879
880
    (SYNONYM CAGE)
    (ADJECTIVE SMALL WICKER)
Jesse McGrew's avatar
Jesse McGrew committed
881
882
883
884
885
886
887
    (FDESC "There is a small wicker cage discarded nearby.")
    (TEXT "It's a small wicker cage.")
    (ACTION WICKER-CAGE-F)
    (FLAGS TAKEBIT CONTBIT OPENBIT OPENABLEBIT TRANSBIT)>

<ROUTINE WICKER-CAGE-F ()
    <COND (<AND <VERB? OPEN> <IN? ,LITTLE-BIRD ,PRSO>>
888
889
           <TELL "(releasing " T ,LITTLE-BIRD ")" CR>
           <PERFORM ,V?RELEASE ,LITTLE-BIRD>
890
891
892
893
894
           <RTRUE>)
          (<AND <VERB? PUT-IN>
                <PRSI? ,WICKER-CAGE>
                <NOT <PRSO? ,LITTLE-BIRD>>>
           <TELL CT ,PRSI " won't hold " T ,PRSO "." CR>)>>
Jesse McGrew's avatar
Jesse McGrew committed
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909

;----------------------------------------------------------------------

<ROOM IN-DEBRIS-ROOM
    (DESC "In Debris Room")
    (IN ROOMS)
    (LDESC "You are in a debris room filled with stuff washed in from the surface.
A low wide passage with cobbles becomes plugged with mud and debris here, but an
awkward canyon leads upward and west.||
A note on the wall says, \"Magic word XYZZY.\"")
    (GLOBAL COBBLES)
    (EAST TO IN-COBBLE-CRAWL)
    (UP TO IN-AWKWARD-SLOPING-E/W-CANYON)
    (WEST TO IN-AWKWARD-SLOPING-E/W-CANYON)
    (ACTION IN-DEBRIS-ROOM-F)
910
911
    (THINGS <> (DEBRIS STUFF MUD) "Yuck."
            <> NOTE               ([READ EXAMINE] "The note says \"Magic word XYZZY\"."))
Jesse McGrew's avatar
Jesse McGrew committed
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
    (FLAGS SACREDBIT)>

<ROUTINE IN-DEBRIS-ROOM-F (RARG)
    <COND (<AND <=? .RARG ,M-BEG> <VERB? XYZZY>>
           <GOTO ,INSIDE-BUILDING>
           <RTRUE>)>>

<OBJECT BLACK-ROD
    (DESC "black rod with a rusty star on the end")
    (IN IN-DEBRIS-ROOM)
    (SYNONYM ROD STAR)
    (ADJECTIVE BLACK RUSTY THREE FOOT IRON)
    (FDESC "A three foot black rod with a rusty star on one end lies nearby.")
    (TEXT "It's a three foot black rod with a rusty star on an end.")
    (ACTION BLACK-ROD-F)
    (FLAGS TAKEBIT)>

<ROUTINE BLACK-ROD-F ()
    <COND (<VERB? WAVE>
           <COND (<=? ,HERE ,WEST-SIDE-OF-FISSURE ,ON-EAST-BANK-OF-FISSURE>
                  <COND (,CAVES-CLOSED
                         <TELL "Peculiar. Nothing happens." CR>)
                        (<FSET? ,CRYSTAL-BRIDGE ,OPENBIT>
                         <FSET ,CRYSTAL-BRIDGE ,INVISIBLE>
                         <FCLEAR ,CRYSTAL-BRIDGE ,OPENBIT>
                         <TELL "The crystal bridge has vanished!" CR>)
                        (ELSE
                         <FCLEAR ,CRYSTAL-BRIDGE ,INVISIBLE>
                         <FSET ,CRYSTAL-BRIDGE ,OPENBIT>
941
                         <THIS-IS-IT ,CRYSTAL-BRIDGE>
Jesse McGrew's avatar
Jesse McGrew committed
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
                         <TELL "A crystal bridge now spans the fissure." CR>)>)
                 (ELSE <TELL "Nothing happens." CR>)>)>>

;----------------------------------------------------------------------

<ROOM IN-AWKWARD-SLOPING-E/W-CANYON
    (DESC "Sloping E/W Canyon")
    (IN ROOMS)
    (LDESC "You are in an awkward sloping east/west canyon.")
    (DOWN TO IN-DEBRIS-ROOM)
    (EAST TO IN-DEBRIS-ROOM)
    (UP TO IN-BIRD-CHAMBER)
    (WEST TO IN-BIRD-CHAMBER)
    (FLAGS SACREDBIT)>

;----------------------------------------------------------------------
"The little bird in its natural habitat"
;----------------------------------------------------------------------

<ROOM IN-BIRD-CHAMBER
    (DESC "Orange River Chamber")
    (IN ROOMS)
    (LDESC "You are in a splendid chamber thirty feet high.
The walls are frozen rivers of orange stone.
An awkward canyon and a good passage exit from east and west sides of the chamber.")
    (EAST TO IN-AWKWARD-SLOPING-E/W-CANYON)
    (WEST TO AT-TOP-OF-SMALL-PIT)
    (FLAGS SACREDBIT)>

<OBJECT LITTLE-BIRD
    (DESC "little bird")
    (IN IN-BIRD-CHAMBER)
    (SYNONYM BIRD)
    (ADJECTIVE CHEERFUL MOURNFUL LITTLE)
976
    (PRONOUN IT)
Jesse McGrew's avatar
Jesse McGrew committed
977
    (FDESC "A cheerful little bird is sitting here singing.")
978
    (SIZE 0)    ;"Doesn't count against inventory limit"
Jesse McGrew's avatar
Jesse McGrew committed
979
980
981
    (ACTION LITTLE-BIRD-F)
    (FLAGS PERSONBIT)>

982
983
984
985
986
<ROUTINE LITTLE-BIRD-F (ARG)
    <COND (<=? .ARG ,M-WINNER>
           <SETG P-CONT 0>
           <TELL CT ,LITTLE-BIRD " tilts its head, confused." CR>)
          (<VERB? EXAMINE>
Jesse McGrew's avatar
Jesse McGrew committed
987
           <COND (<IN? ,PRSO ,WICKER-CAGE>
988
                  <TELL CT ,LITTLE-BIRD " looks unhappy in the cage." CR>)
Jesse McGrew's avatar
Jesse McGrew committed
989
990
                 (ELSE
                  <TELL "The cheerful little bird is sitting here singing." CR>)>)
991
          (<AND <VERB? PUT-IN> <PRSO? ,LITTLE-BIRD>>
Jesse McGrew's avatar
Jesse McGrew committed
992
993
994
995
996
997
998
999
1000
1001
           <COND (<PRSI? ,WICKER-CAGE>
                  <PERFORM ,V?CATCH ,PRSO>
                  <RTRUE>)
                 (ELSE <TELL "Don't put the poor bird in " T ,PRSI "!" CR>)>)
          (<AND <VERB? DROP> <IN? ,PRSO ,WICKER-CAGE>>
           <TELL "(The bird is released from the cage.)" CR CR>
           <PERFORM ,V?RELEASE ,PRSO>
           <RTRUE>)
          (<VERB? TAKE CATCH>
           <COND (<IN? ,PRSO ,WICKER-CAGE>
1002
                  <TELL "You already have " T ,LITTLE-BIRD ".
Jesse McGrew's avatar
Jesse McGrew committed
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
If you take it out of the cage it will likely fly away from you." CR>)
                 (<NOT <HELD? ,WICKER-CAGE>>
                  <TELL "You can catch the bird, but you cannot carry it." CR>)
                 (<HELD? ,BLACK-ROD>
                  <TELL "The bird was unafraid when you entered, but as you approach
it becomes disturbed and you cannot catch it." CR>)
                 (ELSE
                  <MOVE ,PRSO ,WICKER-CAGE>
                  <FCLEAR ,WICKER-CAGE ,OPENBIT>
                  <TELL "You catch the bird in the wicker cage." CR>)>)
          (<VERB? RELEASE>
           <COND (<NOT <IN? ,PRSO ,WICKER-CAGE>>
                  <TELL "The bird is not caged now." CR>)
                 (ELSE
                  <FSET ,WICKER-CAGE ,OPENBIT>
                  <MOVE ,PRSO ,HERE>
                  <COND (<IN? ,SNAKE ,HERE>
                         <REMOVE ,SNAKE>
                         <TELL CT ,PRSO " attacks the green snake, and in an astounding
flurry drives the snake away." CR>)
                        (<IN? ,DRAGON ,HERE>
                         <REMOVE ,PRSO>
                         <TELL CT ,PRSO " attacks the green dragon, and in an astounding
flurry gets burnt to a cinder. The ashes blow away." CR>)
                        (ELSE <TELL "The little bird flies free." CR>)>)>)
          (<AND <VERB? GIVE> <PRSI? ,LITTLE-BIRD>>
           <TELL "It's not hungry. (It's merely pinin' for the fjords).
Besides, I suspect it would prefer bird seed." CR>)
          ;"TODO: TELL, ASK, ANSWER...?"
          (<VERB? ATTACK>
           <COND (<IN? ,PRSO ,WICKER-CAGE>
                  <TELL "Oh, leave the poor unhappy bird alone." CR>)
                 (ELSE
                  <REMOVE ,PRSO>
                  <TELL "The little bird is now dead. Its body disappears." CR>)>)>>

;----------------------------------------------------------------------

<ROOM AT-TOP-OF-SMALL-PIT
    (DESC "At Top of Small Pit")
    (IN ROOMS)
1044
    (GLOBAL MIST ROUGH-STONE-STEPS)
Jesse McGrew's avatar
Jesse McGrew committed
1045
1046
1047
    (EAST TO IN-BIRD-CHAMBER)
    (WEST SORRY "The crack is far too small for you to follow.")
    (DOWN PER DOWN-INTO-SMALL-PIT)
1048
    (ACTION AT-TOP-OF-SMALL-PIT-F)
1049
1050
    (THINGS SMALL PIT   SMALL-MISTY-PIT-F
            SMALL CRACK PIT-CRACK-F)
Jesse McGrew's avatar
Jesse McGrew committed
1051
1052
1053
1054
    (FLAGS SACREDBIT)>

<ROUTINE DOWN-INTO-SMALL-PIT ()
    <COND (<HELD? ,LARGE-GOLD-NUGGET>
1055
           <JIGS-UP "You are at the bottom of the pit with a broken neck.">
1056
           <RFALSE>)
Jesse McGrew's avatar
Jesse McGrew committed
1057
1058
          (ELSE ,IN-HALL-OF-MISTS)>>

1059
1060
1061
1062
1063
<ROUTINE AT-TOP-OF-SMALL-PIT-F (RARG)
    <COND (<=? .RARG ,M-LOOK>
           <TELL "At your feet is a small pit breathing traces of white mist.
A west passage ends here except for a small crack leading on.">
           <COND (<NOT <HELD? ,LARGE-GOLD-NUGGET>>
1064
1065
                  <TELL CR CR "Rough stone steps lead down the pit.">
                  <THIS-IS-IT ,ROUGH-STONE-STEPS>)>
1066
1067
           <CRLF>)
          (<AND <=? .RARG ,M-BEG> <VERB? CLIMB> <NOT ,PRSO>>
1068
           <DO-WALK ,P?DOWN>)>>
1069

1070
<ROUTINE SMALL-MISTY-PIT-F ()
1071
1072
1073
    <COND (<VERB? EXAMINE>
           <TELL "The pit is breathing traces of white mist." CR>)
          (<VERB? ENTER>
1074
1075
           <DO-WALK ,P?DOWN>)>>

Jesse McGrew's avatar
Jesse McGrew committed
1076
<ROUTINE PIT-CRACK-F ()
1077
1078
1079
1080
    <COND (<VERB? EXAMINE>
           <TELL "The crack is very small -- far too small for you to follow." CR>)
          (<VERB? ENTER>
           <TELL "The crack is far too small for you to follow." CR>)>>
Jesse McGrew's avatar
Jesse McGrew committed
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096

<OBJECT MIST
    (DESC "mist")
    (IN LOCAL-GLOBALS)
    (SYNONYM MIST VAPOR WISPS)
    (ADJECTIVE WHITE)
    (TEXT "Mist is a white vapor, usually water, seen from time to time in caves.
It can be found anywhere but is frequently a sign of a deep pit leading down to water.")>

;----------------------------------------------------------------------
"The caves open up: The Hall of Mists"
;----------------------------------------------------------------------

<ROOM IN-HALL-OF-MISTS
    (DESC "In Hall of Mists")
    (IN ROOMS)
1097
    (GLOBAL MIST ROUGH-STONE-STEPS)
Jesse McGrew's avatar
Jesse McGrew committed
1098
1099
1100
1101
1102
    (ACTION IN-HALL-OF-MISTS-F)
    (SOUTH TO IN-NUGGET-OF-GOLD-ROOM)
    (WEST TO ON-EAST-BANK-OF-FISSURE)
    (DOWN TO IN-HALL-OF-MT-KING)
    (NORTH TO IN-HALL-OF-MT-KING)
1103
1104
1105
    (UP PER UP-OUT-OF-SMALL-PIT)
    (THINGS (WIDE STONE) (STAIR STAIRS STAIRCASE) WIDE-STONE-STAIRCASE-F
            <>           DOME                     DOME-F)>
Jesse McGrew's avatar
Jesse McGrew committed
1106
1107
1108

<ROUTINE IN-HALL-OF-MISTS-F (RARG)
    <COND (<AND <=? .RARG ,M-ENTER>
Jesse McGrew's avatar
Jesse McGrew committed
1109
                <NOT <FSET? ,IN-HALL-OF-MISTS ,TOUCHBIT>>>
1110
1111
1112
1113
1114
1115
1116
1117
           <SETG SCORE <+ ,SCORE 25>>)
          (<=? .RARG ,M-LOOK>
           <TELL "You are at one end of a vast hall stretching forward out of sight to the west.
There are openings to either side. Nearby, a wide stone staircase leads downward.
The hall is filled with wisps of white mist swaying to and fro almost as if alive.
A cold wind blows up the staircase.
There is a passage at the top of a dome behind you.">
           <COND (<NOT <HELD? ,LARGE-GOLD-NUGGET>>
1118
1119
                  <TELL CR CR "Rough stone steps lead up the dome.">
                  <THIS-IS-IT ,ROUGH-STONE-STEPS>)>
1120
1121
           <CRLF>)
          (<AND <=? .RARG ,M-BEG> <VERB? CLIMB> <NOT ,PRSO>>
1122
           <DO-WALK ,P?UP>)>>
Jesse McGrew's avatar
Jesse McGrew committed
1123
1124
1125

<ROUTINE UP-OUT-OF-SMALL-PIT ()
    <COND (<HELD? ,LARGE-GOLD-NUGGET>
1126
1127
           <TELL "The dome is unclimbable." CR>
           <RFALSE>)
Jesse McGrew's avatar
Jesse McGrew committed
1128
1129
          (ELSE ,AT-TOP-OF-SMALL-PIT)>>

1130
1131
1132
1133
1134
1135
<ROUTINE WIDE-STONE-STAIRCASE-F ()
    <COND (<VERB? EXAMINE>
           <TELL "The staircase leads down." CR>)
          (<VERB? ENTER>
           <DO-WALK ,P?DOWN>
           <RTRUE>)>>
Jesse McGrew's avatar
Jesse McGrew committed
1136
1137
1138

<OBJECT ROUGH-STONE-STEPS
    (DESC "rough stone steps")
1139
    (IN LOCAL-GLOBALS)
Jesse McGrew's avatar
Jesse McGrew committed
1140
1141
1142
    (SYNONYM ;"STAIR STAIRS STAIRCASE"
             STEP STEPS)
    (ADJECTIVE ROUGH STONE)
1143
    (ACTION ROUGH-STONE-STEPS-F)
Jesse McGrew's avatar
Jesse McGrew committed
1144
1145
    (FLAGS NDESCBIT PLURALBIT MULTITUDEBIT)>

1146
<ROUTINE ROUGH-STONE-STEPS-F ()
1147
1148
1149
1150
1151
1152
    <COND (<HELD? ,LARGE-GOLD-NUGGET>
           <TELL CT ,ROUGH-STONE-STEPS " are gone." CR>)
          (<VERB? EXAMINE>
           <TELL CT ,ROUGH-STONE-STEPS " lead ">
           <COND (<=? ,HERE ,IN-HALL-OF-MISTS>
                  <TELL "up the dome." CR>)
1153
                 (ELSE
1154
1155
1156
                  <TELL "down the pit." CR>)>)
          (<VERB? CLIMB ENTER>
           <DO-WALK <COND (<=? ,HERE ,IN-HALL-OF-MISTS> ,P?UP) (ELSE ,P?DOWN)>>)>>
1157

Jesse McGrew's avatar
Jesse McGrew committed
1158
1159
1160
1161
1162
1163
<ROUTINE DOME-F ()
    <COND (<VERB? EXAMINE>
           <COND (<HELD? ,LARGE-GOLD-NUGGET>
                  <TELL "I'm not sure you'll be able to get up it with what you're carrying." CR>)
                 (ELSE <TELL "It looks like you might be able to climb up it." CR>)>)
          (<VERB? CLIMB>
1164
           <DO-WALK ,P?UP>
Jesse McGrew's avatar
Jesse McGrew committed
1165
1166
1167
1168
1169
1170
1171
1172
1173
           <RTRUE>)>>

;----------------------------------------------------------------------

<ROOM IN-NUGGET-OF-GOLD-ROOM
    (DESC "Low Room")
    (IN ROOMS)
    (LDESC "This is a low room with a crude note on the wall:||
\"You won't get it up the steps.\"")
1174
1175
    (NORTH TO IN-HALL-OF-MISTS)
    (THINGS CRUDE NOTE ([READ EXAMINE] "The note says, \"You won't get it up the steps.\""))>
Jesse McGrew's avatar
Jesse McGrew committed
1176
1177
1178
1179

<OBJECT LARGE-GOLD-NUGGET
    (DESC "large gold nugget")
    (IN IN-NUGGET-OF-GOLD-ROOM)
1180
    (SYNONYM GOLD NUGGET)
Jesse McGrew's avatar
Jesse McGrew committed
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
    (ADJECTIVE GOLD LARGE HEAVY)
    (FDESC "There is a large sparkling nugget of gold here!")
    (TEXT "It's a large sparkling nugget of gold!")
    (FLAGS TAKEBIT TREASUREBIT)>

;----------------------------------------------------------------------

<CONSTANT USE-THE-BRIDGE
    "I respectfully suggest you go across the bridge instead of jumping.">

<ROUTINE FISSURE-ROOMS-F (RARG)
    <COND (<=? .RARG ,M-BEG>
           <COND (<VERB? JUMP>
                  <COND (<FSET? ,CRYSTAL-BRIDGE ,OPENBIT> <TELL ,USE-THE-BRIDGE CR>)
                        (ELSE <JIGS-UP "You didn't make it.">)>)
                 (<AND <VERB? WALK> <PRSO? ,P?DOWN>>
                  <TELL "The fissure is too terrifying!" CR>)>)
1198
          (<=? .RARG ,M-FLASH>
Jesse McGrew's avatar
Jesse McGrew committed
1199
1200
           ;"Since the bridge isn't actually in the room, describe it here"
           <COND (<FSET? ,CRYSTAL-BRIDGE ,OPENBIT>
1201
                  <THIS-IS-IT ,CRYSTAL-BRIDGE>
Jesse McGrew's avatar
Jesse McGrew committed
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
                  <TELL CR "A crystal bridge now spans the fissure." CR>)>)>>

<ROOM ON-EAST-BANK-OF-FISSURE
    (DESC "On East Bank of Fissure")
    (IN ROOMS)
    (LDESC "You are on the east bank of a fissure slicing clear across the hall.
The mist is quite thick here, and the fissure is too wide to jump.")
    (GLOBAL CRYSTAL-BRIDGE FISSURE MIST)
    (EAST TO IN-HALL-OF-MISTS)
    (WEST TO WEST-SIDE-OF-FISSURE IF CRYSTAL-BRIDGE IS OPEN ELSE "The fissure is too wide.")
    (ACTION FISSURE-ROOMS-F)>

<ROOM WEST-SIDE-OF-FISSURE
    (DESC "West Side of Fissure")
    (IN ROOMS)
    (LDESC "You are on the west side of the fissure in the hall of mists.")
    (GLOBAL CRYSTAL-BRIDGE FISSURE)
    (WEST TO AT-WEST-END-OF-HALL-OF-MISTS)
    (EAST TO ON-EAST-BANK-OF-FISSURE IF CRYSTAL-BRIDGE IS OPEN ELSE "The fissure is too wide.")
    (NORTH TO AT-WEST-END-OF-HALL-OF-MISTS)
    (ACTION WEST-SIDE-OF-FISSURE-F)>

<ROUTINE ROOMS-WITH-LOW-WIDE-PASSAGE-F (RARG)
    <COND (<AND <=? .RARG ,M-BEG>
                <VERB? WALK>
                <PRSO? ,P?NORTH>>
           <TELL "You have crawled through a very low wide passage
1229
parallel to and north of the hall of mists." CR CR>
Jesse McGrew's avatar
Jesse McGrew committed
1230
1231
1232
1233
1234
1235
1236
1237
1238
           <RFALSE>)>>

<ROUTINE WEST-SIDE-OF-FISSURE-F (RARG)
    <T? <OR <ROOMS-WITH-LOW-WIDE-PASSAGE-F .RARG>
            <FISSURE-ROOMS-F .RARG>>>>

<OBJECT DIAMONDS
    (DESC "diamonds")
    (IN WEST-SIDE-OF-FISSURE)
1239
    (SYNONYM DIAMOND DIAMONDS)
Jesse McGrew's avatar
Jesse McGrew committed
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
    (ADJECTIVE SEVERAL HIGH QUALITY)
    (FDESC "There are diamonds here!")
    (TEXT "They look to be of the highest quality!")
    (FLAGS TAKEBIT TREASUREBIT PLURALBIT MULTITUDEBIT)>

<OBJECT CRYSTAL-BRIDGE
    (DESC "crystal bridge")
    (IN LOCAL-GLOBALS)
    (SYNONYM BRIDGE)
    (ADJECTIVE CRYSTAL)
    (TEXT "It spans the fissure, thereby providing you a way across.")
1251
    (FLAGS DOORBIT INVISIBLE)>
Jesse McGrew's avatar
Jesse McGrew committed
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308

<OBJECT FISSURE
    (DESC "fissure")
    (IN LOCAL-GLOBALS)
    (SYNONYM FISSURE)
    (ADJECTIVE WIDE)
    (TEXT "The fissure looks far too wide to jump.")>

;----------------------------------------------------------------------

<ROOM AT-WEST-END-OF-HALL-OF-MISTS
    (DESC "At West End of Hall of Mists")
    (IN ROOMS)
    (LDESC "You are at the west end of the hall of mists.
A low wide crawl continues west and another goes north.
To the south is a little passage 6 feet off the floor.")
    (SOUTH TO ALIKE-MAZE-1)
    (UP TO ALIKE-MAZE-1)
    (EAST TO WEST-SIDE-OF-FISSURE)
    (WEST TO AT-EAST-END-OF-LONG-HALL)
    (NORTH TO WEST-SIDE-OF-FISSURE)
    (ACTION ROOMS-WITH-LOW-WIDE-PASSAGE-F)>

;----------------------------------------------------------------------
"Long Hall to the west of the Hall of Mists"
;----------------------------------------------------------------------

<ROOM AT-EAST-END-OF-LONG-HALL
    (DESC "At East End of Long Hall")
    (IN ROOMS)
    (LDESC "You are at the east end of a very long hall apparently without side chambers.
To the east a low wide crawl slants up.
To the north a round two foot hole slants down.")
    (EAST TO AT-WEST-END-OF-HALL-OF-MISTS)
    (UP TO AT-WEST-END-OF-HALL-OF-MISTS)
    (WEST TO AT-WEST-END-OF-LONG-HALL)
    (NORTH TO CROSSOVER)
    (DOWN TO CROSSOVER)>

;----------------------------------------------------------------------

<ROOM AT-WEST-END-OF-LONG-HALL
    (DESC "At West End of Long Hall")
    (IN ROOMS)
    (LDESC "You are at the west end of a very long featureless hall.
The hall joins up with a narrow north/south passage.")
    (EAST TO AT-EAST-END-OF-LONG-HALL)
    (SOUTH TO DIFFERENT-MAZE-1)
    (NORTH TO CROSSOVER)>

;----------------------------------------------------------------------

<ROOM CROSSOVER
    (DESC "N/S and E/W Crossover")
    (IN ROOMS)
    (LDESC "You are at a crossover of a high N/S passage and a low E/W one.")
    (WEST TO AT-EAST-END-OF-LONG-HALL)
1309
    (NORTH TO CROSSOVER-DEAD-END)
Jesse McGrew's avatar
Jesse McGrew committed
1310
    (EAST TO IN-WEST-SIDE-CHAMBER)
1311
1312
    (SOUTH TO AT-WEST-END-OF-LONG-HALL)
    (THINGS CROSS (OVER CROSSOVER) "You know as much as I do at this point.")>
Jesse McGrew's avatar
Jesse McGrew committed
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335

;----------------------------------------------------------------------
"Many Dead Ends will be needed for the maze below, so define a helper function"
;----------------------------------------------------------------------

<DEFINE DEAD-END-ROOM (NAME DIR DEST "ARGS" PS "AUX" DEF)
    <SET DEF
         <FORM ROOM .NAME
               '(DESC "Dead End")
               '(IN ROOMS)
               '(LDESC "You have reached a dead end.")
               '(ACTION DEAD-END-ROOMS-F)
               <LIST .DIR TO .DEST>
               <LIST OUT TO .DEST>
               !.PS>>
    <EVAL .DEF>>

<ROUTINE DEAD-END-ROOMS-F (RARG)
    <COND (<AND <=? .RARG ,M-BEG>
                <VERB? WALK>
                <0? <GETPT ,HERE ,PRSO>>>
           <TELL "You'll have to go back the way you came." CR>)>>

1336
<DEAD-END-ROOM CROSSOVER-DEAD-END SOUTH CROSSOVER>
Jesse McGrew's avatar
Jesse McGrew committed
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367

;----------------------------------------------------------------------
"The Hall of the Mountain King and side chambers"
;----------------------------------------------------------------------

<ROOM IN-HALL-OF-MT-KING
    (DESC "Hall of the Mountain King")
    (IN ROOMS)
    (LDESC "You are in the hall of the mountain king, with passages off in all directions.")
    (UP TO IN-HALL-OF-MISTS)
    (EAST TO IN-HALL-OF-MISTS)
    (NORTH TO LOW-N/S-PASSAGE)
    (SOUTH TO IN-SOUTH-SIDE-CHAMBER)
    (WEST TO IN-WEST-SIDE-CHAMBER)
    (SW TO IN-SECRET-E/W-CANYON)
    (ACTION IN-HALL-OF-MT-KING-F)>

<ROUTINE IN-HALL-OF-MT-KING-F (RARG)
    <COND (<AND <=? .RARG ,M-BEG> <VERB? WALK>>
           <COND (<0? <GETPT ,HERE ,PRSO>>
                  <TELL "Well, perhaps not quite all directions." CR>)
                 (<AND <IN? ,SNAKE ,HERE>
                       <OR <PRSO? ,P?NORTH ,P?SOUTH ,P?WEST>
                           <AND <PRSO? ,P?SW> <PROB 35>>>>
                  <TELL "You can't get by the snake." CR>)>)>>

<OBJECT SNAKE
    (DESC "snake")
    (IN IN-HALL-OF-MT-KING)
    (SYNONYM SNAKE COBRA ASP)
    (ADJECTIVE HUGE FIERCE GREEN FEROCIOUS ;VENEMOUS VENOMOUS LARGE BIG KILLER)
1368
    (PRONOUN IT)
Jesse McGrew's avatar
Jesse McGrew committed
1369
1370
    (FDESC "A huge green fierce snake bars the way!")
    (TEXT "I wouldn't mess with it if I were you.")
1371
1372
    (ACTION SNAKE-F)
    (FLAGS PERSONBIT ATTACKBIT)>
Jesse McGrew's avatar
Jesse McGrew committed
1373

1374
1375
1376
1377
1378
<ROUTINE SNAKE-F (ARG)
    <COND (<=? .ARG ,M-WINNER>
           <SETG P-CONT 0>
           <TELL CT ,SNAKE " gives you a cold stare." CR>)
          (<AND <VERB? THROW-AT> <PRSI? ,SNAKE>>
Jesse McGrew's avatar
Jesse McGrew committed
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
           <COND (<PRSO? ,AXE> <PERFORM ,V?ATTACK ,PRSI>)
                 (ELSE <PERFORM ,V?GIVE ,PRSO ,PRSI>)>
           <RTRUE>)
          (<AND <VERB? GIVE> <PRSI? ,SNAKE>>
           <COND (<PRSO? ,LITTLE-BIRD>
                  <REMOVE ,PRSO>
                  <TELL "The snake has now devoured your bird." CR>)
                 (ELSE <TELL "There's nothing here it wants to eat (except perhaps you)." CR>)>)
          (<VERB? ATTACK>
           <TELL "Attacking the snake both doesn't work and is very dangerous." CR>)
          (<VERB? TAKE>
           <JIGS-UP "It takes you instead. Glrp!">)>>

;----------------------------------------------------------------------

<ROOM LOW-N/S-PASSAGE
    (DESC "Low N/S Passage")
    (IN ROOMS)
    (LDESC "You are in a low N/S passage at a hole in the floor.
The hole goes down to an E/W passage.")
    (SOUTH TO IN-HALL-OF-MT-KING)
    (DOWN TO IN-DIRTY-PASSAGE)
    (NORTH TO AT-Y2)>

<OBJECT BARS-OF-SILVER
    (DESC "bars of silver")
    (IN LOW-N/S-PASSAGE)
1406
    (SYNONYM BAR BARS SILVER)
Jesse McGrew's avatar
Jesse McGrew committed
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
    (FDESC "There are bars of silver here!")
    (TEXT "They're probably worth a fortune!")
    (FLAGS TAKEBIT PLURALBIT TREASUREBIT)>

;----------------------------------------------------------------------

<ROOM IN-SOUTH-SIDE-CHAMBER
    (DESC "In South Side Chamber")
    (IN ROOMS)
    (LDESC "You are in the south side chamber.")
    (NORTH TO IN-HALL-OF-MT-KING)>

<OBJECT PRECIOUS-JEWELRY
    (DESC "precious jewelry")
    (IN IN-SOUTH-SIDE-CHAMBER)
    (SYNONYM JEWEL JEWELS JEWELRY)
    (ADJECTIVE PRECIOUS EXQUISITE)
Jesse McGrew's avatar
Jesse McGrew committed
1424
    (ARTICLE "some")
1425
    (PRONOUN IT THEM)
Jesse McGrew's avatar
Jesse McGrew committed
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
    (FDESC "There is precious jewelry here!")
    (TEXT "It's all quite exquisite!")
    (FLAGS TAKEBIT TREASUREBIT)>

;----------------------------------------------------------------------

<ROOM IN-WEST-SIDE-CHAMBER
    (DESC "In West Side Chamber")
    (IN ROOMS)
    (LDESC "You are in the west side chamber of the hall of the mountain king.
A passage continues west and up here.")
    (WEST TO CROSSOVER)
    (UP TO CROSSOVER)
    (EAST TO IN-HALL-OF-MT-KING)>

<OBJECT RARE-COINS
    (DESC "rare coins")
    (IN IN-WEST-SIDE-CHAMBER)
    (SYNONYM COINS)
    (ADJECTIVE RARE)
Jesse McGrew's avatar
Jesse McGrew committed
1446
    (ARTICLE "many")
Jesse McGrew's avatar
Jesse McGrew committed
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
    (FDESC "There are many coins here!")
    (TEXT "They're a numismatist's dream!")
    (FLAGS TAKEBIT PLURALBIT TREASUREBIT MULTITUDEBIT)>


;----------------------------------------------------------------------
"The Y2 Rock Room and environs, slightly below"
;----------------------------------------------------------------------

<ROOM AT-Y2
    (DESC "At \"Y2\"")
    (IN ROOMS)
    (LDESC "You are in a large room, with a passage to the south,
a passage to the west, and a wall of broken rock to the east.
1461
There is a large \"Y2\" on a rock in the room's center.")
Jesse McGrew's avatar
Jesse McGrew committed
1462
1463
1464
    (SOUTH TO LOW-N/S-PASSAGE)
    (EAST TO JUMBLE-OF-ROCK)
    (WEST TO AT-WINDOW-ON-PIT-1)
1465
1466
    (ACTION AT-Y2-F)
    (THINGS Y2 (ROCK Y2) "There is a large \"Y2\" painted on the rock.")>
Jesse McGrew's avatar
Jesse McGrew committed
1467
1468
1469
1470
1471
1472
1473
1474

<ROUTINE AT-Y2-F (RARG)
    <COND (<=? .RARG ,M-BEG>
           <COND (<VERB? PLUGH>
                  <GOTO ,INSIDE-BUILDING>
                  <RTRUE>)
                 (<VERB? PLOVER>
                  <COND (<HELD? ,EGG-SIZED-EMERALD>
1475
                         <MOVE ,EGG-SIZED-EMERALD ,IN-PLOVER-ROOM>)>
Jesse McGrew's avatar
Jesse McGrew committed
1476
1477
1478
                  <GOTO ,IN-PLOVER-ROOM>
                  <RTRUE>)>)
          (<AND <=? .RARG ,M-END>
1479
                <VERB? LOOK WALK>
Jesse McGrew's avatar
Jesse McGrew committed
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
                <PROB 25>>
           <TELL CR "A hollow voice says, \"Plugh.\"" CR>
           <RFALSE>)>>

;----------------------------------------------------------------------

<ROOM JUMBLE-OF-ROCK
    (DESC "Jumble of Rock")
    (IN ROOMS)
    (LDESC "You are in a jumble of rocks, with cracks everywhere.")
    (DOWN TO AT-Y2)
    (UP TO IN-HALL-OF-MISTS)>

;----------------------------------------------------------------------

<ROOM AT-WINDOW-ON-PIT-1
    (DESC "At Window on Pit")
    (IN ROOMS)
    (GLOBAL WINDOW HUGE-PIT MARKS-IN-DUST SHADOWY-FIGURE MIST)
    (ACTION AT-WINDOW-ON-PIT-ROOMS-F)
    (EAST TO AT-Y2)>

;"AT-WINDOW-ON-PIT-1 and AT-WINDOW-ON-PIT-2 have nearly identical descriptions
  and some common action responses, so we handle them with the same routine"
<ROUTINE AT-WINDOW-ON-PIT-ROOMS-F (RARG)
    <COND (<=? .RARG ,M-BEG>
           <COND (<VERB? WAVE-HANDS>
                  <TELL "The shadowy figure waves back at you!" CR>)
                 (<AND <VERB? WALK> <0? <GETPT ,HERE ,PRSO>>>
                  <TELL "The only passage is back "
                        <COND (<=? ,HERE ,AT-WINDOW-ON-PIT-1> "east to Y2")
                              (ELSE "west to the junction")>
                        "." CR>)
                 (<AND <VERB? JUMP> <=? ,HERE ,AT-WINDOW-ON-PIT-2>>
                  <JIGS-UP "You jump and break your neck!">)>)
          (<=? .RARG ,M-LOOK>
           <TELL "You're at a low window overlooking a huge pit, which extends up out of sight.
A floor is indistinctly visible over 50 feet below.
Traces of white mist cover the floor of the pit, becoming thicker to the "
                 <COND (<=? ,HERE ,AT-WINDOW-ON-PIT-1> "right") (ELSE "left")> ".
Marks in the dust around the window would seem to indicate that someone has been here recently.
Directly across the pit from you and 25 feet away there is a similar window looking into
a lighted room.
A shadowy figure can be seen there peering back at you." CR>)>>

<OBJECT WINDOW
    (DESC "window")
    (IN LOCAL-GLOBALS)
    (SYNONYM WINDOW)
    (ADJECTIVE LOW)
    (LDESC "It looks like a regular window.")
    ;(FLAGS OPENABLEBIT)>

<OBJECT HUGE-PIT
    (DESC "huge pit")
    (IN LOCAL-GLOBALS)
    (SYNONYM PIT)
    (ADJECTIVE DEEP LARGE)
    (LDESC "It's so deep you can barely make out the floor below, and the top isn't visible at all.")>

<OBJECT MARKS-IN-DUST
    (DESC "marks in the dust")
    (IN LOCAL-GLOBALS)
    (SYNONYM MARKS DUST)
    (LDESC "Evidently you're not alone here.")
    (FLAGS PLURALBIT MULTITUDEBIT)>

<OBJECT SHADOWY-FIGURE
    (DESC "shadowy figure")
    (IN LOCAL-GLOBALS)
    (SYNONYM FIGURE PERSON INDIVIDUAL SHADOW)
1551
    (ADJECTIVE MYSTERIOUS SHADOWY)
Jesse McGrew's avatar
Jesse McGrew committed
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
    (LDESC "The shadowy figure seems to be trying to attract your attention.")>

;----------------------------------------------------------------------

<ROOM IN-DIRTY-PASSAGE
    (DESC "Dirty Passage")
    (IN ROOMS)
    (LDESC "You are in a dirty broken passage. To the east is a crawl.
To the west is a large passage. Above you is a hole to another passage.")
    (EAST TO ON-BRINK-OF-PIT)
    (UP TO LOW-N/S-PASSAGE)
    (WEST TO IN-DUSTY-ROCK-ROOM)>

;----------------------------------------------------------------------

<ROOM ON-BRINK-OF-PIT
    (DESC "Brink of Pit")
    (IN ROOMS)
    (LDESC "You are on the brink of a small clean climbable pit.
A crawl leads west.")
    (WEST TO IN-DIRTY-PASSAGE)
    (DOWN TO IN-PIT)
    (IN TO IN-PIT)>

<OBJECT SMALL-CLIMBABLE-PIT
    (DESC "small pit")
    (IN ON-BRINK-OF-PIT)
    (SYNONYM PIT)
    (ADJECTIVE SMALL CLEAN CLIMBABLE)
    (TEXT "It looks like you might be able to climb down into it.")
    (ACTION SMALL-CLIMBABLE-PIT-F)
    (FLAGS NDESCBIT)>

<ROUTINE SMALL-CLIMBABLE-PIT-F ()
1586
1587
1588
    <COND (<VERB? EXAMINE>
           <TELL "It looks like you might be able to climb down into it." CR>)
          (<VERB? CLIMB ENTER>
1589
           <DO-WALK ,P?DOWN>
Jesse McGrew's avatar
Jesse McGrew committed
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
           <RTRUE>)>>

;----------------------------------------------------------------------

<ROOM IN-PIT
    (DESC "In Pit")
    (IN ROOMS)
    (LDESC "You are in the bottom of a small pit with a little stream,
which enters and exits through tiny slits.")
    (GLOBAL STREAM)
    (UP TO ON-BRINK-OF-PIT)
    (DOWN SORRY "You don't fit through the tiny slits!")
    (FLAGS SACREDBIT)>

<OBJECT TINY-SLITS
    (DESC "tiny slits")
    (IN IN-PIT)
    (SYNONYM SLIT SLITS)
    (ADJECTIVE TINY)
    (TEXT "The slits form a complex pattern in the rock.")
    (FLAGS NDESCBIT MULTITUDEBIT PLURALBIT)>

;----------------------------------------------------------------------

<ROOM IN-DUSTY-ROCK-ROOM
    (DESC "In Dusty Rock Room")
    (IN ROOMS)
    (LDESC "You are in a large room full of dusty rocks.
There is a big hole in the floor.
There are cracks everywhere, and a passage leading east.")
    (EAST TO IN-DIRTY-PASSAGE)
    (DOWN TO AT-COMPLEX-JUNCTION)>

<OBJECT DUSTY-ROCKS
    (DESC "dusty rocks")
    (IN IN-DUSTY-ROCK-ROOM)
    (TEXT "They're just rocks. (Dusty ones, that is.)")
    (ACTION DUSTY-ROCKS-F)
    (FLAGS NDESCBIT MULTITUDEBIT PLURALBIT)>

<ROUTINE DUSTY-ROCKS-F ()
    <COND (<VERB? LOOK-UNDER PUSH PULL>
           <TELL "You'd have to blast your way through." CR>)>>

;----------------------------------------------------------------------
"A maze of twisty little passages, all alike..."
;----------------------------------------------------------------------

;"Define a function to save a bit of tedium. This lets us specify connections
  within the maze by number instead of typing out the room name, and omit TO."
<DEFINE MAZE-ROOM (NAME "ARGS" CS "AUX" DEF PS)
    ;"Convert list of map connections to property definitions.
      (NORTH FOO-ROOM) -> (NORTH TO FOO-ROOM)
      (NORTH 5)        -> (NORTH TO ALIKE-MAZE-5)"
    <SET PS
        <MAPF ,LIST
              <FUNCTION (C "AUX" (DIR <1 .C>) (DEST <2 .C>))
                  <COND (<TYPE? .DEST FIX>
                         <SET DEST <PARSE <STRING "ALIKE-MAZE-" <UNPARSE .DEST>>>>)>
                  <LIST .DIR TO .DEST>>
              .CS>>
    ;"Build room definition and evaluate it"
    <SET DEF
        <FORM ROOM .NAME
1654
            <IFFLAG (DBMAZE <LIST DESC <SPNAME .NAME>>) (ELSE '(DESC "Maze"))>
Jesse McGrew's avatar
Jesse McGrew committed
1655
1656
1657
1658
1659
1660
1661
            '(IN ROOMS)
            '(LDESC "You are in a maze of twisty little passages, all alike.")
            '(ACTION MAZE-ROOMS-F)
            !.PS>>
    <EVAL .DEF>>

<ROUTINE MAZE-ROOMS-F (RARG)
1662
1663
1664
    <COND (<=? .RARG ,M-ENTER>
           <FCLEAR ,HERE ,TOUCHBIT>)
          (<AND <=? .RARG ,M-BEG>
Jesse McGrew's avatar
Jesse McGrew committed
1665
1666
1667
1668
1669
1670
1671
1672
                <VERB? WALK>
                <PRSO? ,P?OUT>>
           <TELL "Easier said than done." CR>)>>

<MAZE-ROOM ALIKE-MAZE-1
    (UP AT-WEST-END-OF-HALL-OF-MISTS) (NORTH 1) (EAST 2) (SOUTH 4) (WEST 11)>

<MAZE-ROOM ALIKE-MAZE-2
1673
    (WEST 1) (SOUTH 3) (EAST 4)>
Jesse McGrew's avatar
Jesse McGrew committed
1674
1675

<MAZE-ROOM ALIKE-MAZE-3
1676
    (EAST 2) (DOWN DEAD-END-3) (SOUTH 6) (NORTH DEAD-END-8)>
Jesse McGrew's avatar
Jesse McGrew committed
1677
1678
1679
1680

<MAZE-ROOM ALIKE-MAZE-4
    (WEST 1) (NORTH 2) (EAST DEAD-END-1) (SOUTH DEAD-END-2) (UP 14) (DOWN 14)>

1681
1682
1683
1684
1685
1686
<DEAD-END-ROOM DEAD-END-1 WEST ALIKE-MAZE-4>

<DEAD-END-ROOM DEAD-END-2 EAST ALIKE-MAZE-4>

<DEAD-END-ROOM DEAD-END-3 UP ALIKE-MAZE-3>

Jesse McGrew's avatar
Jesse McGrew committed
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
<MAZE-ROOM ALIKE-MAZE-5
    (EAST 6) (WEST 7)>

<MAZE-ROOM ALIKE-MAZE-6
    (EAST 3) (WEST 5) (DOWN 7) (SOUTH 8)>

<MAZE-ROOM ALIKE-MAZE-7
    (WEST 5) (UP 6) (EAST 8) (SOUTH 9)>

<MAZE-ROOM ALIKE-MAZE-8
1697
    (WEST 6) (EAST 7) (SOUTH 8) (UP 9) (NORTH 10) (DOWN DEAD-END-10)>
Jesse McGrew's avatar
Jesse McGrew committed
1698
1699
1700
1701

<MAZE-ROOM ALIKE-MAZE-9
    (WEST 7) (NORTH 8) (SOUTH DEAD-END-4)>

1702
<DEAD-END-ROOM DEAD-END-4 WEST ALIKE-MAZE-9>
Jesse McGrew's avatar
Jesse McGrew committed
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730

<MAZE-ROOM ALIKE-MAZE-10
    (WEST 8) (NORTH 10) (DOWN DEAD-END-5) (EAST AT-BRINK-OF-PIT)>

<DEAD-END-ROOM DEAD-END-5 UP ALIKE-MAZE-10>

;----------------------------------------------------------------------

<ROOM AT-BRINK-OF-PIT
    (DESC "At Brink of Pit")
    (IN ROOMS)
    (LDESC "You are on the brink of a thirty foot pit with a massive orange column down one wall.
You could climb down here but you could not get back up.
The maze continues at this level.")
    (DOWN TO IN-BIRD-CHAMBER)
    (WEST TO ALIKE-MAZE-10)
    (SOUTH TO DEAD-END-6)
    (NORTH TO ALIKE-MAZE-12)
    (EAST TO ALIKE-MAZE-13)>

<OBJECT MASSIVE-ORANGE-COLUMN
    (DESC "massive orange column")
    (IN AT-BRINK-OF-PIT)
    (TEXT "It looks like you could climb down it.")
    (ACTION MASSIVE-ORANGE-COLUMN-F)
    (FLAGS NDESCBIT)>

<ROUTINE MASSIVE-ORANGE-COLUMN-F ()
1731
    <COND (<VERB? CLIMB> <DO-WALK ,P?DOWN> <RTRUE>)>>
Jesse McGrew's avatar
Jesse McGrew committed
1732
1733
1734
1735
1736

<OBJECT PIT
    (DESC "pit")
    (IN AT-BRINK-OF-PIT)
    (SYNONYM PIT)
1737
    (ADJECTIVE THIRTY FOOT THIRTY-FOOT)
Jesse McGrew's avatar
Jesse McGrew committed
1738
1739
1740
1741
1742
    (TEXT "You'll have to climb down to find out anything more...")
    (ACTION PIT-F)
    (FLAGS NDESCBIT)>

<ROUTINE PIT-F ()
1743
1744
1745
    <COND (<VERB? EXAMINE>
           <TELL "You'll have to climb down to find out anything more..." CR>)
          (<VERB? CLIMB>
1746
           <DO-WALK ,P?DOWN>
Jesse McGrew's avatar
Jesse McGrew committed
1747
1748
           <RTRUE>)>>

1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
<DEAD-END-ROOM DEAD-END-6 EAST AT-BRINK-OF-PIT>

;----------------------------------------------------------------------

<MAZE-ROOM ALIKE-MAZE-11
    (NORTH 1) (WEST 11) (SOUTH 11) (EAST DEAD-END-7)>

<DEAD-END-ROOM DEAD-END-7 WEST ALIKE-MAZE-11>

<DEAD-END-ROOM DEAD-END-8 SOUTH ALIKE-MAZE-3>

<MAZE-ROOM ALIKE-MAZE-12
    (SOUTH AT-BRINK-OF-PIT) (EAST 13) (WEST DEAD-END-9)>

<MAZE-ROOM ALIKE-MAZE-13
    (NORTH AT-BRINK-OF-PIT) (WEST 12) (NW PIRATE-DEAD-END)>

<DEAD-END-ROOM DEAD-END-9 EAST ALIKE-MAZE-12>

<DEAD-END-ROOM DEAD-END-10 UP ALIKE-MAZE-8>

<MAZE-ROOM ALIKE-MAZE-14
    (UP 4) (DOWN 4)>

<ROOM PIRATE-DEAD-END
    (DESC "Dead End")
    (IN ROOMS)
    (LDESC "This is the pirate's dead end.")
    (SE TO ALIKE-MAZE-13)
    (OUT TO ALIKE-MAZE-13)
    (ACTION PIRATE-DEAD-END-F)
    (FLAGS SACREDBIT)>

<ROUTINE PIRATE-DEAD-END-F (RARG)
    <COND (<=? .RARG ,M-ENTER>
           <DEQUEUE I-PIRATE>
           <COND (<AND <IN? ,TREASURE-CHEST ,HERE>
                       <NOT <FSET? ,TREASURE-CHEST ,TOUCHBIT>>>
                  <TELL "You've found the pirate's treasure chest!" CR>)>)>>

<OBJECT TREASURE-CHEST
    (DESC "treasure chest")
    (IN PIRATE-DEAD-END)
    (SYNONYM CHEST BOX RICHES TREASURE)
1793
    (ADJECTIVE PIRATE TREASURE PIRATE\'S)
1794
1795
1796
1797
    (FDESC "The pirate's treasure chest is here!")
    (TEXT "It's the pirate's treasure chest, filled with riches of all kinds!")
    (DEPOSIT-POINTS 12)
    (FLAGS TAKEBIT TREASUREBIT)>
Jesse McGrew's avatar
Jesse McGrew committed
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859

;----------------------------------------------------------------------
"A line of three vital junctions, east to west"
;----------------------------------------------------------------------

<ROOM AT-COMPLEX-JUNCTION
    (DESC "At Complex Junction")
    (IN ROOMS)
    (LDESC "You are at a complex junction.
A low hands and knees passage from the north joins a higher crawl from the east
to make a walking passage going west. There is also a large room above.
The air is damp here.")
    (UP TO IN-DUSTY-ROCK-ROOM)
    (WEST TO IN-BEDQUILT)
    (NORTH TO IN-SHELL-ROOM)
    (EAST TO IN-ANTEROOM)>

;----------------------------------------------------------------------

<ROOM IN-BEDQUILT
    (DESC "In Bedquilt")
    (IN ROOMS)
    (LDESC "You are in bedquilt, a long east/west passage with holes everywhere.
To explore at random select north, south, up, or down.")
    (EAST TO AT-COMPLEX-JUNCTION)
    (WEST TO IN-SWISS-CHEESE-ROOM)
    (SOUTH TO IN-SLAB-ROOM)
    (UP TO IN-DUSTY-ROCK-ROOM)
    (NORTH TO AT-JUNCTION-OF-THREE)
    (DOWN TO IN-ANTEROOM)
    (ACTION IN-BEDQUILT-F)>

<CONSTANT CRAWLED-AROUND-HOLES "You have crawled around in some little holes and
wound up back in the main passage.">

<ROUTINE IN-BEDQUILT-F (RARG "AUX" DEST)
    <COND (<AND <=? .RARG ,M-BEG> <VERB? WALK>>
           <COND (<AND <PRSO? ,P?SOUTH ,P?DOWN> <PROB 80>>
                  <SET DEST 1>)
                 (<PRSO? ,P?UP>
                  <COND (<PROB 80> <SET DEST 1>)>
                  <COND (<PROB 50> <SET DEST ,IN-SECRET-N/S-CANYON-1>)>)
                 (<PRSO? ,P?NORTH>
                  <COND (<PROB 60> <SET DEST 1>)>
                  <COND (<PROB 75> <SET DEST ,IN-LARGE-LOW-ROOM>)>)>
           <COND (<0? .DEST> <RFALSE>)
                 (<1? .DEST> <TELL ,CRAWLED-AROUND-HOLES CR>)
                 (ELSE <GOTO .DEST> <RTRUE>)>)>>

;----------------------------------------------------------------------

<ROOM IN-SWISS-CHEESE-ROOM
    (DESC "In Swiss Cheese Room")
    (IN ROOMS)
    (LDESC "You are in a room whose walls resemble swiss cheese.
Obvious passages go west, east, ne, and nw.
Part of the room is occupied by a large bedrock block.")
    (WEST TO AT-EAST-END-OF-TWOPIT-ROOM)
    (SOUTH TO IN-TALL-E/W-CANYON)
    (NE TO IN-BEDQUILT)
    (NW TO IN-ORIENTAL-ROOM)
    (EAST TO IN-SOFT-ROOM)
1860
1861
    (ACTION IN-SWISS-CHEESE-ROOM-F)
    (THINGS (LARGE BEDROCK) (BEDROCK BLOCK) BEDROCK-BLOCK-F)>
Jesse McGrew's avatar
Jesse McGrew committed
1862
1863
1864
1865
1866
1867
1868
1869
1870

<ROUTINE IN-SWISS-CHEESE-ROOM-F (RARG)
    <COND (<AND <=? .RARG ,M-BEG>
                <VERB? WALK>
                <OR <AND <PRSO? ,P?SOUTH> <PROB 80>>
                    <AND <PRSO? ,P?NW> <PROB 50>>>>
           <TELL ,CRAWLED-AROUND-HOLES CR>)>>

<ROUTINE BEDROCK-BLOCK-F ()
1871
1872
1873
    <COND (<VERB? EXAMINE>
           <TELL "It's just a huge block." CR>)
          (<VERB? LOOK-UNDER PUSH PULL TAKE>
Jesse McGrew's avatar
Jesse McGrew committed
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
           <TELL "Surely you're joking." CR>)>>

;----------------------------------------------------------------------
"The Twopit Room area"
;----------------------------------------------------------------------

;"Possible heights for the plant"
<CONSTANT TINY-HEIGHT 0>
<CONSTANT TALL-HEIGHT 1>
<CONSTANT HUGE-HEIGHT 2>

<ROOM AT-WEST-END-OF-TWOPIT-ROOM
    (DESC "At West End of Twopit Room")
    (IN ROOMS)
    (LDESC "You are at the west end of the twopit room.
There is a large hole in the wall above the pit at the end of this room.")
    (GLOBAL PLANT-STICKING-UP HOLE-ABOVE-PIT-WEST MIST)
    (EAST TO AT-EAST-END-OF-TWOPIT-ROOM)
    (WEST TO IN-SLAB-ROOM)
    (DOWN TO IN-WEST-PIT)
    (UP SORRY "It is too far up for you to reach.")
    (ACTION POTENTIAL-PLANT-STICKING-UP-ROOMS-F)>

<ROUTINE POTENTIAL-PLANT-STICKING-UP-ROOMS-F (RARG)
1898
    <COND (<AND <=? .RARG ,M-FLASH>
Jesse McGrew's avatar
Jesse McGrew committed
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
                <NOT <FSET? ,PLANT-STICKING-UP ,INVISIBLE>>>
           <CRLF>
           <DESCRIBE-PLANT-STICKING-UP>
           <RTRUE>)>>

<OBJECT PLANT-STICKING-UP
    (DESC "beanstalk")
    (IN LOCAL-GLOBALS)
    (SYNONYM PLANT BEANSTALK STALK)
    ;"V3 property size is limited to 8 bytes"
    %<VERSION?
        (ZIP '(ADJECTIVE BEAN GIANT TINY LITTLE TWELVE FOOT TALL))
        (ELSE '(ADJECTIVE BEAN GIANT TINY LITTLE TWELVE FOOT TALL MURMURING BELLOWING))>
    (ACTION PLANT-STICKING-UP-F)
1913
    (FLAGS INVISIBLE SPONGEBIT)>
Jesse McGrew's avatar
Jesse McGrew committed
1914
1915

<ROUTINE DESCRIBE-PLANT-STICKING-UP ()
1916
    <THIS-IS-IT ,PLANT-STICKING-UP>