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