]> github.com/historicalsource and other repositories - zork2.git/blob - 2actions.zil
Extensions on Z-Machine Fixed.
[zork2.git] / 2actions.zil
1 "ACTIONS2 for
2                       Zork II: The Wizard of Frobozz
3         (c) Copyright 1981, 1983 Infocom, Inc.  All Rights Reserved."
4
5 <ROUTINE SWORD-FCN ()
6          <COND (<AND <VERB? TAKE>
7                      <EQUAL? ,WINNER ,ADVENTURER>>
8                 <ENABLE <QUEUE I-SWORD -1>>
9                 <RFALSE>)>>
10
11 "SWORD demon"
12
13 <GLOBAL SWORD-GLOW 0>
14
15 <ROUTINE I-SWORD ("AUX" (DEM <INT I-SWORD>) (NG 0) G P TX L)
16          <SET G ,SWORD-GLOW>
17          <COND (<IN? ,SWORD ,ADVENTURER>
18                 <COND (<INFESTED? ,HERE> <SET NG 2>)
19                       (T
20                        <SET P 0>
21                        <REPEAT ()
22                                <COND (<0? <SET P <NEXTP ,HERE .P>>>
23                                       <RETURN>)
24                                      (<NOT <L? .P ,LOW-DIRECTION>>
25                                       <SET TX <GETPT ,HERE .P>>
26                                       <SET L <PTSIZE .TX>>
27                                       <COND (<EQUAL? .L ,UEXIT ,CEXIT ,DEXIT>
28                                              <COND (<INFESTED? <GETB .TX 0>>
29                                                     <SET NG 1>
30                                                     <RETURN>)>)>)>>)>
31                 <COND (<EQUAL? .NG .G> <RFALSE>)
32                       (<EQUAL? .NG 2>
33                        <TELL "Your sword has begun to glow very brightly." CR>)
34                       (<1? .NG>
35                        <TELL "Your sword is glowing with a faint blue glow."
36                              CR>)
37                       (<0? .NG>
38                        <TELL "Your sword is no longer glowing." CR>)>
39                 <SETG SWORD-GLOW .NG>
40                 <RTRUE>)
41                (T
42                 <PUT .DEM ,C-ENABLED? 0>
43                 <RFALSE>)>>
44
45 <ROUTINE INFESTED? (R "AUX" (F <FIRST? .R>))
46          <REPEAT ()
47                  <COND (<NOT .F> <RFALSE>)
48                        (<AND <FSET? .F ,ACTORBIT>
49                              <NOT <FSET? .F ,INVISIBLE>>
50                              <NOT <EQUAL? .F ,ROBOT>>>
51                         <RETURN .F>)
52                        (<NOT <SET F <NEXT? .F>>> <RFALSE>)>>>
53
54 <ROUTINE CAROUSEL-ROOM-FCN (RARG)
55          <COND (<EQUAL? .RARG ,M-LOOK>
56                 <TELL
57 "You are in a large circular room whose high ceiling is lost in gloom. Eight
58 identical passages leave the room." CR>
59                 <COND (<NOT ,CAROUSEL-FLIP-FLAG>
60                        <TELL
61 "A loud whirring sound comes from all around, and you feel
62 sort of disoriented in here." CR>)>
63                 <RTRUE>)
64                (<AND <NOT ,CAROUSEL-FLIP-FLAG>
65                      <EQUAL? .RARG ,M-BEG>
66                      <VERB? WALK>>
67                 <COND (<EQUAL? ,PRSO ,P?UP ,P?DOWN>
68                        <RFALSE>)>
69                 <COND (<EQUAL? ,PRSO ,P?OUT>
70                        <TELL
71 "Feeling dizzy, you pick a direction at random." CR CR>
72                        <SETG PRSO ,P?EAST>)
73                       (T
74                        <TELL
75 "You're not sure which direction is which. This
76 room is very disorienting." CR CR>)>
77                 <COND (<OR <EQUAL? ,PRSO ,P?WEST> <PROB 80>>
78                        <SETG PRSO <GET ,EIGHT-DIRECTIONS <- <RANDOM 7> 1>>>)>
79                 <V-WALK>
80                 <RTRUE>)>>
81
82 <ROUTINE VIOLIN-FCN ()
83          <COND (<AND <VERB? PLAY>
84                      <EQUAL? ,PRSO ,VIOLIN>>
85                 <TELL
86 "An amazingly offensive noise issues from the violin." CR>)>>
87
88 <GLOBAL EIGHT-DIRECTIONS
89         <TABLE P?NORTH P?EAST P?SOUTH P?NE P?SE P?SW P?NW>>
90
91 <GLOBAL MUNGED-ROOM <>>
92
93 <ROUTINE OPEN-CLOSE (OBJ STROPN STRCLS)
94          #DECL ((OBJ) OBJECT (STROPN STRCLS) STRING)
95          <COND (<VERB? OPEN>
96                 <COND (<FSET? .OBJ ,OPENBIT>
97                        <TELL <RANDOM-ELEMENT ,DUMMY>>)
98                       (T
99                        <TELL .STROPN>
100                        <FSET .OBJ ,OPENBIT>)>
101                 <CRLF>)
102                (<VERB? CLOSE>
103                 <COND (<FSET? .OBJ ,OPENBIT>
104                        <TELL .STRCLS>
105                        <FCLEAR .OBJ ,OPENBIT>
106                        T)
107                       (T <TELL <RANDOM-ELEMENT ,DUMMY> CR>)>
108                 <CRLF>)>>
109
110 ;"SUBTITLE THE VOLCANO"
111
112 <GLOBAL BTIE-FLAG <>>
113 <GLOBAL BINF-FLAG <>>
114 <GLOBAL BLAB-FLAG <>>
115 <GLOBAL SAFE-FLAG <>>
116
117 <ROUTINE BALLOON-FCN ("OPTIONAL" (RARG <>) "AUX" M R RC)
118          #DECL ((RARG) <OR FIX FALSE> (M) <OR FALSE TABLE> (R) OBJECT)
119          <COND (<EQUAL? .RARG ,M-LOOK>
120                 <COND (,BINF-FLAG
121                        <TELL "The cloth bag is inflated and ">
122                        <COND (<FSET? ,RECEPTACLE ,OPENBIT>
123                               <TELL
124 "there is a " D ,BINF-FLAG " burning in the receptacle.">)
125                              (T
126                               <TELL
127 "some smoke is leaking out of the closed receptacle.">)>)
128                       (T
129                        <TELL "The cloth bag is draped over the side
130 of the basket. Directly in the middle of the basket is a metal receptacle
131 which is ">
132                        <COND (<FSET? ,RECEPTACLE ,OPENBIT>
133                               <TELL "open">
134                               <SET RC <FIRST? ,RECEPTACLE>>
135                               <COND (.RC
136                                      <TELL ". A "
137                                            D .RC
138                                            " is "
139                                            <COND (<EQUAL? ,BINF-FLAG .RC>
140                                                   "burning")
141                                                  (T
142                                                   "nestled")>
143                                            " inside">)>)
144                              (T <TELL "closed">)>
145                        <TELL ".">)>
146                 <COND (,BTIE-FLAG
147                        <TELL
148 " The balloon is tied to a hook by the braided wire." CR>)
149                       (T
150                        <TELL
151 " A braided wire is dangling over the side of the basket." CR>)>
152                 <RTRUE>)
153                (<EQUAL? .RARG ,M-OBJDESC>
154                 <TELL
155 "There is a large and extremely heavy wicker basket here. An
156 enormous cloth bag ">
157                 <COND (,BINF-FLAG
158                        <TELL
159 "attached to the basket is inflated. A metal receptacle is fastened to
160 the center of the basket. ">
161                        <COND (<FSET? ,RECEPTACLE ,OPENBIT>
162                               <TELL "In it is a burning " D ,BINF-FLAG>)
163                              (T
164                               <TELL
165 "Some smoke leaks out around its closed lid">)>)
166                       (T
167                        <TELL
168 "is draped over the side and is firmly attached to the basket. A metal
169 receptacle is fastened to the center of the basket">)>
170                 <COND (,BTIE-FLAG
171                        <TELL
172 ". A piece of wire tied to a hook holds the balloon in place." CR>)
173                       (T
174                        <TELL
175 ". Dangling from the basket is a piece of braided wire." CR>)>)
176                (<EQUAL? .RARG ,M-BEG>
177                 <COND (<VERB? WALK>
178                        <COND (<SET M <GETPT ,HERE ,PRSO>>
179                               <COND (,BTIE-FLAG
180                                      <TELL "You are tied to the ledge." CR>
181                                      <RTRUE>)
182                                     (T
183                                      <AND <EQUAL? <PTSIZE .M> 1>
184                                           <NOT <FSET? <SET R <GETB .M 0>>
185                                                       ,RMUNGBIT>>
186                                           <SETG BLOC .R>>
187                                      <ENABLE <QUEUE I-BALLOON 3>>
188                                      <RFALSE>)>)
189                              (T
190                               <TELL
191 "You can't control the balloon this way." CR>
192                               <RTRUE>)>)
193                       (<AND <VERB? OPEN>
194                             ,BINF-FLAG
195                             <EQUAL? ,PRSO ,RECEPTACLE>
196                             <FIRST? ,RECEPTACLE>>
197                        <TELL "Opening it reveals a burning "
198                              D ,BINF-FLAG "." CR>
199                        <FSET ,RECEPTACLE ,OPENBIT>
200                        <RTRUE>)
201                       (<AND <VERB? TAKE>
202                             <EQUAL? ,BINF-FLAG ,PRSO>>
203                        <TELL "You don't really want to hold a burning "
204                              D ,PRSO "." CR>
205                        <RTRUE>)
206                       (<AND <VERB? PUT>
207                             <EQUAL? ,PRSI ,RECEPTACLE>
208                             <FIRST? ,RECEPTACLE>>
209                        <TELL "The receptacle is already occupied." CR>
210                        <RTRUE>)
211                       (<AND <VERB? PUT>
212                             <EQUAL? ,PRSI ,RECEPTACLE>>
213                        <FSET ,PRSO ,NDESCBIT>
214                        <RFALSE>)
215                       (<VERB? INFLATE>
216                        <TELL
217 "It takes more than words to inflate a balloon." CR>)>)>>
218
219 <ROUTINE I-BALLOON ()
220          <COND (<AND <FSET? ,RECEPTACLE ,OPENBIT> ,BINF-FLAG>
221                 <RISE-AND-SHINE>)
222                (<EQUAL? ,HERE ,LEDGE-1 ,LEDGE-2>
223                 <RISE-AND-SHINE>)
224                (T
225                 <DECLINE-AND-FALL>)>>
226
227 <ROUTINE BALLOON-BURN ()
228         <TELL "The " D ,PRSO " burns inside the receptacle." CR>
229         <ENABLE <QUEUE I-BURNUP <* <GETP ,PRSO ,P?SIZE> 20>>>
230         <FSET ,PRSO ,FLAMEBIT>
231         <FSET ,PRSO ,ONBIT>
232         <FCLEAR ,PRSO ,TAKEBIT>
233         <FCLEAR ,PRSO ,READBIT>
234         <COND (,BINF-FLAG <RTRUE>)
235               (T
236                <TELL
237                 "The cloth bag inflates as it fills with hot air." CR>
238                <COND (<NOT ,BLAB-FLAG>
239                       <TELL
240 "A small label drops from the bag into the basket." CR>
241                       <MOVE ,BALLOON-LABEL ,BALLOON>)>
242                <SETG BLAB-FLAG T>
243                <SETG BINF-FLAG ,PRSO>
244                <ENABLE <QUEUE I-BALLOON 3>>)>>
245
246 <ROUTINE PUT-BALLOON (THERE STR)
247         #DECL ((THERE) OBJECT (STR) STRING)
248         <COND (<EQUAL? ,HERE ,LEDGE-1 ,LEDGE-2 ,VOLCANO-BOTTOM>
249                <TELL "You watch as the balloon slowly " .STR CR>)>
250         <MOVE ,BALLOON .THERE>
251         <SETG BLOC .THERE>>
252
253 <GLOBAL BALLOON-UPS
254         <LTABLE VAIR-1 VAIR-2 VAIR-3 VAIR-4>>
255
256 <GLOBAL BALLOON-FLOATS
257         <LTABLE LEDGE-1 VAIR-2 LEDGE-2 VAIR-4>>
258
259 <GLOBAL BALLOON-DOWNS
260         <LTABLE VAIR-4 VAIR-3 VAIR-2 VAIR-1>>
261
262 <ROUTINE RISE-AND-SHINE ("AUX" (IN <IN? ,WINNER ,BALLOON>) R)
263         #DECL ((IN) <OR ATOM FALSE> (R) <OR FALSE OBJECT>)
264         <ENABLE <QUEUE I-BALLOON 3>>
265         <COND (<EQUAL? ,BLOC ,VAIR-4>
266                <DISABLE <INT I-BURNUP>>
267                <DISABLE <INT I-BALLOON>>
268                <REMOVE ,BALLOON>
269                <COND (.IN
270                       <JIGS-UP
271 "The balloon floats majestically out of the volcano, revealing a
272 breathtaking view of a wooded river valley surrounded by impassable
273 mountains. In a clearing stands a white house. You drift into high winds,
274 which carry you towards the snow-capped peaks. Oh, no! You crash into the
275 jagged cliffs of the Flathead Mountains!">)
276                      (<EQUAL? ,HERE ,LEDGE-1 ,LEDGE-2 ,VOLCANO-BOTTOM>
277                       <TELL
278 "You watch the balloon drift out over the rim and away on the wind." CR>)>
279                <SETG BLOC ,VOLCANO-BOTTOM>)
280               (<SET R <LKP ,BLOC ,BALLOON-UPS>>
281                <COND (.IN
282                       <TELL "The balloon ascends." CR CR>
283                       <SETG BLOC .R>
284                       <GOTO .R>)
285                      (T
286                       <PUT-BALLOON .R "ascends.">)>)
287               (<SET R <LKP ,BLOC ,BALLOON-FLOATS>>
288                <COND (.IN
289                       <TELL "The balloon leaves the ledge." CR CR>
290                       <SETG BLOC .R>
291                       <GOTO .R>)
292                      (T
293                       <ENABLE <QUEUE I-GNOME 10>>
294                       <PUT-BALLOON .R
295 "floats away. It seems to be ascending, due to its light load.">
296                       <FSET ,RECEPTACLE ,OPENBIT>)>)
297               (.IN
298                <SETG BLOC ,VAIR-1>
299                <TELL "The balloon rises slowly from the ground." CR CR>
300                <GOTO ,VAIR-1>)
301               (T
302                <PUT-BALLOON ,VAIR-1 "lifts off.">)>>
303
304 <ROUTINE DECLINE-AND-FALL ("AUX" (IN <IN? ,WINNER ,BALLOON>) R)
305     #DECL ((IN) <OR ATOM FALSE> (R) <OR FALSE OBJECT>)
306     <ENABLE <QUEUE I-BALLOON 3>>
307     <COND (<EQUAL? ,BLOC ,VAIR-1>
308            <COND (.IN
309                   <SETG BLOC ,VOLCANO-BOTTOM>
310                   <COND (,BINF-FLAG
311                          <TELL "The balloon has landed." CR CR>
312                          <GOTO ,VOLCANO-BOTTOM>
313                          ;<QUEUE I-BALLOON 0>)
314                         (T
315                          <REMOVE ,BALLOON>
316                          <MOVE ,DEAD-BALLOON ,BLOC>
317                          <MOVE ,WINNER ,HERE>
318                          <DISABLE <INT I-BALLOON>>
319                          <TELL
320                           "You have landed, but the balloon did not survive."
321                           CR CR>
322                          <GOTO ,VOLCANO-BOTTOM>)>)
323                  (T <PUT-BALLOON ,VOLCANO-BOTTOM "lands.">)>)
324            (<SET R <LKP ,BLOC ,BALLOON-DOWNS>>
325             <COND (.IN
326                    <TELL "The balloon descends." CR CR>
327                    <SETG BLOC .R>
328                    <GOTO .R>)
329                   (T <PUT-BALLOON .R "descends.">)>)>>
330
331 <ROUTINE BCONTENTS ()
332          <COND (<VERB? TAKE>
333                 <TELL
334 "The " D ,PRSO " is an integral part of the basket and cannot
335 be removed.">
336                 <COND (<EQUAL? ,PRSO ,BRAIDED-WIRE>
337                        <TELL " The wire might possibly be tied, though.">)>
338                 <CRLF>)
339                (<AND <EQUAL? ,PRSO ,CLOTH-BAG>
340                      <VERB? LOOK-INSIDE OPEN>>
341                 <COND (<VERB? OPEN>
342                        <TELL
343 "The bag is enormous. The concept of opening it here is ludicrous." CR>)
344                       (T
345                        <TELL
346 "It doesn't appear that there's anything inside." CR>)>)
347                (<AND <VERB? EXAMINE> <EQUAL? ,PRSO ,RECEPTACLE>>
348                 <TELL "The receptacle is ">
349                 <COND (<FSET? ,PRSO ,OPENBIT> <TELL "open." CR>)
350                       (T <TELL "closed." CR>)>)
351                (<VERB? FIND EXAMINE>
352                 <TELL
353 "The " D ,PRSO " is part of the basket. It may be manipulated
354 within the basket but cannot be removed." CR>)>>
355
356 <ROUTINE WIRE-FCN ()
357         <COND (<VERB? TAKE FIND EXAMINE>
358                <BCONTENTS>)
359               (<VERB? TIE>
360                <COND (<AND <EQUAL? ,PRSO ,BRAIDED-WIRE>
361                            <EQUAL? ,PRSI ,HOOK-1 ,HOOK-2>>
362                       <SETG BTIE-FLAG ,PRSI>
363                       <FSET ,PRSI ,NDESCBIT>
364                       <DISABLE <INT I-BALLOON>>
365                       <TELL "The balloon is fastened to the hook." CR>)>)
366               (<AND <VERB? UNTIE>
367                     <EQUAL? ,PRSO ,BRAIDED-WIRE>>
368                <COND (,BTIE-FLAG
369                       <ENABLE <QUEUE I-BALLOON 3>>
370                       <FCLEAR ,BTIE-FLAG ,NDESCBIT>
371                       <SETG BTIE-FLAG <>>
372                       <TELL "The wire falls off of the hook." CR>)
373                      (T <TELL "The wire is not tied to anything." CR>)>)>>
374
375 <ROUTINE I-BURNUP ("AUX" (OBJ <FIRST? ,RECEPTACLE>))
376     #DECL ((OBJ) OBJECT)
377     <COND (<EQUAL? ,HERE ,BLOC>
378            <TELL
379 "The " D .OBJ " has now burned out, and the cloth bag starts to deflate." CR>)>
380     <REMOVE .OBJ>
381     <SETG BINF-FLAG <>>
382     T>
383
384 <ROUTINE SAFE-ROOM-FCN (RARG)
385          <COND (<EQUAL? .RARG ,M-LOOK>
386                 <TELL
387 "You are in a dusty old room which is featureless, except
388 for an exit on the north side." CR>
389                 <COND (<NOT ,SAFE-FLAG>
390                        <TELL
391 "Imbedded in the far wall is a rusty box. It appears to be somewhat
392 damaged, since an oblong hole has been chipped out of the front of it." CR>)
393                       (T
394                        <TELL
395 "On the far wall is a rusty box, whose door has been blown off." CR>)>)>>
396
397 <ROUTINE SAFE-FCN ()
398         <COND (<AND <VERB? TAKE> <EQUAL? ,PRSO ,SAFE>>
399                <TELL "The box is imbedded in the wall." CR>)
400               (<VERB? OPEN>
401                <COND (,SAFE-FLAG <TELL "The box has no door!" CR>)
402                      (T <TELL "The box is rusted and will not open." CR>)>)
403               (<VERB? CLOSE>
404                <COND (,SAFE-FLAG <TELL "The box has no door!" CR>)
405                      (T <TELL "The box isn't open!" CR>)>)>>
406
407 <ROUTINE BRICK-FCN ()
408          <COND (<VERB? BURN>
409                 <REMOVE ,BRICK>
410                 <JIGS-UP ,OTHER-PROPERTIES>)>>
411
412 <GLOBAL OTHER-PROPERTIES
413 "Now you've done it. It seems that the brick has other properties
414 than weight, namely the ability to blow you to smithereens.">
415
416 <ROUTINE FUSE-FCN ()
417         <COND (<OR <VERB? BURN>
418                    <AND <VERB? LAMP-ON>
419                         <IN? ,MATCH ,WINNER>
420                         <FSET? ,MATCH ,ONBIT>>>
421                <TELL "The string starts to burn." CR>
422                <ENABLE <QUEUE I-FUSE 2>>)>>
423
424 <ROUTINE I-FUSE ("AUX" (BRICK-ROOM <LOC ,BRICK>) F)
425          <COND (<IN? ,FUSE ,BRICK>
426                 <REPEAT ()
427                         <COND (<NOT .BRICK-ROOM> <RFALSE>)
428                               (<IN? .BRICK-ROOM ,ROOMS>
429                                <RETURN>)
430                               (T
431                                <SET BRICK-ROOM <LOC .BRICK-ROOM>>)>>
432                 <MOVE ,EXPLOSION .BRICK-ROOM>
433                 <FCLEAR .BRICK-ROOM ,TOUCHBIT>
434                 <COND (<EQUAL? .BRICK-ROOM ,HERE>
435                        <MUNG-ROOM .BRICK-ROOM
436                           "The way is blocked by debris from an explosion.">
437                        <JIGS-UP ,OTHER-PROPERTIES>)
438                       (<EQUAL? .BRICK-ROOM ,SAFE-ROOM>
439                        <ENABLE <QUEUE I-SAFE 5>>
440                        <SETG MUNGED-ROOM ,SAFE-ROOM>
441                        <TELL "There is an explosion nearby." CR>
442                        <COND (<IN? ,BRICK ,SLOT>
443                               <FSET ,SLOT ,INVISIBLE>
444                               <FSET ,SAFE ,OPENBIT>
445                               <FCLEAR ,SAFE-ROOM ,TOUCHBIT>
446                               <SETG SAFE-FLAG T>)>)
447                       (T
448                        <TELL "There is an explosion nearby." CR>
449                        <ENABLE <QUEUE I-SAFE 5>>
450                        <SETG MUNGED-ROOM .BRICK-ROOM>
451                        <COND (<SET F <FIRST? .BRICK-ROOM>>
452                               <REPEAT ()
453                                       <COND (<FSET? .F ,TAKEBIT>
454                                              <FSET .F ,INVISIBLE>)>
455                                       <COND (<NOT <SET F <NEXT? .F>>>
456                                              <RETURN>)>>)>)>
457                 <REMOVE ,BRICK>)
458                (<EQUAL? <LOC ,FUSE> ,WINNER ,HERE>
459                 <TELL "The string rapidly burns into nothingness." CR>)>
460          <REMOVE ,FUSE>>
461
462 <ROUTINE I-SAFE ()
463         <COND (<EQUAL? ,HERE ,MUNGED-ROOM>
464                <JIGS-UP
465 "The room trembles and 5000 tons of rock fall on you, turning you
466 into a pancake.">)
467               (<NOT ,DEAD>
468                <TELL
469 "You may recall that recent explosion. Probably as a result of it, you
470 hear an ominous rumbling, as if a nearby room had collapsed." CR>
471                <COND (<EQUAL? ,MUNGED-ROOM ,SAFE-ROOM>
472                       <ENABLE <QUEUE I-LEDGE 8>>)>)>
473         <MUNG-ROOM ,MUNGED-ROOM
474                    "The way is blocked by debris from an explosion.">>
475
476 <ROUTINE I-LEDGE ("AUX" (RM ,LEDGE-2))
477     <COND (<EQUAL? ,HERE ,LEDGE-2>
478            <COND (<IN? ,WINNER ,BALLOON>
479                   <COND (,BTIE-FLAG
480                          <SETG BLOC ,VOLCANO-BOTTOM>
481                          <REMOVE ,BALLOON>
482                          <MOVE ,DEAD-BALLOON ,VOLCANO-BOTTOM>
483                          <SETG BTIE-FLAG <>>
484                          <SETG BINF-FLAG <>>
485                          <DISABLE <INT I-BALLOON>>
486                          <DISABLE <INT I-BURNUP>>
487                          <JIGS-UP
488 "The ledge collapses, probably as a result of the explosion, and plummets
489 to the ground far below. Sadly, you were still attached to the ledge.">)
490                         (T
491                          <TELL
492 "The ledge collapses, leaving you with no place to land." CR>)>)
493                  (T
494                   <JIGS-UP
495 "The force of the recent explosion has caused the ledge to collapse.">)>)
496           (<NOT ,DEAD>
497            <TELL "The ledge collapses. (That was a narrow escape!)" CR>)>
498     <MUNG-ROOM .RM "The ledge has collapsed and cannot be landed on.">>
499
500 <ROUTINE LEDGE-FCN (RARG)
501     <COND (<EQUAL? .RARG ,M-LOOK>
502            <TELL
503 "You are on a wide ledge high in the volcano. The rim of the volcano is
504 about 200 feet above and there is a precipitous drop to the bottom.">
505            <COND (<FSET? ,SAFE-ROOM ,RMUNGBIT>
506                   <TELL " The way to the south is blocked by rubble." CR>)
507                  (T <TELL " There is a small door to the south." CR>)>)>>
508
509 ;<ROUTINE BLAST () ;"APPARENTLY UNUSED?"
510     <COND (<EQUAL? ,HERE ,SAFE-ROOM>)
511           (T
512            <TELL "You must explain how to do that." CR>)>>
513
514 <ROUTINE I-GNOME ()
515     <COND (<EQUAL? ,HERE ,LEDGE-1 ,LEDGE-2>
516            <TELL
517 "A volcano gnome seems to walk straight out of the wall and ">
518            <COND (<IN? ,WAND ,WINNER>
519                   <TELL
520 "noticing the wand, straight back in." CR>)
521                  (T
522                   <TELL
523 "says
524 \"I have a busy appointment schedule and little time to waste on
525 trespassers, but for a small fee I'll show you the way out.\" You
526 notice the gnome nervously glancing at his watch." CR>
527                   <MOVE ,GNOME ,HERE>)>)
528           (T
529            <ENABLE <QUEUE I-GNOME 1>>
530            <RFALSE>)>>
531
532 <GLOBAL GNOME-FLAG <>>
533
534 <ROUTINE GNOME-FCN ()
535     <COND (<VERB? TELL>
536            <SETG P-CONT <>>
537            <SETG QUOTE-FLAG <>>
538            <COND (<NOT ,GNOME-FLAG>
539                   <ENABLE <QUEUE I-NERVOUS 5>>)>
540            <SETG GNOME-FLAG T>
541            <TELL
542 "The gnome appears increasingly nervous." CR>)
543           (<AND <VERB? GIVE THROW> <EQUAL? ,PRSI ,GNOME>>
544            <COND (<GETPT ,PRSO ,P?VALUE>
545                   <TELL
546 "\"Thank you very much for the " D ,PRSO ". I don't believe
547 I've ever seen one as beautiful. Follow me,\" he says, and a door
548 appears on the west end of the ledge. Through the door, you can see
549 a narrow chimney sloping steeply downward. The gnome moves quickly,
550 and disappears from sight." CR>
551                   <REMOVE ,PRSO>
552                   <REMOVE ,GNOME>
553                   <SETG GNOME-DOOR-FLAG T>)
554                  (<BOMB? ,PRSO>
555                   <MOVE ,BRICK ,HERE>
556                   <REMOVE ,GNOME>
557                   <DISABLE <INT I-GNOME>>
558                   <DISABLE <INT I-NERVOUS>>
559                   <TELL
560 "\"That certainly wasn't what I had in mind,\" he says, and disappears." CR>)
561                  (T
562                   <REMOVE-CAREFULLY ,PRSO>
563                   <TELL
564 "\"That wasn't quite what I had in mind,\" he says, crunching the
565 " D ,PRSO " in his rock-hard hands." CR>)>)
566           (T
567            <TELL
568 "The gnome appears increasingly nervous." CR>
569            <COND (<NOT ,GNOME-FLAG>
570                   <ENABLE <QUEUE I-NERVOUS 5>>)>
571            <SETG GNOME-FLAG T>)>>
572
573 <ROUTINE I-NERVOUS ()
574          <COND (<IN? ,GNOME ,HERE>
575                 <TELL
576 "The gnome glances at his watch. \"Oops. I'm late for an
577 appointment!\" He disappears, leaving you alone on the ledge." CR>)>
578          <REMOVE ,GNOME>>
579
580 <ROUTINE PURPLE-BOOK-FCN ()
581          <COND (<AND <VERB? READ>
582                      <IN? ,STAMP ,PURPLE-BOOK>
583                      <NOT <FSET? ,PURPLE-BOOK ,OPENBIT>>>
584                 <TELL <GETP ,PURPLE-BOOK ,P?TEXT> CR>
585                 <PERFORM ,V?OPEN ,PURPLE-BOOK>
586                 <RTRUE>)
587                (T <RANDOM-BOOK>)>>
588
589 <ROUTINE RANDOM-BOOK ()
590          <COND (<VERB? TAKE MOVE PUT>
591                 <FSET ,WHITE-BOOK ,TOUCHBIT>
592                 <FSET ,PURPLE-BOOK ,TOUCHBIT>
593                 <FSET ,GREEN-BOOK ,TOUCHBIT>
594                 <FSET ,BLUE-BOOK ,TOUCHBIT>
595                 <RFALSE>)>>
596
597 ; "SUBTITLE TOMB OF THE FLATHEADS"
598
599 <ROUTINE HEAD-FCN ()
600   <COND (<VERB? HELLO>
601          <TELL "The Flatheads are dead; therefore they do not respond." CR>)
602         (<VERB? KICK ATTACK RUB OPEN TAKE BURN>
603          <JIGS-UP
604 "Although the Flatheads are dead, they foresaw that some cretin
605 might tamper with their remains. Therefore, they took steps to
606 punish such actions.">)>>
607
608 <ROUTINE CRYPT-ANTEROOM-FCN (RARG)
609          <COND (<EQUAL? .RARG ,M-LOOK>
610                 <TELL
611 "The anteroom is large and empty. Marble bas reliefs depict the stirring
612 times and afterlife of the Flatheads (the latter a bit optimistically).
613 The exit is to the west. A huge marble door stands to the south. ">
614                 <TELL "The door is ">
615                 <COND (<FSET? ,CRYPT-DOOR ,OPENBIT>
616                        <TELL "open.">)
617                       (T <TELL "closed.">)>
618                 <TELL
619 " Above the door is the cryptic inscription: \"Feel Free\"." CR>)>>
620
621 <ROUTINE CRYPT-ROOM-FCN (RARG "AUX" CLIT?)
622          <COND (<EQUAL? .RARG ,M-LOOK>
623                 <FCLEAR ,HERE ,ONBIT>
624                 <COND (<LIT? ,HERE>
625                        <TELL
626 "The room contains the earthly remains of the mighty Flatheads, twelve
627 somewhat flat heads mounted securely on poles. While the room might be
628 expected to contain funerary urns or other evidence of the ritual
629 practices of the ancient Zorkers, it is empty of all such objects. There
630 is writing carved on the crypt. The only apparent exit is to the north
631 through the door to the anteroom. The door is ">
632                        <COND (<FSET? ,CRYPT-DOOR ,OPENBIT>
633                               <TELL "open.">)
634                              (T <TELL "closed.">)>
635                        <CRLF>
636                        <COND (<NOT <FSET? ,DIM-DOOR ,INVISIBLE>>
637                               <TELL
638 "Looking closely at the south wall, you can see the dim outline of
639 a secret door labelled with the letter \"F\"." CR>)>)
640                       (T
641                        <DIM-DOOR-APPEARS>)>
642                 <FSET ,HERE ,ONBIT>
643                 <RTRUE>)
644                (<EQUAL? .RARG ,M-END>
645                 <SET CLIT? ,CRYPT-LIT?>
646                 <FCLEAR ,CRYPT-ROOM ,ONBIT>
647                 <SETG CRYPT-LIT? <LIT? ,CRYPT-ROOM>>
648                 <COND (<AND .CLIT?
649                             <NOT ,CRYPT-LIT?>>
650                        <DIM-DOOR-APPEARS>)>
651                 <FSET ,CRYPT-ROOM ,ONBIT>)>>
652
653 <GLOBAL CRYPT-LIT? T>
654
655 <ROUTINE DIM-DOOR-APPEARS ()
656          <TELL
657 "It is dark, but on the south wall is a faint outline of a rectangle, as
658 though light were shining around a doorway. You can also make out a faintly
659 glowing letter in the center of this area. It might be an \"F\"." CR>
660          <FCLEAR ,DIM-DOOR ,INVISIBLE>>
661
662 <ROUTINE CRYPT-OBJECT ()
663          <COND (<VERB? OPEN> <TELL "The crypt is sealed for all time." CR>)
664                (<VERB? RUB> <TELL "The marble is cool." CR>)>>
665
666 <ROUTINE CRYPT-DOOR-FCN ()
667          <COND (<VERB? OPEN CLOSE>
668                 <OPEN-CLOSE ,PRSO
669                             "The crypt door squeaks open."
670                             "The crypt door squeaks closed.">)>>
671
672 <ROUTINE TOMB-PSEUDO ()
673          <COND (<VERB? THROUGH>
674                 <DO-WALK ,P?EAST>
675                 T)>>
676
677 <GLOBAL DIM-DOOR-FLAG <>>
678
679 <ROUTINE DIM-DOOR-FCN ()
680          <COND (<VERB? KNOCK> <TELL "A hollow echo responds." CR>)
681                (<VERB? OPEN CLOSE>
682                 <COND (<VERB? OPEN> <SETG DIM-DOOR-FLAG T>)
683                       (T <SETG DIM-DOOR-FLAG <>>)>
684                 <OPEN-CLOSE ,PRSO
685                             "The secret door opens noiselessly."
686                             "The secret door closes noiselessly.">)>>
687
688 <ROUTINE REPELLENT-FCN ()
689          <COND (<VERB? SHAKE>
690                 <COND (,SPRAY-USED? <TELL "The can seems empty." CR>)
691                       (T <TELL "There is a sloshing sound from inside." CR>)>)
692                (<AND <VERB? SPRAY PUT> <EQUAL? ,PRSO ,REPELLENT>>
693                 <COND (,SPRAY-USED?
694                        <TELL
695 "The repellent is all gone." CR>)
696                       (<NOT ,PRSI>
697                        <SETG SPRAY-USED? T>
698                        <TELL
699 "The spray stinks amazingly for a few moments, then drifts away." CR>)
700                       (T
701                        <COND (<EQUAL? ,PRSI ,ME>
702                               <ENABLE <QUEUE I-SPRAY 8>>
703                               <SETG SPRAYED? T>)>
704                        <SETG SPRAY-USED? T>
705                        <TELL
706 "The spray smells like a mixture of old socks and burning rubber. If
707 I were a grue I'd sure stay clear!" CR>)>)>>
708
709 <GLOBAL SPRAY-USED? <>>
710
711 <ROUTINE I-SPRAY ()
712          <SETG SPRAYED? <>>
713          <TELL "That horrible smell is much less pungent now." CR>>
714
715 <ROUTINE ZORK3-FCN (RARG)
716          <COND (<EQUAL? .RARG ,M-LOOK>
717                 <TELL
718 "Beyond the door is a roughly hewn staircase leading down into darkness.
719 The landing on which you stand is covered with carefully drawn magical runes
720 like those sketched upon the workbench of the Wizard of Frobozz.
721 These have been overlaid with sweeping green lines of enormous power, which
722 undulate back and forth across the landing. ">
723                 <COND (<IN? ,WAND ,WINNER>
724                        <TELL
725 "The wand begins to vibrate in harmony with the motion of the lines.
726 You feel yourself compelled downward, and you yield, stepping onto the
727 staircase. As you pass the green lines, they flare and disappear with a
728 burst of light, and you tumble down the staircase!|
729 |
730 At the bottom, a vast red-lit hall stretches off into the distance.
731 Sinister statues guard the entrance to a dimly visible room far ahead.
732 With courage and cunning you have conquered the Wizard of Frobozz and
733 become the master of his domain, but the final challenge awaits!|
734 |
735 (The ultimate adventure concludes in \"Zork III: The Dungeon Master\".)|
736 |
737 " CR>
738                 <SETG WON-FLAG T>
739                 <FINISH>)
740                       (T
741                        <JIGS-UP
742 "The green curves begin to vibrate toward you, as if searching for
743 something. One by one your possessions glow bright green. Finally, you
744 are attacked by these magical wardens, and destroyed!">)>)>>
745
746 \\f
747
748 ;"SUBTITLE A DROP IN THE BUCKET"
749
750 <GLOBAL BUCKET-TOP-FLAG <>>
751
752 <GLOBAL EVAPORATED <>>
753
754 <ROUTINE I-BUCKET ()
755          <COND (<IN? ,WATER ,BUCKET>
756                 <SETG EVAPORATED T>
757                 <REMOVE ,WATER>)>
758          <RFALSE>>
759
760 <ROUTINE WATER-FCN ("AUX" AV W PI?)
761          #DECL ((AV) <OR OBJECT FALSE> (W) OBJECT (PI?) <OR ATOM FALSE>)
762          <COND (<VERB? SGIVE> <RFALSE>)
763                (<VERB? THROUGH>
764                 <PERFORM ,V?SWIM ,PRSO>
765                 <RTRUE>)
766                (<VERB? FILL>    ;"fill bottle with water =>"
767                 <SET W ,PRSI>      ;"put water in bottle"
768                 <SETG PRSA ,V?PUT>
769                 <SETG PRSI ,PRSO>
770                 <SETG PRSO .W>
771                 <SET PI? <>>)
772                (<EQUAL? ,PRSO ,GLOBAL-WATER ,WATER>
773                 <SET W ,PRSO>
774                 <SET PI? <>>)
775                (,PRSI
776                 <SET W ,PRSI>
777                 <SET PI? T>)>
778          <COND (<EQUAL? .W ,GLOBAL-WATER>
779                 <SET W ,WATER>
780                 <COND (<VERB? TAKE PUT> <REMOVE .W>)>)>
781          <COND (.PI? <SETG PRSI .W>)
782                (T <SETG PRSO .W>)>
783          <SET AV <LOC ,WINNER>>
784          <COND (<NOT <FSET? .AV ,VEHBIT>> <SET AV <>>)>
785          <COND (<AND <VERB? TAKE PUT> <NOT .PI?>>
786                 <COND (<AND .AV <EQUAL? .AV ,PRSI>>
787                        <PUDDLE .AV>)
788                       (<AND .AV <NOT ,PRSI> <NOT <IN? .W .AV>>>
789                        <PUDDLE .AV>)
790                       (<AND ,PRSI <NOT <EQUAL? ,PRSI ,TEAPOT>>>
791                        <TELL "The water leaks out of the " D ,PRSI
792                              " and evaporates immediately." CR>
793                        <REMOVE .W>)
794                       (<IN? ,TEAPOT ,WINNER>
795                        <COND (<NOT <FIRST? ,TEAPOT>>
796                               <COND (<EQUAL? ,HERE ,POOL-ROOM>
797                                      <MOVE ,SALTY-WATER ,TEAPOT>)
798                                     (T 
799                                      <MOVE ,WATER ,TEAPOT>)>
800                               <TELL "The teapot is now full of water." CR>)
801                              (T
802                               <TELL "The teapot isn't currently empty." CR>
803                               <RTRUE>)>)
804                       (<AND <IN? ,PRSO ,TEAPOT>
805                             <VERB? TAKE>
806                             <NOT ,PRSI>>
807                        <SETG PRSO ,TEAPOT>
808                        <ITAKE>
809                        <SETG PRSO .W>)
810                       (T
811                        <TELL "The water slips through your fingers." CR>)>)
812                (.PI? <TELL "Nice try." CR>)
813                (<VERB? DROP GIVE>
814                 <COND (<AND <EQUAL? ,PRSO ,WATER>
815                             <NOT <HELD? ,WATER>>>
816                        <TELL "You don't have any water." CR>
817                        <RTRUE>)>
818                 <REMOVE ,WATER>
819                 <COND (.AV
820                        <PUDDLE .AV>)
821                       (T
822                        <TELL
823 "The water spills to the floor and evaporates." CR>
824                        <REMOVE ,WATER>)>)
825                (<VERB? THROW>
826                 <TELL
827 "The water splashes on the walls and evaporates." CR>
828                 <REMOVE ,WATER>)>>
829
830 <ROUTINE PUDDLE (AV)
831         <TELL "There is now a puddle in the bottom of the " D .AV "." CR>
832         <MOVE ,PRSO .AV>>
833
834 <ROUTINE BUCKET-FCN ("OPTIONAL" (RARG ,M-BEG))
835         <COND (<EQUAL? .RARG ,M-BEG>
836                <COND (<AND <VERB? BURN>
837                            <EQUAL? ,PRSO ,BUCKET>>
838                       <TELL
839                        "The bucket is fireproof, and won't burn." CR>)
840                      (<AND <VERB? DROP PUT>
841                            <EQUAL? ,PRSO ,WATER>
842                            <EQUAL? ,PRSI ,BUCKET>
843                            <IN? ,BUCKET ,WELL-BOTTOM>
844                            <NOT <IN? ,WINNER ,BUCKET>>>
845                       <TELL "The bucket swiftly rises up, and is gone." CR>
846                       <MOVE ,BUCKET ,WELL-TOP>
847                       <MOVE ,WATER ,BUCKET>
848                       <SETG BUCKET-TOP-FLAG T>
849                       <ENABLE <QUEUE I-BUCKET 100>>
850                       <RTRUE>)
851                      (<VERB? KICK>
852                       <JIGS-UP "If you insist.">)>)
853               (<EQUAL? .RARG ,M-END>
854                <COND (<AND <IN? ,WATER ,BUCKET>
855                            <NOT ,BUCKET-TOP-FLAG>>
856                       <TELL "The bucket rises and comes to a stop." CR CR>
857                       <SETG BUCKET-TOP-FLAG T>
858                       <SETG EVAPORATED <>>
859                       <PASS-THE-BUCKET ,WELL-TOP>
860                       <ENABLE <QUEUE I-BUCKET 100>>
861                       <RTRUE>)
862                      (<AND ,BUCKET-TOP-FLAG
863                            <NOT <IN? ,WATER ,BUCKET>>>
864                       <COND (,EVAPORATED
865                              <TELL
866 "The last of the water evaporates, and the bucket descends." CR CR>)
867                             (T
868                              <TELL
869 "The bucket descends and comes to a stop." CR CR>)>
870                       <SETG BUCKET-TOP-FLAG <>>
871                       <PASS-THE-BUCKET ,WELL-BOTTOM>)>)
872               (<VERB? CLIMB-ON>
873                <PERFORM ,V?BOARD ,PRSO>
874                <RTRUE>)>>
875
876 <ROUTINE PASS-THE-BUCKET (R)
877     #DECL ((R) OBJECT)
878     <MOVE ,BUCKET .R>
879     <COND (<IN? ,WINNER ,BUCKET>
880            <GOTO .R>)>>
881
882 \\f
883
884 ;"SUBTITLE CHOMPERS IN WONDERLAND"
885
886 <ROUTINE POSTS-ROOM-FCN (RARG)
887          <COND (<EQUAL? .RARG ,M-BEG>
888                 <COND (<AND <VERB? TAKE> <FSET? ,PRSO ,NONLANDBIT>>
889                        <TELL
890 "The " D ,PRSO " is now much larger than you are. You have no hope of
891 taking it." CR>)>)>>
892
893 <ROUTINE EATME-FCN ("AUX" F N)
894     <COND (<AND <VERB? EAT>
895                 <EQUAL? ,PRSO ,EAT-ME-CAKE>
896                 <EQUAL? ,HERE ,TEA-ROOM>>
897            <TELL
898 "Suddenly, the room appears to have become very large (although
899 everything you are carrying seems to be its normal size)." CR CR>
900            <REMOVE ,EAT-ME-CAKE>
901            <FSET ,ROBOT ,INVISIBLE>
902            <FSET ,ALICE-TABLE ,INVISIBLE>
903            <SET F <FIRST? ,HERE>>
904            <REPEAT ()
905                    <COND (<NOT .F> <RETURN>)
906                          (T
907                           <SET N <NEXT? .F>>
908                           <COND (<AND <NOT <EQUAL? .F ,ADVENTURER>>
909                                       <FSET? .F ,TAKEBIT>>
910                                  <FSET .F ,NONLANDBIT>
911                                  <FSET .F ,TRYTAKEBIT>
912                                  <MOVE .F ,POSTS-ROOM>)>)>
913                    <SET F .N>>
914            <GOTO ,POSTS-ROOM>)
915           (T <CAKE-CRUMBLE>)>>
916
917 <ROUTINE CAKE-CRUMBLE ("AUX" CAKE)
918          <COND (<FSET? ,PRSO ,FOODBIT> <SET CAKE ,PRSO>)
919                (T <SET CAKE ,PRSI>)>
920          <COND (<OR <EQUAL? ,HERE ,TEA-ROOM ,POSTS-ROOM ,POOL-ROOM>
921                     <EQUAL? ,HERE ,MACHINE-ROOM ,MAGNET-ROOM ,CAGE-ROOM>
922                     <EQUAL? ,HERE ,WELL-TOP ,IN-CAGE>>
923                 <RFALSE>)
924                (T
925                 <REMOVE .CAKE>
926                 <TELL
927 "The " D .CAKE " has crumbled to dust." CR>)>>
928
929 <ROUTINE CAKE-FCN ("AUX" F N)
930         <COND (<VERB? READ>
931                <COND (<FSET? ,PRSO ,NONLANDBIT>
932                       <TELL
933 "The cake is much too tall now for you to read the lettering." CR>)
934                      (,PRSI
935                       <COND (<EQUAL? ,PRSI ,PALANTIR-1 ,PALANTIR-2 ,PALANTIR-3>
936                              <PERFORM ,V?LOOK-INSIDE ,PRSI>)
937                             (<EQUAL? ,PRSI ,FLASK>
938                              <TELL "The letters, now visible, say \"">
939                              <COND (<EQUAL? ,PRSO ,RED-ICING>
940                                     <TELL "Evaporate">)
941                                    (<EQUAL? ,PRSO ,ORANGE-ICING>
942                                     <TELL "Explode">)
943                                    (T <TELL "Enlarge">)>
944                              <TELL "\"." CR>)
945                             (T <TELL "You can't see through that!" CR>)>)
946                      (T
947                       <TELL
948 "The first letter is a capital E. The rest is too small to read." CR>)>)
949               (<AND <VERB? EAT>
950                     <EQUAL? ,HERE ,TEA-ROOM ,POSTS-ROOM ,POOL-ROOM>>
951                <COND (<EQUAL? ,PRSO ,ORANGE-ICING>
952                       <REMOVE ,PRSO>
953                       <ICEBOOM>)
954                      (<EQUAL? ,PRSO ,RED-ICING>
955                       <REMOVE ,PRSO>
956                       <JIGS-UP
957 "That was delicious, but your dying memory is of feeling horribly dehydrated
958 and thirsty.">)
959                      (<EQUAL? ,PRSO ,BLUE-ICING>
960                       <REMOVE ,PRSO>
961                       <TELL "The room around you seems to be getting smaller."
962                             CR CR>
963                       <COND (<EQUAL? ,HERE ,POSTS-ROOM>
964                              <FCLEAR ,ROBOT ,INVISIBLE>
965                              <FCLEAR ,ALICE-TABLE ,INVISIBLE>
966                              <FSET ,POSTS ,INVISIBLE>
967                              <SET F <FIRST? ,HERE>>
968                              <REPEAT ()
969                                 <COND (<NOT .F> <RETURN>)
970                                       (T
971                                        <SET N <NEXT? .F>>
972                                        <COND (<AND <NOT <EQUAL? .F ,ADVENTURER>>
973                                                    <FSET? .F ,TAKEBIT>>
974                                               <FCLEAR .F ,NONLANDBIT>
975                                               <FCLEAR .F ,TRYTAKEBIT>
976                                               <MOVE .F ,TEA-ROOM>)>)>
977                                 <SET F .N>>
978                              <GOTO ,TEA-ROOM>)
979                             (T <JIGS-UP
980 "The room seems to have become too small to hold you. The walls are not as
981 compressible as your body, which is demolished." >)>)>)
982               (<AND <VERB? THROW PUT>
983                     <EQUAL? ,PRSO ,ORANGE-ICING>
984                     <EQUAL? ,HERE ,TEA-ROOM ,POSTS-ROOM ,POOL-ROOM>>
985                <REMOVE ,PRSO>
986                <ICEBOOM>)
987               (<AND <VERB? THROW PUT>
988                     <EQUAL? ,PRSO ,RED-ICING ,BLUE-ICING ,ORANGE-ICING>
989                     <EQUAL? ,PRSI ,POOL>>
990                <COND (<EQUAL? ,PRSO ,BLUE-ICING ,ORANGE-ICING>
991                       <TELL "The cake sinks majestically into the pool." CR>
992                       <REMOVE ,PRSO>
993                       <RTRUE>)>
994                <MOVE ,PRSO ,HERE>
995                <REMOVE ,PRSI>
996                <TELL
997 "Most of the pool evaporates, revealing a (slightly damp but
998 still valuable) package of rare candies. The red cake must be
999 pretty strong stuff, since it remains intact!" CR>
1000                <FCLEAR ,CANDY ,INVISIBLE>)
1001               (T <CAKE-CRUMBLE>)>>
1002
1003 <ROUTINE CANDY-FCN ()
1004          <COND (<VERB? EXAMINE READ>
1005                 <FIXED-FONT-ON>
1006                 <TELL
1007 "       Frobozz Magic Candy Company|
1008          >>Special Assortment<<|
1009           Candied Grasshoppers|
1010              Chocolated Ants|
1011               Worms Glacee|
1012 (By Appointment to His Majesty, Dimwit I)|
1013 ">
1014                 <FIXED-FONT-OFF>
1015                 <RTRUE>)
1016                (<VERB? EAT OPEN>
1017                 <TELL
1018 "Such rich food would probably not be good for you." CR>)>>
1019
1020 <ROUTINE TOP-ETCHINGS-F ()
1021         <COND (<VERB? EXAMINE READ>
1022                <FIXED-FONT-ON>
1023                <TELL
1024 "       o  b  o|
1025    r             z|
1026 f   M  A  G  I  C   z|
1027 c    W  E   L  L    y|
1028    o             n|
1029        m  p  a|
1030 ">
1031                <FIXED-FONT-OFF>
1032                <RTRUE>)>>
1033
1034 <ROUTINE BOTTOM-ETCHINGS-F ()
1035         <COND (<VERB? EXAMINE READ>
1036                <FIXED-FONT-ON>
1037                <TELL
1038 "       o  b  o|
1039 |
1040        A  G  I|
1041         E   L|
1042 |
1043        m  p  a|
1044 ">
1045                <FIXED-FONT-OFF>
1046                <RTRUE>)>>
1047
1048 <ROUTINE CUBE-F ()
1049         <COND (<VERB? EXAMINE READ>
1050                <FIXED-FONT-ON>
1051                <TELL    
1052 "              Bank of Zork|
1053                    VAULT|
1054                  *722 GUE*|
1055         Frobozz Magic Vault Company|
1056 ">
1057                <FIXED-FONT-OFF>
1058                <RTRUE>)>>
1059
1060 <ROUTINE FIXED-FONT-ON () <PUT 0 8 <BOR <GET 0 8> 2>>>
1061
1062 <ROUTINE FIXED-FONT-OFF() <PUT 0 8 <BAND <GET 0 8> -3>>>
1063
1064 <ROUTINE POOL-FCN ()
1065          <COND (<VERB? DRINK>
1066                 <TELL
1067 "The water is extremely salty." CR>)
1068                (<VERB? LOOK-UNDER>
1069                 <TELL
1070 "You'd probably have to enter the pool to see what's below the surface." CR>)
1071                (<VERB? THROUGH>
1072                 <JIGS-UP
1073 "You enter the pool, thrash around for a good while, and then drown.
1074 Sad, but true.">)>>
1075
1076 <ROUTINE FLASK-FCN ()
1077          <COND (<VERB? LOOK-INSIDE>
1078                 <TELL
1079 "You notice that objects behind the flask appear to be magnified.
1080 You might try looking at something through the flask." CR>)
1081                (<AND <VERB? READ> <EQUAL? ,PRSI ,FLASK>>
1082                 <TELL
1083 "The flask distorts and magnifies the " D ,PRSO ", showing details
1084 not noticed earlier." CR>
1085                 <RFALSE>)
1086                (<VERB? OPEN>
1087                 <MUNG-ROOM ,HERE "Noxious vapors prevent your entry.">
1088                 <JIGS-UP ,FATAL-VAPORS>)
1089                (<VERB? MUNG THROW>
1090                 <TELL "The flask breaks into pieces." CR>
1091                 <REMOVE ,PRSO>
1092                 <JIGS-UP ,FATAL-VAPORS>)>>
1093
1094 <GLOBAL FATAL-VAPORS
1095 "As you pass out, you realize that the vapors from the
1096 flask's contents are fatal.">
1097
1098 <ROUTINE PLEAK ()
1099     <COND (<VERB? TAKE>
1100            <TELL <PICK-ONE ,YUKS> CR>)
1101           (<VERB? PLUG>
1102            <TELL "The leak is too high above you to reach." CR>)>>
1103
1104 <ROUTINE ICEBOOM ()
1105     <MUNG-ROOM ,HERE
1106 "The entrance is blocked by sticky orange rubble. Probably some careless
1107 adventurer was playing with blasting cakes.">
1108     <JIGS-UP
1109 "You have been blasted to smithereens (wherever they are).">>
1110
1111 <ROUTINE MAGNET-ROOM-FCN (RARG)
1112         <COND (<EQUAL? .RARG ,M-LOOK>
1113                <TELL
1114 "You are in a circular room with a low ceiling. There are exits to
1115 the east and southeast." CR>)
1116               (<AND <EQUAL? .RARG ,M-ENTER>
1117                     ,CAROUSEL-FLIP-FLAG>
1118                <COND (,CAROUSEL-ZOOM-FLAG
1119                       <JIGS-UP <COND (<EQUAL? ,ADVENTURER ,WINNER>
1120 "According to Prof. TAA of GUE Tech, the rapidly changing magnetic
1121 fields in the room are intense enough to electrocute you.
1122 I really don't know, but in any event, something just killed you." )
1123                                      (T
1124 "According to Prof. TAA of GUE Tech, the magnetic fields in the room are
1125 intense enough to fry the delicate innards of the robot. I really don't
1126 know, but in any event, smoke pours from its ears and it has stopped moving.")>>)
1127                      (<EQUAL? ,WINNER ,ADVENTURER>
1128                       <TELL
1129 "As you enter, your compass starts spinning wildly." CR>
1130                       <COND (<NOT ,COMPASS-KLUDGE>
1131                              <TELL
1132 "What compass, you ask? The one which allows you to specify compass directions
1133 for movement.">
1134                              <SETG COMPASS-KLUDGE T>)>
1135                       <CRLF>)>)>>
1136
1137 <GLOBAL COMPASS-KLUDGE <>>
1138
1139 <ROUTINE MAGNET-ROOM-EXIT ()
1140         <COND (<AND ,CAROUSEL-FLIP-FLAG <EQUAL? ,WINNER ,ADVENTURER>>
1141                <TELL "You cannot get your bearings..." CR CR>
1142                <COND (<PROB 50>
1143                       ,MACHINE-ROOM)
1144                      (T
1145                       ,TEA-ROOM)>)
1146               (<EQUAL? ,PRSO ,P?EAST>
1147                ,MACHINE-ROOM)
1148               (<OR <EQUAL? ,PRSO ,P?SE>
1149                    <EQUAL? ,PRSO ,P?OUT>>
1150                ,TEA-ROOM)
1151               (T
1152                <TELL "You can't go that way." CR>
1153                <RFALSE>)>>
1154
1155 <GLOBAL CAROUSEL-ZOOM-FLAG <>>
1156
1157 <GLOBAL CAROUSEL-FLIP-FLAG <>>
1158
1159 <ROUTINE BUTTONS ()
1160         <COND (<VERB? PUSH>
1161                <COND (<EQUAL? ,WINNER ,ADVENTURER>
1162                       <JIGS-UP
1163 "There is a giant spark and you are fried to a crisp.">)
1164                      (<EQUAL? ,PRSO ,SQUARE-BUTTON>
1165                       <COND (,CAROUSEL-ZOOM-FLAG
1166                              <TELL "Nothing seems to happen." CR>)
1167                             (ELSE
1168                              <SETG CAROUSEL-ZOOM-FLAG T>
1169                              <TELL "The whirring increases in intensity." CR>)>)
1170                      (<EQUAL? ,PRSO ,ROUND-BUTTON>
1171                       <COND (,CAROUSEL-ZOOM-FLAG
1172                              <SETG CAROUSEL-ZOOM-FLAG <>>
1173                              <TELL "The whirring decreases in intensity." CR>)
1174                             (T
1175                              <TELL "Nothing seems to happen." CR>)>)
1176                      (<EQUAL? ,PRSO ,TRIANGULAR-BUTTON>
1177                       <SETG CAROUSEL-FLIP-FLAG <NOT ,CAROUSEL-FLIP-FLAG>>
1178                       <COND (<IN? ,IRON-BOX ,CAROUSEL-ROOM>
1179                              <TELL
1180 "A dull thump is heard in the distance." CR>
1181                              <COND (<FSET? ,IRON-BOX ,INVISIBLE>
1182                                     <FCLEAR ,IRON-BOX ,INVISIBLE>)
1183                                    (T
1184                                     <FSET ,IRON-BOX ,INVISIBLE>)>
1185                              <COND (<NOT <FSET? ,IRON-BOX ,INVISIBLE>>
1186                                     <FCLEAR ,CAROUSEL-ROOM ,TOUCHBIT>)>
1187                              T)
1188                             (T <TELL "Click." CR>)>)>)>>
1189
1190 <GLOBAL CAGE-SOLVE-FLAG <>>
1191
1192 <ROUTINE SPHERE-FCN ("AUX" FL)
1193         #DECL ((FL) <OR ATOM FALSE>)
1194         <COND (<AND <NOT ,CAGE-SOLVE-FLAG> <VERB? TAKE MOVE PUT>>
1195                <SET FL T>)
1196               (T <SET FL <>>)>
1197         <COND (<AND .FL <EQUAL? ,ADVENTURER ,WINNER>>
1198                <TELL
1199 "As you reach for the sphere, a solid steel cage falls from the ceiling
1200 to entrap you. To make matters worse, poisonous gas starts coming
1201 into the room." CR CR>
1202                <COND (<IN? ,ROBOT ,HERE>
1203                       <MOVE ,ROBOT ,IN-CAGE>
1204                       <FSET ,ROBOT ,NDESCBIT>)>
1205                <GOTO ,IN-CAGE>
1206                <MOVE ,CAGE ,HERE>
1207                <FSET ,CAGE ,NDESCBIT>
1208                <FCLEAR ,CAGE ,INVISIBLE>
1209                <ENABLE <QUEUE I-SPHERE 6>>
1210                T)
1211               (.FL
1212                <FSET ,PALANTIR-1 ,INVISIBLE>
1213                <REMOVE ,ROBOT>
1214                <FSET ,PRSO ,INVISIBLE>
1215                <MOVE ,CAGE ,CAGE-ROOM>
1216                <FCLEAR ,CAGE ,INVISIBLE>
1217                <JIGS-UP
1218 "As the robot reaches for the sphere, a solid steel cage falls from the
1219 ceiling, trapping him. You can faintly hear his last words: \"Whirr,
1220 buzz, click!\" A cloud of smoke rising from beneath the cage confirms
1221 your fears about the fate of your brave mechanical friend.">
1222                T)
1223               (<VERB? LOOK-INSIDE EXAMINE>
1224                <PALANTIR>)>>
1225
1226 <ROUTINE I-SPHERE ()
1227          <COND (<EQUAL? ,HERE ,CAGE-ROOM ,IN-CAGE>
1228                 <FSET ,PALANTIR-1 ,INVISIBLE>
1229                 <MUNG-ROOM ,CAGE-ROOM
1230 "You are stopped by a cloud of poisonous gas.">
1231                 <JIGS-UP
1232 "Time passes...and you die from some obscure poisoning.">)>>
1233
1234 <ROUTINE IN-CAGE-FCN (RARG)
1235     <COND (,CAGE-SOLVE-FLAG <SETG HERE ,CAGE-ROOM>)>>
1236
1237 <ROUTINE ROBOT-FCN ("OPTIONAL" (RARG ,M-OBJECT))
1238         <COND (<EQUAL? ,WINNER ,ROBOT>
1239                <COND (<VERB? SGIVE> <RFALSE>)
1240                      (<VERB? FOLLOW>
1241                       <TELL
1242 "\"My memory circuits are not that advanced. I can move as directed,
1243 though.\"" CR>)
1244                      (<AND <VERB? RAISE TAKE MOVE> <EQUAL? ,PRSO ,CAGE>>
1245                       <TELL
1246 "The cage shakes and is hurled across the room. It's hard to
1247 say, but the robot appears to be smiling." CR CR>
1248                       <DISABLE <INT I-SPHERE>>
1249                       <SETG WINNER ,ADVENTURER>
1250                       <GOTO ,CAGE-ROOM>
1251                       <MOVE ,MANGLED-CAGE ,CAGE-ROOM>
1252                       <FCLEAR ,ROBOT ,NDESCBIT>
1253                       <FSET ,PALANTIR-1 ,TAKEBIT>
1254                       <MOVE ,ROBOT ,CAGE-ROOM>
1255                       <SETG CAGE-SOLVE-FLAG T>)
1256                      (<VERB? EAT DRINK>
1257                       <COND (<IN? ,ADVENTURER ,HERE>
1258                              <TELL
1259 "\"I am sorry but that is difficult for a being with no mouth.\"" CR>)>
1260                       <RTRUE>)
1261                      (<AND <PROB 2>
1262                            <EQUAL? <META-LOC ,ADVENTURER> ,HERE>>
1263                       <TELL
1264 "\"Buzz! Buzz! Buzz! My circuits are getting rusty. Try again.\"" CR>)
1265                      (<VERB? READ EXAMINE>
1266                       <COND (<EQUAL? <META-LOC ,ADVENTURER> ,HERE>
1267                              <TELL
1268 "\"My vision is not sufficiently acute to do that.\"" CR>)>
1269                       <RTRUE>)
1270                      (<VERB? DROP PUT THROW>
1271                       <COND (<NOT <EQUAL? <META-LOC ,ADVENTURER> ,HERE>>
1272                              <RFALSE>)
1273                             (<IN? ,PRSO ,ROBOT>
1274                              <TELL "\"Whirr, buzz, click!\"" CR>
1275                              <RFALSE>)
1276                             (T
1277                              <TELL
1278 "\"Click! I don't have that. Buzz! Whirr!\"" CR>)>)
1279                      (<OR <VERB? WALK>
1280                           <AND <VERB? TAKE PUSH TURN>
1281                                <NOT <FSET? ,PRSO ,ACTORBIT>>>>
1282                       <COND (<NOT <EQUAL? <META-LOC ,ADVENTURER> ,HERE>>
1283                              <RFALSE>)
1284                             (<PROB 80>
1285                              <TELL "\"Whirr, buzz, click!\"" CR>)
1286                             (T
1287                              <TELL "\"Buzz, click, whirr!\"" CR>)>
1288                       <RFALSE>)
1289                      (T
1290                       <COND (<EQUAL? <META-LOC ,ADVENTURER> ,HERE>
1291                              <TELL
1292 "\"My programming is insufficient to allow me to perform that task.\"" CR>)>
1293                       <RTRUE>)>)
1294               (<VERB? OPEN LOOK-INSIDE CLOSE>
1295                <TELL "There's no access panel or door on the robot." CR>)
1296               (<AND <VERB? GIVE>
1297                     <EQUAL? ,PRSI ,ROBOT>>
1298                <MOVE ,PRSO ,ROBOT>
1299                <TELL "The robot gladly takes the "
1300                      D ,PRSO
1301                      " and nods his head-like appendage in thanks." CR>)
1302               (<VERB? THROW MUNG>
1303                <TELL
1304 "The robot falls to the ground and (being of shoddy construction)
1305 disintegrates before your eyes." CR>
1306                <REMOVE <COND (<VERB? THROW> ,PRSI) (,PRSO)>>)>>
1307
1308 \\f
1309
1310 ;"SUBTITLE BANK OF ZORK"
1311
1312 <GLOBAL BANK-SOLVE-FLAG <>>
1313
1314 <ROUTINE BILLS-OBJECT ()
1315         <SETG BANK-SOLVE-FLAG T>
1316         <COND (<VERB? BURN>
1317                <TELL "Nothing like having money to burn!" CR>
1318                <RFALSE>)
1319               (<VERB? EAT>
1320                <TELL "Talk about eating rich foods!" CR>)>>
1321         
1322 <ROUTINE BKLEAVEE ("OPTIONAL" (RM ,TELLER-EAST))
1323     #DECL ((RM) OBJECT)
1324     <COND (<OR <HELD? ,BILLS> <HELD? ,PORTRAIT>>
1325            <TELL
1326 "An alarm rings briefly, and an invisible force bars your way." CR>
1327            <RFALSE>)
1328           (T .RM)>>
1329
1330 <ROUTINE BKLEAVEW ()
1331     <BKLEAVEE ,TELLER-WEST>>
1332
1333 <GLOBAL SCOL-ROOMS <LTABLE
1334        P?EAST
1335        VIEWING-EAST
1336        P?WEST
1337        VIEWING-WEST
1338        P?NORTH
1339        SMALL-ROOM
1340        P?SOUTH
1341        VAULT>>
1342
1343 <GLOBAL SCOL-WALLS <TABLE
1344        VIEWING-WEST
1345        SEWL
1346        VIEWING-WEST
1347        VIEWING-EAST
1348        SWWL
1349        VIEWING-EAST
1350        SMALL-ROOM
1351        SSWL
1352        VAULT
1353        VAULT
1354        SNWL
1355        SMALL-ROOM>>
1356
1357 <GLOBAL SCOL-ROOM VIEWING-WEST>
1358
1359 <ROUTINE DEPOSITORY-FCN (RARG)
1360         <COND (<EQUAL? .RARG ,M-ENTER>
1361                <SETG SCOL-ROOM <LKP ,PRSO ,SCOL-ROOMS>>)>>
1362
1363 <ROUTINE TELLER-ROOM (RARG)
1364     <COND (<EQUAL? .RARG ,M-LOOK>
1365            <TELL
1366 "You are in a small room, which was used by a bank officer who retrieved
1367 safety deposit boxes for the customer. On the north side of the room is a
1368 sign which reads  \"Viewing Room\". On the ">
1369            <COND (<EQUAL? ,HERE ,TELLER-WEST> <TELL "west">)
1370                  (T <TELL "east">)>
1371            <TELL " side of the room, above an open door, is a sign reading:|
1372 |
1373           BANK PERSONNEL ONLY|
1374 " CR>)>>
1375
1376 <ROUTINE SCOL-OBJECT ("OPTIONAL" (OBJ <>))
1377     <COND (<VERB? PUSH MOVE TAKE RUB>
1378            <TELL "As you try, your hand seems to go through it." CR>)
1379           (<AND <VERB? ATTACK> ,PRSI>
1380            <TELL "The " D ,PRSI " goes through it." CR>)
1381           (<AND <VERB? THROW OVERBOARD> <EQUAL? ,PRSI ,CURTAIN .OBJ>>
1382            <COND (<IN? ,PRSO ,WINNER>
1383                   <V-THROUGH ,PRSO>)
1384                  (T <TELL "You don't have that!" CR>)>)>>
1385
1386 <ROUTINE GET-WALL (RM "AUX" W)
1387     #DECL ((RM) OBJECT)
1388     <SET W ,SCOL-WALLS>
1389     <REPEAT ()
1390         <COND (<EQUAL? <GET .W 0> .RM>
1391                <RETURN .W>)
1392               (T <SET W <REST .W 6>>)>>>
1393
1394 <ROUTINE SCOLWALL ()
1395     <COND (<AND <VERB? THROW OVERBOARD PUT>
1396                 <EQUAL? ,HERE ,SCOL-ACTIVE>
1397                 <EQUAL? ,PRSI <GET <GET-WALL ,HERE> 1>>>
1398            <SCOL-OBJECT ,PRSI>)>>
1399
1400 <ROUTINE SCOL-GO (OBJ)
1401          #DECL ((OBJ) OBJECT)
1402          <SETG SCOL-ACTIVE ,SCOL-ROOM>
1403          <COND (.OBJ <SCOL-OBJ .OBJ 0 ,SCOL-ROOM>)
1404                (T
1405                 <SCOL-THROUGH 12 ,SCOL-ROOM>)>>
1406
1407 <ROUTINE SCOL-OBJ (OBJ CINT RM)
1408     #DECL ((OBJ) OBJECT (CINT) FIX (RM) OBJECT)
1409     <ENABLE <QUEUE I-CURTAIN .CINT>>
1410     <MOVE .OBJ .RM>
1411     <COND (<EQUAL? .RM ,DEPOSITORY>
1412            <TELL "The " D .OBJ " passes through the wall and vanishes." CR>)
1413           (T
1414            <TELL "The curtain dims slightly as the "
1415                  D .OBJ " passes through." CR>
1416            <SETG SCOL-ROOM <>>
1417            T)>>
1418
1419 <ROUTINE SCOL-THROUGH (CINT RM)
1420     #DECL ((CINT) FIX (RM) OBJECT)
1421     <ENABLE <QUEUE I-CURTAIN .CINT>>
1422     <TELL "You feel somewhat disoriented as you pass through..." CR CR>
1423     <GOTO .RM>>
1424
1425 <GLOBAL SCOL-ACTIVE <>>
1426
1427 <ROUTINE I-CURTAIN ()
1428     <SETG SCOL-ACTIVE <>>
1429     <COND (<EQUAL? ,HERE ,VAULT>
1430            <JIGS-UP
1431 "A metallic voice says \"Hello, Intruder! Your unauthorized presence
1432 in the vault of the Bank of Zork has set off all sorts of nasty surprises,
1433 most of which are fatal. This message brought to you by the Frobozz Magic
1434 Vault Company.\"">)
1435           (<EQUAL? ,HERE ,VIEWING-EAST ,VIEWING-WEST ,SMALL-ROOM>
1436            <TELL "You hear a faint voice say \"Curtain Door Closed.\"" CR>
1437            <COND (<EQUAL? ,HERE ,SMALL-ROOM>
1438                   <COND (,ZGNOME-FLAG <RTRUE>)
1439                         (T
1440                          <ENABLE <QUEUE I-ZGNOME 3>>
1441                          <SETG ZGNOME-FLAG T>)>)>)>>
1442
1443 <GLOBAL ZGNOME-FLAG <>>
1444
1445 <ROUTINE I-ZGNOME ()
1446          <COND (<EQUAL? ,HERE ,SMALL-ROOM>
1447                 <ENABLE <QUEUE I-ZGNOME-OUT 12>>
1448                 <TELL
1449 "An epicene gnome of Zurich wearing a three-piece suit and carrying a
1450 safety deposit box materializes in the room.">
1451                 <COND (<IN? ,WAND ,WINNER>
1452                        <TELL
1453 " He notices the wand and dematerializes speedily." CR>)
1454                       (T
1455                        <TELL " \"You seem to have
1456 forgotten to deposit your valuables,\" he says, tapping the lid of the
1457 box impatiently. \"We don't usually allow customers to use the boxes
1458 here, but we can make this ONE exception, I suppose...\" He looks
1459 askance at you over his wire-rimmed bifocals." CR>
1460                        <MOVE ,GNOME-OF-ZURICH ,HERE>)>)>>
1461
1462 <ROUTINE BOX-F ()
1463          <TELL "The gnome clutches it possessively." CR>>
1464
1465 <ROUTINE ZGNOME-FCN ()
1466     <COND (<VERB? TELL>
1467            <SETG P-CONT <>>
1468            <SETG QUOTE-FLAG <>>
1469            <TELL
1470 "The gnome appears increasingly impatient." CR>)
1471           (<AND <VERB? GIVE THROW> <EQUAL? ,PRSI ,GNOME-OF-ZURICH>>
1472            <COND (<GETPT ,PRSO ,P?VALUE>
1473                   <TELL
1474 "The gnome carefully places the " D ,PRSO  " in the
1475 deposit box. \"Let me show you the way out,\" he says, making it clear
1476 he will be pleased to see the last of you. Then, you are momentarily
1477 disoriented, and when you recover you are back at the Bank Entrance." CR>
1478                   <REMOVE ,GNOME-OF-ZURICH>
1479                   <REMOVE ,PRSO>
1480                   <DISABLE <INT I-ZGNOME-OUT>>
1481                   <GOTO ,BANK-ENTRANCE>
1482                   <RTRUE>)
1483                  (<BOMB? ,PRSO>
1484                   <REMOVE ,GNOME-OF-ZURICH>
1485                   <MOVE ,PRSO ,HERE>
1486                   <DISABLE <INT I-ZGNOME>>
1487                   <DISABLE <INT I-ZGNOME-OUT>>
1488                   <TELL
1489 "\"You are so very gracious. I really cannot accept.\" he says. He
1490 disappears, a wry smile on his lips." CR>)
1491                  (T
1492                   <TELL
1493 "\"I wouldn't put THAT in a safety deposit box,\" remarks the gnome with
1494 disdain, tossing it over his shoulder, where it disappears with an
1495 understated \"pop\"." CR>
1496                   <REMOVE-CAREFULLY ,PRSO>
1497                   <RTRUE>)>)
1498           (<VERB? ATTACK>
1499            <TELL
1500 "The gnome says \"Well, I never...\" and disappears with a snap of his
1501 fingers, leaving you alone." CR>
1502            <REMOVE ,GNOME-OF-ZURICH>
1503            <DISABLE <INT I-ZGNOME-OUT>>)
1504           (T
1505            <TELL
1506 "The gnome appears increasingly impatient." CR>)>>
1507
1508 <ROUTINE I-ZGNOME-OUT ()
1509          <REMOVE ,GNOME-OF-ZURICH>
1510          <COND (<EQUAL? ,HERE ,SMALL-ROOM>
1511                 <TELL
1512 "The gnome looks impatient: \"I may have another customer waiting;
1513 you'll just have to fend for yourself, I'm afraid.\" He disappears,
1514 leaving you alone." CR>)>>
1515
1516 <ROUTINE BOMB? (O)
1517         <COND (<AND <EQUAL? .O ,BRICK>
1518                     <IN? ,FUSE ,BRICK>
1519                     <NOT <0? <GET <INT I-FUSE> ,C-ENABLED?>>>>
1520                <RTRUE>)
1521               (T <RFALSE>)>>
1522
1523 \\f
1524
1525 "PALANTIRS, ETC."
1526
1527 <ROUTINE GO&LOOK (RM "AUX" OHERE OLIT (OSEEN <>))
1528          #DECL ((RM) OBJECT)
1529          <SET OHERE ,HERE>
1530          <COND (<FSET? .OHERE ,TOUCHBIT>
1531                 <SET OSEEN T>)>
1532          <SET OLIT ,LIT>
1533          <SETG HERE .RM>
1534          <SETG LIT <LIT? .RM>>
1535          <PERFORM ,V?LOOK>
1536          <COND (<NOT .OSEEN> <FCLEAR .OHERE ,TOUCHBIT>)>
1537          <SETG HERE .OHERE>
1538          <SETG LIT .OLIT>
1539          T>
1540
1541 <ROUTINE TINY-ROOM-FCN (RARG)
1542     #DECL ((RARG) <OR FIX FALSE>)
1543     <COND (<EQUAL? .RARG ,M-LOOK>
1544            <TELL
1545 "This is a tiny room carved out of the wall of the ravine. There is
1546 an exit down a precarious climb. ">
1547            <P-DOOR "north" ,LID-1 ,KEYHOLE-1>
1548            <RTRUE>)
1549           (<NOT <VERB? LOOK>> <PCHECK> <RFALSE>)>>
1550
1551 <ROUTINE DREARY-ROOM-FCN (RARG)
1552     #DECL ((RARG) <OR FIX FALSE>)
1553     <COND (<EQUAL? .RARG ,M-LOOK>
1554            <TELL
1555 "This is a small and rather dreary room, eerily illuminated by a red glow
1556 emanating from a crack in one wall. The light falls upon a dusty wooden table
1557 in the center of the room. ">
1558            <P-DOOR "south" ,LID-2 ,KEYHOLE-2>
1559            <RTRUE>)>
1560           (T <PCHECK> <RFALSE>)>
1561
1562 <ROUTINE PCHECK ("AUX" (LID <PLID>))
1563         #DECL ((LID) OBJECT)
1564         <SETG PLOOK-FLAG <>>
1565         <COND (<OR <IN? ,KEY ,KEYHOLE-1>
1566                    <IN? ,KEY ,KEYHOLE-2>>
1567                <FSET ,KEY ,NDESCBIT>)
1568               (T
1569                <FCLEAR ,KEY ,NDESCBIT>)>
1570         <COND (<HELD? ,PLACE-MAT>
1571                <SETG MUD-FLAG <>>)> ;"HUH?"
1572         <COND (,MUD-FLAG
1573                <MOVE ,PLACE-MAT ,HERE>
1574                <FSET ,PLACE-MAT ,NDESCBIT>)
1575               (T
1576                <FCLEAR ,PLACE-MAT ,NDESCBIT>)>>
1577
1578 <ROUTINE P-DOOR (STR LID KEYHOLE "AUX" F)
1579         #DECL ((STR) STRING (LID KEYHOLE) OBJECT)
1580         <COND (,PLOOK-FLAG <SETG PLOOK-FLAG <>> <RFALSE>)>
1581         <TELL "On the "
1582               .STR
1583               " side of the room is a massive wooden door, which has a
1584 small window barred with iron. A formidable bolt lock is set within the
1585 door frame. A keyhole ">
1586         <COND (<NOT <FSET? .LID ,OPENBIT>>
1587                <TELL "covered by a thin metal lid ">)>
1588         <TELL "lies within the lock.">
1589         <COND (<SET F <FIRST? .KEYHOLE>>
1590                <TELL " A " D .F
1591                      " is in place within the keyhole.">)>
1592         <COND (,MUD-FLAG
1593                <TELL " The edge of a place mat is visible under the door.">
1594                <COND (,MATOBJ
1595                       <TELL " Lying on the place mat is a " D ,MATOBJ ".">)>)>
1596         <CRLF>>
1597
1598 <ROUTINE PLID ("OPTIONAL" (OBJ1 ,LID-1) (OBJ2 ,LID-2))
1599     #DECL ((OBJ1 OBJ2) OBJECT)
1600     <COND (<IN? .OBJ1 ,HERE>
1601            .OBJ1)
1602           (T .OBJ2)>>
1603
1604 <ROUTINE PKH (KEYHOLE "OPTIONAL" (THIS <>))
1605     #DECL ((KEYHOLE) OBJECT (THIS) <OR ATOM FALSE>)
1606     <COND (<AND <EQUAL? .KEYHOLE ,KEYHOLE-1> <NOT .THIS>>
1607            ,KEYHOLE-2)
1608           (<AND <NOT <EQUAL? .KEYHOLE ,KEYHOLE-1>> .THIS>
1609            ,KEYHOLE-2)
1610           (T ,KEYHOLE-1)>>
1611
1612 <ROUTINE PKH-FCN ("AUX" OBJ KH)
1613     #DECL ((OBJ) OBJECT)
1614     <COND (<VERB? LOOK-INSIDE>
1615            <COND (<AND <FSET? ,LID-1 ,OPENBIT>
1616                        <FSET? ,LID-2 ,OPENBIT>
1617                        <NOT <FIRST? ,KEYHOLE-1>>
1618                        <NOT <FIRST? ,KEYHOLE-2>>
1619                        <LIT? <COND (<EQUAL? ,HERE ,DREARY-ROOM>
1620                                     ,TINY-ROOM)
1621                                    (T ,DREARY-ROOM)>>>
1622                   <TELL
1623 "You can see a lighted room at the other end." CR>)
1624                  (T
1625                   <TELL
1626 "No light can be seen through the keyhole." CR>)>)
1627           (<VERB? PUT>
1628            <COND (<FSET? <PLID> ,OPENBIT>
1629                   <COND (<FIRST? <PKH ,PRSI T>>
1630                          <TELL "The keyhole is blocked." CR>)
1631                         (<EQUAL? ,PRSO ,LETTER-OPENER ,KEY>
1632                          <COND (<FIRST? <SET KH <PKH ,PRSI>>>
1633                                 <TELL
1634 "There is a faint noise from behind the door and a small cloud of
1635 dust rises from beneath it." CR>
1636                                 <SET OBJ <FIRST? .KH>>
1637                                 <REMOVE .OBJ>
1638                                 <COND (,MUD-FLAG
1639                                        <SETG MATOBJ .OBJ>)>
1640                                 <RFALSE>)>)
1641                         (T <TELL "The " D ,PRSO " doesn't fit." CR>)>)
1642                  (T <TELL "The lid is in the way." CR>)>)>>
1643
1644 <ROUTINE PLID-FCN ()
1645     <COND (<VERB? OPEN RAISE MOVE>
1646            <COND (<FSET? ,PRSO ,OPENBIT>
1647                   <TELL <RANDOM-ELEMENT ,DUMMY> CR>)
1648                  (T <TELL "The lid is now open." CR>)>
1649            <FSET ,PRSO ,OPENBIT>)
1650           (<VERB? CLOSE LOWER>
1651            <COND (<FIRST? <COND (<EQUAL? ,HERE ,DREARY-ROOM>
1652                                  ,KEYHOLE-2)
1653                                 (T ,KEYHOLE-1)>>
1654                   <TELL "The keyhole is occupied." CR>)
1655                  (T
1656                   <TELL "The lid covers the keyhole." CR>
1657                   <FCLEAR ,PRSO ,OPENBIT>)>)
1658           (<VERB? LOOK-BEHIND>
1659            <TELL "There's a keyhole behind the lid." CR>)>>
1660         
1661 <GLOBAL MUD-FLAG <>>
1662
1663 <GLOBAL MATOBJ <>>
1664
1665 <GLOBAL PUNLOCK-FLAG <>>
1666
1667 <GLOBAL PLOOK-FLAG <>>
1668
1669 <ROUTINE ROOM? (OBJ "AUX" NOBJ)
1670          <REPEAT ()
1671                  <SET NOBJ <LOC .OBJ>>
1672                  <COND (<NOT .NOBJ> <RFALSE>)
1673                        (<EQUAL? .NOBJ ,WINNER> <RFALSE>)
1674                        (<EQUAL? .NOBJ ,ROOMS> <RETURN .OBJ>)>
1675                  <SET OBJ .NOBJ>>>
1676
1677 <ROUTINE PALANTIR ()
1678          <COND (<VERB? LOOK-INSIDE>
1679                 <PALANTIR-LOOK <COND (<EQUAL? ,PRSO ,PALANTIR-1>
1680                                       ,PALANTIR-2)
1681                                      (<EQUAL? ,PRSO ,PALANTIR-2>
1682                                       ,PALANTIR-3)
1683                                      (<EQUAL? ,PRSO ,PALANTIR-3>
1684                                       ,PALANTIR-1)
1685                                      (T ,PALANTIR-4)>>)
1686                (<VERB? EXAMINE>
1687                 <TELL
1688 "There is something misty in the sphere. Perhaps if you were to look
1689 into it..." CR>)
1690                (<AND <VERB? TAKE> <==? ,PRSO ,PALANTIR-3>>
1691                 <PUTP ,PRSO ,P?LDESC <>>
1692                 <RFALSE>)>>
1693
1694 <ROUTINE DEAD-PALANTIR (RARG "AUX" P)
1695          <COND (<EQUAL? .RARG ,M-LOOK>
1696                 <TELL
1697 "You are inside a huge crystalline sphere filled with thin "
1698                 <COND (<EQUAL? ,HERE ,DEAD-PALANTIR-1>
1699                        <SET P ,PALANTIR-1>
1700                        "red")
1701                       (<EQUAL? ,HERE ,DEAD-PALANTIR-2>
1702                        <SET P ,PALANTIR-2>
1703                        "blue")
1704                       (T <SET P ,PALANTIR-3> "white")>
1705 " mist. The mist becomes "
1706                 <COND (<EQUAL? ,HERE ,DEAD-PALANTIR-1> "blue")
1707                       (<EQUAL? ,HERE ,DEAD-PALANTIR-2> "white")
1708                       (T "black")>
1709 " to the west." CR>
1710                 <TELL "You strain to look out through the mist... " CR>
1711                 <COND (<FSET? .P ,TOUCHBIT>
1712                        <PALANTIR-LOOK .P T>)
1713                       (<EQUAL? .P ,PALANTIR-1>
1714                        <TELL
1715 "You see a small room with a sign on the wall, but it is too blurry to
1716 read." CR>)
1717                       (<EQUAL? .P ,PALANTIR-2>
1718                        <TELL
1719 "You look out into a large, dreary room with a great door and a huge table.
1720 There is an odd glow to the mist." CR>)
1721                       (<EQUAL? .P ,PALANTIR-3>
1722                        <TELL
1723 "A strange blurry room is barely visible.">
1724                        <COND (<AND <IN? ,SERPENT ,AQUARIUM> <PROB 25>>
1725                               <TELL
1726 " An odd sinuous shadow crosses the mist as you look.">)>
1727                        <CRLF>)>
1728                 <RTRUE>)
1729                (<AND <EQUAL? .RARG ,M-ENTER> <EQUAL? ,HERE ,DEAD-PALANTIR-4>>
1730                 <TELL
1731 "You follow a corridor of black mist into a black walled spherical
1732 room.">
1733                 <COND (<IN? ,GENIE ,PENTAGRAM-ROOM>
1734                        <TELL
1735 " The room is empty. A huge face looks down on you from outside and
1736 laughs sardonically. It doesn't look like you're getting out of this
1737 predicament!" CR>
1738                        <FINISH>)>
1739                 <TELL
1740 " As you enter, a huge and horrible face materializes out of the
1741 mist.|
1742 |
1743 \"What brings you here to trouble my imprisonment, wanderer?\"
1744 it asks. Hearing no immediate answer, it studies you for a moment." CR>
1745
1746                 <COND (<NOT <L? ,DEATHS 3>>
1747                        <TELL
1748 "\"Not you again! This is getting tedious. You'll obviously never
1749 be much help to me. Better luck next time, oh wondrous
1750 adventurer.\" The face disappears and everything goes black." CR>
1751                        <FINISH>)
1752                       (T
1753                        <TELL
1754 "\"Perhaps you may be of some use to me in gaining my freedom from
1755 this place. Return to your foolish quest! I shall not destroy you
1756 this time. Mayhap you will repay this favor in kind someday.\" The
1757 face vanishes and the mist begins to swirl. When it clears you are
1758 returned to the world of life." CR>
1759                 <SETG DEAD <>>
1760                 <GOTO ,INSIDE-BARROW>
1761                 ;<GOTO ,INSIDE-BARROW <>>
1762                 ;<TELL CR "Inside the Barrow" CR>
1763                 <RTRUE>)>)>>
1764
1765 <ROUTINE GLOBAL-PALANTIRS ()
1766          <COND (<VERB? LOOK-INSIDE EXAMINE>
1767                 <DEAD-PALANTIR ,M-LOOK>)
1768                (<VERB? MUNG> <TELL "The sphere is unbreakable." CR>)>>
1769
1770 <ROUTINE PALANTIR-LOOK (OBJ "OPTIONAL" (INSIDE? <>) "AUX" RM OHERE)
1771          <COND (<EQUAL? .OBJ ,PALANTIR-4>
1772                 <TELL
1773 "As you peer into the sphere, a strange vision takes shape...a huge and
1774 fearful face with yellow eyes. The face peers out at you expectantly." CR>
1775                 <RTRUE>)>
1776          <SET RM <ROOM? .OBJ>>
1777          <COND (<OR <NOT .RM> <NOT <LIT? .RM>>>
1778                 <TELL "You see only darkness." CR>)
1779                (<OR <IN? .OBJ .RM> <SEE-INSIDE? <LOC .OBJ>>>
1780                 <SET OHERE ,HERE>
1781                 <COND (.INSIDE?
1782                        <TELL
1783 "As you peer through the mist, a strangely colored vision of a
1784 huge room takes shape..." CR CR>)
1785                       (T
1786                        <TELL
1787 "As you peer into the sphere, a strange vision takes shape of
1788 a distant room, which can be described clearly...." CR CR>)>
1789                 <FSET .OBJ ,INVISIBLE>
1790                 <GO&LOOK .RM>
1791                 <COND (<EQUAL? .OHERE .RM>
1792                        <TELL
1793 "An astonished adventurer is staring into a crystal sphere." CR>)>
1794                 <FCLEAR .OBJ ,INVISIBLE>
1795                 <COND (<NOT .INSIDE?>
1796                        <TELL
1797 "The vision fades, revealing only an ordinary crystal sphere." CR>)>)
1798                (T
1799                 <TELL "You see only darkness." CR>)>
1800          T>
1801
1802 <ROUTINE PWINDOW-FCN ()
1803     <COND (<VERB? LOOK-INSIDE>
1804            <SETG PLOOK-FLAG T>
1805            <COND (<FSET? ,PDOOR ,OPENBIT>
1806                   <TELL "The door is open, dummy." CR>)
1807                  (<EQUAL? ,HERE ,DREARY-ROOM>
1808                   <GO&LOOK ,TINY-ROOM>)
1809                  (T <GO&LOOK ,DREARY-ROOM>)>)
1810           (<VERB? THROUGH>
1811            <TELL "Perhaps if you were diced...." CR>)>>
1812
1813 <ROUTINE PDOOR-FCN ("AUX" K)
1814     <COND (<AND <VERB? LOOK-UNDER> ,MUD-FLAG>
1815            <TELL "The place mat is under the door." CR>)
1816           (<VERB? UNLOCK>
1817            <COND (<EQUAL? ,PRSI ,KEY>
1818                   <COND (<AND <SET K <FIRST? <PLID ,KEYHOLE-1 ,KEYHOLE-2>>>
1819                               <NOT <EQUAL? .K ,KEY>>>
1820                          <TELL "The keyhole is blocked." CR>)
1821                         (T
1822                          <TELL "The door is now unlocked." CR>
1823                          <SETG PUNLOCK-FLAG T>)>)
1824                  (<EQUAL? ,PRSI ,GOLD-KEY>
1825                   <TELL "It doesn't fit the lock." CR>)
1826                  (T <TELL "It can't be unlocked with that." CR>)>)
1827           (<VERB? LOCK>
1828            <COND (<EQUAL? ,PRSI ,KEY>
1829                   <TELL "The door is locked." CR>
1830                   <SETG PUNLOCK-FLAG <>>
1831                   T)
1832                  (<EQUAL? ,PRSI ,GOLD-KEY>
1833                   <TELL "It doesn't fit the lock." CR>)
1834                  (T <TELL "It can't be locked with that." CR>)>)
1835           (<VERB? PUT-UNDER>
1836            <COND (<EQUAL? ,PRSO ,ROBOT-LABEL>
1837                   <TELL
1838 "The paper is very small and vanishes under the door." CR>
1839                   <MOVE ,PRSO <COND (<EQUAL? ,HERE ,TINY-ROOM> ,DREARY-ROOM)
1840                                     (T ,TINY-ROOM)>>)
1841                  (<EQUAL? ,PRSO ,NEWSPAPER>
1842                   <TELL
1843 "The newspaper crumples up and won't go under the door." CR>)>)
1844           (<VERB? OPEN CLOSE>
1845            <COND (,PUNLOCK-FLAG
1846                   <OPEN-CLOSE ,PRSO
1847                        "The door is now open."
1848                        "The door is now closed.">)
1849                  (T <TELL "The door is locked." CR>)>)>>
1850         
1851 <ROUTINE PKEY-FCN ()
1852     <COND (<VERB? TURN>
1853            <COND (,PUNLOCK-FLAG
1854                   <PERFORM ,V?LOCK ,PDOOR ,PRSO>)
1855                  (T
1856                   <PERFORM ,V?UNLOCK ,PDOOR ,PRSO>)>)>>
1857                 
1858 <ROUTINE PLACE-MAT-FCN ()
1859     <COND (<VERB? PUT-UNDER>
1860            <COND (<EQUAL? ,PRSI ,PDOOR>
1861                   <TELL "The place mat fits easily under the door." CR>
1862                   <MOVE ,PRSO ,HERE>
1863                   <SETG MUD-FLAG T>)
1864                  (<EQUAL? ,PRSI ,WIZ-DOOR ,RIDDLE-DOOR ,CRYPT-DOOR>
1865                   <TELL "There's not enough room under this door." CR>)>)
1866           (<AND <VERB? TAKE MOVE> ,MATOBJ>
1867            <MOVE ,MATOBJ ,HERE>
1868            <TELL "As the place mat is moved, a "
1869                  D
1870                  ,MATOBJ
1871                  " falls from it and onto the floor." CR>
1872            <SETG MATOBJ <>>
1873            <SETG MUD-FLAG <>>
1874            <RTRUE>)>>
1875
1876 <ROUTINE WISH-FCN ()
1877          <COND (<VERB? MAKE>
1878                 <COND (<AND <EQUAL? ,HERE ,WELL-BOTTOM>
1879                             <IN? ,COIN ,HERE>>
1880                        <TELL
1881 "A whispering voice replies: \"Water makes the bucket go.\"
1882 Unfortunately, wishing makes the coin go...." CR>
1883                       <REMOVE ,COIN>)
1884                       (T
1885                        <TELL "No one is listening." CR>)>)>>
1886
1887 <ROUTINE WELL-FCN ()
1888         <COND (<AND <FSET? ,PRSO ,TAKEBIT> <VERB? THROW PUT DROP>>
1889                <TELL "The " D ,PRSO
1890                      " is now sitting at the bottom of the well." CR>
1891                <MOVE ,PRSO ,WELL-BOTTOM>)
1892               (<VERB? CLIMB-UP CLIMB-DOWN CLIMB-FOO>
1893                <TELL "You can't climb the well." CR>)>>
1894
1895 <GLOBAL MATCH-COUNT 6>
1896
1897 <ROUTINE MATCH-FCN ( "AUX" CNT)
1898          <COND (<AND <VERB? LAMP-ON BURN> <EQUAL? ,PRSO ,MATCH>>
1899                 <COND (<G? ,MATCH-COUNT 0>
1900                        <SETG MATCH-COUNT <- ,MATCH-COUNT 1>>)>
1901                 <COND (<NOT <G? ,MATCH-COUNT 0>>
1902                        <TELL
1903                         "I'm afraid you have run out of matches." CR>)
1904                       (T
1905                        <FSET ,MATCH ,FLAMEBIT>
1906                        <FSET ,MATCH ,ONBIT>
1907                        <ENABLE <QUEUE I-MATCH 2>>
1908                        <TELL "One of the matches starts to burn." CR>)>)
1909                (<AND <VERB? LAMP-OFF> <FSET? ,MATCH ,FLAMEBIT>>
1910                 <TELL "The match is out." CR>
1911                 <FCLEAR ,MATCH ,FLAMEBIT>
1912                 <FCLEAR ,MATCH ,ONBIT>
1913                 <QUEUE I-MATCH 0>
1914                 T)
1915                (<VERB? COUNT>
1916                 <TELL "You have ">
1917                 <SET CNT <- ,MATCH-COUNT 1>>
1918                 <TELL N .CNT " match">
1919                 <COND (<NOT <1? .CNT>> <TELL "es.">) (T <TELL ".">)>
1920                 <CRLF>)
1921                (<VERB? EXAMINE>
1922                 <COND (<FSET? ,MATCH ,ONBIT>
1923                        <TELL "A match is burning.">)
1924                       (T
1925                        <TELL "No match is burning.">)>
1926                 <CRLF>)>>
1927
1928 <ROUTINE I-MATCH ()
1929          <TELL "The match has gone out." CR>
1930          <FCLEAR ,MATCH ,FLAMEBIT>
1931          <FCLEAR ,MATCH ,ONBIT>>
1932
1933
1934 <GLOBAL LAMP-TABLE
1935         <TABLE 300
1936                "The lamp appears a bit dimmer."
1937                100
1938                "The lamp is definitely dimmer now."
1939                50
1940                "The lamp is nearly out."
1941                0>>
1942
1943 <ROUTINE LANTERN ()
1944          <COND (<AND <VERB? THROW> <==? ,PRSO ,LAMP>>
1945                 <TELL
1946 "The lamp has smashed into the floor, and the light has gone out." CR>
1947                 <DISABLE <INT I-LANTERN>>
1948                 <REMOVE ,LAMP>
1949                 <MOVE ,BROKEN-LAMP ,HERE>)
1950                (<VERB? LAMP-ON>
1951                 <COND (<FSET? ,LAMP ,RMUNGBIT>
1952                        <TELL "A burned-out lamp won't light." CR>)
1953                       (T
1954                        <ENABLE <INT I-LANTERN>>
1955                        <>)>)
1956                (<VERB? LAMP-OFF>
1957                 <COND (<FSET? ,LAMP ,RMUNGBIT>
1958                        <TELL "The lamp has already burned out." CR>)
1959                       (T
1960                        <DISABLE <INT I-LANTERN>>
1961                        <>)>)
1962                (<VERB? EXAMINE>
1963                 <COND (<FSET? ,LAMP ,RMUNGBIT>
1964                        <TELL "The lamp has burned out.">)
1965                       (<FSET? ,LAMP ,ONBIT>
1966                        <TELL "The lamp is on.">)
1967                       (T
1968                        <TELL "The lamp is turned off.">)>
1969                 <CRLF>)>>
1970
1971 <ROUTINE I-LANTERN ("AUX" TICK (TBL <VALUE LAMP-TABLE>))
1972          <ENABLE <QUEUE I-LANTERN <SET TICK <GET .TBL 0>>>>
1973          <LIGHT-INT ,LAMP .TBL .TICK>
1974          <COND (<NOT <0? .TICK>>
1975                 <SETG LAMP-TABLE <REST .TBL 4>>)>>
1976
1977 <ROUTINE LIGHT-INT (OBJ TBL TICK)
1978          <COND (<0? .TICK>
1979                 <FCLEAR .OBJ ,ONBIT>
1980                 <FSET .OBJ ,RMUNGBIT>)>
1981          <COND (<OR <HELD? .OBJ> <IN? .OBJ ,HERE>>
1982                 <COND (<0? .TICK>
1983                        <TELL
1984 "You'd better have more light than from the " D .OBJ "." CR>)
1985                       (T
1986                        <TELL <GET .TBL 1> CR>)>)>>
1987
1988 ;<ROUTINE LIGHT-INT (OBJ INTNAM TBLNAM "AUX" (TBL <VALUE .TBLNAM>) TICK)
1989          #DECL ((OBJ) OBJECT (TBLNAM INTNAM) ATOM (TBL) <PRIMTYPE VECTOR>
1990                 (TICK) FIX)
1991          <ENABLE <QUEUE .INTNAM <SET TICK <GET .TBL 0>>>>
1992          <COND (<0? .TICK>
1993                 <FSET .OBJ ,RMUNGBIT>
1994                 <FCLEAR .OBJ ,ONBIT>)>
1995          <COND (<OR <HELD? .OBJ> <IN? .OBJ ,HERE>>
1996                 <COND (<0? .TICK>
1997                        <TELL
1998 "I hope you have more light than from the " D .OBJ "." CR>)
1999                       (T
2000                        <TELL <GET .TBL 1> CR>)>)>
2001          <COND (<NOT <0? .TICK>>
2002                 <SETG .TBLNAM <REST .TBL 4>>)>
2003          <RTRUE>>
2004
2005 ;"Riddles"
2006
2007 <ROUTINE RIDDLE-ROOM-FCN (RARG)
2008          <COND (<EQUAL? .RARG ,M-LOOK>
2009                 <TELL
2010 "This is a room which is bare on all sides. There is an exit down in
2011 the northwest corner of the room. To the east is a great ">
2012                 <COND (<FSET? ,RIDDLE-DOOR ,OPENBIT>
2013                        <TELL "open">)
2014                       (T
2015                        <TELL "closed">)>
2016                 <TELL " door made of
2017 stone. Above the stone, the following words are written: \"No man shall
2018 pass this door without solving this riddle:|
2019 |
2020   What is tall as a house,|
2021     round as a cup,|
2022       and all the king's horses|
2023         can't draw it up?\"|
2024 ">)
2025                (<EQUAL? .RARG ,M-BEG>
2026                 <COND (<VERB? ANSWER SAY>
2027                        <COND (<FSET? ,RIDDLE-DOOR ,OPENBIT>
2028                               <RFALSE>)
2029                              (<OR <EQUAL? <GET ,P-LEXV ,P-CONT> ,W?WELL>
2030                                   <EQUAL? <GET ,P-LEXV <+ ,P-CONT 2>> ,W?WELL>>
2031                               <TELL
2032 "There is a deafening clap of thunder and the stone door
2033 quietly swings open to reveal a passageway beyond." CR>
2034                               <SCORE-UPD 5>
2035                               <FSET ,RIDDLE-DOOR ,OPENBIT>)
2036                              (T
2037                               <TELL
2038 "A hollow laugh seems to come from the stone door." CR>)>
2039                       <SETG P-CONT <>>
2040                       <SETG QUOTE-FLAG <>>
2041                       <RTRUE>)>)>>
2042
2043 <ROUTINE RIDDLE-DOOR-FCN ()
2044          <COND (<VERB? OPEN>
2045                 <COND (<FSET? ,RIDDLE-DOOR ,OPENBIT>
2046                        <TELL "It is open!" CR>)
2047                       (T
2048                        <TELL
2049 "The door can only be opened by answering the riddle." CR>)>)
2050                (<VERB? CLOSE>
2051                 <COND (<FSET? ,RIDDLE-DOOR ,OPENBIT>
2052                        <TELL "Not a chance. The door weighs many tons." CR>)
2053                       (T
2054                        <TELL "It is closed!" CR>)>)>>
2055
2056 <GLOBAL DUMMY
2057         <LTABLE "Look around."
2058                "You think it isn't?"
2059                "I think you've already done that.">>
2060
2061 <ROUTINE RIDDLE-PSEUDO ()
2062          <COND (<VERB? EXAMINE>
2063                 <TELL "Use the \"Look\" command." CR>)>>
2064
2065 <ROUTINE MAGIC-ACTOR ("AUX" V)
2066          <COND (,SPELL?
2067                 <COND (<EQUAL? ,SPELL? ,S-FALL>
2068                        <COND (<OR <VERB? CLIMB-UP CLIMB-DOWN CROSS>
2069                                   <AND <VERB? WALK>
2070                                        <GETPT ,HERE ,P?DOWN>>>
2071                               <SET V <GETPT ,HERE ,P?GLOBAL>>
2072                               <COND (<ZMEMQB ,BRIDGE .V <PTSIZE .V>>
2073                                      <JIGS-UP
2074 "You find yourself drawn toward the edge of the bridge. You peer over
2075 the side. Oops, that was clumsy of you! You tripped on something and
2076 fell in. Too bad.">)
2077                                     (<PROB 25>
2078                                      <JIGS-UP
2079 "For some odd reason you have tripped on your own feet, or perhaps an
2080 invisible cord stretched across the path. The resulting fall seems to
2081 have done you in.">)
2082                                    (T
2083                                     <TELL
2084 "You just tripped on an invisible cord, or perhaps your own feet. But
2085 this must be your lucky day, as you managed to regain your balance
2086 before what could have been a fatal fall." CR>)>)
2087                              (<VERB? BOARD>
2088                               <TELL
2089 "You get in the " D ,PRSO " but you fall out again, almost as though
2090 an invisible hand had tipped it over." CR>)>)
2091                       (<EQUAL? ,SPELL? ,S-FLOAT>
2092                        <COND (<VERB? DIAGNOSE WAIT> <RFALSE>)
2093                              (<VERB? WALK>
2094 <TELL "I suppose you plan to do that by flapping your arms?" CR>)
2095                              (<VERB? DROP>
2096                               <MOVE ,PRSO ,HERE>
2097                               <TELL
2098 "The " D ,PRSO " drops to the ground." CR>)
2099                              (<AND <VERB? TAKE> <IN? ,PRSO ,HERE>>
2100                               <TELL
2101 "You can't reach that! It's on the ground." CR>)>)
2102                       (<EQUAL? ,SPELL? ,S-FREEZE>
2103                        <COND (<VERB? DIAGNOSE WAIT> <RFALSE>)
2104                              (T
2105                               <TELL
2106 "You are frozen solid. You might as well wait it out, because you
2107 can't do anything else in this state." CR>)>)
2108                       (<AND <EQUAL? ,SPELL? ,S-FENCE>
2109                             <VERB? WALK>>
2110                        <TELL
2111 "An invisible fence of magical force bars your way." CR>
2112                        <RTRUE>)
2113                       (<AND <EQUAL? ,SPELL? ,S-FIERCE>
2114                             <SET V <INFESTED? ,HERE>>>
2115                        <COND (<VERB? ATTACK MUNG> <RFALSE>)
2116                              (T
2117                               <FORCE-FIGHT .V>
2118                               <RTRUE>)>)
2119                       (<AND <EQUAL? ,SPELL? ,S-FERMENT>
2120                             <VERB? WALK>
2121                             <IN? ,WINNER ,HERE>>
2122                        <TELL
2123 "Oops, you seem a little unsteady... I'm not sure you got where
2124 you intended going." CR CR>
2125                        <RANDOM-WALK>)
2126                       (<AND <EQUAL? ,SPELL? ,S-FEAR>
2127                             <SET V <INFESTED? ,HERE>>>
2128                        <TELL
2129 "All at once, you are overcome by fear! There's is a " D .V " in here!
2130 Maybe it's after you! ">
2131                        <COND (<FSET? <LOC ,WINNER> ,VEHBIT>
2132                               <TELL
2133 "You huddle in the corner, terrified." CR>)
2134                              (T
2135                               <TELL
2136 "You run from the room screaming in terror!" CR CR>
2137                               <RANDOM-WALK>)>)>)>>
2138
2139 <ROUTINE RANDOM-WALK ("AUX" P TX L S (D <>))
2140          <SET P 0>
2141          <REPEAT ()
2142                  <COND (<L? <SET P <NEXTP ,HERE .P>> ,LOW-DIRECTION>
2143                         <COND (.D
2144                                <SET S ,SPELL?>
2145                                <SETG SPELL? <>>
2146                                <SETG WINNER ,ADVENTURER>
2147                                <MOVE ,WINNER ,HERE>
2148                                <DO-WALK .D>
2149                                <SETG SPELL? .S>)>
2150                         <RETURN>)
2151                        (T
2152                         <SET TX <GETPT ,HERE .P>>
2153                         <SET L <PTSIZE .TX>>
2154                         <COND (<OR <EQUAL? .L ,UEXIT>
2155                                    <AND <EQUAL? .L ,CEXIT>
2156                                         <VALUE <GETB .TX ,CEXITFLAG>>>
2157                                    <AND <EQUAL? .L ,DEXIT>
2158                                         <FSET? <GETB .TX ,DEXITOBJ> ,OPENBIT>>>
2159                                <COND (<NOT .D> <SET D .P>)
2160                                      (<PROB 50> <SET D .P>)>)>)>>>
2161
2162 <ROUTINE FORCE-FIGHT (V "AUX" W)
2163          <COND (<NOT <SET W <FIND-IN ,ADVENTURER ,WEAPONBIT>>>
2164                 <SET W ,HANDS>)>
2165          <TELL
2166 "You are maddened by an overwhelming ferocity, and attack the "
2167 D .V " instead." CR>
2168          <PERFORM ,V?ATTACK .V .W>>
2169
2170 \\f
2171
2172 "SUBTITLE DIAMOND MAZE"
2173
2174 <GLOBAL DIAMOND-SOLVE <>> ;"T if solved"
2175
2176 <GLOBAL DIAMOND-COUNT 0>  ;"count of current progress"
2177 <GLOBAL DIAMOND-MOVES 0>  ;"count of moves since progressed"
2178 <GLOBAL DIAMOND-BASE 0>   ;"count of maximum progress ever"
2179
2180 <GLOBAL DWDESCS
2181         <TABLE "dark"
2182                "flickering dimly"
2183                "dimly glowing"
2184                "glowing"
2185                "glowing brightly">>
2186
2187 <ROUTINE DWINDOW-DESC ()
2188          <TELL
2189 "On the floor is a very small diamond shaped window which is ">
2190          <COND (,DIAMOND-SOLVE <TELL "glowing serenely">)
2191                (T <TELL <GET ,DWDESCS ,DIAMOND-COUNT>>)>
2192          <TELL "." CR>>
2193
2194 <ROUTINE DWINDOW-FCN ()
2195          <COND (<VERB? TAKE>
2196                 <TELL
2197 "The window is an integral part of the floor." CR>)
2198                (<VERB? MUNG>
2199                 <TELL
2200 "The window is diamond-hard and cannot be broken." CR>)
2201                (<VERB? EXAMINE LOOK-INSIDE>
2202                 <DWINDOW-DESC>)>>
2203
2204 <ROUTINE DIAMOND-MOTION (RARG "AUX" DC DIR RM)
2205          <COND (<EQUAL? .RARG ,M-LOOK>
2206                 <TELL
2207 "This is a room with oddly angled walls and passages in all directions.
2208 The walls are made of some glassy substance." CR>
2209                 <COND (<EQUAL? ,HERE ,DIAMOND-5>
2210                        <TELL
2211 "A marble stairway leads upward.">
2212                        <COND (,DIAMOND-SOLVE
2213                               <TELL
2214 " The floor has swung down at the end of the stairway to reveal a secret
2215 passage leading down into unrelieved darkness.">)>
2216                        <CRLF>)
2217                       (T <DWINDOW-DESC>)>
2218                 <RTRUE>)
2219                (<EQUAL? .RARG ,M-FLASH> <DWINDOW-DESC> <RTRUE>)
2220                (<AND <EQUAL? .RARG ,M-BEG>
2221                      <VERB? WALK>
2222                      <NOT ,DIAMOND-SOLVE>>
2223                 <COND (<OR <EQUAL? ,HERE ,DIAMOND-2 ,DIAMOND-4>
2224                            <EQUAL? ,HERE ,DIAMOND-6 ,DIAMOND-8>>
2225                        <SET DIR <GET ,DIDIRS <- ,DIAMOND-COUNT 1>>>
2226                        <COND (<EQUAL? ,PRSO .DIR>
2227                               <SETG DIAMOND-COUNT <+ ,DIAMOND-COUNT 1>>
2228                               <COND (<G? ,DIAMOND-COUNT ,DIAMOND-BASE>
2229                                      <SETG DIAMOND-BASE ,DIAMOND-COUNT>
2230                                      <SETG DIAMOND-MOVES 0>)>
2231                               <COND (<EQUAL? ,DIAMOND-COUNT 5>
2232                                      <TELL
2233 "You hear a strange rusty squeal echoing in the distance." CR>
2234                                      <FCLEAR ,DIAMOND-5 ,TOUCHBIT>
2235                                      <SCORE-UPD 5>
2236                                      <SETG DIAMOND-SOLVE T>)>
2237                               <COND (<EQUAL? ,HERE ,DIAMOND-2>
2238                                      <SET DIR ,DIAMOND-4>)
2239                                     (<EQUAL? ,HERE ,DIAMOND-4>
2240                                      <SET DIR ,DIAMOND-8>)
2241                                     (<EQUAL? ,HERE ,DIAMOND-8>
2242                                      <SET DIR ,DIAMOND-6>)
2243                                     (<EQUAL? ,HERE ,DIAMOND-6>
2244                                      <SET DIR ,DIAMOND-2>)>
2245                               <GOTO .DIR>)
2246                              (T
2247                               <DIAMOND-LOSS>)>
2248                        <RTRUE>)
2249                       (<AND <EQUAL? ,HERE ,DIAMOND-5>
2250                             <EQUAL? ,PRSO ,P?UP>>
2251                        <RFALSE>)
2252                       (T
2253                        <SETG DIAMOND-COUNT 0>
2254                        <COND (<PROB 33>
2255                               <TELL
2256 "There is no way to go in that direction." CR>
2257                               <RTRUE>)
2258                              (<PROB 25>
2259                               <DIAMOND-LOSS>
2260                               <RTRUE>)
2261                              (T
2262                               <SETG DIAMOND-COUNT 1>
2263                               <COND (<G? ,DIAMOND-COUNT ,DIAMOND-BASE>
2264                                      <SETG DIAMOND-BASE ,DIAMOND-COUNT>
2265                                      <SETG DIAMOND-MOVES 0>)>
2266                               <SET RM <GET ,DIAMOND-ROOMS
2267                                            <- <RANDOM 4> 1>>>
2268                               <COND (<FSET? ,BAT ,INVISIBLE>
2269                                      <FCLEAR ,BAT ,INVISIBLE>
2270                                      <MOVE ,BAT .RM>)>
2271                               <GOTO .RM>
2272                               <RTRUE>)>)>)>>
2273
2274 <ROUTINE DIAMOND-LOSS ()
2275          <SETG DIAMOND-MOVES <+ ,DIAMOND-MOVES 1>>
2276          <COND (<EQUAL? ,DIAMOND-MOVES 20>
2277                 <TELL
2278 "As you thrash about in the maze, the mirthful voice of the Wizard
2279 taunts you: \"Fool! You'll never get past ">
2280                 <TELL <GET ,BASES ,DIAMOND-BASE>>
2281                 <TELL " base at this rate!\"" CR>)>
2282          <GOTO <GET ,DIAMOND-ROOMS <+ 3 <RANDOM 5>>>>>
2283
2284 <GLOBAL BASES <TABLE "first" "first" "first" "second" "third" "home">>
2285
2286 <GLOBAL DIAMOND-ROOMS
2287         <TABLE DIAMOND-2 DIAMOND-4 DIAMOND-6 DIAMOND-8
2288                DIAMOND-1 DIAMOND-3 DIAMOND-5 DIAMOND-7 DIAMOND-9>>
2289
2290 <GLOBAL DIDIRS <TABLE P?SE P?NE P?NW P?SW>>
2291
2292 \\f
2293
2294 "SUBTITLE CERBERUS"
2295
2296 <GLOBAL CERBERUS-LEASHED <>>
2297
2298 <ROUTINE CERBERUS-FCN ()
2299          <COND (<AND <VERB? WAVE RUB RAISE> <EQUAL? ,PRSO ,WAND>>
2300                 <TELL "The dog looks puzzled." CR>
2301                 <RFALSE>)
2302                (<AND ,WAND-ON <VERB? SAY INCANT>> <RFALSE>)
2303                (<HELLO? ,CERBERUS>
2304                 <COND (,CERBERUS-LEASHED <TELL "\"Arf! Arf! Arf!\"" CR>)
2305                       (T <TELL "\"Grrrr!\"" CR>)>)
2306                (<VERB? ATTACK MUNG STAB>
2307                 <COND (,CERBERUS-LEASHED
2308                        <REMOVE ,CERBERUS>
2309                        <TELL
2310 "With a quiet bark of disappointment, the creature expires.
2311 Its six eyes look at you reproachfully. As it dies, it collapses
2312 into a small pile of dust which blows away into nothing." CR>)
2313                       (<PROB 50>
2314                        <JIGS-UP
2315 "The dog-thing snaps at you viciously, and succeeds. Your head, it seems,
2316 is only a small mouthful for the poor animal, who is just as hungry
2317 afterward.">)
2318                       (T
2319                        <TELL
2320 "The maddened dog-thing snaps viciously at you." CR>)>)
2321                (<AND <VERB? PUT PUT-ON> <EQUAL? ,PRSO ,COLLAR>>
2322                 <MOVE ,COLLAR ,CERBERUS>
2323                 <FSET ,COLLAR ,NDESCBIT>
2324                 <FSET ,COLLAR ,TRYTAKEBIT>
2325                 <PUTP ,CERBERUS ,P?LDESC
2326 "An insipidly grinning three-headed dog is wagging its tail here.
2327 It is wearing a huge dog collar.">
2328                 <SETG CERBERUS-LEASHED T>
2329                 <TELL
2330 "The creature whines happily, then the center head
2331 licks your face (which is roughly like experiencing a sandpaper
2332 washcloth). The other two heads look about, as though the
2333 monster felt a sudden need to find a pair of slippers somewhere.
2334 Its huge tail wags enthusiastically, knocking small rocks
2335 around and almost blowing you over from the breeze it creates." CR>)
2336                (<VERB? ENCHANT>
2337                 <COND (<EQUAL? ,SPELL-USED ,W?FLOAT>
2338                        <SETG SPELL-HANDLED? T>
2339                        <TELL
2340 "The huge dog rises about an inch off the ground, for a moment." CR>)
2341                       (<EQUAL? ,SPELL-USED ,W?FIERCE>
2342                        <SETG SPELL-HANDLED? T>
2343                        <JIGS-UP
2344 "Cerberus tears you limb from limb! What ferocity!">)
2345                       (<EQUAL? ,SPELL-USED ,W?FEEBLE>
2346                        <TELL
2347 "What an effect! He now has the strength of just one elephant, rather
2348 than ten!" CR>)>)
2349                (<NOT ,CERBERUS-LEASHED>
2350                 <TELL "The three-headed dog snaps at you viciously!" CR>)
2351                (<AND ,CERBERUS-LEASHED <VERB? RUB>>
2352                 <TELL
2353 "The dog is now insanely happy, slobbering all over the place and
2354 whining with uncontained doggish joy." CR>)>>
2355
2356 <ROUTINE COLLAR-FCN ()
2357          <COND (<AND <VERB? TAKE> ,CERBERUS-LEASHED>
2358                 <JIGS-UP
2359 "That wasn't such a good idea. The creature was enjoying being your pet.
2360 As you unfasten the collar, the disappointed monster hound begins to growl,
2361 and then its three fang-crammed mouths rend you into little doggy biscuits.">)
2362                (<AND <VERB? ENCHANT> <EQUAL? ,SPELL-USED ,W?FLOAT>>
2363                 <PERFORM ,V?ENCHANT ,CERBERUS>
2364                 <RTRUE>)>>
2365
2366 \\f
2367
2368 "SUBTITLE DRAGON AND GLACIER"
2369
2370 <GLOBAL ICE-MELTED <>>
2371
2372 <ROUTINE GLACIER-FCN ()
2373          <COND (<VERB? MELT>
2374                 <TELL
2375 "This is a big glacier; you'll need a lot of heat." CR>)>>
2376
2377 <ROUTINE GLACIER-ROOM-FCN (RARG)
2378          <COND (<EQUAL? .RARG ,M-LOOK>
2379                 <TELL
2380 "This is a large hall of ancient lava, since worn smooth by the movement
2381 of a glacier. A large passage exits to the east and an upward lava tube
2382 is at the top of a jumble of fallen rocks." CR>
2383                 <COND (,ICE-MELTED
2384                        <TELL
2385 "A damp and scorched passage leads west. It is still partly full of
2386 steam." CR>)>
2387                 <RTRUE>)>>
2388
2389 <ROUTINE DRAGON-FCN ()
2390          <ENABLE <QUEUE I-DRAGON -1>>
2391          <COND (<HELLO? ,DRAGON>
2392                 <TELL
2393 "The dragon looks amused. He speaks in a voice so deep you feel it
2394 rather than hear it, but the tongue is unknown to you. You find
2395 yourself almost hypnotized." CR>
2396                 <SETG DRAGON-ANGER <+ ,DRAGON-ANGER 2>>)
2397                (<VERB? EXAMINE>
2398                 <TELL
2399 "He turns and looks back at you, his cat's eyes yellow in the gloom.
2400 You start to feel weak, and quickly turn away." CR>
2401                 <SETG DRAGON-ANGER <+ ,DRAGON-ANGER 1>>)
2402                (<VERB? ATTACK MUNG KICK LAMP-ON>
2403                 <COND (<OR <VERB? LAMP-ON>
2404                            <AND <VERB? ATTACK> <NOT ,PRSI>>>
2405                        <TELL
2406 "With your bare hands? I doubt the dragon even noticed." CR>)
2407                       (T
2408                 <TELL <RANDOM-ELEMENT ,DRAGON-ATTACKS> CR>)>
2409                 <SETG DRAGON-ANGER <+ ,DRAGON-ANGER 4>>)
2410                (<AND <VERB? GIVE> <EQUAL? ,PRSI ,DRAGON>>
2411                 <SETG DRAGON-ANGER <+ ,DRAGON-ANGER 1>>
2412                 <COND (<GETPT ,PRSO ,P?VALUE>
2413                        <MOVE ,PRSO ,CHEST>
2414                        <TELL
2415 "The dragon is pleased by your gift, excuses himself for a moment,
2416 and returns without it." CR>)
2417                       (<BOMB? ,PRSO>
2418                        <SETG DRAGON-ANGER <+ ,DRAGON-ANGER 2>>
2419                        <REMOVE ,BRICK>
2420                        <TELL
2421 "The dragon snakes his long red tongue around the bomb and politely
2422 swallows it. A few moments later he belches and smoke curls out of
2423 his nostrils." CR>)
2424                       (T
2425                        <TELL "The dragon refuses your gift." CR>)>)
2426                (<AND <VERB? WALK>
2427                      <EQUAL? ,HERE ,DRAGON-ROOM>
2428                      <EQUAL? ,PRSO ,P?NORTH>>
2429                 <SETG DRAGON-ANGER <+ ,DRAGON-ANGER 3>>
2430                 <TELL
2431 "The dragon puts out a claw, grins (all of his sword-sharp teeth
2432 glinting in the light), and blocks your way." CR>)>>
2433
2434 <GLOBAL DRAGON-ANGER 0>
2435
2436 <GLOBAL DRAGON-ATTACKS
2437         <LTABLE
2438 "Dragon hide is tough as steel, but you have succeeded in annoying him
2439 a bit. He looks at you as if deciding whether or not to eat you."
2440 "That captured his interest. He stares at you balefully."
2441 "The dragon is surprised and interested (for the moment)."
2442 "You've made him rather angry. You had better be very careful now."
2443 "That did no damage, but he turns his smoky yellow eyes in your direction
2444 and sighs.">>
2445
2446 <ROUTINE HELLO? (WHO)
2447          <COND (<OR <EQUAL? ,WINNER .WHO>
2448                     <VERB? TELL ANSWER REPLY SAY HELLO INCANT>>
2449                 <COND (<VERB? TELL ANSWER SAY INCANT REPLY>
2450                        <SETG P-CONT <>>
2451                        <SETG QUOTE-FLAG <>>)>
2452                 <RTRUE>)>>
2453
2454 <ROUTINE FIND-TARGET (TARGET "AUX" P TX L ROOM)
2455          <COND (<IN? .TARGET ,HERE> ,HERE)
2456                (T
2457                 <SET P 0>
2458                 <REPEAT ()
2459                         <COND (<0? <SET P <NEXTP ,HERE .P>>>
2460                                <RETURN <>>)
2461                               (<NOT <L? .P ,LOW-DIRECTION>>
2462                                <SET TX <GETPT ,HERE .P>>
2463                                <SET L <PTSIZE .TX>>
2464                                <COND (<EQUAL? .L ,UEXIT ,CEXIT ,DEXIT>
2465                                       <SET ROOM <GETB .TX 0>>
2466                                       <COND (<IN? .TARGET .ROOM>
2467                                              <RETURN .ROOM>)>)>)>>)>>
2468
2469 <GLOBAL OLD-HERE DRAGON-ROOM>
2470
2471 <ROUTINE I-DRAGON ("AUX" ROOM)
2472          <COND (<G? ,DRAGON-ANGER 6>
2473                 <TELL
2474 "The dragon tires of this game. With an almost bored yawn, he opens his
2475 mouth and ">
2476                 <COND (<EQUAL? ,SPELL? ,S-FIREPROOF>
2477                        <TELL
2478 "blasts you with a great gout of fire, but it washes over you
2479 harmlessly." CR>)
2480                       (T
2481                        <DRAGON-LEAVES>
2482                        <JIGS-UP
2483 "incinerates you in a blast of white-hot dragon fire.">)>)
2484                (<AND <IN? ,WINNER ,DRAGON-ROOM>
2485                      <NOT <IN? ,DRAGON ,DRAGON-ROOM>>>
2486                 <MOVE ,DRAGON ,DRAGON-ROOM>
2487                 <TELL
2488 "The dragon doubles back and charges into the room, maddened by your
2489 attempt to sneak past him. His eyes glow with a white heat of anger." CR>
2490                 <COND (<EQUAL? ,SPELL? ,S-FIREPROOF>
2491                        <JIGS-UP
2492 "A huge ball of flame envelops you, but you don't even feel the heat.
2493 The dragon is puzzled, but not too puzzled to crush you in his jaws.">)
2494                       (T
2495                        <JIGS-UP
2496 "Worse for you, his mouth opens and a great gout of flame puffs out
2497 and consumes you on the spot.">)>)
2498                (<NOT <G? ,DRAGON-ANGER 0>>
2499                 <COND (<AND <PROB 50>
2500                             <IN? ,DRAGON ,HERE>>
2501                        <TELL "The dragon looks bored." CR>)
2502                       (T
2503                        <DRAGON-LEAVES>
2504                        <COND (<EQUAL? ,HERE ,GLACIER-ROOM>
2505                               <TELL
2506 "The dragon is no longer around. He must have become bored with you." CR>)
2507                              (<EQUAL? ,HERE ,OLD-HERE>
2508                               <TELL
2509 "The dragon seems to have lost interest in you.">
2510                               <COND (<EQUAL? ,OLD-HERE ,DRAGON-ROOM> <CRLF>)
2511                                     (T <TELL " He wanders off." CR>)>)>)>)
2512                (T
2513                 <SET ROOM <FIND-TARGET ,WINNER>>
2514                 <COND (<NOT .ROOM>
2515                        <COND (<PROB 25> <DRAGON-LEAVES>)>)
2516                       (<OR <EQUAL? .ROOM ,CAROUSEL-ROOM ,TINY-ROOM>
2517                            <EQUAL? .ROOM ,RAVINE-LEDGE ,FRESCO-ROOM>>
2518                        <COND (<PROB 25> <DRAGON-LEAVES>)>
2519                        <TELL "The dragon will follow no further." CR>)
2520                       (<EQUAL? .ROOM ,GLACIER-ROOM>
2521                        <TELL CR
2522 "As the dragon enters, he sees his reflection on the icy surface of the
2523 glacier at its western end. He becomes enraged: There is another dragon here,
2524 behind that glass, he thinks! Dragons are smart, but sometimes naive, and
2525 this one has never seen ice before. He rears up to his full height to
2526 challenge this intruder into his territory. He roars a challenge! The
2527 intruder responds! The dragon takes a deep breath, and out of his mouth
2528 pours a massive gout of flame. It washes over the ice, which melts rapidly,
2529 sending out torrents of water and a huge cloud of steam! You manage to clamber
2530 up to a small shelf, but the dragon is terrified! A huge splash goes down his
2531 throat! There is a muffled explosion and the dragon, a puzzled expression on
2532 his face, dies. He is carried away by the water.|
2533 |
2534 When the flood recedes you climb gingerly down. While no trace of
2535 the dragon can be found, the melting of the ice has revealed a passage
2536 leading west." CR>
2537                        <REMOVE ,DRAGON>
2538                        <REMOVE ,ICE>
2539                        <MOVE ,DEAD-DRAGON ,DEEP-FORD>
2540                        <DISABLE <INT I-DRAGON>>
2541                        <SCORE-UPD 5>
2542                        <SETG ICE-MELTED T>)
2543                       (T
2544                        <COND (<NOT <EQUAL? .ROOM ,OLD-HERE>>
2545                               <MOVE ,DRAGON .ROOM>
2546                               <TELL
2547 "The dragon follows you, out of mingled curiosity and anger." CR>)
2548                              (T
2549                               <TELL
2550 "The dragon continues to watch you carefully." CR>)>
2551                        <COND (<NOT <G? ,DRAGON-ANGER 0>>
2552                               <SETG DRAGON-ANGER 0>
2553                               <DISABLE <INT I-DRAGON>>)>)>)>
2554          <SETG OLD-HERE <LOC ,DRAGON>>
2555          <SETG DRAGON-ANGER <- ,DRAGON-ANGER 2>>
2556          <COND (<L? ,DRAGON-ANGER 0> <SETG DRAGON-ANGER 0>)>
2557          T>
2558
2559 <ROUTINE DRAGON-LEAVES ()
2560          <COND (<NOT <LOC ,DEAD-DRAGON>>
2561                 <MOVE ,DRAGON ,DRAGON-ROOM>
2562                 <SETG DRAGON-ANGER 0>
2563                 <DISABLE <INT I-DRAGON>>)>>
2564
2565 <ROUTINE I-GARDEN ()
2566          <COND (<OR <EQUAL? ,HERE ,GARDEN-NORTH ,GAZEBO-ROOM>
2567                     <EQUAL? ,HERE ,TOPIARY-ROOM ,FORMAL-GARDEN>>
2568                 <COND (<AND <IN? ,UNICORN ,GARDEN-NORTH>
2569                             <PROB 33>>
2570                        <REMOVE ,UNICORN>
2571                        <COND (<NOT <EQUAL? ,HERE ,TOPIARY-ROOM>>
2572                               <TELL "The unicorn bounds lightly away." CR>)>)
2573                       (<AND <IN? ,PRINCESS ,DRAGON-LAIR>
2574                             <NOT <IN? ,UNICORN ,GARDEN-NORTH>>
2575                             <PROB 25>
2576                             <NOT <EQUAL? ,HERE ,TOPIARY-ROOM>>>
2577                        <COND (,UNICORN-FRIGHTENED
2578                               <SETG UNICORN-FRIGHTENED <>>
2579                               <RFALSE>)>
2580                        <MOVE ,UNICORN ,GARDEN-NORTH>
2581                        <COND (<EQUAL? ,HERE ,GARDEN-NORTH>
2582                               <TELL <RANDOM-ELEMENT ,UNICORN-MSGS> CR>)
2583                              (T <TELL
2584 "A unicorn is peacefully cropping grass at the north end of the garden.
2585 There is something hanging around its neck." CR>)>)
2586                       (<EQUAL? ,HERE ,TOPIARY-ROOM>
2587                        <COND (<AND <NOT ,TOPIARY-MOVED> <PROB 12>>
2588                               <SETG TOPIARY-MOVED T>
2589                               <TELL
2590 "You look around, and strangely, the topiary animals seem to have
2591 changed position slightly." CR>)
2592                              (<AND ,TOPIARY-MOVED
2593                                    <NOT ,TOPIARY-NEAR>
2594                                    <PROB 8>>
2595                               <SETG TOPIARY-NEAR T>
2596                               <TELL
2597 "The topiary animals seem to close in on you. You turn and they are
2598 very close. They seem to be leering at you." CR>)
2599                              (<AND ,TOPIARY-NEAR <PROB 4>>
2600                               <SETG TOPIARY-MOVED <>>
2601                               <SETG TOPIARY-NEAR <>>
2602                               <JIGS-UP
2603 "The topiary animals attack! You are crushed by their branches and
2604 clawed by their thorns.">)>)>)
2605                (T
2606                 <REMOVE ,UNICORN>
2607                 <DISABLE <INT I-GARDEN>>
2608                 <RFALSE>)>>
2609
2610 <GLOBAL TOPIARY-MOVED <>>
2611 <GLOBAL TOPIARY-NEAR <>>
2612
2613 <GLOBAL UNICORN-MSGS
2614         <LTABLE
2615          "There is a large, white animal partly hidden behind some trees."
2616          "You catch a glimpse of something white between two hedges."
2617          "A unicorn is cropping grass on the other side of the room.
2618 A gold key hangs from a ribbon around its neck."
2619          "There is a beautiful unicorn eating roses here. Around his
2620 neck is a red satin ribbon on which is strung a tiny key.">>
2621
2622 <ROUTINE GARDEN-ROOM-FCN (RARG)
2623          <COND (<EQUAL? .RARG ,M-ENTER>
2624                 <ENABLE <QUEUE I-GARDEN -1>>)>>
2625
2626 <ROUTINE GLOBAL-UNICORN-FCN ()
2627          <COND (<IN? ,UNICORN ,GARDEN-NORTH>
2628                 <TELL
2629 "The unicorn is way up at the north end of the garden." CR>)
2630                (<VERB? FIND FOLLOW>
2631                 <COND (<FSET? ,UNICORN ,TOUCHBIT>
2632                        <TELL "I don't know where it is now." CR>)
2633                       (T <TELL
2634 "The unicorn is a mythical beast." CR>)>)
2635                (T
2636                 <TELL
2637 "Unicorn? What unicorn?" CR>)>>
2638
2639 <ROUTINE UNICORN-FCN ()
2640          <COND (<HELLO? ,UNICORN>
2641                 <TELL
2642 "The unicorn listens distractedly, then goes back to cropping grass." CR>)
2643                (<VERB? FOLLOW>
2644                 <TELL
2645 "The unicorn shies away as you approach." CR>)
2646                (<AND <VERB? EXAMINE> <EQUAL? ,PRSO ,UNICORN>>
2647                 <TELL
2648 "The unicorn shies away as you approach for a closer look, but you do
2649 notice a tiny gold key hanging from a red satin ribbon looped around
2650 the animal's neck." CR>)
2651                (<VERB? EXAMINE>
2652                 <TELL "The unicorn shies away as you approach." CR>)
2653                (<VERB? TAKE PUT RUB MUNG ATTACK>
2654                 <REMOVE ,UNICORN>
2655                 <SETG UNICORN-FRIGHTENED T>
2656                 <TELL
2657 "The unicorn, unsurprised by this evidence that you are indeed the
2658 uncouth sort of vagabond it suspected you were, melts into the hedges
2659 and is gone." CR>)>>
2660
2661 <GLOBAL UNICORN-FRIGHTENED <>>
2662
2663 <ROUTINE GAZEBO-FCN ()
2664          <COND (<AND <EQUAL? ,HERE ,GARDEN-NORTH> <VERB? THROUGH>>
2665                 <DO-WALK ,P?IN> <RTRUE>)
2666                (<AND <EQUAL? ,HERE ,GAZEBO-ROOM>
2667                      <VERB? THROUGH>>
2668                 <TELL "You're already in it." CR>)
2669                (<AND <EQUAL? ,HERE ,GAZEBO-ROOM> <VERB? LEAVE EXIT>>
2670                 <DO-WALK ,P?OUT> <RTRUE>)>>
2671
2672 <ROUTINE CHEST-FCN ()
2673          <COND (<VERB? OPEN>
2674                 <COND (<PROB 25>
2675                        <V-OPEN>
2676                        <COND (<AND <IN? ,PRINCESS ,HERE>
2677                                    <NOT ,PRINCESS-AWAKE>>
2678                               <TELL
2679 "The opening of the squeaky lid startles the young woman." CR>)>)
2680                       (T
2681                        <TELL
2682 "The hinges are very rusty, but they seem to be starting to give.
2683 You can probably open it if you try again. There is something
2684 bumping around inside.">
2685                        <COND (<AND <IN? ,PRINCESS ,HERE>
2686                                    <NOT ,PRINCESS-AWAKE>>
2687                               <TELL
2688 " All this rummaging around has startled
2689 the young woman.">)>
2690                        <CRLF>)>
2691                 <PUTP ,CHEST ,P?ACTION 0>
2692                 <COND (<AND <IN? ,PRINCESS ,HERE>
2693                             <NOT ,PRINCESS-AWAKE>>
2694                        <PERFORM ,V?ALARM ,PRINCESS>)>
2695                 T)>>
2696
2697 <GLOBAL PRINCESS-AWAKE <>>
2698
2699 <ROUTINE PRINCESS-FCN ("AUX" (DEM <INT I-PRINCESS>))
2700          <COND (<VERB? FOLLOW>
2701                 <COND (<IN? ,PRINCESS ,HERE>
2702                        <TELL
2703 "You can't follow her until she leaves..." CR>)
2704                       (,PRFOLLOW
2705                        <DO-WALK ,PRFOLLOW>)
2706                       (T
2707                        <TELL "I seem to have lost track of her." CR>)>
2708                 <RTRUE>)
2709                (<NOT <IN? ,PRINCESS ,HERE>>
2710                 <TELL "There is no princess here." CR>)
2711                (<VERB? ATTACK MUNG RAPE>
2712                 <REMOVE ,PRINCESS>
2713                 <TELL
2714 "The princess screams as you approach. \"Won't someone deliver
2715 me from this awful fate?\" she cries. ">
2716                 <COND (<IN? ,WIZARD ,HERE>
2717                        <TELL
2718 "Shocked, the Wizard of Frobozz turns toward you.">)
2719                       (ELSE
2720                        <TELL "Just in time, the Wizard of Frobozz
2721 appears, seeming to unroll himself out of nothing like a window shade.">)>
2722                 <TELL
2723 " \"Fry!\" he intones, and a massive bolt of lightning reduces you to a pile
2724 of smoking ashes. (Serves you right, too, if you ask me.)">
2725                 <JIGS-UP>)
2726                (<OR <HELLO? ,PRINCESS> <VERB? ALARM KISS EXAMINE RUB>>
2727                 <COND (<AND <IN? ,PRINCESS ,DRAGON-LAIR>
2728                             <EQUAL? <GET .DEM ,C-ENABLED?> 0>>
2729                        <PUTP ,PRINCESS ,P?LDESC
2730 "There is a dishevelled and slightly unkempt princess here.">
2731                        <ENABLE <QUEUE I-PRINCESS 2>>
2732                        <SETG PRINCESS-AWAKE T>
2733                        <TELL
2734 "The princess (for she is obviously one) shakes herself awake, then
2735 notices you for the first time. She smiles. \"Thank you for rescuing
2736 me from that horrid worm,\" she says. \"I must depart. My parents will
2737 be worried about me.\" With that, she arises, looking purposefully out
2738 of the lair." CR>)
2739                       (T
2740                        <TELL
2741 "The princess ignores you. She looks about the room, but her eyes
2742 fix on the ">
2743                        <COND (<EQUAL? ,HERE ,GAZEBO-ROOM>
2744                               <TELL "garden outside">)
2745                              (<EQUAL? ,HERE ,GARDEN-NORTH>
2746                               <TELL "gazebo">)
2747                              (<EQUAL? ,HERE ,RAVINE-LEDGE>
2748                               <TELL "ledge">)
2749                              (T
2750                               <TELL <GET ,PRDIRS <* ,PRCOUNT 4>>>)>
2751                        <TELL "." CR>)>)
2752                (<NOT ,PRINCESS-AWAKE>
2753                 <TELL "She's in a trance!" CR>)>>
2754
2755 <GLOBAL PRCOUNT 0>
2756
2757 <GLOBAL PRFOLLOW <>>
2758
2759 <GLOBAL PRDIRS
2760         <TABLE "south" DRAGON-ROOM "north" P?SOUTH
2761                "east" LEDGE-TUNNEL "west" P?EAST
2762                "east" RAVINE-LEDGE "west" P?EAST
2763                "down" DEEP-FORD "up" P?DOWN
2764                "south" MARBLE-HALL "north" P?SOUTH
2765                "east" STREAM-PATH "west" P?EAST
2766                "east" FORMAL-GARDEN "west" P?EAST
2767                "north" GARDEN-NORTH "south" P?NORTH
2768                "in" GAZEBO-ROOM "out" P?IN>>
2769
2770 <ROUTINE I-PRINCESS ("AUX" (DEM <INT I-PRINCESS>) (OLDP <LOC ,PRINCESS>)
2771                      (PC <* ,PRCOUNT 4>))
2772          <MOVE ,PRINCESS <GET ,PRDIRS <+ .PC 1>>>
2773          <SETG PRFOLLOW <>>
2774          <COND (<AND <IN? ,PRINCESS ,STREAM-PATH>
2775                      <IN? ,WINNER ,MARBLE-HALL>>
2776                 <TELL
2777 "The princess presses a loose piece of marble in the wall and a large
2778 section of the wall slides away, revealing a passage to the east. She
2779 enters it." CR>
2780                 <COND (<IN? ,WINNER .OLDP>
2781                        <SETG PRFOLLOW <GET ,PRDIRS <+ .PC 3>>>)>
2782                 <SETG SECRET-DOOR T>)
2783                (<AND <IN? ,PRINCESS ,STREAM-PATH>
2784                      <IN? ,WINNER ,STREAM-PATH>>
2785                 <SETG SECRET-DOOR T>
2786                 <TELL
2787 "The princess appears from behind some rocks, as though she had walked
2788 through a wall." CR>)
2789                (<IN? ,WINNER .OLDP>
2790                 <SETG PRFOLLOW <GET ,PRDIRS <+ .PC 3>>>
2791                 <COND (<EQUAL? .OLDP ,GARDEN-NORTH>
2792                        <TELL "The princess enters the gazebo">
2793                        <COND (<FSET? ,GAZEBO-ROOM ,RMUNGBIT>
2794                               <TELL ", although you would never get past
2795 the debris. She must be magically protected.">)>
2796                        <TELL "." CR>)
2797                       (<EQUAL? .OLDP ,RAVINE-LEDGE>
2798                        <TELL
2799 "The princess climbs daintily down the rock face." CR>)
2800                       (T
2801                        <TELL "The princess walks ">
2802                        <TELL <GET ,PRDIRS .PC>>
2803                        <TELL ". She glances back at you as she goes." CR>)>)
2804                (<IN? ,PRINCESS ,HERE>
2805                 <COND (<EQUAL? ,HERE ,GAZEBO-ROOM>
2806                        <TELL "The princess joins you in the gazebo." CR>)
2807                       (<EQUAL? ,HERE ,DEEP-FORD>
2808                        <TELL "The princess climbs down the rock wall onto the beach." CR>)
2809                       (T
2810                        <TELL "The princess enters from the ">
2811                        <TELL <GET ,PRDIRS <+ 2 .PC>>>
2812                        <TELL ". She seems surprised to see you." CR>)>)>
2813          <COND (<IN? ,PRINCESS ,GAZEBO-ROOM>
2814                 <DISABLE .DEM>
2815                 <ENABLE <QUEUE I-UNICORN 6>>)
2816                (T
2817                 <SETG PRCOUNT <+ ,PRCOUNT 1>>
2818                 <ENABLE <QUEUE I-PRINCESS
2819                                <COND (<PROB 75> 1)(T 2)>>>)>
2820          <RTRUE>>
2821
2822 <ROUTINE I-UNICORN ()
2823          <COND (<EQUAL? ,HERE ,GAZEBO-ROOM ,GARDEN-NORTH>
2824                 <MOVE ,ROSE ,WINNER>
2825                 <FCLEAR ,GOLD-KEY ,NDESCBIT>
2826                 <MOVE ,GOLD-KEY ,WINNER>
2827                 <SCORE-OBJ ,GOLD-KEY>
2828                 <PUTP ,GOLD-KEY ,P?ACTION 0>
2829                 <TELL
2830 "Shyly, a unicorn peeks out of the hedges. It notices the princess and
2831 seems captivated. It approaches her and bows its head as though curtseying
2832 to her. Around its neck is a red satin ribbon on which is strung a delicate
2833 gold key. The princess takes the ribbon and uses it to tie up her hair. She
2834 looks at you and then, smiling, hands you the key and a fresh rose which she
2835 plucks from the arbor. \"You may have use of such a thing,\" she says. \"It
2836 is the least I can do for one who rescued me from a fate I dare not
2837 contemplate.\" With that, she mounts the unicorn (side-saddle, of course)
2838 and rides off into the gloom." CR>
2839                 <REMOVE ,PRINCESS>)
2840                (T
2841                 <REMOVE ,PRINCESS>
2842                 <MOVE ,ROSE ,GAZEBO-ROOM>
2843                 <RFALSE>)>>
2844
2845 \\f
2846
2847 "SUBTITLE WIZARD WORKSHOP AND ENVIRONS"
2848
2849 <ROUTINE MENHIR-ROOM-FCN (RARG)
2850          <COND (<AND <EQUAL? .RARG ,M-FLASH> ,MENHIR-POSITION>
2851                 <DESCRIBE-MENHIR>)
2852                (<EQUAL? .RARG ,M-LOOK>
2853                 <TELL
2854 "This is a large room which was evidently used once as a quarry. Many
2855 large limestone chunks lie helter-skelter around the room. Some are
2856 rough-hewn and unworked, others smooth and well-finished. One side of
2857 the room appears to have been used to quarry building blocks, the other
2858 to produce menhirs (standing stones). Obvious passages lead north and
2859 south." CR>
2860                 <COND (<IN? ,MENHIR ,LOCAL-GLOBALS>
2861                        <DESCRIBE-MENHIR>)>
2862                 T)>>
2863
2864 <ROUTINE DESCRIBE-MENHIR ()
2865          <COND (<EQUAL? ,HERE ,MENHIR-ROOM>
2866                 <COND (<EQUAL? ,MENHIR-POSITION <>>
2867                        <TELL
2868 "One particularly large menhir, at least twenty feet tall and eight feet
2869 thick, is leaning against the wall blocking a dark opening leading
2870 southwest. On this side of the menhir is carved an ornate letter \"F\"." CR>)
2871                       (<EQUAL? ,MENHIR-POSITION 1>
2872                        <TELL
2873 "There is a huge menhir lying on the floor near a southwest passage." CR>)
2874                       (<EQUAL? ,MENHIR-POSITION 2>
2875                        <TELL
2876 "A dark opening leads southwest." CR>)
2877                       (<EQUAL? ,MENHIR-POSITION 3>
2878                        <TELL "There is a huge menhir here." CR>)
2879                       (T
2880                        <TELL
2881 "There is a huge menhir floating like a feather in midair here. A
2882 passage to the southwest opens beneath it." CR>)>
2883                 <COND (<EQUAL? ,HERE ,MUNGED-ROOM>
2884                        <TELL
2885 "The explosion appears to have had no effect on the menhir." CR>)>
2886                 <RTRUE>)
2887                (T <TELL "A dark opening leads southwest." CR>)>>
2888
2889 <GLOBAL MENHIR-POSITION <>>
2890
2891 <ROUTINE MENHIR-FCN ()
2892          <COND (<VERB? LOOK-UNDER LOOK-BEHIND>
2893                 <COND (,MENHIR-POSITION
2894                        <TELL
2895 "Behind the menhir is some air and then a wall." CR>)
2896                       (T
2897                        <TELL
2898 "The gap between the menhir and the wall is very narrow, but it is clear
2899 that there is a sizeable room in there. Your light only reveals a part of
2900 the far wall." CR>)>)
2901                (<VERB? TAKE MOVE TURN>
2902                 <TELL
2903 "The menhir weighs many tons and is eight feet wide. You can't even get
2904 a grip on it, much less move it." CR>)
2905                (<VERB? READ> <TELL "\"F\"" CR>)
2906                (<VERB? EXAMINE>
2907                 <TELL
2908 "It is nicely finished, and the letter \"F\" on it is particularly well
2909 carved." CR>)
2910                (<AND <VERB? ENCHANT> <EQUAL? ,SPELL-USED ,W?FLOAT>>
2911                 <TELL
2912 "The menhir floats majestically into the air, rising about ten feet.
2913 The passage beneath it beckons invitingly." CR>
2914                 <SETG MENHIR-POSITION 3>)
2915                (<AND <VERB? DISENCHANT>
2916                      <EQUAL? ,SPELL-USED ,W?FLOAT>>
2917                 <SETG MENHIR-POSITION <>>
2918                 <COND (<EQUAL? ,HERE ,MENHIR-ROOM ,KENNEL>
2919                        <TELL
2920 "The menhir sinks to the ground." CR>)>)>>
2921
2922 <GLOBAL GUARDIAN-FED <>>
2923
2924 <ROUTINE DOOR-KEEPER-FCN ()
2925          <COND (<AND <VERB? ALARM> ,GUARDIAN-FED>
2926                 <TELL "Try as you may, you can't wake it." CR>)
2927                (<AND <VERB? GIVE> <EQUAL? ,PRSI ,DOOR-KEEPER>>
2928                 <COND (,GUARDIAN-FED
2929                        <TELL
2930 "He is asleep, at least for the moment." CR>)
2931                       (<EQUAL? ,PRSO ,CANDY>
2932                        <SETG GUARDIAN-FED T>
2933                        <REMOVE ,CANDY>
2934                        <TELL
2935 "The guardian greedily wolfs down the candy, including the package. (It
2936 seemed to enjoy the grasshoppers particularly.) It then becomes
2937 quiet and its eyes close. (Lizards are known to sleep a long time while
2938 digesting their meals.)" CR>)
2939                       (<EQUAL? ,PRSO ,FLASK>
2940                        <TELL
2941 "The lizard sniffs it experimentally, then looks at you angrily, hissing
2942 and snapping." CR>)
2943                       (<BOMB? ,PRSO>
2944                        <REMOVE ,PRSO>
2945                        <TELL
2946 "The guardian greedily wolfs it down. After a while, you hear a
2947 very small pop and the guardian's eyes bulge out. It hisses nastily
2948 at you." CR>)
2949                       (<EQUAL? ,PRSO ,PALANTIR-1 ,PALANTIR-2 ,PALANTIR-3>
2950                        <TELL
2951 "The guardian greedily gobbles the sphere, but finds it unchewable. He
2952 then tries repeatedly to swallow it whole, with disappointing results.
2953 Finally, he spits it on the ground." CR>
2954                        <MOVE ,PRSO ,HERE>)
2955                       (T
2956                        <REMOVE ,PRSO>
2957                        <TELL
2958 "The lizard wolfs down the " D ,PRSO ", crunching greedily." CR>)>)
2959                (<VERB? ATTACK MUNG>
2960                 <TELL
2961 "The guardian seems impervious to your attack. In fact, your blows
2962 don't even seem to be landing." CR>)>>
2963
2964 <GLOBAL WIZ-DOOR-FLAG <>>
2965
2966 <ROUTINE WIZ-DOOR-FCN ()
2967          <COND (<NOT ,GUARDIAN-FED>
2968                 <COND (<VERB? OPEN>
2969                        <TELL
2970 "The lizard comes to life and snaps at you as you reach for the
2971 handle." CR>)
2972                       (<VERB? UNLOCK>
2973                        <TELL
2974 "The lizard door keeper comes awake and bites at your hand. You
2975 jerk away just in time.">
2976                        <COND (<AND <EQUAL? ,PRSI ,GOLD-KEY> <PROB 5>>
2977                               <REMOVE ,GOLD-KEY>
2978                               <TELL " The guardian does get the
2979 key, though. It grins maniacally." CR>)
2980                              (<PROB 20>
2981                               <MOVE ,GOLD-KEY ,HERE>
2982                               <TELL " You drop the key, though." CR>)
2983                              (T <CRLF>)>)>)
2984                (<VERB? UNLOCK>
2985                 <COND (,WIZ-DOOR-FLAG
2986                        <TELL "It is already!" CR>)
2987                       (<EQUAL? ,PRSI ,GOLD-KEY>
2988                        <SETG WIZ-DOOR-FLAG T>
2989                        <TELL
2990 "The key turns and the bolt clicks. The door is unlocked." CR>)
2991                       (T
2992                        <SETG WIZ-DOOR-FLAG <>>
2993                        <TELL "That won't unlock it." CR>)>)
2994                (<VERB? LOCK>
2995                 <COND (<NOT ,WIZ-DOOR-FLAG>
2996                        <TELL "It is locked already." CR>)
2997                       (<EQUAL? ,PRSI ,GOLD-KEY>
2998                        <TELL "The door is now locked." CR>
2999                        <SETG WIZ-DOOR-FLAG <>>
3000                        <RTRUE>)
3001                       (T <TELL "That won't lock it." CR>)>)
3002                (<VERB? OPEN CLOSE>
3003                 <COND (,WIZ-DOOR-FLAG
3004                        <OPEN-CLOSE ,PRSO
3005                                    "The door creaks open."
3006                                    "The door reluctantly closes.">)
3007                       (<VERB? OPEN>
3008                        <TELL "The door is locked!" CR>)>)>>
3009
3010 <ROUTINE GUARDIAN-ROOM-FCN (RARG)
3011          <COND (<EQUAL? .RARG ,M-LOOK>
3012                 <TELL
3013 "This room is cobwebby and musty, but tracks in the dust show that it has
3014 seen visitors recently. At the south end of the room is a stained and
3015 battered (but very strong-looking) door. To the north, a corridor exits." CR>
3016                 <COND (<FSET? ,WIZ-DOOR ,OPENBIT>
3017                        <TELL "The door is open." CR>)>
3018                 <COND (<NOT ,GUARDIAN-FED>
3019                        <TELL
3020 "Imbedded in the door is a nasty-looking lizard head, with sharp
3021 teeth and beady eyes. ">
3022                        <COND (<IN? ,CANDY ,WINNER>
3023                               <TELL "The lizard is sniffing at you." CR>)
3024                              (T
3025                               <TELL
3026 "The eyes move to watch you approach." CR>)>)
3027                       (T
3028                        <TELL
3029 "A sleepy-looking lizard head is mounted on the door." CR>)>)>>
3030
3031 <ROUTINE WORKSHOP-FCN (RARG)
3032          <COND (<EQUAL? .RARG ,M-LOOK>
3033                 <TELL
3034 "You are standing in the entry hall of the Wizard's Workshop. Dark
3035 corridors lead west and south from here. The corridor to the west
3036 smells slightly of incense or candle smoke.">
3037                 <COND (<FSET? ,WIZ-DOOR ,OPENBIT>
3038                        <TELL " The workshop door is open.">)>
3039                 <CRLF>
3040                 <RTRUE>)>>
3041
3042 <ROUTINE ARCANA-PSEUDO ()
3043          <COND (<VERB? TAKE>
3044                 <TELL
3045 "The stuff on the bench appears to be so much junk, and you decide that
3046 it would only get in your way if you took it." CR>)>>
3047
3048 <ROUTINE TROPHY-PSEUDO ()
3049          <COND (<VERB? READ> <RFALSE>)
3050                (<VERB? TAKE RUB>
3051                 <TELL
3052 "As your fingers near it, you get a nasty shock (but fortunately not a fatal
3053 one)." CR>)>>
3054
3055 <ROUTINE STAND-FCN ()
3056          <COND (<VERB? TAKE>
3057                 <TELL "The " D ,PRSO " is firmly attached to the bench." CR>)
3058                (<AND <VERB? PUT PUT-ON>
3059                      <EQUAL? ,PRSO ,PALANTIR-1 ,PALANTIR-2 ,PALANTIR-3>
3060                      <EQUAL? ,PRSI ,STAND-1 ,STAND-2 ,STAND-3>>
3061                 <V-PUT>
3062                 <COND (<AND <IN? ,PALANTIR-1 ,STAND-1>
3063                             <IN? ,PALANTIR-2 ,STAND-2>
3064                             <IN? ,PALANTIR-3 ,STAND-3>>
3065                        <REMOVE ,PALANTIR-1>
3066                        <REMOVE ,PALANTIR-2>
3067                        <REMOVE ,PALANTIR-3>
3068                        <MOVE ,STAND-4 ,WORKBENCH>
3069                        <TELL
3070 "As you place the " D ,PRSO " in the " D ,PRSI ", a low humming noise
3071 begins, and you can feel the hairs on the back of your neck begin to
3072 stand up. The three spheres begin to vibrate, faster and faster, as
3073 the noise becomes higher and higher pitched. Three puffs of smoke, one
3074 red, one blue, one white, rise up from empty stands. The spheres are gone!
3075 But in the center of the triangle formed by the stands is now a black stand
3076 of obsidian in which rests a strange black sphere." CR>)>
3077                 T)>>
3078
3079 <ROUTINE IN-AQUARIUM-FCN (RARG)
3080          <COND (<EQUAL? .RARG ,M-LOOK>
3081                 <TELL
3082 "There is a sandy floor here, and your vision seems murky and blurred.
3083 The wall you are looking at is nicely dressed stone." CR>
3084                 <COND (<IN? ,SERPENT ,AQUARIUM>
3085                        <COND (<PROB 25>
3086                               <TELL
3087 "While you watch a shadow seems to pass overhead." CR>)
3088                              (<PROB 5>
3089                               <TELL
3090 "The head of some horrible serpent pokes into view, its beady green eyes
3091 almost seeming to see you." CR>)>)>
3092                 <RTRUE>)
3093                (<EQUAL? .RARG ,M-ENTER>
3094                 <COND (<IN? ,SERPENT ,AQUARIUM>
3095                        <JIGS-UP
3096 "You drop into the aquarium with a splash (which attracts the serpent).
3097 He greedily eats you. He's just a baby, after all, and needs all the
3098 food he can get.">)
3099                       (T <JIGS-UP
3100 "Oh dear, you have cut yourself severely on the broken glass. I'm afraid
3101 you've bled to death.">)>)>>
3102
3103 <ROUTINE AQUARIUM-FCN ("AUX" OBJ)
3104          <COND (<VERB? BOARD THROUGH> <DO-WALK ,P?IN> <RTRUE>)
3105                (<AND <VERB? LOOK-INSIDE>
3106                      <IN? ,SERPENT ,AQUARIUM>>
3107                 <TELL
3108 "In the aquarium is a baby sea-serpent who eyes you suspiciously. His
3109 scaly body writhes about in the huge tank." CR>)
3110                (<OR <AND <VERB? MUNG ATTACK> <EQUAL? ,PRSO ,AQUARIUM>>
3111                     <AND <VERB? THROW> <EQUAL? ,PRSI ,AQUARIUM>>>
3112                 <COND (<EQUAL? ,PRSO ,AQUARIUM>
3113                        <COND (<NOT ,PRSI> <RFALSE>)
3114                              (T <SET OBJ ,PRSI>)>)
3115                       (T <SET OBJ ,PRSO>)>
3116                 <MOVE .OBJ ,HERE>
3117                 <COND (<IN? ,DEAD-SERPENT ,HERE>
3118                        <TELL
3119 "The aquarium is already broken!" CR>
3120                        <RTRUE>)
3121                       (<EQUAL? .OBJ ,FLASK>
3122                        <JIGS-UP
3123 "The flask shatters, and poison gas fills the room!">
3124                        <RTRUE>)
3125                       (<BOMB? .OBJ>
3126                        <DISABLE <INT I-FUSE>>)
3127                       (<OR <FSET? .OBJ ,WEAPONBIT>
3128                            <G? <GETP .OBJ ,P?SIZE> 10>>
3129                 <REMOVE ,SERPENT>
3130                 <MOVE ,PALANTIR-3 ,AQUARIUM>
3131                 <FCLEAR ,PALANTIR-3 ,NDESCBIT>
3132                 <PUTP ,AQUARIUM ,P?LDESC
3133 "A shattered aquarium fills the northern half of the room.">
3134                 <MOVE ,DEAD-SERPENT ,HERE>
3135                 <TELL
3136 "The " D .OBJ " shatters the glass wall of the aquarium, spilling out
3137 an impressive amount of salt water and wet sand. It also spills out an
3138 extremely annoyed sea serpent who bites angrily at the " D .OBJ ", and
3139 then at you. He is having difficulty breathing, and he seems to hold you
3140 responsible for his current problem.">
3141                 <COND (<VERB? MUNG>
3142                        <TELL
3143 " He manages to rend you limb from limb before he drowns in the
3144 air." CR>
3145                        <JIGS-UP "I guess you were too careless.">)
3146                       (T
3147                        <TELL
3148 " He tries to slither across the stone floor towards you. Fortunately,
3149 he expires mere inches away from biting off your foot. A clear crystal
3150 sphere sits amid the sand and broken glass on the bottom of the
3151 aquarium." CR>)>)
3152                       (T
3153                        <TELL
3154 "The " D .OBJ " bounces harmlessly off the glass." CR>)>)>>
3155
3156 <ROUTINE SERPENT-FCN ()
3157          <COND (<EQUAL? ,SERPENT ,WINNER>
3158                 <TELL
3159 "The serpent only stares hungrily at you." CR>)
3160                (<VERB? ATTACK MUNG>
3161                 <TELL
3162 "He swims towards you with a powerful stroke of his flippers, dagger-like
3163 teeth dripping. Fortunately, he doesn't want to crash into the aquarium
3164 wall, and contents himself with splashing you with water." CR>)
3165                (<AND <VERB? PUT>
3166                      <EQUAL? ,PRSO ,SERPENT>>
3167                 <TELL "Impossible for many reasons." CR>)
3168                (<VERB? TAKE GIVE>
3169                 <JIGS-UP
3170 "He takes you instead. *Uurrp!*">)>>
3171
3172 <ROUTINE DEAD-SERPENT-FCN ()
3173          <COND (<VERB? TAKE>
3174                 <TELL
3175 "This may only be a baby sea serpent, but it's as big as a small whale." CR>)>>
3176
3177 <ROUTINE GENIE-FCN ("OPTIONAL" (RARG ,M-OBJECT) "AUX" V HOARD)
3178         <COND (<VERB? HELLO>
3179                <TELL
3180 "The genie grins demonically, but says nothing." CR>)
3181               (<EQUAL? ,WINNER ,GENIE>
3182                <COND (<NOT ,GENIE-READY?>
3183                       <TELL
3184 "\"My fee is not paid! I perform no tasks for free! We demons have a
3185 strong union these days.\"" CR>
3186                       <RFATAL>)
3187                      (<VERB? SGIVE> <RFALSE>)
3188                      (<OR <G? <GET ,P-PRSO 0> 1>
3189                           <G? <GET ,P-PRSI 0> 1>>
3190                       <TELL
3191 "\"I will do one thing only, oh gracious master!\"" CR>
3192                       <RFATAL>)
3193                      (<AND <VERB? MOVE> <EQUAL? ,PRSO ,GLOBAL-MENHIR>>
3194                       <SETG MENHIR-POSITION 1>
3195                       <TELL
3196 "The demon is gone for a moment. \"A trifle... My little finger alone
3197 was enough.\"" CR>
3198                       <GENIE-LEAVES>)
3199                      (<VERB? TAKE>
3200                       <COND (<EQUAL? ,PRSO ,GLOBAL-MENHIR>
3201                              <REMOVE ,MENHIR>
3202                              <SETG MENHIR-POSITION 2>
3203                              <TELL
3204 "The demon flashes away for a second. \"I have little use for such a
3205 thing, but perhaps as a doorstop...\"" CR>
3206                              <GENIE-LEAVES>)
3207                             (<EQUAL? ,PRSO ,WAND>
3208                              <TELL
3209 "\"This I do gladly, oh fool!\" cackles the demon gleefully. He stretches
3210 out an enormous hand towards the wand and taking it like a toothpick (this
3211 is a large demon), points it at himself. \"Free!\" he commands, and the
3212 demon and his wand vanish forever." CR>
3213                              <GENIE-LEAVES <>>
3214                              <REMOVE ,WAND>)
3215                             (<FSET? ,PRSO ,TAKEBIT>
3216                              <GENIE-LEAVES <>>
3217                              <REMOVE ,PRSO>
3218                              <TELL
3219 "The demon snaps his fingers, the " D ,PRSO " spins wildly in the air in
3220 front of him, then he and it depart." CR>)
3221                             (T
3222                              <TELL
3223 "\"I fear that I cannot take such a thing.\"" CR>)>)
3224                      (<AND <VERB? GIVE> <EQUAL? ,PRSI ,ME>>
3225                       <COND (<EQUAL? ,PRSO ,WAND>
3226                              <TELL
3227 "\"I hear and obey!\" says the demon. He stretches out an enormous hand
3228 towards the wand. The Wizard is unsure what to do, pointing it threateningly
3229 at the demon, then at you. \"Fudge!\" he cries, but aside from a strong
3230 odor of chocolate in the air, there is no effect. The demon plucks the
3231 wand out of his hand (it's about toothpick-size to him) and gingerly lays
3232 it before you. He fades into the smoke, which disperses.
3233 The wizard runs from the room in terror." CR>
3234                              <REMOVE ,WIZARD>
3235                              <GENIE-LEAVES <>>
3236                              <FCLEAR ,WAND ,NDESCBIT>
3237                              <MOVE ,WAND ,HERE>)
3238                             (<EQUAL? ,PRSO ,GLOBAL-MENHIR>
3239                              <MOVE ,MENHIR ,PENTAGRAM-ROOM>
3240                              <FCLEAR ,MENHIR ,NDESCBIT>
3241                              <FCLEAR ,MENHIR ,TAKEBIT>
3242                              <SETG MENHIR-POSITION 3>
3243                              <TELL
3244 "He waves his hands, and the menhir drops softly at your feet." CR>
3245                              <GENIE-LEAVES>)
3246                             (<FSET? ,PRSO ,TAKEBIT>
3247                              <MOVE ,PRSO ,PENTAGRAM-ROOM>
3248                              <TELL
3249 "The " D ,PRSO " appears before you and settles to the ground." CR>
3250                              <GENIE-LEAVES>)
3251                             (T
3252                              <TELL
3253 "\"Were it possible, this would be my fondest wish, but alas...\"" CR>)>)
3254                      (<VERB? ATTACK>
3255                       <COND (<EQUAL? ,PRSO ,GLOBAL-CERBERUS>
3256                              <TELL
3257 "\"This may prove taxing, but we'll see. Perhaps I'll tame him for a
3258 pup instead.\" The demon disappears for an instant, then reappears. He
3259 looks rather gnawed and scratched. He winces. \"Too much for me. Puppy
3260 dog, indeed. You're welcome to him. Never did like dogs anyway... Any
3261 other orders, oh beneficent one?\"" CR>)
3262                             (<EQUAL? ,PRSO ,WIZARD>
3263                              <TELL
3264 "The demon grins hideously. \"This has been my desire e'er since this
3265 charlatan bent me to his service. I perform this deed with pleasure!\"
3266 The demon forms himself back into a cloud of greasy smoke. The cloud
3267 envelops the Wizard, who waves his wand fruitlessly, mumbling various
3268 phrases which begin with \"F\". A horrible scream is heard, and the smoke
3269 begins to clear. Nothing remains of the Wizard but his wand." CR>
3270                              <REMOVE ,WIZARD>
3271                              <FCLEAR ,WAND ,NDESCBIT>
3272                              <MOVE ,WAND ,HERE>
3273                              <GENIE-LEAVES>)
3274                             (<EQUAL? ,PRSO ,ME>
3275                              <GENIE-LEAVES <>>
3276                              <SETG WINNER ,ADVENTURER>
3277                              <JIGS-UP
3278 "\"Foolish mortal, if you insist...\" The demon crushes you with one
3279 blow of his enormous hand.">)
3280                             (T
3281                              <TELL 
3282 "\"I know no way to kill a " D ,PRSO ".\"" CR>)>)
3283                      (<VERB? FIND EXAMINE>
3284                       <TELL
3285 "\"I am not permitted to ">
3286                       <COND (<VERB? FIND>
3287                              <TELL "answer questions">)
3288                             (T <TELL "perform such menial tasks">)>
3289                       <TELL ". The terms of my contract
3290 are explicit on this matter, learned one. Surely you would not wish to
3291 violate my contract?\" He licks his lips with a forked tongue like a
3292 snake's. \"The penalty clauses are ... hmm ... devilish.\"" CR>)
3293                      (T
3294                       <TELL
3295 "\"Apologies, oh master, but even for such a one as I this is not possible.\"
3296 He seems somewhat chagrined to have to admit this." CR>
3297                       <RTRUE>)>)
3298               (<VERB? EXORCISE ATTACK MUNG>
3299                <TELL
3300 "The demon laughs uproariously." CR>)
3301               (<AND <VERB? GIVE> <EQUAL? ,PRSI ,GENIE>>
3302                <COND (<AND <EQUAL? ,PRSO ,IRON-BOX>
3303                            <IN? ,VIOLIN ,PRSO>>
3304                       <TELL
3305 "The genie frowns briefly, then ">
3306                       <COND (<FSET? ,PRSO ,OPENBIT> <TELL "looks inside">)
3307                             (ELSE <TELL "opens">)>
3308                       <TELL " the box. He smiles horribly." CR>
3309                       <REMOVE-CAREFULLY ,IRON-BOX>
3310                       <SETG PRSO ,VIOLIN>)>
3311                <COND (<AND <GETPT ,PRSO ,P?VALUE>
3312                            <NOT <EQUAL? ,PRSO ,SWORD>>>
3313                       <REMOVE-CAREFULLY ,PRSO>
3314                       <SETG GENIE-HOARD <+ ,GENIE-HOARD 1>>
3315                       <SCORE-UPD 2>
3316                       <SET HOARD <+ ,GENIE-HOARD <CASE-WORTH>>>
3317                       <COND (<NOT <L? .HOARD ,TREASURES-MAX>>
3318                              <SETG GENIE-READY? T>
3319                              <PUTP ,WIZARD ,P?LDESC
3320 "A dejected and fearful Wizard watches from the corner.">
3321                              <TELL
3322 "\"This will do for my fee. 'Tis a paltry hoard, but as you have done
3323 me a small service by loosing me from this wizard, it will suffice.\"" CR>)
3324                             (T
3325                              <TELL
3326 "\"" <GET ,GENIE-THANKS .HOARD> "\"" CR>
3327                              <COND (<EQUAL? .HOARD 8>
3328                                     <TELL
3329 "The Wizard looks at you as if you are a madman. He tears his beard and
3330 stares at you fearfully." CR>)>
3331                              <RTRUE>)>)
3332                      (<BOMB? ,PRSO>
3333                       <GENIE-LEAVES <>>
3334                       <TELL
3335 "\"I fear that this violates my contract, oh foolish one. Thus, I am
3336 free to depart.\"" CR>)
3337                      (T
3338                       <REMOVE-CAREFULLY ,PRSO>
3339                       <TELL
3340 "The demon gladly takes the " D ,PRSO " and smiles balefully,
3341 revealing enormous fangs." CR>)>)>>
3342
3343 <ROUTINE GENIE-LEAVES ("OPTIONAL" (NOISY? T))
3344          <FSET ,GENIE ,INVISIBLE>
3345          <COND (.NOISY?
3346                 <TELL "The genie departs, his agreement fulfilled." CR>)>
3347          <SETG P-CONT <>>
3348          <RFATAL>>
3349
3350 <GLOBAL GENIE-READY? <>>
3351 <GLOBAL GENIE-HOARD 0>
3352 <CONSTANT TREASURES-MAX 10>     ;"all treasures but palantirs(4),
3353                                   candy, collar, wand."
3354
3355 <GLOBAL GENIE-THANKS <LTABLE
3356 "Most fine, master! But 'tis not enough. I will do a great service,
3357 and are not great services bought at great price?"
3358 "Very nice, but not enough!"
3359 "Ah, truly magnificent! Keep them coming."
3360 "Almost halfway there, oh worthy one!"
3361 "Oh, such beauty! Your generosity almost overwhelms me!"
3362 "Truly I shall do thee a wonderful service when thou hast finished!"
3363 "Truly you are most generous! But still, this is yet not enough."
3364 "A fine gift, mighty one, you have almost reached my fee."
3365 "Wondrous fine, master! But one treasure is yet to be given!">>
3366
3367 <ROUTINE CASE-WORTH ("AUX" F (W 0))
3368          <SET F <FIRST? ,WIZARD-CASE>>
3369          <REPEAT ()
3370                  <COND (<NOT .F> <RETURN .W>)>
3371                  <COND (<GETPT .F ,P?VALUE>
3372                         <SET W <+ .W 1>>)>
3373                  <SET F <NEXT? .F>>>>
3374
3375 <ROUTINE PENTAGRAM-FCN ("OPTIONAL" (RARG ,M-BEG))
3376          <COND (<EQUAL? .RARG ,M-BEG>
3377                 <COND (<VERB? THROUGH BOARD>
3378                        <TELL
3379 "You try to enter the pentagram, but are forced back by an invisible
3380 power." CR>)
3381                       (<AND <VERB? PUT PUT-ON> <EQUAL? ,PRSO ,PALANTIR-4>>
3382                        <REMOVE ,PALANTIR-4>
3383                        <FCLEAR ,GENIE ,INVISIBLE>
3384                        <MOVE ,GENIE ,PENTAGRAM-ROOM>
3385                        <TELL
3386 "A cold wind blows outward from the sphere. The candles flicker, and a
3387 low moan, almost inaudible, is heard. It rises in volume and pitch
3388 until it becomes a high-pitched keening. A dim shape becomes visible in
3389 the air above the sphere. The shape resolves into a large and somewhat
3390 formidable looking demon. He looks around, tests the walls of the
3391 pentagram experimentally, then sees you! \"Hmm, a new master...\" he
3392 says under his breath. \"Greetings, oh master! Wouldst desire a
3393 service, as our contract stateth? For some pittance of wealth, some
3394 trifle, I will gratify thy desires to the utmost limit of my powers, and
3395 they are not inconsiderable.\" He makes a pass with his massive arms and
3396 the walls begin to shake a little. Another pass and the shaking stops.
3397 \"A nice effect... I find it makes for a better relationship to give
3398 such a demonstration early on.\" He grins vilely." CR>)>)>>
3399
3400 <ROUTINE WIZARD-FCN ("OPTIONAL" (RARG ,M-OBJECT) "AUX" OLIT)
3401          <COND (<EQUAL? ,WINNER ,WIZARD>
3402                 <COND (<VERB? GIVE> <TELL
3403 "The Wizard replies \"Foolishment!\"" CR>)
3404                       (T
3405                        <TELL
3406 "The Wizard considers your statement carefully. His expression indicates
3407 he regards it as fanciful." CR>)>)
3408                (<AND <VERB? GIVE> <EQUAL? ,PRSI ,WIZARD>>
3409                 <SET OLIT ,LIT>
3410                 <REMOVE-CAREFULLY ,PRSO>
3411                 <COND (<BOMB? ,PRSO>
3412                        <COND (<IN? ,GENIE ,PENTAGRAM-ROOM>
3413                               <MOVE ,PRSO ,HERE>
3414                               <TELL
3415 "The wizard accepts this final folly resignedly." CR>)
3416                              (T
3417                               <REMOVE ,WIZARD>
3418                               <TELL
3419 "\"Hmm...\" The Wizard mutters something, then waves his wand over the
3420 bomb. It transforms into a bouquet of flowers. Both Wizard and
3421 flowers disappear." CR>)>)
3422                       (<AND .OLIT <NOT ,LIT>>
3423                        <TELL
3424 "\"Thank you.\" As the Wizard places the " D ,PRSO " under his robe, the
3425 room becomes dark." CR>)
3426                       (T
3427                        <TELL "\"Thank you.\"" CR>)>)
3428                (<HELLO? ,WIZARD>
3429                 <TELL
3430 "The Wizard seems surprised, much as you might be if a dog talked." CR>)
3431                (<VERB? ATTACK MUNG>
3432                 <REMOVE ,WIZARD>
3433                 <COND (<IN? ,WAND ,WIZARD>
3434                        <TELL
3435 "The Wizard retreats, waving his wand and chanting. He says \"Fear!\"
3436 ">)
3437                       (T
3438                        <TELL
3439 "The Wizard tries to cast the \"Fear!\" spell, but without his wand!
3440 ">)>
3441                 <COND (<NOT <FSET? ,GENIE ,INVISIBLE>>
3442                        <TELL
3443 "Nothing happens! With a terrified glance at the demon, the wizard
3444 runs past you and out of the room." CR>)
3445                       (T
3446                        <TELL
3447 "You are suddenly terrified. The Wizard seems huge and terrible,
3448 looming over you. You flee, terrified. He chuckles, snaps his fingers, and
3449 disappears." CR CR>
3450                        <SETG SPELL? ,S-FEAR>
3451                        <PUTP ,ADVENTURER ,P?ACTION MAGIC-ACTOR>
3452                        <ENABLE <QUEUE I-WIZARD 10>>
3453                        <RANDOM-WALK>)>)>>
3454
3455 <ROUTINE I-WIZARD ("AUX" CAST-PROB (PCNT 0) F (WLOC <LOC ,WINNER>))
3456          <ENABLE <QUEUE I-WIZARD 4>>
3457          <COND (,DEAD <RFALSE>)
3458                (,SPELL?
3459                 <COND (<EQUAL? ,SPELL? ,S-FLOAT>
3460                        <COND (<EQUAL? ,HERE ,WELL-TOP>
3461                               <JIGS-UP
3462 "You plunge to the bottom of the shaft as the spell wears off.">
3463                               <RTRUE>)
3464                              (<AND <FSET? ,HERE ,NONLANDBIT>
3465                                    <NOT <EQUAL? ,HERE ,WELL-BOTTOM
3466                                                 ,VOLCANO-BOTTOM>>>
3467                               <JIGS-UP
3468 "As the spell wears off, you find yourself making a half-gainer
3469 towards the bottom of the volcano.">
3470                               <RTRUE>)>)
3471                       (<EQUAL? ,SPELL? ,S-FEEBLE>
3472                        <SETG LOAD-ALLOWED ,LOAD-MAX>)
3473                       (<EQUAL? ,SPELL? ,S-FIERCE>
3474                        <SETG SWORD-GLOW 0>)
3475                       (<EQUAL? ,SPELL? ,S-FUMBLE>
3476                        <SETG FUMBLE-NUMBER 7>
3477                        <SETG FUMBLE-PROB 8>)>
3478                 <COND (<GET ,SPELL-STOPS ,SPELL?>
3479                        <TELL <GET ,SPELL-STOPS ,SPELL?> CR>)>
3480                 <PUTP ,ADVENTURER ,P?ACTION 0>
3481                 <SETG SPELL? <>>
3482                 <RTRUE>)>
3483          <COND (<IN? ,GENIE ,PENTAGRAM-ROOM>
3484                 <DISABLE <INT I-WIZARD>> 
3485                 <COND (<NOT <IN? ,WIZARD ,PENTAGRAM-ROOM>>
3486                        <MOVE ,WIZARD ,PENTAGRAM-ROOM>
3487                        <COND (<IN? ,WINNER ,PENTAGRAM-ROOM>
3488                               <TELL
3489
3490 "Suddenly the Wizard materializes in the room. He is astonished by what
3491 he sees: his servant in deep conversation with a common adventurer! He
3492 draws forth his wand, waves it frantically, and incants \"Frobizz!
3493 Frobozzle! Frobnoid!\" The demon laughs heartily. \"You no longer
3494 control the Black Crystal, hedge-wizard! Your wand is powerless! Your
3495 doom is sealed!\" The demon turns to you, expectantly." CR>)>)>
3496                 <RTRUE>)>
3497          <COND (<AND <NOT ,LIT>
3498                      <FSET? ,LAMP ,RMUNGBIT>
3499                      <G? ,SCORE 200>>
3500                 <SETG ALWAYS-LIT T>
3501                 <SETG LIT T>
3502                 <TELL
3503 "In the darkness you hear the voice of the Wizard. \"Dear me, you seem
3504 to have gotten into quite a pickle.\" He chuckles. \"Fluoresce!\" he
3505 incants. It is no longer dark." CR>
3506                 <RTRUE>)>
3507          <COND (<AND <LOC ,WIZARD> <PROB 80>>
3508                 <COND (<AND ,LIT <IN? ,WIZARD ,HERE>>
3509                        <TELL "The Wizard vanishes." CR>)>
3510                 <REMOVE ,WIZARD>
3511                 <RTRUE>)>
3512          <COND (<PROB 10>
3513                 <COND (<NOT ,LIT>
3514                        <TELL
3515 "You feel a slight outrush of air as something moves nearby." CR>)
3516                       (<EQUAL? ,HERE ,POSTS-ROOM ,POOL-ROOM>
3517                        <TELL
3518 "A huge and terrible wizard appears before you, as large as the largest
3519 tree! He looks down on you as you would look upon a gnat!" CR>)
3520                       (<FSET? ,HERE ,NONLANDBIT>
3521                        <TELL
3522 "The Wizard appears, floating nonchalantly in the air beside you. He
3523 grins sideways at you." CR>)
3524                       (T
3525                        <TELL
3526 "A strange little man in a long cloak appears suddenly in the room.
3527 He is wearing a high pointed hat embroidered with astrological signs.
3528 He has a long, stringy, and unkempt beard." CR>)>
3529                 <COND (<IN? ,PALANTIR-4 ,ADVENTURER>
3530                        <COND (,LIT
3531                               <TELL
3532 "The Wizard notices that you carry the Black Crystal, and with an
3533 unseemly haste, he disappears." CR>)
3534                              (ELSE
3535                               <TELL
3536 "You feel a sudden inrush of air as though something disappeared." CR>)>
3537                        <REMOVE ,WIZARD>
3538                        <RTRUE>)
3539                       (<PROB 20>
3540                        <COND (,LIT
3541                               <TELL
3542 "He mutters something (muffled by his beard) and disappears as suddenly
3543 as he came." CR>)
3544                              (ELSE
3545                               <TELL
3546 "You hear low, confused muttering." CR>)>
3547                        <REMOVE ,WIZARD>
3548                        <RTRUE>)>
3549                 <COND (<IN? ,PALANTIR-1 ,ADVENTURER>
3550                        <SET PCNT <+ .PCNT 1>>)>
3551                 <COND (<IN? ,PALANTIR-2 ,ADVENTURER>
3552                        <SET PCNT <+ .PCNT 1>>)>
3553                 <COND (<IN? ,PALANTIR-3 ,ADVENTURER>
3554                        <SET PCNT <+ .PCNT 1>>)>
3555                 <SET CAST-PROB <- 80 <* .PCNT 20>>>
3556                 <COND (,LIT
3557                        <TELL
3558 "The Wizard draws forth his wand and waves it in your direction. It
3559 begins to glow with a faint blue glow." CR>)
3560                       (ELSE
3561                        <TELL
3562 "Suddenly, illuminated by the faint blue glow of a magic wand pointed
3563 in your direction, you see the Wizard!" CR>)>
3564                 <COND (<PROB .CAST-PROB>
3565                        <MOVE ,WIZARD ,HERE>
3566                        <SETG SPELL? <RANDOM ,SPELLS>>
3567                        <PUTP ,ADVENTURER ,P?ACTION MAGIC-ACTOR>
3568                        <ENABLE <QUEUE I-WIZARD 
3569                                       <+ 5
3570                                          <RANDOM <- 30 <* 5 .PCNT>>>>>>
3571                        <COND (<PROB 75>
3572                               <TELL
3573 "The Wizard, in a deep and resonant voice, speaks the word \""
3574 <GET ,SPELL-NAMES ,SPELL?> "!\" He then vanishes, cackling gleefully." CR>)
3575                              (T
3576                               <TELL
3577 "The Wizard, almost inaudibly, whispers a word beginning with \"F,\"
3578 and then disappears, chuckling nastily." CR>)>
3579                        <REMOVE ,WIZARD>
3580                        <COND (<GET ,SPELL-HINTS ,SPELL?>
3581                               <TELL <GET ,SPELL-HINTS ,SPELL?> CR>)>
3582                        <COND (<EQUAL? ,SPELL? ,S-FALL>
3583                               <COND (<FSET? .WLOC ,VEHBIT>
3584                                      <TELL
3585 "You suddenly fall headlong out of the " D .WLOC " as though
3586 someone had flipped it over." CR>
3587                                      <COND (<EQUAL? ,HERE ,WELL-TOP>
3588