Implement per-file license notices
[spiritwrak.git] / src / borphee.inf
1
2 ! *************************************************************
3 ! BORPHEE.INF -- add-on for SPIRITWRAK
4 !
5 ! SPIRITWRAK is free software; you can redistribute it and/or modify
6 ! it under the terms of the GNU General Public License as published by
7 ! the Free Software Foundation; either version 3 of the License, or
8 ! (at your option) any later version.
9 !
10 ! SPIRITWRAK is distributed in the hope that it will be useful, but
11 ! WITHOUT ANY WARRANTY; without even the implied warranty of
12 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 ! General Public License for more details.
14 !
15 ! You should have received a copy of the GNU General Public License
16 ! along with SPIRITWRAK. If not, see <https://www.gnu.org/licenses/>.
17 ! *************************************************************
18
19 ! (Single global variable to store progress of 'Trophy room puzzle'
20 global trophy_stage = 0;  ! equals 'stage' completed, up to 4(th)
21
22 Object BORPHEE_GUSStop "Downtown New Borphee"
23    with description "You're right in the middle of downtown \
24 New Borphee -- perhaps the busiest, most crowded \
25 city you've ever seen. Huge brand-new buildings \
26 and throngs of fast-moving people make the whole \
27 scene somewhat surreal. The streets head north to \
28 a business district, while a set of stairs here leads \ 
29 down.",
30         name "buildings" "throngs" "crowd" "people" "streets" "district"
31 "stairs",
32         n_to BORPHEE_BD,
33         d_to BORPHEE_GUSStation,
34         cant_go "You walk around downtown a bit, are appalled by the \
35              sights, and hastily return here.",
36      !   w_to "You walk around downtown a bit, are disturbed by the \
37      !        sights, and hastily return here.",
38    has light;
39
40 Object BORPHEE_BD "Business District"
41    with description "You're in a crowded business district filled \
42 with busy people. The city thins out a bit to the north, \
43 while city streets head west and south. Directly to the east is a \
44 building so tall it makes you dizzy just looking at it.",
45         name "building" "crowd" "streets" "people",
46         s_to BORPHEE_GUSStop,
47         n_to BORPHEE_burbs,
48         w_to BORPHEE_CS,
49         e_to Skyscraper,
50         each_turn [;
51            if (self hasnt general) {
52               give self general;
53               move flour_scroll to BORPHEE_BD;
54               "^A number of people rudely brush past you and \
55 accidentally knock you down. A kindly old lady helps you \
56 to your feet. ~I think you dropped that,~ she says, pointing \
57 to a paper object nearby that doesn't seem familiar. She \
58 walks off, and is soon lost in the crowd.";
59            }
60         ],
61    has light;
62
63 Object BORPHEE_CS "City Streets"
64    with description "You're on some busy side street in New Borphee. \
65 There's a crowded walk back east. To the north is the \
66 entrance to some sort of open area, with a large open arch.",
67         name "street" "walk" "area",
68         e_to BORPHEE_BD,
69         n_to GUE_Gate,
70    has light;
71
72 Nearby fake_arch "arch"
73    with name "open" "arch",
74         description "A large metal and stone arch. You'll have \
75 to get closer to see anything more.",
76    has scenery;
77
78 Object Skyscraper "Inside Skyscraper"
79    with description "You're inside a gigantic \
80 skyscraper. The marble and brass fixtures and trim \
81 exude professionalism. There's a small open chamber \
82 to the north. City streets are to the west.",
83         name "marble" "brass" "fixtures" "trim" "skyscraper"
84 "streets" "chamber",
85         w_to BORPHEE_BD,
86         e_to "You can't go that way.",   ! but later...
87         n_to Elevator,
88         before [;
89             Go:
90                 if (noun == n_obj)
91                   print "As you enter the small chamber, metal \
92                        doors suddenly spring forward and close \
93                        behind you!^";
94         ],
95    has light;
96
97 Object ss_sign "sign" Skyscraper
98    with initial "There is a large sign posted near the small chamber.",
99         name "sign",
100         description [;
101            print "The sign reads:^^\
102 ~ELEVATOR UNDER CONSTRUCTION^PLEASE USE STAIRS.";
103            if ((self hasnt general) && (magic_door notin Skyscraper)) {
104               give self general;
105            "~^^Oddly, there don't seem to be any stairs."; 
106            }
107            else "~"; 
108         ],
109    has static;
110
111 Object Elevator "Inside Elevator"
112    with description "You are inside a cramped metal room, with \
113 featureless walls. There are no obvious exits.",
114         s_to "The doors seem to be closed tight.",
115         each_turn [;
116            if (random(20) == 1) {
117               print "^Suddenly, the doors spring open! You \
118 dive out.";
119               PlayerTo(SkyScraper);
120               rtrue;
121            }
122         ],
123 ;   
124
125 Object elevator_sign "sign" Elevator
126    with name "sign",
127         initial "There's a small paper sign attached to a wall.",
128         description "~Shep:^^Put the elevator buttons _here_.^^-T~",
129    has static;
130
131 ! (Not real doors, of course)
132 !Object elevator_doors "doors" Elevator
133 !   with name "doors" "door",
134 !        description "Solid-looking metal sliding doors.",
135 !        before [;
136 !            Push, Pull, Open: 
137 !              "Try as you might, the doors are shut fast.";
138 !            Close:
139 !              "They appear to already be closed.";
140 !        ],
141 !   has scenery;
142  
143 Object BORPHEE_burbs "Suburbs"
144    with description "A suburb starts here, in contrast to the start \
145 of a big downtown to the south. For a residential area, \
146 it's surprisingly crowded. A main street runs \
147 north-south here.",
148         name "suburb" "downtown" "street",
149         n_to BORPHEE_Outskirts,
150         s_to BORPHEE_BD,
151    has light;
152
153 Object BORPHEE_Outskirts "Outskirts"
154    with description "New Borphee stops here, although it probably \
155 won't for long. A rough trail leads off into some \
156 woods to the northwest, or you can enter the city to \
157 the south.",
158         name "trail" "woods" "city",
159         s_to BORPHEE_burbs,
160         nw_to BORPHEE_forest,
161         ne_to "Accardi-By-The-Sea is closed to visitors these days.",
162    has light;
163
164 Object BORPHEE_forest "Forest"
165    with description "Deep forest surrounds you. A rough trail runs \
166 north and southeast.",
167         name "forest" "trail",
168         se_to BORPHEE_Outskirts,
169         n_to Over_river,
170    has light;
171
172 Object Over_river "Over River"
173    with description "You're on a nice new bridge crossing some \
174 large river below. Trails lead north and south into \
175 woods.",
176         name "bridge" "trails" "woods",
177         n_to Forest_trail,
178         s_to BORPHEE_forest,
179         before [;
180           Jump:  "Bridge-jumping carries a stiff fine around here.";
181         ],
182    has light;
183
184 Object c5 "coin" Over_river class coin_class;
185
186 Object Phee_river "river" Over_river
187    with name "river" "Phee",
188         description "Just a large east-west river.",
189         before [;
190            Receive:
191              remove noun;
192              print "You drop "; DefArt(noun); " into the river and \
193                     watch it disappear.";
194            Search, LetGo, Rub, Take, Push, Pull, Touch, Squeeze, Turn, Shake:
195 "The river is far below the bridge.";
196         ],
197    has scenery container;
198
199 Object Forest_trail "Forest Trail"
200    with description "A beaten trail cuts through some very dense \
201 forest running north and south.",
202    name "trail" "forest",
203       s_to Over_river,
204       n_to Ravine_pass,
205   has light;
206   
207 Object Ravine_pass "Ravine Pass"
208    with description "A forest ravine opens into some sort of clearing \
209 to the north here, or a trail heads south.",
210    name "ravine" "forest" "clearing" "trail",
211       s_to Forest_trail,
212       n_to [;
213         if (army in self)
214            "The group of soldiers won't let you pass.";
215         else return Forest_clearing;
216       ],
217    has light;
218    
219 Nearby army "group of soldiers"
220    with name "group" "soldiers" "army",
221         description "A group of well-armed soldiers, who look a little \
222         haggard.",
223         life [;
224            Attack: "Forget it.";
225            default: "The soldiers are a little too weary to pay you any \
226 direct attention at the moment.";
227         ],
228    has animate;
229
230 ! (A rather mangled version of the Byzantine Generals Problem)
231 ! (actually, completely different -- i.e., the BGP is unsolvable
232 !  with three armies...)
233
234 Object wicker_cage "wicker cage" Ravine_pass
235    with name "cage" "wicker",
236         description "A wicker cage, with two compartments, and a lever \
237 attached to the front.",
238         capacity 3,
239         size 20,
240         before [;
241           Open: 
242             "You can't seem to pry open the cage door by hand.";
243         ],
244         add_to_scope cage_lever,
245    has static container transparent;
246
247 Object cage_lever "lever"
248    with name "lever",
249         description "A wooden lever attached to the cage.",
250         before [;
251            Pull:
252              if (Morgan in Delbins)
253                 "A soldier slaps your hand away. ~That windcat \
254                 messenger box belongs to our Captain, \
255                 Morgan Grueslayer, so don't mess with it!~";
256              if (Morgan notin Ravine_pass)
257                 "You pull the lever and watch the cage door \
258                 momentarily open, then shut.";  
259              if ((children(E_windcat) == 0) || (children(W_windcat) == 0))
260                 "Morgan stops you and points at the windcats. ~An \
261 instruction must be sent with both of the cats, using the signal flags!~";
262              print "Morgan stops your hand, just as you are about to \
263 pull the lever. She looks at the cats. \
264 ~Are you quite sure, Priest?~^^\
265 Now, that seems like a reasonable question. So, are you?  ";
266                  if (YesOrNo() == 0) "You pause, to reconsider.";
267                  else {
268                     remove E_windcat;
269                     remove W_windcat;
270                     remove army;
271                     remove Morgan;  
272                     print "You nod and yank the lever. The cage door \
273  latch is loosened enough for both windcats to break free! The \
274  spotted windcat tears off to the west, and the speckled cat \
275  zips off to the east!^^There is a somewhat stressful pause.^^";
276                   ! simply put, the flags must both be red
277                   if (((rf1 in E_windcat) && (rf2 in W_windcat)) ||
278                       ((rf2 in E_windcat) && (rf1 in W_windcat))) {
279                       Achieved(13);
280  "Simultaneously, from the east and west, a three horn signal sounds! \
281  Morgan smiles triumphantly. ~A truce has been declared! The \
282  war has ended!~ The army soldiers yell a round of ~Three cheers!~ \
283  before heading off. Morgan shakes your hand \
284  with almost enough force to break it. ~Well done indeed, Priest. \
285  Your wisdom only compliments your tranquil nature.~ She walks off, \
286  seeking the next challenge."; 
287                  }   
288                  else {
289                     move battle to Forest_clearing;
290  "Suddenly, from somewhere, a single horn note sounds! The sounds \
291  of a fight to the north are soon heard. Morgan \
292  gives you a sad, tired look. ~Perhaps it was meant to be,~ she \
293  says, as she and the army quickly march north to join their \
294  comrades.";
295                  }
296               }
297         ],
298    has static;
299
300
301 Object rf1 "red flag" Ravine_pass
302    class flag_class,
303    with name "red",
304         plural "red flags",
305         description "A red square of cloth.";
306 Object rf2 "red flag" Ravine_pass
307    class flag_class,
308    with name "red",
309         plural "red flags",
310         description "A red square of cloth.";
311 Object bf1 "blue flag" Ravine_pass
312    class flag_class,
313    with name "blue",
314         plural "blue flags",
315         description "A blue square of cloth.";
316 Object bf2 "blue flag" Ravine_pass
317    class flag_class,
318    with name "blue",
319         plural "blue flags",
320         description "A blue square of cloth.";
321
322 Object E_windcat "speckled windcat" wicker_cage
323    with name "windcat" "cat" "speckled",
324         description "A sleek, speckled salt-and-pepper windcat, with \
325 large paws.",
326         capacity 1,
327                   before [;
328                      Take:
329                         "The windcat hisses and struggles until you desist.";
330                      Receive:
331                        if (noun hasnt is_flag)
332                           "I don't think the windcat would appreciate that.";
333         Push, Pull, Attack, Squeeze, Turn:
334                           "I don't think the windcat would appreciate that.";
335         Rub, Touch:  "The windcat purrs.";
336                   ],
337    has supporter;                
338         
339 Object W_windcat "spotted windcat" wicker_cage
340    with name "windcat" "cat" "spotted",
341         description "A sleek, spotted black-and-white windcat, with \
342 large paws.",
343         capacity 1,
344                   before [;
345                      Take:
346                         "The windcat hisses and struggles until you desist.";
347                      Receive:
348                        if (noun hasnt is_flag)
349                           "I don't think the windcat would appreciate that.";
350         Push, Pull, Attack, Squeeze, Turn:
351                           "I don't think the windcat would appreciate that.";
352         Rub, Touch:  "The windcat purrs.";
353                   ],
354    has supporter;                
355    
356 Object Forest_clearing "Forest Clearing"
357    with description "A open clearing is surrounded by forest trees here. \
358 A ravine pass is to the south, and a short trail heads northwest. \
359 You can just see a small cave opening to the northeast.",
360    name "clearing" "forest" "trees" "ravine" "pass" "trail" "cave",
361    s_to Ravine_pass,
362    nw_to [;
363       if (battle in self)
364          "You're not getting past that bloody battle (intact).";
365       else return Forest_brambles;
366    ],
367    ne_to [;
368      if (battle in self)
369         "You're not getting past that bloody battle (intact).";
370      else return Forest_cave;
371    ],
372    has light;
373    
374 Object battle "bloody battle"
375    with name "battle" "war" "warriors",
376         initial "There's a violent battle taking place in the middle \
377 of the field.",
378         description "It's a fierce battle. Kobolds and soldiers are locked \
379 in mortal combat. Getting too close would be certain death.",
380         life [;
381            Attack:  
382               deadflag = 1;
383            "You give a yell and plunge into the battle, and get \
384 skewered by a kobold arrow moments later.";
385 default: "At the moment, everyone seems rather occupied.";
386         ],
387    has animate;
388    
389 Object Forest_brambles "Forest Brambles"
390    with description "There's a small area of forest surrounded by \
391 brambles and shrubs here. A trail leads southeast.",
392    name "forest" "brambles" "shrubs" "trail",
393    se_to Forest_clearing,
394    has light;
395    
396 Object Forest_cave "In front of cave"
397    with description "A small cave mouth enters into darkness to the \
398 north here. A clearing lies to the southwest.",
399    name "cave" "mouth" "darkness" "clearing",
400    sw_to Forest_clearing,
401    n_to CAVE_NSTUNNEL,
402    has light;
403    
404 Object CAVE_NSTUNNEL "North-South Tunnel"
405    with description "You're in a natural cave tunnel running north and \
406 south. To the south you can see a glimmer of daylight.",
407    name "glimmer" "daylight" "tunnel",
408    s_to Forest_cave,
409    n_to CAVE_INTER,
410    ;
411    
412 Object CAVE_INTER "Tunnel Intersection"
413    with description "Several natural cave tunnels intersect here, \
414 running north, south, and east.",
415    name "tunnel" "tunnels",
416    s_to CAVE_NSTUNNEL,
417    n_to CAVE_CURVE,
418    e_to CAVE_NCREVASSE,
419    ;
420    
421 !Object CAVE_BARE "Bare Cavern",
422 !   with description "A bare cavern.  The exit is east.",
423 !   e_to CAVE_INTER,
424 !   ;
425    
426 Object CAVE_CURVE "Twisting Tunnel",
427    with description "A natural cave tunnel makes short twists and \
428 turns here, running south and east.",
429    name "tunnel" "twists" "turns",
430    s_to CAVE_INTER,
431    e_to CAVE_DAMP,
432    ;
433    
434 Object CAVE_DAMP "Damp Cave"
435    with description "You're in a small cave with noticeably damp walls. \
436 Exits lie to the west and south.",
437    name "cave" "damp",
438    w_to CAVE_CURVE,
439    s_to CAVE_NCREVASSE,
440    ;
441    
442 Object CAVE_NCREVASSE "Sloping Tunnel"
443    with description "You're in a windy tunnel that gradually slopes up to the \
444 east, or down to the west. A cold breeze blows from a tunnel to the north.",
445    name "tunnel" "breeze",
446    w_to CAVE_INTER,
447    n_to CAVE_DAMP,
448    e_to CAVE_WINDY,
449    d_to CAVE_INTER,
450    u_to CAVE_WINDY,
451    ;
452             
453 Object CAVE_WINDY "Windy Tunnel"
454    with description "A strange wind seems to howl through this \
455 winding tunnel heading east and west. A crack in the tunnel \
456 wall exposes an exit north.",
457    name "wind" "tunnel" "crack",
458    w_to CAVE_NCREVASSE,
459    e_to CAVE_BARE2,
460    n_to Ancient_Tunnel,
461    before [;
462       Listen: "A light wind howls through this tunnel.";
463    ],
464    ;
465
466 Object CAVE_BARE2 "Bare Cavern",
467    with description "A bare cavern. The exit is west.",
468    w_to CAVE_WINDY,
469    ;
470    
471 ! (torn -- planes are reachable)
472 Object p4 "torn parchment" CAVE_BARE2
473    class parchment_class,
474    with name "torn",
475 description "~...places no mortal man should go, \
476 There are planes of existence far beyond our own, that \
477 connect and interlace, so that even mortal man may \
478 tread upon the featureless gray of <smudge>. But, \
479 I believe that there may be other planes, perhaps \
480 where the Implementors are said to live. Are these \
481 places just parts of existing planes or planes unto \
482 themselves? I do not...~";
483
484 Object Ancient_Tunnel "Ancient Hallway"
485    with description "You're in a stone hallway, clearly man-made. \
486 The dust and musty smell indicate the place hasn't \
487 been used in quite some time. The corridor runs north, while the \
488 south wall has a large crack, creating a dark opening.",
489    name "dust" "hallway" "crack" "opening",
490    s_to CAVE_WINDY,
491    n_to End_of_hall,
492    before [;
493       Smell: "The air smells a bit musty and stale.";
494    ],
495    ;
496    
497 Object End_of_hall "End of Hallway"
498    with description "You're at the north end of a long stone hallway. \
499 You can follow the hallway back south, or you can take a set of \
500 cracked stone stairs up.",
501    name "hallway" "stairs",
502    s_to Ancient_Tunnel,
503    u_to Domed_chamber,
504    ;
505    
506 Object Domed_chamber "Domed Chamber"
507    with description [;
508    print "You are in a large man-made underground chamber, with a \
509 perfectly domed high ceiling. Smooth stone archways lead to rooms to the \
510 north, south, east and west. Stone cut steps lead down. In the very \
511 center of the ceiling you notice a strange circular depression in \
512 the stone";
513    if ((self hasnt general) && (amulet has worn)) {
514       give self general;
515       ".^^Your amulet suddenly gives off a flash of purple light, then fades!";
516    }
517    else ".";
518    ],
519    name "dome" "archways" "steps" "ceiling",
520    d_to End_of_hall,
521    n_to TROPHY_N,
522    e_to TROPHY_E,
523    s_to TROPHY_S,
524    w_to TROPHY_W,
525    u_to "The ceiling is too far above you.";
526    
527 Nearby fake_depression "depression"
528    with name "depression" "circle" "hole",
529         description "It looks like a slightly recessed circular depression \
530 in the ceiling. It's hard to tell from here if it was something cut out of \
531 the stone, or perhaps it's a separate piece.",
532    has scenery;
533
534 ! (Player can only get here in end game, and probably doesn't want to be here either)
535 Object TROPHY_SECRET "Secret Trophy Room"
536    with description "You're in a small domed stone room. The only exit, \
537 unfortunately, is a hole in the stone floor to a floor of another chamber \
538 far below. Engraved in the wall is: ~LORD DUNCANTHRAX'S PRIVATE TROPHY \
539 ROOM~.",
540    number 0,
541    name "hole",
542    each_turn [;
543       if (TROPHY_SECRET.number == 0) {
544          TROPHY_SECRET.number = 1;
545          TROPHY_SECRET.description = "You're in a small domed stone room. \
546 There appear to be no exits -- the hole in the floor appears to have been \
547 sealed with stone. Engraved in \
548 the wall is: ~LORD DUNCANTHRAX'S PRIVATE TROPHY ROOM~.";
549          give self ~light ~visited;
550          "^Lord Duncanthrax and some of his soldiers are here.^^\
551 Duncanthrax looks up and sees you. ~Who is that?~ he asks. ~Looks like a \
552 priest,~ a soldier says. ~Wonderful. First, the black paint, and now, \
553 a priest breaks into my trophy room.~ He sighs. ~Will no one rid me of \
554 this meddlesome priest?~ One of the soldiers takes the hint and knocks \
555 you out cold.^^You awake a short time later.";
556       }      
557       else {   
558       deadflag = 1;
559       "^You soon run out of air in the sealed stone room.";
560       }
561    ],
562 has light;
563    
564 Object TROPHY_N "North Trophy Room"
565    with description "This is a bare cubical stone chamber. Some worn black \
566 lettering on the wall reads: ~THE EAST CHAMBER IS NOT THE FIRST TROPHY \
567 ROOM~. An archway exits south.",
568    name "archway" "stone",
569    s_to Domed_chamber,
570 ;
571
572 Object TROPHY_E "East Trophy Room"
573    with description "This is a bare cubical stone chamber. Some worn black \
574 lettering on the wall reads: ~THE NORTH CHAMBER HAS SILVER LETTERING~. \
575 An archway exits west.",
576    name "archway" "stone",
577    w_to Domed_chamber,
578 ;
579 ! sigh: logic bug in rel 1.  Try the following stmt below instead.  Note
580 ! that two solutions are possible in this case...
581 ! on the wall reads: ~THE NORTH CHAMBER HAS GOLD LETTERING AND THE SOUTH \
582 ! CHAMBER IS THE SECOND TROPHY ROOM~.  \
583
584 Object TROPHY_S "South Trophy Room"
585    with description "This is a bare cubical stone chamber. Some worn black \
586 lettering on the wall reads: ~THE EAST CHAMBER HAS SILVER LETTERING AND \
587 I HAVE GOLD LETTERING~. An archway exits north.",
588    name "archway" "stone",
589    n_to Domed_chamber,
590 ;
591
592 Object TROPHY_W "West Trophy Room"
593    with description "This is a bare cubical stone chamber. Some worn black \
594 lettering on the wall reads: ~EITHER I AM THE SECOND TROPHY ROOM AND THE \
595 NORTH CHAMBER IS THE LAST TROPHY ROOM, OR I HAVE GOLD LETTERING~. \
596 An archway exits east.",
597    name "archway" "stone",
598    e_to Domed_chamber,
599 ;
600
601 Object lettering "lettering"
602    with name "lettering" "black" "writing",
603         description [; <Look>; ],
604         found_in TROPHY_N TROPHY_E TROPHY_S TROPHY_W,
605    has scenery;
606
607 ! (Now, the special key depressions
608 ! AUTHOR NOTE: Originally, I represented all 4 by one object.  I
609 ! switched to four identical but separate objects to simplify the 
610 ! ease of have the trophy still sitting in the given depression
611 ! (potentially increasing the likelihood that the player might 
612 ! drop the trophy in more than once, thereby fouling the puzzle)
613 Object Nkey_depression "circular depression" TROPHY_N
614    class trophy_dep_class,
615    with before [;
616          Receive:
617             if (noun ~= trophy)
618                "That doesn't quite fit.";
619             else {
620                if (trophy_stage == 3) {
621                  ! got it --- drop rod if in chamber
622                  trophy_stage = 0;  ! could get 'reset'
623                  print "You hear a click";
624                  move trophy to self;
625                  if (white_rod_piece in TROPHY_SECRET) {
626                     Achieved(14);
627                     move white_rod_piece to Domed_chamber;
628                     move air_spirit to Domed_chamber;
629                     Domed_chamber.description = "You are in a large man-made underground chamber, with a \
630 perfectly domed high ceiling. Smooth stone archways lead to rooms to the \
631 north, south, east and west. Stone cut steps lead down. In the very \
632 center of the ceiling you notice a circular hole.";
633                     fake_depression.description = "It's a small circular hole shrouded in darkness.";
634                     ", followed by a dull thump \
635                     from the south.";
636                  }
637                  else ".";                 
638                }
639                else {
640                   trophy_stage = 0;  ! reset
641                   move trophy to self;
642                   "You hear a click.";
643                }
644             }
645          ],
646 ;
647         
648 Object Ekey_depression "circular depression" TROPHY_E
649    class trophy_dep_class,
650    with before [;
651          Receive:
652             if (noun ~= trophy)
653                "That doesn't quite fit.";
654             else {
655                move trophy to self;
656                if (trophy_stage == 0)  trophy_stage = 1;  
657                else  trophy_stage = 0;  ! reset
658                   "You hear a click.";
659             }
660          ],
661 ;
662                
663 Object Skey_depression "circular depression" TROPHY_S
664    class trophy_dep_class,
665    with before [;
666          Receive:
667             if (noun ~= trophy)
668                "That doesn't quite fit.";
669             else {
670                move trophy to self;
671                if (trophy_stage == 2)  trophy_stage = 3;  
672                else  trophy_stage = 0;  ! reset
673                   "You hear a click.";
674             }
675          ],
676 ;
677
678 Object Wkey_depression "circular depression" TROPHY_W
679    class trophy_dep_class,
680    with before [;
681          Receive:
682             if (noun ~= trophy)
683                "That doesn't quite fit.";
684             else {
685                move trophy to self;
686                if (trophy_stage == 1)  trophy_stage = 2;  
687                else  trophy_stage = 0;  ! reset
688                   "You hear a click.";
689             }
690          ],
691 ;
692            
693 ! (GUE Tech -- with new curriculum...)
694 Object GUE_Gate "GUE Entrance"
695    with description "You're standing under an open archway that has \
696 the letters ~GUE TECH~ prominently displayed in \
697 twisted brass and copper. A busy street lies to the \
698 south, and the campus quad opens up to the north.",
699         name "letters" "street" "quad",
700         s_to BORPHEE_CS,
701         n_to GUE_QuadS,
702    has light;
703
704 Nearby GUE_arch "archway"
705    with name "arch" "archway",
706         description "It's an elaborate metal and stone affair that \
707 probably cost a fortune. On one side, an inscription reads \
708 ~Forburn Gate~.",
709    has scenery;
710
711 Object GUE_QuadS "South Quad"
712    with description "You're walking across a grassy field. More \
713 lawn lies to the north, while an archway exits the area to the \
714 south. To the west is a low stone building with the word \
715 ~GYMNASIUM~ etched in stone across the entrance. To the east \
716 is a old brick building covered in ivy.",
717         name "grass" "field" "lawn" "archway" "building" 
718 "ivy",
719         s_to GUE_Gate,
720         n_to GUE_Quad,
721         w_to GUE_Gym,
722         e_to GUE_Hum,
723    has light;
724
725 Object GUE_Quad "Center of Quad"
726    with description "The center of the campus is a nicely tended \
727 green lawn with a bronze statue in the center. \
728 Paths lead north and south across grassy fields. \
729 To the west is a small brick building. To the east \
730 is a large stone building with a lintel roof and the \
731 words ~WOOMAX LIBRARY~ enscribed across the entrance.",
732         name "lawn" "grass" "fields" "building" "lintel",
733         s_to GUE_QuadS,
734         n_to GUE_QuadN,
735         w_to GUE_Cafe,
736         e_to GUE_Library,
737         each_turn [ i ;
738             i = random(20);
739             if (i==8 or 17)
740                "^Some students walk by. They must be upperclassmen, \
741 as they don't even look in your direction.";
742             if (i==9 or 14)
743                "^Some students walk by. They must be underclassmen, \
744 as some of them look at you with puzzled expressions.";
745         ],
746    has light;
747
748 Nearby belboz_statue "statue"
749    with name "statue" "bronze",
750         description "An old bronze statue of a wise-looking \
751 man in wizard's clothes with a stern, disapproving look. An inscription \
752 at the base reads ~BELBOZ AT MITHICUS~.",
753    has scenery;
754
755 Object GUE_QuadN "North Quad"
756    with description "You're walking across a grassy field. More \
757 lawn lies to the south, while a large building that resembles a \
758 auditorium of some sort is north. An inscription near the entrance \
759 reads ~ENCHANTER HALL~. To the west you see a small house-like \
760 building. To the east you see a low stone building, clearly new \
761 and rather modern looking in contrast to its surroundings.",
762    name "grass" "field" "lawn" "building" "auditorium",
763         s_to GUE_Quad,
764         n_to GUE_Enchanter_hall,
765         w_to GUE_Dorms,
766         e_to GUE_Labs,
767    has light;
768
769 Object GUE_Gym "Gymnasium"
770    with description "There's a large field house here, filled with \
771 gym equipment and helpful rubber mats. The exit is east.",
772         e_to GUE_QuadS,
773         before [;
774            Jump:  "You do a bit of exercise.";
775         ],
776    has light;
777
778 Nearby gym_stuff "equipment"
779    with description "Various things useful to those who exercise.",
780         name "equipment" "mats",
781         before [;
782             Pull, Push: "You do a bit of exercise.";
783         ],
784    has scenery;
785
786 Object dorm_key "flat key" GUE_Gym
787    with name "key" "flat" "dorm",
788         initial "Someone left a key here.",
789         description "A flat metal key with ~102~ marked on one side.",
790         !weight 5,
791         size 5,
792 ;
793
794 Object GUE_Hum "Humanities Building"
795    with description "You're in the humanities building, which is \
796 vacant and closed for the summer. The exit is west.",
797        w_to GUE_QuadS,
798    has light;
799
800 Object History_book "history book" GUE_Hum
801    with name "book" "history",
802       initial "Someone left a history book here.",
803       description "It's a biography on the life and times of \
804       Duncanthrax the Bellicose. Most of it chronicles fairly \
805       dry stuff about his much publicized conquests of the \
806       Eastlands and his famous battles. There is an interesting  \
807       bit about some secret trophy chamber that Duncanthrax \
808       had constructed near the end of his reign, but for more \
809       details, I'd suggest ~look up (word) in book~ specifically.",
810       before 
811       [ w1; Consult:
812             if (consult_words > 1)
813                "The index is rather terse, try limiting your lookup \
814                to one word.";
815             wn = consult_from; w1 = NextWord();
816             switch (w1) {
817                'trophy', 'secret':
818                "Apparently, in 680 GUE, Duncanthrax grew increasingly \
819                withdrawn. At this time, of foremost importance to him was his collection of \
820                various battle trophys and awards he had bestowed to \
821                himself (for unusual valor on the field of battle) \
822                over the years. He decided to construct a hidden \
823                underground chamber south of Egreth to sequester this \
824                collection, which would be locked in a most clever means. \
825                He decided to order the construction of \
826                a ~four-room key~ which, when a miniature trophy \
827                was inserted and removed (once) in a special keyhole in each \
828                of the four rooms (in a specific order), would unlock a holding chamber \
829                in a center room containing his prized trophies. \ 
830                Priding himself on his logic skills, he requested that \
831                two captured foreigners produce a logic puzzle plainly \
832                inscribed in the four key rooms themselves that would \
833                detail the exact order that the key rooms were to be \
834                ~applied~. A Prevaricon, \
835                who could not help but write untruths, was given a can of \
836                gold paint, while a Veritassi, who could only write the \
837                truth, was given a can of silver paint. Imagine \
838                Duncanthrax's rage when he discovered that the two \
839                prisoners had secretly painted over their gold and \
840                silver key phrases with _black_ paint! \
841                The prisoners were \
842                summarily executed, of course, but Duncanthrax sealed \
843                off the chamber and researchers can only guess at \
844                the final fate of the trophy collection of Duncanthrax.";
845                'Zilbo':
846                "Zilbo the third was overthrown in the great revolt lead \
847                by Duncanthrax in 659 GUE. The biographers suggest \
848                reading their companion text ~How Zilbo Came to Mithicus~.";
849                'Griffspotter', 'Antharia':
850                "In 665 GUE, Duncanthrax humiliated the Antharian naval \
851                Armada in the famous battle at Fort Griffspotter. \
852                (Well, okay, there's quite a bit more in the book about \
853                this battle, but remember, you're a priest, not a \
854                navy sailor.)";
855                'Diablo', 'Massacre':
856                "In 666 GUE, Duncanthrax invaded Zorbel Pass in the \
857                Eastlands and severely trounced a local militia of \
858                trolls armed with clubs and garlic. The key \
859                significance of this victory on Duncanthrax's \
860                conquest of the Eastlands, as well as the immediate \
861                recall of all vampiric soldiers in Duncanthrax's \
862                military force, cannot be understated.";
863                'Ogre', 'battle', 'duel':
864                "In late 666 GUE, Duncanthrax was engaged in a fierce \
865                battle with forces near Globby Hills. In a brilliant \
866                tactical move, Duncanthrax goaded the opposing force \
867                into decided the fate of the battle on a single duel -- \
868                himself versus their champion. Unfortunately for \
869                Duncanthrax, the Globby Hill champion turned out to \
870                be an Ogre of immense size. In an attempted diversion, \
871                Duncanthrax was quoted as saying to the Ogre, \
872                ~It's all right, we're with Silvermane.~ The Ogre \
873                was quoted as responding with ~Huh?~. Duncanthrax then, \
874                perhaps in a moment of sheer bravado, was heard to \
875                say ~Your shoes are untied.~ As the Ogre bent down \
876                to examine his unshod feet, Duncanthrax gave the \
877                signal, and the Ogre was buried under a massive \
878                pile of granola.";               
879                'Silvermane':
880                "Silvermane, the book notes, was the name of \
881                Duncanthrax's pet Dire Wolf.";
882                'Index', 'index':
883                "There appear to be notable entries on ~trophy~, \ 
884                ~Zilbo~, ~Griffspotter~, ~Diablo~, ~Ogre~, and \
885                ~Silvermane~.";
886                default:
887                  "You can't find anything interesting about that.";               
888              }               
889           ],
890        !weight 20,
891        size 15,
892 ;
893  
894 Object GUE_Cafe "Cafeteria"
895    with description "A small cramped area with lots of tables and \
896 chairs and food stains. The exit is east.",
897         name "table" "tables" "chair" "chairs" "food" "stains",
898         e_to GUE_Quad,
899    has light;
900
901 Nearby cafe_mess "mess"
902    with name "mess" "cups" "napkins" "junk",
903         initial "Someone must've had a late night recently, as \
904 there is quite a mess of coffee cups, napkins, and other junk \
905 on one table.",
906         before [;
907             Search:
908                if (self hasnt general) {
909                   give self general;
910               move sugar_cube to GUE_Cafe;
911               move decaf_coffee_can to GUE_Cafe;
912               "You dig through the mess and find an \
913 unopened can of coffee and a sugar-cube.";
914             }
915             Take:
916               "There's too much to carry.";
917             Rub, Push, Pull, Turn, Touch, Shake:
918 "You mess with the mess. Nothing happens.";
919         ],
920    has static;
921
922 Object sugar_cube "sugar cube"
923    with name "sugar" "cube",
924         short_name "sugar cube",
925         description "A perfect featureless white cube (of sugar).",
926         !weight 5,
927         size 5,
928    has edible;
929
930 Object GUE_Library "Library"
931    with description "A student library is here, filled with \
932 various texts. The exit is west.",
933         w_to [ x y z ;
934              objectloop (x in player) {
935              if ((x == marked_scroll) && (librarian hasnt general))
936 "Some strange invisible force stops you as you try \
937 to leave. The librarian doesn't look up, but merely says, \ 
938 ~If you want to check something out, I'll \
939 need to see some ID first.~";
940 ! (now, instead of doing recursive tree traverse, I do two levels
941 ! of checking, to save code space, since there aren't that many
942 ! workable containers in this game)
943              if (children(x) > 0) {
944                 objectloop (y in x) {
945                    if ((y == marked_scroll) && (librarian hasnt general))
946 "Some strange invisible force stops you as you try \
947 to leave. The librarian doesn't look up, but merely says, \ 
948 ~If you want to check something out, I'll \
949 need to see some ID first.~";
950                    if (children(y) > 0) {
951                       objectloop (z in y) {
952                          if ((z == marked_scroll) && (librarian hasnt general))
953 "Some strange invisible force stops you as you try \
954 to leave. The librarian doesn't look up, but merely says, \ 
955 ~If you want to check something out, I'll \
956 need to see some ID first.~";
957                       }
958                    }
959                 }
960              }
961              }
962              return GUE_Quad;
963 ! if ((marked_scroll notin GUE_Library) && (librarian hasnt general)) 
964         ],
965    has light;
966
967
968 Object magazine_lib "wrinkled magazine" GUE_Library
969    with name "magazine" "wrinkled" "report",
970         initial "There's a wrinkled magazine (~US News and Dungeon Report~) here.",
971         description "SPIRITWRAK Author notes:^\
972 3/96 -- Initial (beta) release. Functionally complete, some \
973 nagging bugs and typos may still be present.^\
974 4/96 -- Second release. Reported bugs fixed. A few puzzles \
975 added, some removed.^\
976 6/96 -- Third release. Bug fix release.",
977         size 15;
978         
979         
980
981 Object GUE_Dorms "Dorms"
982    with description "You're in a short hallway inside some student \
983 dormitories. The exit is east.",
984         e_to GUE_QuadN,
985         n_to dorm_doorN,
986         s_to dorm_doorS,
987         w_to "You wander the halls a bit and return here.",
988    has light;
989
990 Object dorm_doorN "northern door" GUE_Dorms
991    with name "door" "northern",
992         when_closed "There's a closed door to the north.",
993         when_open "There's an open door to the north.",
994         description "A wooden door with a keylock. A note \
995 attached to it says ~DOING WORK ABROAD~.",
996         with_key dorm_key,
997         door_dir n_to,
998         door_to GUE_dormroom,
999         after [;
1000            Open:
1001               give dorm_doorN2 open;
1002            Close:
1003               give dorm_doorN2 ~open;
1004         ],
1005     has static door openable lockable locked;
1006
1007
1008 Object dorm_doorS "southern door" GUE_Dorms
1009    with name "door" "southern",
1010         when_closed "There's a closed door to the south.",
1011         description "A wooden door with a keylock. A note \
1012 attached to it says ~BEWARE OF DOG~.",
1013         door_dir n_to,
1014         door_to GUE_Dorms,  ! doesn't really go anywhere  
1015         before [;
1016            Open:
1017               deadflag = 1;
1018               "As you open the door, an enormous hellhound jumps \
1019 out! The unusual watchdog creeps back into the room and closes the \
1020 door -- after having mauled you to pieces, of course.";
1021         ],
1022     has static door openable lockable;
1023
1024 Object GUE_ID1 "dirty ID card" GUE_Dorms
1025   with name "ID" "card" "dirty",
1026        description "A slightly dirty ID card. There's a picture \
1027 of some woman with short dark hair and glasses, and the name \
1028 ~Stephanie~ on the front.",
1029        size 5,
1030 ;
1031  
1032 Object GUE_ID2 "clean ID card" 
1033   with name "ID" "card" "clean",
1034        description "An ID card with a picture \
1035 of some young student and the name \
1036 ~Harold~ written on the front.",
1037        size 5,
1038 ;
1039
1040 Object GUE_dormroom "Dorm room"
1041    with description "A cramped room, mostly empty, with some \
1042 bare furnishings.",
1043    name "furnishings" "desk" "chair" "bed",
1044         s_to dorm_doorN2,
1045    has light;
1046
1047 ! (due to short name confusion ("northern door"), 2nd half
1048 ! of this door done separately)
1049 Object dorm_doorN2 "door" GUE_dormroom
1050    with name "door",
1051         when_closed "There's a closed door to the south.",
1052         when_open "There's an open door to the south.",
1053         description "An unremarkable wooden door.",  
1054 !        with_key dorm_key,
1055         door_dir s_to,
1056         door_to GUE_Dorms,
1057         after [;
1058            Open:
1059              give dorm_doorN open ~locked;
1060            Close:
1061              give dorm_doorN ~open;
1062         ],
1063         before [;
1064            Lock:
1065               "You can't lock the door from this side.";
1066            Unlock:
1067               "You can't unlock the door from this side.";
1068         ],
1069     has static door openable lockable;
1070
1071 !Nearby dormroom_furnishings "furnishings"
1072 !   with name "furnishings" "desk" "chair" "bed",
1073 !        description "Minimal furnishings -- a desk and chair, \
1074 !a small bed.  Almost reminds you of the Monastery.",
1075 !   has scenery;
1076
1077 Object textbook "textbook" GUE_dormroom
1078    with name "book" "textbook" "text",
1079         initial "A forgotten textbook is lying in one corner of \
1080 the room.",
1081         description [;
1082            if (self hasnt open)
1083             "The cover reads ~Ancient Mythology~.";
1084            else
1085               "~A colorful myth among ancient races has been \
1086 called 'The myth of the Four Brothers' by Elder Kroonwatz \
1087 (the famous Royal Chronicler). The story states that at the dawn of time, four \
1088 evil gods, who were brothers, sought dominance over that \
1089 which would become our world. Great battles were fought \
1090 between forces of light and darkness, and these \
1091 brothers were often victorious. \
1092 Fortunately for us, they \
1093 could not cooperate with each other, and \
1094 fought amongst themselves in petty power \
1095 struggles, driven individually by power and greed. 
1096 Indeed, legends state that on occassions, the brothers \
1097 would seek ways to actually destroy their own siblings, \
1098 along with the forces of good. \
1099 One brother constructed a strange artifact that would \
1100 have given him great power, but was discovered by agents of good. \
1101 He was imprisoned within the very object he built. The remaining \
1102 three, facing certain defeat without the combined strength of their \
1103 trapped brother, fled into planes unknown, but made a pact \
1104 that if the brother were ever freed, and the artifact of \
1105 power returned to him, the four would \
1106 agree to make their final attack against the forces of good. \
1107 Kroonwatz points out the obvious parallels with various other \
1108 mythologies that foretell the end of the known world.~";
1109         ],
1110         !weight 20,
1111         size 15,
1112         before [;
1113            Open:
1114              if (self hasnt general) {
1115                 give self general;
1116                 give self open;
1117                 move GUE_ID2 to parent(player);
1118                 "As you open the book, a small card flies out and lands \
1119 at your feet.";
1120              }
1121         ],
1122    has openable;
1123
1124 Object GUE_Enchanter_hall "Enchanter Hall (top)"
1125    with description "You're at the top of a large auditorium which \
1126 is empty. You can walk down a long aisle to the \
1127 front of the hall, or out to the south.",
1128         name "aisle" "seats",
1129         s_to GUE_QuadN,
1130         d_to GUE_Enchanter_hall_front,
1131         n_to GUE_Enchanter_hall_front,
1132    has light;
1133
1134 Object GUE_Enchanter_hall_front "Enchanter Hall (bottom)"
1135    with description [;
1136    print "You're at the very front of a large \
1137 auditorium. From here you can look south and sees rows upon \
1138 rows of empty seats focused on the stage-like area where you now \
1139 stand. You can walk back into the seats to the south";
1140    if (hall_switch has on)
1141       ". A soft dim glow highlights your current area.";
1142    else ".";
1143    ],
1144    name "rows" "seats" "glow",
1145         s_to GUE_Enchanter_hall,
1146         u_to GUE_Enchanter_hall,
1147    has light;
1148
1149 Nearby hall_switch "switch"
1150    with name "switch",
1151         initial "There's a curious switch in the wall here.",
1152         description "A small switch in the far wall.",
1153         before [;
1154            SwitchOn:
1155               if (self hasnt on) {
1156               give self on;
1157               print "You hear a click. A dim light now makes the \
1158 nearby area less gloomy.^";
1159               }
1160               else "It seems to be on already.";
1161               if (self hasnt general) {
1162                  give self general;
1163                  move notebook to hall_desk;
1164                  "^A student creeps out of the shadows. He looks \
1165 at you sheepishly. ~Sorry I haven't been to class all semester, \
1166 Professor,~ he begins. ~Anyway, here's my final paper.~ He puts \
1167 a notebook on the desk. ~All this stuff about the new 'science' \
1168 -- I don't know what all the fuss \
1169 is about. Magic was okay too, wasn't it? There's a part in my \
1170 conclusion where --~ He stops and looks at the notebook. ~Well, \
1171 anyhow.~ he says, and disappears back into the shadows."; 
1172               }
1173               else rtrue;
1174            SwitchOff:
1175               if (self has on) {
1176               give self ~on;
1177               "The dim light fades.";
1178               }
1179               else "It seems to be off already.";
1180         ], 
1181    has static switchable;
1182
1183 Object hall_desk "large desk" GUE_Enchanter_hall_front
1184    with name "desk",
1185         description "A long desk sits in the middle of this area.",
1186         capacity 30,
1187    has static supporter;
1188
1189 Object notebook "notebook"
1190    with name "notebook",
1191         capacity 3,
1192         description "A plain white notebook with some loose pages.",
1193         !weight 10,
1194         size 10,
1195         before [;
1196            Receive:
1197                 if ((noun ~= term_paper) && (noun hasnt is_scroll)) 
1198                    "You can't put that into the notebook.";
1199         ],
1200    has container openable;
1201
1202 Object term_paper "term paper" notebook
1203    with name "paper" "term",
1204         !weight 5,
1205         size 10,
1206         description "~Magic, so what's it good for?~ by \
1207 Wilbur Lunchbox. It's a long-winded haphazard writing about \
1208 the virtues of magic in a time of science. Some of the topic \
1209 sentences are particularly clumsy. However, there's an insightful \
1210 bit at the end about how under certain circumstances, magic and \
1211 science become indistinguishable.",
1212 ;
1213
1214 Object GUE_Labs "Science Center"
1215    with description "You are in a short hallway of some new \
1216 building. The words ~SCIENCE CENTER~ are painted on one wall. \
1217 The hallway opens to rooms to the east, or you can escape to the west.",
1218         name "words",
1219         w_to GUE_QuadN,
1220         e_to GUE_Labs_Eng,
1221    has light;
1222
1223 Object GUE_Labs_Eng "Engineering Labs"
1224    with description "\
1225 You shudder as you look around this area. \
1226 Clearly a place of science, piles of heavy machinery and strange \
1227 delicate-looking tools and artifacts are everywhere here. Hallways \
1228 run west and east.",
1229         name "machinery" "tools" "artifacts",
1230         w_to GUE_Labs,
1231         e_to GUE_Labs_Office,
1232         s_to GUE_Lab_door,
1233    has light; 
1234
1235 Object wood_book "research paper" GUE_Labs_Eng
1236    with name "paper" "research",
1237         description "~On the Structural Strength of Woods~, \
1238 a short, fairly dry research paper. Apparently, the researcher was testing \
1239 the breaking point of various woods. The conclusions reached \
1240 are summed up in the final paragraph:^^\
1241 ~In summary, our findings indicate that out of the materials \
1242 tested, Ebony wood is clearly the best choice, and Balsa wood \
1243 clearly the worst. Balsa wood structures broke immediately when \
1244 even the slightest weight was tested on them. Pine wood structures \
1245 fared slightly better, holding light weights, but tended to break \
1246 on repeated stress. Ebony wood structures were approximately twice \
1247 as strong as Pine structures, holding up to at least one repeated \
1248 stress test before breaking.~",
1249         !weight 5, 
1250         size 15;
1251
1252 Object GUE_Labs_Office "Office"
1253   with description "You're in a small office of some sort. The \
1254 only exit is west.",
1255        w_to GUE_Labs_Eng,
1256   has light;
1257
1258 Nearby Lab_desk "desk" 
1259    with name "desk",
1260         initial "A small desk sits in one corner here.",
1261         description "It's quite tiny really.",
1262    has static supporter;
1263
1264 Object Lab_journal "lab journal" Lab_desk 
1265    with name "journal" "lab",
1266         description "Some loose handwritten pages read:^\
1267 ^~...DAY 14)  We've put the artifact in the south lab. Still \
1268 ^             no idea what it does, but I'm sure I can find \
1269 ^             some lab student who can figure it out. \
1270 ^    DAY 20)  My lab assistant Peabody believes that it's \
1271 ^             some sort of 'mystical gate'. \
1272 ^             Clearly this is hogwash. However \
1273 ^             my grant has been awarded, so I have allowed \
1274 ^             Peabody to continue work. \
1275 ^    DAY 25)  Peabody demonstrated something fantastic today. \
1276 ^             He took my briefcase and put it on \
1277 ^             the artifact and in a white flash, it was gone! \
1278 ^    DAY 27)  This is my last entry. I am leaving the University \
1279 ^             tomorrow. Peabody, in my request to retrieve my briefcase \
1280 ^             stepped onto the artifact, and was gone! I've read \
1281 ^             his recent research notes, and if he's right, he's \
1282 ^             now lost in a place unimaginable! I've locked the  \
1283 ^             artifact away and destroyed the combination -- I pray no \
1284 ^             one ever sees it again!...~\
1285 ^ (The journal breaks off here)",
1286        !weight 15,
1287        size 15,
1288 ;
1289
1290 Object GUE_Lab_door "lab door"
1291    with name "door" "lab",
1292         when_closed [;
1293              print "There's a closed heavy metal door to the";
1294              if (self in GUE_Labs_Eng)
1295              " south.";
1296              else " north.";
1297         ],
1298         when_open [;
1299              print "There's an open metal door to the";
1300              if (self in GUE_Labs_Eng)
1301              " south.";
1302              else " north.";
1303         ],
1304         description "A large door made of some shiny hard metal. \
1305                     There are no obvious handles or hinges.",
1306         door_dir [;
1307              if (self in GUE_Labs_Eng) return s_to;
1308              else return n_to;
1309         ], 
1310         door_to [;
1311              if (self in GUE_Labs_Eng) return GUE_Labs_SECRET;
1312              else return GUE_Labs_Eng;
1313         ],
1314         before [;
1315              Close:
1316                if (self has open) {
1317                   left_dial.number = random(9);
1318                   right_dial.number = random(9);
1319                   center_dial.number = random(9);
1320                   give self ~open locked;
1321                   "You close the door and hear some mechanisms spin.";
1322                } 
1323         ],
1324         found_in GUE_Labs_Eng GUE_Labs_SECRET,
1325     has static door openable lockable locked;
1326
1327 ! (and now a combination lock, which is probably going to be more 
1328 !  of an effort to code than for the player to figure out)
1329 Object special_lock "set of dials" GUE_Labs_Eng
1330     with name "dials",
1331          initial "There's an odd set of dials in the wall near the \
1332 metal door.",
1333          description [;
1334            print "Three dials are in a left-to-right row. Above \
1335 each dial is a tiny square window with some number visible behind it. \
1336 The windows currently read: ~",left_dial.number,center_dial.number, right_dial.number;
1337 "~. Right next to the set of dials is a small green button. \
1338 Letters right above the dials read: ~FrobozzCo~."; 
1339     ],
1340     has static transparent;
1341
1342 Class dial_class
1343    with name "dial",
1344         number 0,
1345         description [; 
1346             print "A small dial. The window above reads ~", self.number;
1347             "~.";
1348         ],
1349    has static;
1350         
1351
1352 Object left_dial "left dial" special_lock
1353    class dial_class
1354    with name "left",
1355         before [;
1356             Turn:
1357               left_dial.number = left_dial.number + 1;
1358               if (left_dial.number > 9) left_dial.number = 0;
1359               print "The left window now reads: ~", left_dial.number; 
1360                "~.";
1361             SetTo:
1362               if ((second < 0) || (second > 9))
1363                  "The left dial apparently only goes from 0 to 9.";
1364               else left_dial.number = second;
1365               print "The left window now reads: ~", left_dial.number; 
1366                "~.";
1367         ],
1368 ;
1369 Object center_dial "center dial" special_lock
1370    class dial_class
1371    with name "center" "middle",
1372         before [;
1373             Turn:
1374               center_dial.number = center_dial.number + 1;
1375               if (center_dial.number > 9) center_dial.number = 0;
1376               print "The center window now reads: ~", center_dial.number; 
1377                "~.";
1378             SetTo:
1379               if ((second < 0) || (second > 9))
1380                  "The center dial apparently only goes from 0 to 9.";
1381               else center_dial.number = second;
1382               print "The center window now reads: ~", center_dial.number; 
1383                "~.";
1384         ],
1385 ;
1386 Object right_dial "right dial" special_lock
1387    class dial_class
1388    with name "right",
1389         before [;
1390             Turn:
1391               right_dial.number = right_dial.number + 1;
1392               if (right_dial.number > 9) right_dial.number = 0;
1393               print "The right window now reads: ~", right_dial.number; 
1394                "~.";
1395             SetTo:
1396               if ((second < 0) || (second > 9))
1397                  "The right dial apparently only goes from 0 to 9.";
1398               else right_dial.number = second;
1399               print "The right window now reads: ~", right_dial.number; 
1400                "~.";
1401         ],
1402 ;
1403
1404 Object green_button "green button" special_lock
1405    with name "button" "green",
1406         number 0,
1407         weight 0,
1408         description "A small green button next to the dials.",
1409         before [;
1410            Push:
1411               ! a simple game of mastermind.  NOTE: I hate mastermind...
1412               if (GUE_Lab_door has open)
1413                  "You hear a short buzzing noise.";
1414               if ((left_dial.number == 7) &&
1415                   (center_dial.number == 3) &&
1416                   (right_dial.number == 4)) {
1417                  give GUE_Lab_door ~locked open;
1418                  Achieved(15);
1419                  "You hear three clicks, and the door swings open!";
1420               }
1421               ! observe the bizarre numerical method of tracking guesses...
1422               ! ('0' implies wrong)
1423               ! (As with regular mastermind, we first check for all
1424               ! 'right # and right spot' and build a bitstring that
1425               ! indicates this (i.e. 700 combo would give 100 bitstring).
1426               ! Then, we scan over the slots that were not marked as 
1427               ! 'right # and right spot' to check for 'right #, wrong 
1428               ! spot'.  If, notably, we already found that number in
1429               ! the 1st scan, we do _not_ treat it as 'right #, wrong
1430               ! spot' (i.e. 777 should give us 1 click, not 1 click,
1431               ! 2 thunks).
1432               ! -- Author's note:  There is no doubt a simpler method
1433               ! to do this, and you Inform junkies should feel free
1434               ! to let me know this, however I found this method to
1435               ! be easy to code, easy to understand, and pretty
1436               ! robust.
1437               green_button.number = 0;  ! RESET
1438               green_button.weight = 0;  ! (# of 'thunks')
1439               ! FIRST SCAN
1440               if (left_dial.number == 7) green_button.number = 100; 
1441               if (center_dial.number == 3) 
1442                  green_button.number = green_button.number + 10;
1443               if (right_dial.number == 4)
1444                  green_button.number = green_button.number + 1;
1445               ! SECOND SCAN
1446               if (green_button.number ~= 100 or 101 or 110) {
1447                  if (green_button.number ~= 11) {
1448                  if ((left_dial.number == 3) && 
1449                      (green_button.number ~= 10))
1450                      green_button.weight = green_button.weight + 1; ! 'add a thunk' 
1451                  if ((left_dial.number == 4) && 
1452                      (green_button.number ~= 1))
1453                      green_button.weight = green_button.weight + 1; ! 'add a thunk' 
1454                  }
1455               }
1456               if (green_button.number ~= 10 or 11 or 110) {
1457                  if (green_button.number ~= 101) {
1458                  if ((center_dial.number == 7) && 
1459                      (green_button.number ~= 100))
1460                      green_button.weight = green_button.weight + 1; ! 'add a thunk' 
1461                  if ((center_dial.number == 4) && 
1462                      (green_button.number ~= 1))
1463                      green_button.weight = green_button.weight + 1; ! 'add a thunk' 
1464                  }
1465               }
1466               if (green_button.number ~= 1 or 11 or 101) {
1467                  if (green_button.number ~= 110) {
1468                  if ((right_dial.number == 7) && 
1469                      (green_button.number ~= 100))
1470                      green_button.weight = green_button.weight + 1; ! 'add a thunk' 
1471                  if ((right_dial.number == 3) && 
1472                      (green_button.number ~= 10))
1473                      green_button.weight = green_button.weight + 1; ! 'add a thunk' 
1474                  }
1475               }
1476               ! Print number of clicks and thunks
1477               if (green_button.number == 0 && green_button.weight == 0)
1478                  "Nothing happens.";
1479               if (green_button.number == 1 or 10 or 100) {
1480                  print "You hear a single click";
1481                  if (green_button.weight == 0) ".";
1482                  else print " followed by ";
1483               }
1484               else {
1485                  if (green_button.number == 11 or 101 or 110) {
1486                     print "You hear two clicks";
1487                     if (green_button.weight == 0) ".";
1488                     else print " followed by ";
1489                  }
1490                  else {
1491                     print "You hear ";
1492                  }
1493               }
1494               EnglishNumber(green_button.weight);
1495               if (green_button.weight == 1) 
1496               " thunk.";
1497               else " thunks.";
1498
1499          ],
1500    has static;
1501
1502
1503
1504 Object GUE_Labs_SECRET "Strange Lab"
1505    with description "This is an odd room, cramped even by lab \
1506 standards. The place seems to have been cleared out recently.",
1507    n_to GUE_Lab_door,
1508 has light;
1509
1510
1511 ! *************
1512 ! critters/people
1513 ! *************
1514
1515 Object librarian "librarian" GUE_Library
1516    with name "librarian" "student" "Stephanie",
1517         description "A young woman with short dark hair and \
1518 gold-framed glasses.",
1519         life [;
1520            Attack, ThrowAt:
1521               "Attacking librarians is not very becoming of \
1522               a priest.";
1523            Show, Give:
1524               if (noun == glasses)
1525                  "~Thanks no, I already have a pair.~";
1526               if (noun == GUE_ID1) {
1527                  remove GUE_ID1;
1528                  "The librarian snatches the ID out of your hand. \
1529 ~Where'd you get my ID?~ she says. ~I've been looking for it \
1530 everywhere.~";
1531               }
1532               if (noun == GUE_ID2) {
1533                  print "The librarian peers at the ID. ~Hi ";
1534                  if (self has general)
1535                  "again, Harold,~ she says.";
1536                  else {
1537                  give self general;
1538                  "Harold,~ \
1539 she says. ~I heard you were going to be away for a least two \
1540 more years. Got tired of Mithicus, eh? Well, anyway, remember to \
1541 return anything you borrow after summer session is over.~ She \
1542 scribbles something down in a notebook.";
1543                  }
1544               } 
1545            default: "The librarian is currently too busy \
1546 cataloging books.";
1547         ],
1548         react_before [;
1549              Cast:
1550                 "The librarian frowns as you start to chant. \
1551 ~Quiet! This is a library, you know.~ she says.";
1552              Blow:
1553               if (noun==whistle)
1554                  "You make an unusually high-pitched noise. \
1555 The librarian frowns. ~Please! This is a library, you know.~";
1556              Yell:
1557                  "The librarian frowns. ~Please! This is a library, you know.~";
1558              Sneeze:
1559                  "~You should see the school nurse about that cold.~";
1560         ],
1561    has animate female;
1562
1563
1564 Object kobold "large kobold" Forest_brambles
1565    with name "kobold" "large",
1566         initial "There appears to be a wounded kobold here, resting \
1567         against a shrub.",
1568         description "He's a pretty tough looking kobold. The large wound \
1569         in his shoulder clearly has him in a foul mood.",
1570         each_turn [;
1571            if (random(20) == 1)
1572               "^The kobold swipes at you with a club in his good arm, \
1573               but due to his condition, doesn't come close.";
1574         ],
1575         life [;
1576            Attack,ThrowAt: "Attacking a defenseless wounded would be somewhat \
1577 unsporting.";
1578            default: "The kobold hisses at you and spits out some words that \
1579            you can't understand at all.";
1580         ],
1581         before [;
1582            Cast:
1583               if (the_spell_was == espnis_spell or foblub_spell)
1584                  "The kobold cannot understand your language.  The \
1585                  chant fails.";
1586               if (the_spell_was == taclor_spell) {
1587                  move green_sphere to Forest_brambles;
1588                  remove self;
1589                  "You begin your chant, and the kobold seems stricken with \
1590                 fear. Soon, however, the kobold stands up and looks at \
1591                 his healed shoulder with wonder. He starts to say something, \
1592                 realizes you don't speak kobold, and stops. Puzzled by \
1593                 your actions, he stares at you for a moment, then searchs \
1594                 his jerkin, finding a small object which he tosses at your \
1595                 feet. He walks off into the deep forest, and vanishes."; 
1596               }
1597         ], 
1598    has animate;
1599
1600 Object air_spirit "air spirit" 
1601   with name "spirit",
1602        description "It looks like a small, animated tornado capable \
1603        of taking you for quite a spin.",
1604        each_turn [ i ;
1605        ! spirit attack
1606        ! (in general, the 4 spirits are _very_ dangerous.
1607        ! There's a 1/5 chance of killing outright, and 2
1608        ! chances of doing 10 and 5 points of damage respectively.
1609        ! In short, the player needs to realize it's time to swanko,
1610        ! and do so, quickly)
1611        if (self hasnt general) {
1612           give self general ~concealed;    
1613           "^You hear a strange intake of air from the hole above \
1614           your head. Without warning, a small tornado seems to \
1615           flow in from above. It seems to be sentient!";
1616        }
1617        i = random(5);
1618        if (i == 1) {
1619           deadflag = 1;
1620           "^The air creature moves with amazing speed! \
1621           It surrounds you in a mass of whirling winds, and you \
1622           find yourself spinning helplessly. The speed increases, \
1623           and you are soon torn apart!";
1624        }
1625        if (i == 2) 
1626           Player_HP_CUR = Player_HP_CUR - 10;
1627        if (i==3) 
1628           Player_HP_CUR = Player_HP_CUR - 5;
1629        if (Player_HP_CUR <= 0) {
1630           deadflag = 1;
1631           "^The last blow from the air spirit was too much for \
1632           you, I'm afraid to say. You are picked up and \
1633           tossed against the wall in a lifeless heap by a \
1634           massive gust of wind.";
1635        } 
1636        print "^The air spirit ";
1637        if (i==2)
1638           "picks you up in a powerful gust \
1639           of wind and sends you flying across the chamber! Ouch.";
1640        if (i==3)
1641           "surrounds you with flying dust and \
1642           debris, momentarily choking you! You break free \
1643           just in time.";
1644        "charges, but you evade the moving tornado.";
1645        ],
1646        before [;
1647           Cast:
1648             if (the_spell_was == swanko_spell) {
1649                remove self;
1650                "As you speak the chant, the air spirit falls back \
1651                in fear! You finish the chant, and the air spirit \
1652                slowly dissipates and grows smaller, until the \
1653                creature vanishes completely.";
1654             }
1655             print "A sharp gust of wind practically \
1656             tears your chant out of your lungs.^"; 
1657        ],
1658        life [ ;
1659           Attack:   
1660             print "You ";
1661             if (random(20) >= 8)
1662             "strike the air creature, but your attack passes \
1663             harmlessly through it! Strange laughter seems to \
1664             echo from everywhere.";
1665             "attack the air spirit, but miss!";
1666           default: "It's too busy trying to kill you.";
1667        ],
1668    has animate concealed;
1669
1670
1671 ! *************
1672 ! scrolls/spells
1673 ! *************
1674
1675 Object flour_scroll "flour-coated scroll" 
1676    class scroll_class,
1677    with name "flour-coated",
1678 ;
1679
1680 Object gloth_spell "fold dough 83 times" flour_scroll
1681    class spell_class,
1682    with name "gloth",
1683         magic [;
1684            if (second has animate)
1685               "Well, when you see a living creature made out of \
1686               dough around here, let me know.";
1687            "The chant fails. I suppose you probably need actual dough \
1688            for it to work.";
1689         ],
1690 ;
1691
1692 Object marked_scroll "pen-marked scroll" GUE_Library
1693    class scroll_class,
1694    with name "pen-marked",
1695         initial "There's a pen-marked scroll sitting amongst some books here.",
1696 ;
1697
1698 Object taclor_spell "heal wounds" marked_scroll
1699    class spell_class,
1700    with name "taclor",
1701         magic [;
1702           if (second == 0)
1703              "The chant searches for a body to heal, and fails.";
1704           if (second == player) {
1705              Player_HP_CUR = Player_HP_MAX;
1706              "You speak the chant, and feel a warm glow surround you. \
1707              In moments, you feel physically renewed!";
1708           }
1709           if (second hasnt animate) {
1710              print "It's apparently beyond your powers to \
1711              heal "; DefArt(second); ".";
1712           }
1713           else {
1714              CDefArt(second);
1715              " is no doubt grateful for the gift of better health.";
1716           }                                     
1717         ],
1718 ;       
1719
1720
1721 ! *************
1722 ! interesting objects
1723 ! *************
1724 Object white_rod_piece "white rod piece" TROPHY_SECRET
1725   class rod_class,
1726   with name "white",
1727        initial "In the center of the room is a short white rod.",
1728        description "It's a short section of a rod made of some \
1729 undeterminable hard substance, \
1730 colored cloud-white. A piece of the Rod of the Ancients, no doubt!",
1731 ;
1732
1733 Object green_sphere "green sphere"
1734    class sphere_class,
1735    with name "green",
1736         description "A tiny perfect green sphere, made of some strange \
1737            unknown metal.",
1738 ;