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