Implement per-file license notices
[spiritwrak.git] / src / aragain.inf
1
2 ! *******************************************************************
3 ! ARAGIN.INF
4 ! -- Add-on for SPIRITWRAK (don't use alone!)
5 !    for Aragain city, royal grounds, possibly Barsap's Gambit
6 !
7 ! SPIRITWRAK is free software; you can redistribute it and/or modify
8 ! it under the terms of the GNU General Public License as published by
9 ! the Free Software Foundation; either version 3 of the License, or
10 ! (at your option) any later version.
11 !
12 ! SPIRITWRAK is distributed in the hope that it will be useful, but
13 ! WITHOUT ANY WARRANTY; without even the implied warranty of
14 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 ! General Public License for more details.
16 !
17 ! You should have received a copy of the GNU General Public License
18 ! along with SPIRITWRAK. If not, see <https://www.gnu.org/licenses/>.
19 ! *******************************************************************
20
21
22 Object ARAGAIN_GUSStop "Aragain North"
23    with description "You are just north of the newly \
24 built Aragain City. The general vicinity \
25 is busy with important-looking people. \
26 A stairway goes down here, \
27 while a large walkway heads south into Aragain.",
28        name "people" "stairway" "walkway",
29        d_to ARAGAIN_GUSStation,
30        s_to ARAGAIN_Entrance,
31    has light;
32
33 Object ARAGAIN_Entrance "Aragain Entrance"
34    with description "Before you is a truly astounding sight. \
35 A huge metal gate to the south blocks the entrance into the newly \
36 built Aragain Royal Grounds. Worse yet, a seemingly \
37 endless line of people stands before the gate. \
38 They look like dignitaries, diplomats, or \
39 just plain politicians. A walkway heads north.",
40         name "walkway" "pastries",
41         n_to ARAGAIN_GUSStop,
42         s_to ARAGAIN_Entrance_gate,
43         cant_go "The only interesting place seems to be past \
44                 that gate.",
45    has light;
46
47 Nearby line1 "line"
48    with name "line" "people" "dignitaries" "diplomats" "politicians",
49         description "A god-awful line of well-dressed people. You \
50                     notice that many of them are holding what appear \
51                     to be round pastries of some sort.",
52         life [;
53 default: "No one in the line seems to be paying you any attention.";
54         ],
55         before [;
56            Cast:
57               if (the_spell_was == espnis_spell)
58 "A few people doze off as you canvass the line. They are \
59 quickly replaced by others.";
60         ],
61    has animate concealed;
62
63 Object gate_sign "large sign" ARAGAIN_Entrance
64    with initial "There is a large sign bolted to the gate.",
65         name "sign" "large",
66         description [;
67            print "The sign reads:^^\
68 ~WELCOME TO ARAGAIN!^^\
69 As today (and everyday henceforth) has been decreed \
70 his royal lordship's birthday, we request that all \
71 visitors respect good king Sydney Flathead's wishes \
72 and present a cake appropriate for the occasion before \
73 entering.";
74            if (self hasnt general) {
75               give self general;
76 "~^^Well, that's odd. If memory and Brother \
77 TuffBerry's Quendor History lessons serve, the \
78 Flathead family died off more than a hundred years \
79 ago."; 
80            }
81            else "~"; 
82         ],
83    has static;
84
85  
86 Object ARAGAIN_Entrance_gate "huge entrance gate" ARAGAIN_Entrance
87    with name "gate" "entrance",
88         description "A solid steel gate, probably 40 feet tall, \
89 complete with spikes at the top and close-set bars.",
90         door_dir [;
91            if (self in ARAGAIN_Entrance)
92                return s_to;
93            else return n_to;
94         ],
95         door_to [;
96            if (self in ARAGAIN_Entrance)
97                return ARAGAIN_Courtyard;
98            else return ARAGAIN_Entrance;
99         ],
100         found_in ARAGAIN_Entrance ARAGAIN_Courtyard,
101         when_open "The massive gate is open.",
102         when_closed "The massive gate is closed.",
103         before [;
104            Open, Push, Pull:
105               if (Entrance_guardian hasnt general)
106                  "The guard shoves you away as you approach the gate. \
107                  He points at the sign. ~No cake, no castle.~";
108            Close:
109               "It must weigh a ton, you can't seem to move it.";
110         ],
111    has static door openable locked;
112
113 Object ARAGAIN_Courtyard "Courtyard"
114   with description "You're standing in a lovely courtyard with \
115 magnificent topiary designs and real marble walkways. A large \
116 gate stands to the north. To the east is a red stone building \
117 with spires and columns. To the west is a large flat stone \
118 building. To the south is a huge entranceway into what must \
119 be the new Royal Palace, which appears to be carved out of the \
120 face of a massive mountain.",
121        name "marble" "walkway" "red" "spires" "columns" "flat"
122 "entranceway" "mountain" "Palace",
123        n_to ARAGAIN_Entrance_gate,
124        e_to ARAGAIN_Museum,
125        w_to ARAGAIN_Gambit,
126        s_to ARAGAIN_Palace,
127 has light;
128
129 Nearby topiary "topiary"
130    with name "topiary",
131         description "Cleverly abused shrubs in the shape of giant \
132 crowns.",
133    has scenery;
134
135 ! -- The (rather empty) Royal Museum 
136
137 Object ARAGAIN_Museum "Royal Museum"
138    with description "You're in the entrance to a museum. The \
139 lighting is rather dim, throwing light shadows all over the \
140 walls. There are exhibit rooms to the north and south, or \
141 an exit west.",
142    name "lighting" "shadows",
143         w_to ARAGAIN_Courtyard,
144         n_to Museum_north,
145         s_to Museum_south,
146    has light;
147
148 Object Museum_north "North Exhibit Room"
149    with description "You are in a small exhibit room designed with \
150 dark wood floors and plaster-on-stucco walls. The room is dimly lit by \
151 hidden lamps or torches behind recessed wall niches. \
152 The exit is south.",
153         name "wood" "plaster" "stucco" "lamps" "torches" "niches",
154         s_to ARAGAIN_Museum,
155         each_turn [;
156           if ((glass_wall in self) && (Thief notin Delbins)) {
157              if (random(10) == 2 or 7)
158                 "^You get the odd feeling that there's someone behind \
159 you, but when you turn around, you see no one!";
160           }
161         ],
162         before [;
163           Cast:
164 if (the_spell_was == huncho_spell or luncho_spell)
165 "From nearby, a museum curator walks up and abruptly \
166 stops your chant. ~Please don't disturb the other patrons,~ \
167 he says and walks off. There doesn't seem to be anyone else \
168 around, however.";
169           Blow:
170              if ((noun == whistle) && (glass_wall in self)) {
171                 remove glass_wall;
172                 print "You produce an extremely high-pitched noise. \
173 Suddenly, to the north, a near-invisible wall of glass shatters \
174 into a million little shards";
175                 if (Thief notin Delbins) {
176                    move Painting_REAL to THIEF_Storeroom;
177                    Painting_REAL.initial = nothing;
178                    move magic_door to Museum_north;
179                    "!^^From out of the shadows, a man dressed \
180 in black appears! He performs a half-bow in your direction \
181 before deftly prying the painting off the wall! ~I'm a great \
182 appreciator of the arts, you understand,~ he says, as with a quick \
183 twist of his cape, he melds into the shadows and disappears \
184 with the painting!^^As you reflect on the thief's actions, \
185 you can't help but notice that he apparently dropped something \
186 while making his dramatic exit.";
187                 }
188                 else "!";
189 ! -- guards always come and move player to jail room ?
190 ! -- if thief still in delbins, attempt to get painting is \
191 ! trapped below, player CANT TAKE IT (as a priest)
192              }
193         ],
194    has light; 
195
196 Nearby glass_wall "glass wall"
197    with name "wall" "glass",
198         description "Yes, there's a glass wall covering the \
199 north wall, all right. It's exceptionally smooth and transparent.",
200         before [;
201           Attack:
202               "Your blows have no effect, it must be quite thick.";
203         ],
204    has static concealed;
205
206 Object Painting_REAL "priceless painting" Museum_north
207    with name "painting",
208         short_name "priceless painting",
209         plural "priceless paintings",
210         initial "There is a priceless painting hanging on the north wall.",
211         description "It's a beautiful oil painting of a dark stormy \
212 scene. On the horizon, you can see the edges of mountaintops. Near \
213 the top of the painting, two winged figures are carrying a lone \
214 individual towards a break in the clouds, where a bright white light \
215 seems to emanate.",
216         size 25,
217         before [;
218           Take, Pull, Push, Turn, Attack, Rub, Cut, Touch, Search:
219             if (self in Museum_north) {
220                if (glass_wall in Museum_north)
221  "As you get close to the painting, you find yourself stopped by a \
222 nearly-invisible glass wall!";
223                else {
224                   if (action == ##Search)
225                   "You notice a slightly loose part \
226 of the canvas in one corner, but the painting is apparently \
227 bonded to the wall, which limits your investigation.";
228                   if (action ~= ##Touch)
229                   "You can't seem to move the painting at all. \
230 It's somehow bonded to the museum wall!";
231                }
232             }
233             else {
234                if ((action == ##Take) && (self in THIEF_Storeroom) && 
235                    (Painting_FAKE in THIEF_Storeroom))
236                   "They both look so genuine! You can't decide!";
237                if (action == ##Search) {
238                    if ((self in THIEF_Storeroom) && 
239                    (Painting_FAKE in THIEF_Storeroom))
240                    "Search which one? Goodness, you can't decide!";
241                    if (self hasnt general) {
242                       give self general;
243                       move white_scroll to player;
244                       "You notice a slightly loose part \
245 of the canvas in one corner. You carefully peel back a part of the \
246 canvas from the back and reveal a hidden scroll!";  
247                    }
248                }
249             }
250           Drop:
251             if (location == Museum_north) {
252                ! player returned painting to museum, give him a reward
253                move c4 to player;
254                move self to Museum_north;
255                "A museum curator appears and graciously takes the \
256 painting. ~Thank you for recovering this priceless work.~ He \
257 gives you a coin. ~The reward. We've been a little short on funds \
258 lately.~ The curator somehow attaches the painting to the north wall, \
259 and leaves.";               
260             }               
261         ],
262 ;
263
264 Object c4 "coin" class coin_class;
265  
266 Object Painting_plaque "plaque" Museum_north
267    with name "plaque",
268         initial [;
269 print "A metal plaque is attached to the wall";
270 if (Painting_REAL in Museum_north)
271    " next to the painting.";
272 else ".";
273         ],
274         description "~ASCENDENCY~   Leonardo Flathead, 777 GUE",
275         before [;
276           Take, Pull, Push, Turn, Attack, Rub, Cut, Touch:
277             if ((self in Museum_north) && (glass_wall in Museum_north))
278  "As you get close to the painting, you find yourself stopped by a \
279 nearly-invisible glass wall!";
280         ],
281    has static;
282  
283 Object Museum_south "South Exhibit Room"
284    with description "You are in a square exhibit room with \
285 wood flooring and plain plaster walls. In the center of the \
286 room is an exhibit platform made from a large slab of marble. \
287 The room is lit brightly by hidden torches. The exit is north.",
288         name "wood" "plaster" "torches",
289         n_to ARAGAIN_Museum
290    has light;
291
292 Nearby museum_dais "platform"
293   with name "platform" "slab" "marble",
294        description "It's a large flat slab of marble, polished \
295 smooth, in the center of the floor.",
296        capacity 20,
297   has scenery supporter;
298
299 Object TEMPLE_Artifact "flower vase" museum_dais
300    with name "artifact" "vase",
301         initial "There's an ancient wood vase sitting on the marble platform.",
302         description "An extremely narrow short wood vase, possibly for \
303 holding long-stemmed flowers. It's clearly of ancient origin, well \
304 preserved, with strange carvings and designs \
305 of robed figures all over.",
306         capacity 1,
307         before [;
308            Receive:
309               if (noun hasnt is_rod)
310                  "Strangely, it doesn't quite fit.";
311            LetGo:
312               if (self in TEMPLE_1_Opening)
313               "You can't reach the vase, much less the contents of the vase.";
314         ],
315         size 10,
316    has container open;
317
318 ! -- Okay maze-lovers, you asked for it -- Barsap's Gambit
319
320 Object ARAGAIN_Gambit "Warm Room"
321   with description "You are in a long stone room, which is strangely \
322 warm. In the very center of the room is a hole, with a ladder \
323 down. An outdoor courtyard lies to the east.",
324        name "hole" "courtyard" "ladder",
325        e_to ARAGAIN_Courtyard,
326        d_to GAMBIT_11,
327   has light;
328
329 Nearby Gambit_sign "large sign"
330    with initial "There is a large sign posted near the doorway.",
331         name "sign",
332         description "~Welcome to Barsap's Royal Gambit, a \
333 delight to entertain all guests to the Aragain Royal Grounds. \
334 Please consult your tourbook for rules and regulations regarding \
335 this area. His highness, Sydney Flathead, and those in his \
336 employ, cannot be held responsible for any accidents or minor
337 spills at this location.~",
338    has static;
339
340 ! (room names -- GAMBIT_XY, where X=level (1,2,3), Y=room #)
341
342
343 ! -----------------------------------------------------
344 ! The all-important "CheckGambit" routine.  Called by a 
345 ! room when a player attempts  to move onto a beam.
346 ! Various important things need to be passed...
347 ! RETNS: 0 if cant go, 1 if player fell, 2 if can go
348 [ CheckGambit 
349     i   ! niche associated with dir player moving in
350     j   ! niche directly below (if player falls) [0 if lev 3]
351     k   ! 'level' currently on (1, 2 or 3)
352     m   ! (local var)
353    ;
354   ! ** Step one -- check if there's even a beam there at all
355   if (children(i) == 0)
356      return 0;
357   ! ** Step two -- check if the beam is strong enough
358      m = child(i);
359      if (m.number == 99) ! (we have the 'wrong half')
360         m = child(i.counter_niche);
361      if (m.number <= 0) {
362         ! -- nope, beam breaks, we're about to fall
363         ! -- remove broken beam
364         remove child(i); remove child(i.counter_niche);
365         print "As you step onto the wood beam, it breaks with a \
366 shuddering crack! ";
367         if (has_resist_gravity == 0) {
368              deadflag = 1;   
369              print "You plummet quickly through the air, ";
370              switch (k) {
371              1: print "pass by two levels of floating cubes and beams, ";
372              2: print "pass by one level of floating cubes and beams, ";
373              }
374              print "and find the bottom of the chamber is filled with \
375  red-hot lava...";
376              return 1;
377         }
378         else {
379            ! -- player will float, but see if there's anything to float to...
380            print "Amazingly, you float downwards like a \
381 feather, instead of falling to your death! ";
382            if (k==3) {  ! (j==0) {  on the bottom level
383               deadflag = 1;
384               print "Unfortunately, you float slowly down to \
385 the bottom of the chamber, which is filled with red-hot lava.";
386               return 1;
387            }
388            print "You float down towards another network of floating \
389 cubes and beams. ";
390            if (children(j) == 0) {  ! no wood beam waiting
391               deadflag = 1;
392               print "You pass between two giant floating cubes, \
393 similar to the ones you just left. Sadly, no wood beam seems \
394 to connect these particular cubes, and you float downwards ";
395               if (k==1) 
396                 print "past yet another level of floating cubes and beams, ";
397               print "to a pit of hot lava.";
398               return 1;
399            }
400            print "You float to another wood beam and your feet \
401 land on it, perfectly balanced! ";
402            m = child(j);
403            if (m.number == 99) ! (we have the 'wrong half')
404            m = child(j.counter_niche);
405            if (m.number <= 0) {
406            ! -- beam breaks (again!), player dies
407            ! -- remove broken beam
408            remove child(j); remove child(j.counter_niche);
409            print "Sadly, this wood beam also breaks! You \
410 continue to float downwards ";
411            if (k==1)
412               print "past yet another level of floating cubes and beams ";
413            print "into a pit of hot lava.";
414            deadflag = 1;
415            return 1;    
416            }
417            else  {
418              print "^";
419              ! -- beam is ok, decrement strength counter
420              m.number = m.number - 1;
421              ! -- MOVE PLAYER TO NEW BEAM
422              !    set-up new WN_TO and ES_TO
423              if (j.niche_dir == 3 or 4) {
424                 WN_TO = parent(j);
425                 ES_TO = parent(j.counter_niche);
426              }
427              else {
428                 ES_TO = parent(j);
429                 WN_TO = parent(j.counter_niche);
430              }
431              !    move to appropriate 'on beam' room
432              !   TODO update beam description....
433              if (j.niche_dir == 2 or 4) {
434                 if (k==1)
435                    PlayerTo(GAMBIT_W21);
436                 else
437                    PlayerTo(GAMBIT_W31);
438              }
439              else {
440                 if (k==1)
441                    PlayerTo(GAMBIT_W22);
442                 else
443                    PlayerTo(GAMBIT_W32);
444              }
445              return 1;
446            }
447         }
448      }
449      else {
450         ! -- beam is ok, decrement strength counter
451         m.number = m.number - 1;
452         print "You step gingerly onto the wood beam...^";
453         if (i.niche_dir == 3 or 4) {
454            WN_TO = parent(i);
455            ES_TO = parent(i.counter_niche);
456         }
457         else {
458            ES_TO = parent(i);
459            WN_TO = parent(i.counter_niche);
460         }
461         return 2;
462      }
463 ]; 
464 ! -----------------------------------------------------
465
466
467 Class Gambit_Room_Lev1_Class
468    with description "You are standing on a large floating white \
469 stone cube in a very large underground chamber. The entire place is \
470 dimly lit red from somewhere below.",
471         name "white" "stone" "cube" "chamber",
472    has light;
473
474
475 Object GAMBIT_11 "On Giant White Cube"
476    with description "As far as you can tell, you are standing on a \
477 large white stone cube that somehow floats without visible supports in \
478 a terrifyingly large underground chamber. The entire place is \
479 dimly lit red from somewhere below. There is a ladder up to a hole \
480 high in the ceiling here.",
481         name "white" "stone" "cube" "chamber" "ladder" "hole",
482         u_to ARAGAIN_Gambit,
483         w_to 
484         [ i ;
485           i = CheckGambit(n112,n212,1);
486           if (i ~= 2) return i;
487           else return GAMBIT_W1;
488         ],
489         s_to 
490         [ i ;
491           i = CheckGambit(n113,n213,1);
492           if (i ~= 2) return i;
493           else return GAMBIT_W2;
494         ],
495    has light;
496
497 Object GAMBIT_12 "On Giant White Cube"
498    class Gambit_Room_Lev1_Class
499    with e_to
500         [ i ;
501           i = CheckGambit(n124,n224,1);
502           if (i ~= 2) return i;
503           else return GAMBIT_W1;
504         ],
505         w_to
506         [ i ;
507           i = CheckGambit(n122,n222,1);
508           if (i ~= 2) return i;
509           else return GAMBIT_W1;
510         ],
511         s_to 
512         [ i ;
513           i = CheckGambit(n123,n223,1);
514           if (i ~= 2) return i;
515           else return GAMBIT_W2;
516         ],
517 ;
518
519 Object GAMBIT_13 "On Giant White Cube"
520    class Gambit_Room_Lev1_Class
521    with e_to
522         [ i ;
523           i = CheckGambit(n134,n234,1);
524           if (i ~= 2) return i;
525           else return GAMBIT_W1;
526         ],
527         s_to
528         [ i ;
529           i = CheckGambit(n133,n233,1);
530           if (i ~= 2) return i;
531           else return GAMBIT_W2;
532         ],
533 ;
534
535 Object GAMBIT_14 "On Giant White Cube"
536    class Gambit_Room_Lev1_Class
537    with w_to
538         [ i ;
539           i = CheckGambit(n142,n242,1);
540           if (i ~= 2) return i;
541           else return GAMBIT_W1;
542         ],
543         n_to 
544         [ i ;
545           i = CheckGambit(n141,n241,1);
546           if (i ~= 2) return i;
547           else return GAMBIT_W2;
548         ],   
549         s_to 
550         [ i ;
551           i = CheckGambit(n143,n243,1);
552           if (i ~= 2) return i;
553           else return GAMBIT_W2;
554         ],   
555 ;
556
557 Object GAMBIT_15 "On Giant White Cube"
558    class Gambit_Room_Lev1_Class
559    with e_to
560         [ i ;
561           i = CheckGambit(n154,n254,1);
562           if (i ~= 2) return i;
563           else return GAMBIT_W1;
564         ],
565         w_to
566         [ i ;
567           i = CheckGambit(n152,n252,1);
568           if (i ~= 2) return i;
569           else return GAMBIT_W1;
570         ],
571         n_to 
572         [ i ;
573           i = CheckGambit(n151,n251,1);
574           if (i ~= 2) return i;
575           else return GAMBIT_W2;
576         ],   
577         s_to 
578         [ i ;
579           i = CheckGambit(n153,n253,1);
580           if (i ~= 2) return i;
581           else return GAMBIT_W2;
582         ],   
583 ;
584        
585 Object GAMBIT_16 "On Giant White Cube"
586    class Gambit_Room_Lev1_Class
587    with e_to
588         [ i ;
589           i = CheckGambit(n164,n264,1);
590           if (i ~= 2) return i;
591           else return GAMBIT_W1;
592         ],
593         n_to 
594         [ i ;
595           i = CheckGambit(n161,n261,1);
596           if (i ~= 2) return i;
597           else return GAMBIT_W2;
598         ],   
599         s_to 
600         [ i ;
601           i = CheckGambit(n163,n263,1);
602           if (i ~= 2) return i;
603           else return GAMBIT_W2;
604         ],   
605 ;
606
607 Object GAMBIT_17 "On Giant White Cube"
608    class Gambit_Room_Lev1_Class
609    with w_to
610         [ i ;
611           i = CheckGambit(n172,n272,1);
612           if (i ~= 2) return i;
613           else return GAMBIT_W1;
614         ],
615         n_to 
616         [ i ;
617           i = CheckGambit(n171,n271,1);
618           if (i ~= 2) return i;
619           else return GAMBIT_W2;
620         ],   
621 ;
622
623 Object GAMBIT_18 "On Giant White Cube"
624    class Gambit_Room_Lev1_Class
625    with w_to
626         [ i ;
627           i = CheckGambit(n182,n282,1);
628           if (i ~= 2) return i;
629           else return GAMBIT_W1;
630         ],
631         n_to 
632         [ i ;
633           i = CheckGambit(n181,n281,1);
634           if (i ~= 2) return i;
635           else return GAMBIT_W2;
636         ],
637         e_to
638         [ i ;
639           i = CheckGambit(n184,n284,1);
640           if (i ~= 2) return i;
641           else return GAMBIT_W1;
642         ],
643 ;
644
645 Object GAMBIT_19 "On Giant White Cube"
646    class Gambit_Room_Lev1_Class
647    with e_to
648         [ i ;
649           i = CheckGambit(n194,n294,1);
650           if (i ~= 2) return i;
651           else return GAMBIT_W1;
652         ],
653         n_to 
654         [ i ;
655           i = CheckGambit(n191,n291,1);
656           if (i ~= 2) return i;
657           else return GAMBIT_W2;
658         ],   
659 ;
660
661
662 ! (level 1 niches)
663  
664 Object n112 "western niche" GAMBIT_11
665    class niche_class
666    with name "western",
667         counter_niche n124,
668         niche_dir 2,  ! 2 = on western edge of floor
669         ;
670 Object n113 "southern niche" GAMBIT_11
671    class niche_class
672    with name "southern",
673         counter_niche n141,
674         niche_dir 3;
675
676 Object n124 "eastern niche" GAMBIT_12
677    class niche_class
678    with name "eastern",
679         counter_niche n112,
680         niche_dir 4;
681 Object n123 "southern niche" GAMBIT_12
682    class niche_class
683    with name "southern",
684         counter_niche n151,
685         niche_dir 3;
686 Object n122 "western niche" GAMBIT_12
687    class niche_class
688    with name "western",
689         counter_niche n134,
690         niche_dir 2;
691
692 Object n134 "eastern niche" GAMBIT_13
693    class niche_class
694    with name "eastern",
695         counter_niche n122,
696         niche_dir 4;
697 Object n133 "southern niche" GAMBIT_13
698    class niche_class
699    with name "southern",
700         counter_niche n161,
701         niche_dir 3;
702
703 Object n141 "northern niche" GAMBIT_14
704    class niche_class
705    with name "northern",
706         counter_niche n113,
707         niche_dir 1;
708 Object n142 "western niche" GAMBIT_14
709    class niche_class
710    with name "western",
711         counter_niche n154,
712         niche_dir 2;
713 Object n143 "southern niche" GAMBIT_14
714    class niche_class
715    with name "southern",
716         counter_niche n171,
717         niche_dir 3;
718
719 Object n151 "northern niche" GAMBIT_15
720    class niche_class
721    with name "northern",
722         counter_niche n123,
723         niche_dir 1;
724 Object n154 "eastern niche" GAMBIT_15
725    class niche_class
726    with name "eastern",
727         counter_niche n142,
728         niche_dir 4;
729 Object n152 "western niche" GAMBIT_15
730    class niche_class
731    with name "western",
732         counter_niche n164,
733         niche_dir 2;
734 Object n153 "southern niche" GAMBIT_15
735    class niche_class
736    with name "southern",
737         counter_niche n181,
738         niche_dir 3;
739
740 Object n164 "eastern niche" GAMBIT_16
741    class niche_class
742    with name "eastern",
743         counter_niche n152,
744         niche_dir 4;
745 Object n161 "northern niche" GAMBIT_16
746    class niche_class
747    with name "northern",
748         counter_niche n133,
749         niche_dir 1;
750 Object n163 "southern niche" GAMBIT_16
751    class niche_class
752    with name "southern",
753         counter_niche n191,
754         niche_dir 3;
755
756 Object n171 "northern niche" GAMBIT_17
757    class niche_class
758    with name "northern",
759         counter_niche n143,
760         niche_dir 1;
761 Object n172 "western niche" GAMBIT_17
762    class niche_class
763    with name "western",
764         counter_niche n184,
765         niche_dir 2;
766
767 Object n181 "northern niche" GAMBIT_18
768    class niche_class
769    with name "northern",
770         counter_niche n153,
771         niche_dir 1;
772 Object n182 "western niche" GAMBIT_18
773    class niche_class
774    with name "western",
775         counter_niche n194,
776         niche_dir 2;
777 Object n184 "eastern niche" GAMBIT_18
778    class niche_class
779    with name "eastern",
780         counter_niche n172,
781         niche_dir 4;
782
783 Object n191 "northern niche" GAMBIT_19
784    class niche_class
785    with name "northern",
786         counter_niche n163,
787         niche_dir 1;
788 Object n194 "eastern niche" GAMBIT_19
789    class niche_class
790    with name "eastern",
791         counter_niche n182,
792         niche_dir 4;
793
794 ! (level 1 initial wood beam layout)
795 ! wood beam, as two 'halves'
796 ! (the 'trick' here, is to devise a method of testing for the 
797 ! correct '.number', without having to constantly update
798 ! both halves (which, when separated in niches, is impossible)
799 ! Thus, one half will always have number=99, which indicates
800 ! 'wrong half to test'.  The other half, which is gained by
801 ! checking child(self.counter_niche), has the useful .number
802
803 ! Object e11 "ebony beam" n112 class ebony_beam_class;
804 ! Object e111 "ebony beam" n124 class ebony_beam_class with number 99;
805 Object e12 "ebony beam" n113 class ebony_beam_class;
806 Object e121 "ebony beam" n141 class ebony_beam_class with number 99;
807 Object e13 "ebony beam" n153 class ebony_beam_class;
808 Object e131 "ebony beam" n181 class ebony_beam_class with number 99;
809
810 Object p11 "pine beam" n123 class pine_beam_class;
811 Object p111 "pine beam" n151 class pine_beam_class with number 99;
812 Object p12 "pine beam" n122 class pine_beam_class;
813 Object p121 "pine beam" n134 class pine_beam_class with number 99;
814 Object p13 "pine beam" n133 class pine_beam_class;
815 Object p131 "pine beam" n161 class pine_beam_class with number 99;
816 Object p14 "pine beam" n194 class pine_beam_class;
817 Object p141 "pine beam" n182 class pine_beam_class with number 99;
818 Object p15 "pine beam" n112 class pine_beam_class;
819 Object p151 "pine beam" n124 class pine_beam_class with number 99;
820
821 ! (side note: with balsa beams, 2nd side need not be 99, since 
822 ! it will always break on the first try, and the default number is 0
823 Object b11 "balsa beam" n152 class balsa_beam_class;
824 Object b111 "balsa beam" n164 class balsa_beam_class;
825 Object b12 "balsa beam" n143 class balsa_beam_class;
826 Object b121 "balsa beam" n171 class balsa_beam_class;
827 Object b13 "balsa beam" n163 class balsa_beam_class;
828 Object b131 "balsa beam" n191 class balsa_beam_class;
829 Object b14 "balsa beam" n142 class balsa_beam_class;
830 Object b141 "balsa beam" n154 class balsa_beam_class;
831 Object b15 "balsa beam" n172 class balsa_beam_class;
832 Object b151 "balsa beam" n184 class balsa_beam_class;
833
834                
835 ! (remaining 2 levels in sep. files)
836 Include "gambit2.inf";
837 Include "gambit3.inf";
838  
839
840 ! tricky 'on beam' rooms -- only two for each level
841 ! change description of fake_beam as appropriate
842 Object GAMBIT_W1 "On wood beam"
843    with description "You're walking along a very narrow wood beam that runs \
844 east to west into darkness. Below, you can see the dark \
845 silhouette of a network of beams and floating cubes. Much \
846 farther below you can see a dull red glow.",
847         name "darkness" "network" "silhouette" "cubes" "glow",
848         w_to [; give self ~visited; return WN_TO; ],
849         e_to [; give self ~visited; return ES_TO; ],
850         before [;
851            Jump:
852               "There's barely enough room to walk, much less jump.";
853            Drop:
854               print "Dropping "; DefArt(noun);
855               print " will result in your losing both ";
856               DefArt(noun); 
857               " and probably your balance.";
858         ],
859    has light;
860
861 Object GAMBIT_W2 "On wood beam"
862    with description "You're walking along a very narrow wood beam that runs \
863 north to south into darkness. Below, you can see the dark \
864 silhouette of a network of beams and floating cubes. Much \
865 farther below you can see a dull red glow.",
866         name "darkness" "network" "silhouette" "cubes" "glow",
867         n_to [; give self ~visited; return WN_TO; ],
868         s_to [; give self ~visited; return ES_TO; ],
869         before [;
870            Jump:
871               "There's barely enough room to walk, much less jump.";
872            Drop:
873               print "Dropping "; DefArt(noun);
874               print " will result in your losing both ";
875               DefArt(noun); 
876               " and probably your balance.";
877         ],
878    has light;
879
880 Object GAMBIT_W21 "On wood beam"
881    with description "You're walking along a very narrow wood beam that runs \
882 east to west into darkness. Both above and below, you can see the dark \
883 silhouette of a network of beams and floating cubes. \
884 Farther below you can see a dull red glow.",
885         name "darkness" "network" "silhouette" "cubes" "glow",
886         w_to [; give self ~visited; return WN_TO; ],
887         e_to [; give self ~visited; return ES_TO; ],
888         before [;
889            Jump:
890               "There's barely enough room to walk, much less jump.";
891            Drop:
892               print "Dropping "; DefArt(noun);
893               print " will result in your losing both ";
894               DefArt(noun); 
895               " and probably your balance.";
896         ],
897    has light;
898
899 Object GAMBIT_W22 "On wood beam"
900    with description "You're walking along a very narrow wood beam that runs \
901 north to south into darkness. Both above and below, you can see the dark \
902 silhouette of a network of beams and floating cubes. \
903 Farther below you can see a dull red glow.",
904         name "darkness" "network" "silhouette" "cubes" "glow",
905         n_to [; give self ~visited; return WN_TO; ],
906         s_to [; give self ~visited; return ES_TO; ],
907         before [;
908            Jump:
909               "There's barely enough room to walk, much less jump.";
910            Drop:
911               print "Dropping "; DefArt(noun);
912               print " will result in your losing both ";
913               DefArt(noun); 
914               " and probably your balance.";
915         ],
916    has light;
917
918 Object GAMBIT_W31 "On wood beam"
919    with description [;
920      print "You're walking along a very narrow wood beam that runs \
921 east to west into darkness. Above you can see a network of floating beams \
922 and cubes. Below you can see a red glow";
923      if ((self hasnt general) && (GAMBIT_W32 hasnt general) && 
924          (amulet has worn) && (ES_TO == GAMBIT_37)) {
925         give self general;
926         ".^^Your amulet suddenly gives off a bright flash, then fades!";
927         }
928      else ".";
929 ],
930         name "darkness" "network" "cubes" "glow",
931         w_to [; give self ~visited; return WN_TO; ],
932         e_to [; give self ~visited; return ES_TO; ],
933         before [;
934            Jump:
935               "There's barely enough room to walk, much less jump.";
936            Drop:
937               print "Dropping "; DefArt(noun);
938               print " will result in your losing both ";
939               DefArt(noun); 
940               " and probably your balance.";
941         ],
942    has light;
943
944 Object GAMBIT_W32 "On wood beam"
945    with description [;
946      print "You're walking along a very narrow wood beam that runs \
947 north to south into darkness. Above you can see a network of floating beams \
948 and cubes. Below you can see a red glow.";
949      if ((self hasnt general) && (GAMBIT_W31 hasnt general) && 
950          (amulet has worn) && (ES_TO == GAMBIT_37)) {
951         give self general;
952         ".^^Your amulet suddenly gives off a bright flash, then fades!";
953         }
954      else ".";
955  ],
956         name "darkness" "network" "cubes" "glow",
957         n_to [; give self ~visited; return WN_TO; ],
958         s_to [; give self ~visited; return ES_TO; ],
959         before [;
960            Jump:
961               "There's barely enough room to walk, much less jump.";
962            Drop:
963               print "Dropping "; DefArt(noun);
964               print " will result in your losing both ";
965               DefArt(noun); 
966               " and probably your balance.";
967         ],
968    has light;
969
970 Object fake_beam "wood beam"
971    with name "wood" "beam",
972         description "A long thin wood beam, barely wide enough for \
973         both of your feet.", ! change as appropriate
974         before [;
975            Turn, Search, Rub, LookUnder, Attack, Take, Push, Pull:
976               "You'll have to show me how you intend to do \
977 this, since you're standing on the wood beam.";
978         ],
979         found_in GAMBIT_W1 GAMBIT_W2 GAMBIT_W21 GAMBIT_W22
980                  GAMBIT_W31 GAMBIT_W32,
981    has scenery;
982    
983
984
985 ! -- The Royal Palace, and its strange secret
986
987 Object ARAGAIN_Palace "Palace Entrance Hall"
988    with description "A vast hall runs north and south \
989 in this massive palace. Royal trappings decorate the walls \
990 and ceiling, and red carpet lines the floor. \
991 A tremendous open archway exits to the north into some \
992 courtyard, while two open solid brass doors mark the \
993 entrance south into some audience chamber. Two smaller \
994 exits head east and west towards stairways up and down \
995 respectively.",
996         name "trappings" "carpet" "archway" "courtyard"
997 "brass" "doors",
998         n_to ARAGAIN_Courtyard,
999         s_to Palace_Audience,
1000         e_to Palace_office,
1001         w_to Palace_Westwing,
1002         u_to Palace_office,
1003         d_to Palace_Westwing,
1004    has light;
1005
1006 Object Palace_Audience "Audience Hall"
1007    with description "This is a giant audience hall, equivalent to \
1008 a large auditorium with a throne on the stage. The hall is \
1009 filled with luxurious decorations -- red carpeting, expensive \
1010 chandeliers, sweeping gold-edged drapery. The hall is also \
1011 currently filled with a large number of dignitaries and \
1012 important-looking people taking up all the seats. Open brass \
1013 doors lie to the north.",
1014    name "carpeting" "chandeliers" "drapery" "seats" "brass" "doors",
1015       n_to ARAGAIN_Palace,
1016    has light;
1017    
1018 Nearby audience_people "people"
1019    with name "people" "dignitaries" "diplomats",
1020         description "Just your average throng of official-looking \
1021 people. Interestingly, many of them seem to be smeared \
1022 with flour.",
1023         life [;
1024            default:  "The audience seems to be too busy waiting \
1025 for something interesting to happen.";
1026         ],
1027         before [;
1028 Cast:
1029    if (the_spell_was == foblub_spell)
1030       "You give a marvelous sermon on patience. The audience \
1031 seems glued to their seats, which changes little.";
1032    if (the_spell_was == espnis_spell)
1033       "You give a rather overdone sermon on patience. A few \
1034 people in the back rows drop off to sleep.";
1035         ],
1036    has animate concealed;
1037       
1038 Object throne "throne"
1039    with name "throne",
1040         description "A large throne.",
1041         before [;
1042            Enter: "This is no time to be playing king.";
1043         ],
1044    has scenery enterable;
1045
1046 Object Palace_office "Royal Bedroom"
1047    with description "This might have once been a lavish bedroom \
1048 for royalty. At the moment, it seems like someone has converted \
1049 it into a private lounge of some sort. A stairway heads down.",
1050         name "stairway",
1051         d_to ARAGAIN_Palace,
1052    has light;
1053
1054 Object cab_key "shiny key" Gov_desk2
1055    with name "key" "shiny",
1056         !weight 5, 
1057         size 5,
1058         description "A shiny key.",
1059 ;
1060
1061 Object Palace_cabinet "cabinet" Palace_office
1062    with name "cabinet",
1063         with_key cab_key,
1064         description [;
1065            print "A rather new-looking wooden cabinet";
1066            if (self has general)
1067               ", with a bit of waxy build-up all over it.";
1068            else ".";
1069         ],
1070        when_closed "A wooden cabinet stands against one wall, \
1071 clearly a new addition to the room.",
1072        when_open [ x;
1073          print "The wooden cabinet has been opened. ";
1074          x = children(self);
1075          if (x == 0) "It seems to be empty.";
1076          print "It contains:^";
1077          ! if (x == 1) print "is "; else print "are:^";
1078          x = FULLINV_BIT + INDENT_BIT + NEWLINE_BIT + RECURSE_BIT;
1079          WriteListFrom (child(self), x, 1); 
1080          rtrue;
1081        ],
1082        before [;
1083           Cast: 
1084             if (the_spell_was == egdelp_spell) {
1085                give self general;
1086                "The cabinet is covered in waxy build-up.";
1087             }
1088           Open:
1089             if ((self hasnt locked) && (self hasnt open)) {
1090                print "You give the cabinet a good tug";
1091                if (self hasnt general)
1092                   ", but the \
1093 cabinet doors barely budge. The new-looking wood seems \
1094 to be rather tightly fitted.";
1095                else {
1096                   give self open;
1097                   ". The wax makes the doors open with ease.";  
1098                } 
1099             }
1100        ],
1101        size 25,
1102        capacity 20,
1103    has static container openable lockable locked;
1104    
1105
1106 ! (warped -- true story of the great battle)
1107 Object p6 "warped parchment" Palace_cabinet
1108    class parchment_class,
1109    with name "warped",
1110 description "~...truth. In fact, the truth too terrible to \
1111 believe, but believe it I must, for all the evidence I \
1112 have found indicates that the Ancient Ones went up against \
1113 the evil elementals and lost! With the Rod in hand, they \
1114 were defeated by trickery! The Rod was broken and \
1115 scattered into the world, but can be regained and rejoined \
1116 by any whose heart and spirit are pure! Did the \
1117 Ancient Ones forsake the spheres of...~";
1118
1119
1120 Object Palace_Westwing "Palace Dungeons"
1121    with description "Dark and spooky, the palace dungeons seem \
1122 empty at the moment. The north portion of the room is sectioned-off \
1123 by iron bars that form a makeshift cell.",
1124    n_to [; <<Enter prison_cell>>; ],
1125    u_to ARAGAIN_Palace,
1126    has light;
1127    
1128 Nearby prison_cell "prison cell"
1129    with name "cell" "bars" "iron",
1130        when_open [ x;
1131          print "The cell stands open.";
1132          x = children(self);
1133          if (x == 0) { new_line; rtrue; }
1134          print " Inside you notice:^";
1135          x = FULLINV_BIT + INDENT_BIT + NEWLINE_BIT + RECURSE_BIT;
1136          WriteListFrom (child(self), x, 1); 
1137          rtrue;
1138        ],
1139        when_closed [ x;
1140          print "The cell is closed.";
1141          x = children(self);
1142          if (x == 0) { new_line; rtrue; }
1143          print "  Inside you notice:^";
1144          x = FULLINV_BIT + INDENT_BIT + NEWLINE_BIT + RECURSE_BIT;
1145          WriteListFrom (child(self), x, 1); 
1146          rtrue;
1147        ],
1148         description "A cramped space with a wall of iron bars.",
1149         before [;
1150         Cast:
1151         if (the_spell_was == bekdab_spell) {
1152            print "The bars seem to rust a bit";
1153            if (self has locked) {
1154              give self ~locked;
1155              ". You hear a lock mechanism in the cell door break!";
1156            }
1157            else ".";
1158         }
1159         Go:
1160            if ((noun == s_obj) && (player in prison_cell)) {
1161               <Exit prison_cell>; return 2; }
1162         ],
1163         size 50,
1164    has static container openable transparent enterable;   
1165    
1166
1167 ! *****************
1168 ! Creatures/people
1169 ! *****************
1170
1171 Object Entrance_guardian "Tough-looking Palace guard" ARAGAIN_Entrance
1172    with name "guardian" "guard",
1173         initial "A tough-looking palace guard is standing by the gate.",
1174         description "Typical guard -- big, armed to the teeth, and a \
1175 sour disposition.",
1176         before [;
1177            Cast:
1178               "The guard stops you in mid-chant by blowing a rather \
1179 shrill whistle. ~None of that priest mumbo-jumbo on \
1180 my watch!.~";
1181         ],
1182         react_before [;
1183            Blow:
1184               if (noun==whistle)
1185 "The guard stops you as you are about to blow the whistle. \
1186 ~I blow the whistles around here.~";
1187         ],
1188         life 
1189         [ i ;
1190            Attack, ThrowAt:
1191               "I'd advise against this. He's probably knows 101 \
1192 ways to dismember an opponent. \
1193 Also, he's armed and encased in plate mail.";
1194            Ask:
1195              if ((noun == 'cake' or 'gate') && (self hasnt general))
1196               "~It's pretty simple. Give me a cake, and you get in. \
1197 That's the rules.~";
1198            Show:
1199              if ((noun == Baking_Pan) && (cake in Baking_Pan))
1200                 "~Well, hand it over already.~";
1201            Give:
1202              ! Now for the fun...
1203              if ((noun == Baking_Pan) && (cake notin Baking_Pan))
1204                 "The guard looks at the pan, and hands it back. \
1205 ~I don't see any cake. What are you, a wise guy or something?~";
1206              if ((noun == Baking_Pan) && (cake in Baking_Pan)) {
1207                 move Baking_Pan to Entrance_guardian;
1208                 print "The guard grabs the pan, and, to your \
1209 annoyance, cuts himself a massive slice of cake with his broadsword. \
1210 The guard takes a bite";
1211                 ! 1st, check for strange foreign objects
1212                 objectloop (i in dough) {
1213                    if ((i ~= flour) &&
1214                        (i ~= sugar_cube) &&
1215                        (i ~= baking_powder) &&
1216                        (i ~= corbie_egg) &&
1217                        (i ~= dornberries) &&
1218                        (i ~= butter)) { 
1219                    if (i hasnt edible) {
1220                    print " and you hear a strange \
1221 'crunch'. He removes ", (a) i; " from his teeth. ~What's this?~ the \
1222 guard says, clearly angry. ~I oughta report you to the 'Better \
1223 Bakers Bureau'.~";  ! hopefully, this will break out of objectloop
1224                    }
1225                    else {
1226                    print ", and chews for a bit. \
1227 His eyes widen, and he spits the cake out. ~Hey pal, I taste ", (name) i;
1228 " in this so-called cake of yours! Grues could've done a better job \
1229 than this!~";
1230                    }
1231                    }
1232                 }
1233                 ! 2nd, check overall quality of cake 
1234                 if (cake.number ~= 0) {
1235                    print ", and chews for a bit. \
1236 He frowns. ~Sorry pal, this doesn't pass inspection. ";
1237                    if (cake.number == 1) 
1238                       "It could stand some more cooking.~";
1239                    if (cake.number == 2) 
1240                       "Did ya burn it or something?~";
1241                    if (cake.number == 3) 
1242                       "It'd make an okay pancake, though.~";
1243                    if (cake.number == 4) 
1244                       "It's hard as a rock!~";
1245                 }
1246                 ! finally, check that all proper ingredients are there.
1247                 if ((butter in dough) &&
1248                     (sugar_cube in dough) &&
1249                     (corbie_egg in dough) &&
1250                     (baking_powder in dough) &&
1251                     (dornberries in dough) &&
1252                     (flour in dough)) { 
1253                     ! good cake
1254                     give self general;
1255                     give ARAGAIN_Entrance_gate open ~locked;
1256                     Achieved(4);
1257                     ", and smacks \
1258 his lips. ~Finally, someone who can bake an acceptable cake.~ \
1259 He unlocks and opens the gate. ~You can pass.~";  
1260                 }
1261                 else 
1262                   ", and chews for a bit. He seems displeased. \
1263 ~I don't know where you learned to bake, but there's definitely \
1264 something missing here.~";
1265              }
1266            default:
1267               "The guard is amazingly good at ignoring distractions.";
1268         ],
1269         each_turn [ i;
1270            i = random(25);
1271            if (i == 1)
1272               "^A couple of dignitaries from Gurth push their way to the \
1273 front and present a flat object to the guard. The guard frowns. \
1274 ~A fish cake? I don't think so.~ The dignitaries return to the line.";
1275            if (i==3)
1276               "^The guard paces back and forth.";
1277            if (i==5)
1278               "^A representative from Borphee steps up and presents \
1279 a pile of baked dough-bits on a plate to the guard. ~Frobolli cake, eh? \
1280 Well, this may be popular where you come from, but it ain't popular \
1281 here.~ The representative walks off.";
1282            if (i==7)
1283               "^The guard practices his menacing stares.";
1284            if (i==8)
1285               "^The guard blows his whistle at some people in line.";
1286            if (i==9)
1287               "^An official presents a nice morgia root pie to the \
1288 guard. ~A pie?~ the guard says, clearly exasperated. He points at \
1289 the sign as the official leaves. ~Cakes folks, we're taking C-A-K-E-S.~";
1290            if (i==11)
1291               "^The guard polishes a spot on his armor.";
1292            if (i==13)
1293               "^Some dignitary presents the guard with a strange \
1294 green cake with the words ~EAT ME~ written in frosting. The guard smiles, \
1295 cuts himself a piece, and suddenly stuffs it into the dignitary's mouth! \
1296 ~You boys are going to have to do better than that,~ he says to the 
1297 now tiny dignitary, who stalks off.";
1298            if (i==15)
1299               "^The guard hums a military dirge to himself."; 
1300         ],
1301 has animate;
1302
1303 ! -- The evil magistrate
1304 Object Magistrate "magistrate" Palace_Audience
1305     with name "magistrate",
1306          initial "There is a royal magistrate here.",
1307          description "A rather nasty-looking thin tall fellow with an \
1308 evil grin.",
1309          number 1,
1310          life [;
1311             Attack, ThrowAt:
1312                magroutine1(1); rtrue;
1313             Show:
1314                if (noun==Gov_ledger && Sydney notin Palace_Audience) {
1315                   move Sydney to Palace_Audience;
1316                   remove Gov_ledger;
1317                   "The Magistrate grabs the ledger and \
1318 frowns as he reads it. ~Fine, you want a presentation?~ He grabs a \
1319 young boy who was hiding behind \
1320 the throne and shoves him forward. ~Presenting his royal \
1321 Highness, King Sydney Flathead, lost heir to the Flathead monarchy!~ \
1322 The crowd reaction is somewhat mixed. ~Well, his head does look \
1323 flat,~ you hear one person say.";
1324                }
1325                if (noun==cab_key) {
1326                   move cab_key to self;
1327                   "The magistrate moves with surprising speed and \
1328 takes the key. ~I was looking for that!~ he says.";
1329                }
1330                else "~Oh, very interesting.~ he says with heavy \
1331 sarcasm.";            
1332             Give:
1333                if (noun==Gov_ledger && Sydney notin Palace_Audience) {
1334                   <<Show Gov_ledger Magistrate>>;
1335                }
1336                if (noun==cab_key) {
1337                   move cab_key to self;
1338                   "The magistrate takes the key. \
1339 ~I was looking for that!~ he says.";
1340                }
1341                else "~I have no need for that!~ he says with a sneer.";
1342             default: "The magistrate pays you absolutely no attention.";
1343          ],
1344          react_before [;
1345             Cast:
1346                if (the_spell_was ~= ledak_spell) {
1347                magroutine1(2); rtrue; 
1348                }
1349          ], 
1350          each_turn [ i ;
1351          i = random(20);
1352              if (Sydney in Palace_Audience) {
1353                 if (i==1)
1354                    "^A diplomat approaches the little boy with a \
1355                    document. The Magistrate steps forward and \
1356                    stops him. ~Sydney is much too busy to bother \
1357                    with that.~ the Magistrate says.";
1358              }
1359              else {
1360                 if (i==5)
1361                    "^An impatient diplomat shouts out, \
1362                    ~Bring out the King!~ The Magistrate smiles \
1363                    and says, ~Did anyone make a petition for \
1364                    a royal presentation?~ The crowd is silent. \
1365                    ~I didn't think so.~";
1366              }
1367          ],
1368  has animate;
1369
1370 ! (a short code-space saving routine)
1371 [ magroutine1 
1372    w 
1373   ;
1374
1375   ! remove player's possessions
1376   while (child(player) ~= 0) {
1377      give child(player) ~worn;
1378      move child(player) to Palace_office;
1379   }
1380   if (w == 1)
1381      print "You move quickly, but from nowhere, two royal palace \
1382 guards appear and wrestle you to the ground. ~Lock this \
1383 fanatic up!~ ";
1384   if (w == 2) 
1385      print "You start to chant, but the magistrate has sharp \
1386 ears, and recognizes your magic! With a quick signal, \
1387 two royal palace guards appear and wrestle you to the ground. \
1388 ~Lock this babbler up!~ ";
1389 print "the Magistrate says with a sneer. The guards \
1390 strip you of your possessions and drag you down to the royal \
1391 dungeons.^";
1392    PlayerTo(prison_cell);
1393    give prison_cell ~open locked;
1394    rtrue;
1395 ];
1396
1397
1398
1399 Object Sydney "young child" 
1400   with name "child" "boy" "sydney",
1401        ! describe "There is a young boy here",
1402        description [;
1403           print "A little boy dressed in uncomfortable-looking frilly clothes";
1404           if (flat_hat in self)
1405              ". He's wearing a small red hat."; 
1406           else ".";
1407        ],
1408        before [;
1409           Cast:
1410              if (the_spell_was == foblub_spell or espnis_spell)
1411 "The boy seems to miss the subtle nuances of your sermon. All \
1412 that happens is that now he seems even more nervous than before.";
1413        ],
1414        life
1415        [;
1416           Ask, Tell:
1417              if (self has general)
1418                 "Young Sydney Flathead only tucks his head lower and whimpers.";
1419              else
1420              "Young Sydney Flathead only shrugs.";
1421           Answer:
1422              if (special_word=='hello' or 'hi') {
1423                 if (self hasnt general)
1424                  "Young Sydney Flathead doesn't respond -- he seems \
1425 to find you a bit frightening.";
1426                 else  
1427                  "~Hello,~ the young lad says, somewhat shyly.";
1428              }
1429              "Young Sydney Flathead only stares at you.";
1430           Attack, ThrowAt: 
1431   give self ~general;
1432   deadflag = 1;
1433   "The young boy screams in terror as you move to threaten him \
1434   (shame on you!). Several guards appear out of nowhere, and club \
1435   you to death for attempting regicide.";
1436           Give:
1437              if (noun==stuffed_toy) {
1438                 give self general;
1439                 move stuffed_toy to self;
1440                 "Tentatively, the boy takes the stuffed toy. You \
1441 catch the glimpse of a sad smile as he holds it tightly.";
1442              }
1443              "Young Sydney cowers and shakes his head.";
1444           Order:
1445              if (action==##Give) {
1446                 if (noun==flat_hat) {
1447                    if (self has general) {
1448                       remove Magistrate;
1449                       remove self;
1450                       move flat_hat to player;
1451                       move brown_sphere to player;
1452                       "Little Sydney smiles and removes the hat and \
1453 hands it to you. You notice his head is actually round, and the hat \
1454 was cleverly hiding this.^^\
1455 ~He's no Flathead!~ someone in the audience hall yells out. A distinct \
1456 murmur of discontent rises from the crowd. The Magistrate slowly \
1457 backs away. ~Wait! I can explain!~ the Magistrate \
1458 starts, but soon runs screaming out of the hall, with several angry diplomats \
1459 hot on his heels!^^\
1460 ~Thank you, kind sir,~ someone behind you says. You turn around. \
1461 Little Sydney is happily in the arms of a kindly-looking couple. The woman \
1462 continues. ~Our son was kidnaped, a little while ago. We've \
1463 been waiting here, hoping to get him back. You did a very brave thing.~ \
1464 The man steps forward holding some small object. \
1465 ~A priest fellow, such as yourself, told me a long time \
1466 ago that one day, someone would help us in our time of need, and that \
1467 I should give him this.~ He gives you a strange round object. \
1468 ~It's the least we can do.~ he says. The couple leaves the hall, \
1469 with the little boy laughing in their arms."; 
1470                    }
1471                    else "Little Sydney shrinks back and holds on to his \
1472 hat. He stares at you fearfully.";
1473                 }
1474                 "Little Sydney shrinks back and stares at you fearfully.";
1475              }
1476              "Sydney shakes his head fretfully.";
1477        ],
1478   has animate transparent;
1479
1480
1481
1482 ! *****************
1483 ! scrolls/spells
1484 ! *****************
1485
1486 Object crumpled_scroll "crumpled scroll" Palace_cabinet
1487   class scroll_class,
1488   with name "crumpled",
1489 ;
1490
1491 Object ledak_spell "detect forgery" crumpled_scroll
1492   class spell_class,
1493   with name "ledak",
1494        magic [;
1495             if ((location==Palace_Audience) &&
1496                 (Sydney in Palace_Audience) &&
1497                 ((second == 0) || (second == Sydney))) {
1498 "You notice a soft yellow glow around the young boy. \
1499 The glow fades."; 
1500             }
1501             if (second==0)
1502                "The place appears to be free of forgeries, at the \
1503 moment.";
1504             else {
1505                if (second==player) "You appear to be the geniune thing.";
1506                CDefArt(second);
1507                " appears to be the genuine thing.";
1508             }
1509        ],
1510 ;
1511
1512 ! ****************
1513 ! Misc objects
1514 ! ****************
1515
1516 Object flat_hat "red hat" Sydney
1517    with name "hat" "red",
1518         description "A little red hat with no brim. It's unusually \
1519 flat at the top.",
1520         before [;
1521           Wear:
1522             "It's too small for your head.";
1523         ],
1524         size 10,
1525    has clothing;
1526
1527 Object brown_sphere "brown sphere"
1528    class sphere_class,
1529    with name "brown",
1530         description "A tiny perfect brown sphere, made of some strange \
1531 unknown metal.",
1532 ;
1533
1534 ! THIEF'S magic door
1535 ! Contains an unusual amount of properties...
1536 Object magic_door "strange door"
1537    with name "door" "strange",
1538         !weight 20,
1539         size 30,
1540         description [;
1541            print "A small door labeled ~STAIRS~, of all \
1542 things";
1543            if (self hasnt static)
1544               ". Oddest of all is the fact that it isn't \
1545 attached to anything!";
1546            else ".";
1547         ],
1548         door_dir [;
1549            if (self has static) {
1550               if (location == Skyscraper) return e_to;
1551               else return w_to;
1552            }
1553         ],
1554         door_to [;
1555            if (self has static) {
1556               if (location == Skyscraper) return THIEF_Bottom_of_staircase;
1557               else return Skyscraper;
1558            }
1559         ],
1560         found_in [;
1561            if (self has static) {
1562               if (location == Skyscraper or THIEF_Bottom_of_staircase)
1563                  rtrue;
1564               else rfalse; 
1565            }
1566            ! else rtrue????
1567         ],
1568         describe [;
1569            ! we force a describe routine here, rather than use
1570            ! when_open/closed due to the results that happen
1571            ! after an obj has been moved (which the door will be).
1572            if (self hasnt static)
1573               "^There's an unattached door lying on the ground here.";
1574            else {
1575               if (self has open) {
1576               print "^There's an open door to the";
1577               if (location == Skyscraper) 
1578                  " east.";
1579               else 
1580                  " west.";
1581               }
1582               else {
1583               print "^There's a closed door";
1584               if (location == Skyscraper) 
1585                  " in the eastern wall.";
1586               else 
1587                  " to the west.";
1588               }
1589            }
1590         ],
1591         time_left 0,
1592         time_out [;
1593            ! after timeout -- Thief locks the door
1594            give self ~open locked;
1595            if ((location == THIEF_Bottom_of_staircase) ||
1596                (location == THIEF_Ent) ||
1597                (location == THIEF_Foyer) ||
1598                (location == THIEF_Lounge) ||
1599                (location == THIEF_Storeroom)) {
1600                print "^Suddenly, out of the shadows springs a \
1601 gentleman dressed in black! ~How did you get in here!~ he \
1602 cries. Quicker than lightning, he envelopes you in his dark \
1603 cape, which seems to fade into shadows, leaving you in...^";
1604                PlayerTo(Skyscraper);
1605                rtrue;
1606            }
1607            if (location == Skyscraper)
1608               "^Out of the shadows, a gentleman dressed in \
1609 black appears! He sees the door to the east and seems \
1610 somewhat annoyed. ~Much too busy for unexpected guests,~ \
1611 you hear him say as he slips through the door and closes \
1612 it behind him. Moments later you hear the sound of a lock \
1613 closing on the other side.^"; 
1614         ],
1615         before [;
1616            Enter:
1617               if (self has static) {
1618                  if (location == Skyscraper) <<Go e_obj>>;
1619                  else <<Go w_obj>>;
1620               }
1621               else
1622                 "Since the door doesn't currently lead anywhere, \
1623 entering it seems pointless.";
1624            Open:
1625              if (self hasnt static)
1626                 "The door opens onto...thin air. Without a \
1627 doorway to attach to, it's not terribly useful, it appears.";
1628              if ((self has static) && (self hasnt open) &&
1629                  (self hasnt general)) {
1630                  give self general;
1631                  give self open;
1632                  StartTimer(magic_door,15);
1633                 "The door opens. There's a dark chamber \
1634 on the other side, which seems all but impossible, given \
1635 that the wall previously appeared solid!";     
1636              } 
1637            Close:
1638              if (self hasnt static)
1639                 "You close the door, which at this moment \
1640 means you turn the movable door to a new angle. Without a \
1641 doorway to attach to, it's not terribly useful, it seems.";
1642            Drop:
1643              if (location == Skyscraper) {
1644                 move self to Skyscraper;
1645                 give self static;
1646                 Skyscraper.e_to = magic_door;
1647                 THIEF_Bottom_of_staircase.w_to = magic_door;
1648                 "As you drop the door, it leaps off the ground \
1649 and flies towards the eastern wall! Amazingly, it seems to \
1650 attach itself to the eastern wall!";
1651              }
1652         ],
1653   has door openable;
1654
1655