Updating FSF address and adding website URL
[supernova.git] / src / NOVA.PAS
1 {//-------------------------------------------------------------------------}\r
2 {/*                                                                         }\r
3 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
4 {                                                                           }\r
5 {This file is part of Supernova.  Supernova is free software; you can       }\r
6 {redistribute it and/or modify it under the terms of the GNU General Public }\r
7 {License as published by the Free Software Foundation; either version 3     }\r
8 {of the License, or (at your option) any later version.                     }\r
9 {                                                                           }\r
10 {This program is distributed in the hope that it will be useful,            }\r
11 {but WITHOUT ANY WARRANTY; without even the implied warranty of             }\r
12 {MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                       }\r
13 {                                                                           }\r
14 {See the GNU General Public License for more details.                       }\r
15 {                                                                           }\r
16 {You should have received a copy of the GNU General Public License          }\r
17 {along with this program; if not, see https://gnu.org/licenses or write to: }\r
18 {  Free Software Foundation, Inc.                                           }\r
19 {  51 Franklin Street, Fifth Floor                                          }\r
20 {  Boston, MA 02110-1301                                                    }\r
21 {  USA                                                                      }\r
22 {                                                                           }\r
23 {Original Source: 1990 Scott Miller                                         }\r
24 {Prepared for public release: 03/19/09 - Joe Siegler, Apogee Software, Ltd. }\r
25 {*/                                                                         }\r
26 {//-------------------------------------------------------------------------}\r
27 (****************************************************************************)\r
28 (*                             SUPERNOVA VERSION B                          *)\r
29 (*     >> This file contains the special room routines for Supernova <<     *)\r
30 (*                         Programmer: Scott Miller                         *)\r
31 (*                       << Began February 2, 1985 >>                       *)\r
32 (*                       Copyright 1985 Scott Miller                        *)\r
33 (****************************************************************************)\r
34 \r
35 {$C-,R-,V-,K-}\r
36 \r
37 const\r
38    VMax    = 95;     { Verbs   }\r
39    NMax    = 133;    { Nouns   }\r
40    PMax    = 11;     { Preps   }\r
41    AMax    = 4;      { Adverbs }\r
42    TMax    = 30;     { Timers  }\r
43    RMax    = 109;    { Rooms   }\r
44    MMax    = 29;     { Mov's   }\r
45    Null    = 0;\r
46    Legal   = 255;\r
47 \r
48 type\r
49    Str1    = string[1];\r
50    Str9    = string[9];\r
51    Str19   = string[19];\r
52    Str29   = string[29];\r
53    Str53   = string[53];\r
54    Str77   = string[77];\r
55    Str78   = string[78];\r
56    Str130  = string[131];\r
57    Str234  = string[234];\r
58    Str255  = string[255];\r
59    Entr    = record AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags:integer;end;\r
60    LSet    = set of 1..NMax;\r
61    SaveSet = record\r
62               aInv    : set of 1..MMax;\r
63               aPStat  : set of 1..6;\r
64               aEvents : set of 1..255;\r
65               aSocket,\r
66               aWear   : set of 1..MMax\r
67              end;\r
68 \r
69 var\r
70    SetSave : SaveSet;\r
71    Sets    : file of SaveSet;\r
72    Objects : file of LSet;\r
73    Things  : file of byte;\r
74    Timers  : file of integer;\r
75    V{erb}  : array [1..VMax] of Str29;\r
76    N{oun}  : array [1..NMax] of Str29;\r
77    P{rep}  : array [1..PMax] of Str29;\r
78    A{dvb}  : array [1..AMax] of Str53;\r
79    RN{ame} : array [1..RMax]   of Str19;{ Name of each room stored here.      }\r
80    R{oom}  : array [1..MMax] of byte;   { Knows which room a Mov object is in.}\r
81    L{ocate}: array [0..RMax] of LSet;   { Locates all non-Mov objects.        }\r
82    T{imer} : array [1..TMax] of integer;\r
83    Dir     : array [1..8]    of Str9;\r
84    M{max}  : array [1..3]    of byte;    {******************}\r
85    PStat        : set of 1..6;           {* Player Status: *}\r
86    NoNounOnly   : set of 1..VMax;        {* [] = Healthy   *}\r
87    OneNounMaybe : set of 1..VMax;        {*  2 = Hungry    *}\r
88    ToNounOnly   : set of 1..VMax;        {*  3 = Sick      *}\r
89    ToNounMaybe  : set of 1..VMax;        {*  4 = Injured   *}\r
90    Events       : set of 1..255;         {*  5 = Tired     *}\r
91    Mov{able objects},                    {*  6 = Thirsty   *}\r
92    Inv{ventory},                         {******************}\r
93    Socket,\r
94    Wear         : set of 1..MMax;\r
95    Brief        : set of 1..RMax;\r
96    NounSet      : set of 1..NMax;\r
97    MugCon,         { All -Con variables are containers. }\r
98    FoodCon,\r
99    SatchCon,\r
100    HolstCon,\r
101    NicheCon,\r
102    PyraCon,\r
103    HingeCon,\r
104    PodumCon,\r
105    RobotCon,\r
106    CodeSet,\r
107    ScrnSet,\r
108    Vb,\r
109    N1,\r
110    N2,\r
111    Pr,\r
112    Md,\r
113    VNP,\r
114    Prm,      { Player Room }\r
115    EFlag,    { Error Flag  }\r
116    FFlag,    { Format Flag }\r
117    TFlag,    { Timer Flag  }\r
118    list,\r
119    Num,\r
120    Region,   { Knows what room to go in when exiting the player's ship }\r
121    AlienRm,\r
122    FriendRm,\r
123    SinkRm,\r
124    Serum,    { Begins at zero, dispenser jams at 2! }\r
125    Weight,\r
126    Old,      { for Block Reader }\r
127    Old2,\r
128    x,y,o   : byte;\r
129    Code,     { dials, etc }\r
130    Tic,\r
131    StoreR,   { Knows if the previous Room that was read is the same as the  }\r
132    StoreS,   { Room that is about to be read.  If so, then it simply writes }\r
133    StoreL,   { that variable again! }\r
134    StoreC,\r
135    RC,       { Endless Room Counter }\r
136    Sc,       { Score       }\r
137    TestC,\r
138    Floor,\r
139    i,j     : integer;\r
140    Input,\r
141    Again,\r
142    Line    : Str130;\r
143    Text1,\r
144    Text2,\r
145    Text4   : Str234;\r
146    Text3   : Str78;\r
147    Text5   : Str77;\r
148    R1,R2,S1: file of Str234;\r
149    L1      : file of Str78;\r
150    C1      : file of Str77;\r
151    T1,T2   : text[2500];\r
152    Identity,\r
153    VStr,\r
154    NStr,\r
155    PStr,\r
156    LastNoun,\r
157    Word    : Str29;\r
158    Result  : Entr;\r
159    Drive,\r
160    Log,\r
161    CFlag   : char;\r
162    Maze,\r
163    Crawl,\r
164    Color,\r
165    QFlag,\r
166    SFlag   : boolean;  { If TRUE then a Special action took place. }\r
167 {----------}\r
168 \r
169 {$Ia:ADPAR.pas   <<<<<------  LOADS IN MANY PARSER COMMANDS  ***************}\r
170 \r
171 procedure Describe(Room:byte);\r
172  begin\r
173   col(9,9);write(RN[Prm]);col(11,7);writeln;\r
174   if(en(1))or(not(en(1))and not(Prm in Brief))then\r
175    begin Brief:=Brief+[Prm];\r
176     case Prm of   { Alternate Room Descriptions }\r
177      29:if en(35) then begin RS(130);RS(131)end else RR(29);\r
178      34:if en(30) then begin RS(81);RS(82)end else RR(34);\r
179      52:if en(39) then RS(126)else RR(52);\r
180      91:if en(51) then begin RS(157);RS(158)end else RR(91)\r
181      else RR(Room)\r
182     end;\r
183    end;\r
184   case Prm of     { For initial object's description }\r
185     1:if 16 in L[1] then RL(150);\r
186    107:if 19 in L[107] then RL(518);\r
187    38:if 17 in L[38] then RL(260);\r
188    41:if(18 in L[41])and not en(34)then RS(96);\r
189    55:if 11 in L[55] then RL(290);\r
190    63:if 20 in L[63] then RL(356);\r
191    73:if 28 in L[73] then RL(352);\r
192    80:if 17 in L[80] then RL(395);\r
193    94:begin if 26 in L[94] then RL(397);if 2 in L[94] then RL(398)end;\r
194   end;\r
195   for o:=1 to MMax do  { Print the objects that are lying in the room }\r
196    if r[o]=Prm then\r
197     begin\r
198      if o=6 then write('There is some ',FN(o),' here.')\r
199      else\r
200       begin Word:=FN(o);\r
201        if Word[1] in['a','e','i','o','u']then\r
202         write('There is an ',FN(o),' here.')else\r
203         write('There is a ',FN(o),' here.')\r
204       end;\r
205      if((o=29)and(MugCon<>Null))or((o=7)and(HolstCon<>Null))or\r
206        ((o=5)and(SatchCon<>Null))then write('  (with something in it)');\r
207      if(o=5)and(R[5]=20)then write('  (lying in some trash)');\r
208      if(o=7)and(7 in L[12])and(R[7]=12)then write('  (on the shelf)');\r
209      if o=NicheCon then write('  (on the niche)');\r
210      if(en(6))and(o=16)then write('  (on the seat)');\r
211      if o=PyraCon then write('  (in the pyramid''s slot)');\r
212      if o=HingeCon then write('  (inside the statue''s mouth)');\r
213      if o=PodumCon then write('  (on top of the podium)');\r
214      if(o=16)and en(37)then write('  (under the crystal)');\r
215      if o=RobotCon then write('  (in the robot''s panel)');\r
216      if o in Socket then write('  (in one of the regulator''s sockets)');\r
217      writeln;\r
218     end;\r
219  end; { Describe }\r
220 \r
221 procedure Move{New:byte};\r
222  begin SF;\r
223   if en(7) then RL(22) else\r
224   if en(8) then RL(23) else\r
225   begin\r
226    if(MugCon<>Null)and(29 in Inv)then\r
227     begin if Prm<>8 then L[Prm]:=L[Prm]-[MugCon];L[New]:=L[New]+[MugCon]end;\r
228    if(SatchCon<>Null)and(5 in Inv)then\r
229     begin L[Prm]:=L[Prm]-[SatchCon];L[New]:=L[New]+[SatchCon]end;\r
230    if(HolstCon<>Null)and(7 in Inv)then\r
231     begin L[Prm]:=L[Prm]-[HolstCon];L[New]:=L[New]+[HolstCon]end;\r
232    Prm:=New;\r
233    Describe(Prm);\r
234   end\r
235  end; { Move }\r
236 \r
237 \r
238 {$Ia:VOCAB.pas    <<<<<-------  Loads in VOCABULARY LIST  **********}\r
239 \r
240 \r
241 {****************************** ROOM ROUTINES *******************************}\r
242 overlay procedure Room1;   { The Player's Ship }\r
243 begin\r
244 case Prm of\r
245  1:case Vb of  { Bridge }\r
246    2,13:Door(2,50);\r
247    11:RL(199);\r
248    22,24,28:case N1 of\r
249         37,38,55,44:if Md<>Null then RL(534)else RB(3,11);103:RL(317);\r
250         35:if en(6)then RL(542)else RL(543);\r
251         59:case Region of\r
252             1:RS(46);\r
253             2:RS(63);\r
254             4:RS(T[9]+46);\r
255            end\r
256        end;\r
257    35:if N1 in[16,35] then\r
258        if(here(16))and(en(6))then\r
259         if not en(4) then\r
260          begin Add(7);sound(440);RS(19);T[6]:=4;for x:=1 to random(30)+9 do\r
261           begin y:=random(6000)+60;play(y,y,70);delay(9)end;Score(10,67)\r
262          end\r
263         else begin Add(7);RL(149); for x:=1 to random(9)+9 do\r
264             begin y:=random(9999);play(y,y,30);delay(55)end;end\r
265        else RL(141);\r
266    56:if en(7)and en(6)then\r
267        if T[6]>0 then\r
268         if input=Identity then\r
269          begin RS(21);T[6]:=Null;Score(15,4);play(400,400,200)end\r
270         else RL(142)\r
271        else\r
272         if input='r2/20-8 d2/vega' then\r
273          if not(Region in[2,4]) then\r
274           begin RS(28);Add(26);Min(27);play(600,600,99)end\r
275          else RL(154)\r
276         else\r
277          begin Min(26);RS(39);Min(27);play(600,600,99)end\r
278        else RL(179);\r
279    44:if en(7)and en(6)then\r
280        case N1 of\r
281         43:begin play(750,750,200);  { Purple }\r
282             if Region=4 then\r
283              if T[9]=11 then begin Score(5,68);Region:=2;T[13]:=3;TFlag:=2;\r
284               n[126]:='hinged mouth\mouth\hinge\';\r
285               RB(9,11);Explode(30)end\r
286              else RS(64)\r
287             else RL(198)\r
288            end;\r
289         40:begin play(900,900,200);  { Cyan }\r
290             if en(26) then begin RS(37);Add(27)end\r
291             else RL(195)\r
292            end;\r
293         41:begin play(600,600,200);  { Tan }\r
294             if en(27) then\r
295              if not(en(22))and not(en(23))then\r
296               begin col(28,23);RL(180);col(11,7);\r
297                RS(38);T[8]:=7;\r
298                for x:=1 to 6 do\r
299                 for y:=30 to 200 do begin sound(y);delay(5)end;nosound;\r
300               end\r
301              else begin RS(40);play(500,999,3);Min(26);Min(27)end\r
302             else if en(26)then RL(184)else RL(185)\r
303            end;\r
304        end {case}\r
305       else RL(179);\r
306    39:if(16 in NounSet)and en(6)then\r
307        if en(7)then RL(575)else begin Min(6);RL(145);SFlag:=false;end;\r
308    end; {Vb}\r
309  end; {main case}\r
310 end; { Room1 }\r
311 {----------}\r
312 overlay procedure Room2;   { The Player's Ship }\r
313 begin\r
314 case Prm of\r
315  2:case Vb of  { Forward Corridor }\r
316    9,13,51:if(n1 in[0,62,64,71])then\r
317      if en(23) then begin RL(237);case Region of 1:move(22);2:move(24);end end\r
318      else RL(99);\r
319    1,11:Door(1,50);\r
320    2:move(3);\r
321    4:move(4);\r
322    24,28:if NStr='hatch' then if en(23) then RL(163)else RL(99);\r
323    50:if N1=78 then\r
324        if en(22)then begin RL(160);Min(22)end else\r
325         begin RL(161);Add(22);\r
326          if T[8]>0 then begin RS(40);play(500,999,3);T[8]:=0;Min(27)end end;\r
327    41:if NStr='hatch' then\r
328        if Region<>4 then\r
329         if en(22) then\r
330          begin RL(96);Add(23);\r
331           if(not en(44))and(Region=2)then\r
332            begin Add(44);RL(327);for i:=1 to 400 do sound(random(3500)+999);\r
333             for i:=7500 downto 500 do begin sound(random(i)+i);\r
334              sound(random(3500)+2000)end;\r
335             for i:=1 to 300 do sound(random(3500)+2500);nosound;\r
336            end\r
337          end\r
338         else RL(97)\r
339        else begin RS(45);DEAD end;\r
340    53:if N1=56 then\r
341        if en(23) then begin RL(98);Min(23)end else say('hatch','closed');\r
342    end; {Vb}\r
343 \r
344  3:case Vb of  { Rear Corridor }\r
345    1,13:move(2);\r
346    3:move(6);\r
347    4:move(7);\r
348    28,31:if N1 in[55,81] then begin RB2(4,12);Pause;end;\r
349    24,41,76:if N1=55 then if Md in[1,4]then RL(533)else begin RS(22);DEAD;end;\r
350    end; {Vb}\r
351  end; {main case}\r
352 end; { Room2 }\r
353 {----------}\r
354 overlay procedure Room3;   { The Player's Ship }\r
355 begin\r
356 case Prm of\r
357 \r
358  4:case Vb of  { Ship's Lab }\r
359    3,13:move(2);\r
360    28,22:case N1 of\r
361           90:RS(23); 52:RS(26); 38:RS(27); 55:RS(31);\r
362           81,119:begin RB(10,14);Pause;end;\r
363           64:if NicheCon<>Null then\r
364               writeln('There is a ',FN(NicheCon),' sitting on the niche.')\r
365              else RL(152);\r
366          end;\r
367    31:if N1 in[81,119] then begin RB(10,14);Pause;end;\r
368    41..44,88:if N1=55 then RL(174);\r
369    33:if N2=64 then\r
370        if N1 in[3,4,8,9,12,17,29] then\r
371         if Pr in[1,5,10] then\r
372          if NicheCon=Null then\r
373           begin Van(N1);R[N1]:=4;NicheCon:=N1;RL(147)end\r
374          else RL(148)\r
375         else crazy\r
376        else RL(146);\r
377    54:if N1 in[38,90]then begin RL(321);Serum:=1;end;\r
378    56:begin Serum:=Serum+1;\r
379        if Serum<3 then\r
380         if NicheCon=Null then RS(24)\r
381         else if NicheCon<>29 then\r
382          writeln('A small amount of serum drips onto the ',FN(NicheCon),' and ',\r
383                   'dries up.')\r
384          else\r
385           if MugCon=Null then begin MugCon:=92;RS(25);L[4]:=L[4]+[92];\r
386            if input='6' then Add(42)else Min(42)end\r
387           else\r
388            if MugCon in[79,92,99] then\r
389             writeln('The serum mixes with the ',FN(MugCon),' inside the mug.')\r
390            else\r
391             writeln('The serum drips on the ',FN(MugCon),' inside the mug and',\r
392                     ' quickly evaporates.')\r
393        else RS(135)\r
394       end; {type}\r
395 \r
396    end; {Vb}\r
397 \r
398  5:case Vb of  { Sanitary Facilities }\r
399    2,13:move(6);\r
400    22,28:if N1=98 then RL(122);\r
401    end; {Vb}\r
402 \r
403  6:case Vb of  { Sleep Chamber }\r
404    1,11:move(5);\r
405    4,13:move(3);\r
406    28:case N1 of 80:RL(159); 69:RS(29) end;\r
407    51:if N1=69 then Vb:=35;\r
408    end; {Vb}\r
409 \r
410  7:case Vb of  { Cargo Area }\r
411    3,13:move(3);\r
412    22,28:if N1=32 then RL(155);\r
413    24:if N1=32 then RL(156);\r
414    41,53:if N1=32 then RL(157);\r
415    39:if 32 in NounSet then RL(158);\r
416    end; {Vb}\r
417 \r
418  end; {main case}\r
419 end; { Room3 }\r
420 {----------}\r
421 overlay procedure Room4;   { The Tavern }\r
422 begin\r
423 case Prm of\r
424  8:case Vb of  { Tavern }\r
425    2,13:if en(7)then RL(22)else begin RL(93);move(13)end;\r
426    3,9,11,51:if en(7)then RL(22)\r
427        else if(N1 in[null,71])then begin RL(283);move(9)end\r
428        else if N1=126 then RL(473);\r
429    31:if N1 in[81,119]then RB(2,9);\r
430    35:case N1 of\r
431       83:if T[1] in[4..7,11..17] then RS(8) else begin Add(19);Add(7);RL(30)end;\r
432       35,84,85:begin Add(7);RL(30);if N1 in[35,84] then Add(2)else Min(2)end;\r
433       end;\r
434    65:if N1=124 then\r
435        if en(2) then\r
436         if T[1] in[5..7,11..18] then\r
437          if(md=1)or(en(18))then begin RL(31);Score(20,3);\r
438           if not en(18)then begin Add(18);T[1]:=8;end end\r
439          else RL(32)\r
440         else RL(41)\r
441        else RL(33);\r
442    28:case N1 of 56:RL(371);81,119:RB(2,9);111:RL(44)end;\r
443    41:if N1=56 then RL(394);\r
444    39:if(29 in NounSet)and not en(21)then RL(86);\r
445    54,93:if N1=111 then begin RS(32);DEAD;end;\r
446    42,44,75:if N1=111 then RL(474);\r
447    59:if N1=126 then RL(473);\r
448    20:if N1=126 then RL(178);\r
449    end; {Vb}\r
450 \r
451  9:case Vb of  { West Hallway }\r
452    1,2:RL(89);\r
453    3,11:move(10);\r
454    28:if N1=56 then RL(92);\r
455    4,10,13,51:if(n1 in[null,71])then begin RL(284);move(8)end;\r
456    54:if(N1=56)and(T[1]<1)then RS(13)else RL(123);\r
457    41,88:if N1=56 then\r
458           case N2 of 0:RL(107);3:RL(101)else RL(137)end;\r
459    end; {Vb}\r
460 \r
461 10:case Vb of  { Central Hallway }\r
462    1:RL(89);\r
463    4,13:move(9);\r
464    3:move(11);\r
465    28:if N1=56 then if en(11)then RL(370)else RL(92);\r
466    2,11:if en(11) then begin RL(90);Score(5,69);move(12);Min(11)end\r
467         else RL(89);\r
468    41,88:if N1=56 then case N2 of 0:RL(107);3:begin;end else RL(137)end;\r
469    54:if N1=56 then RL(123);\r
470    end; {Vb}\r
471 \r
472 11:case Vb of  { East Hallway }\r
473    1,2:RL(89);\r
474    4,13:move(10);\r
475    28:if N1=56 then RL(92);\r
476    41,88:if N1=56 then\r
477           case N2 of 0:RL(107);3:RL(101)else RL(137)end;\r
478    54:if N1=56 then RL(123);\r
479    53:if N1=56 then begin RL(92);Min(11)end;\r
480    end; {Vb}\r
481 \r
482 12:case Vb of  { Suite #4 }\r
483    1,13:if en(7)then RL(22)else\r
484         if en(11) then begin RL(91);move(10);Min(11)end else RL(92);\r
485    41,88:if N1=56 then begin RL(104);Add(11)end;\r
486    22,28,76:\r
487       case N1 of\r
488        56:if en(11)then RL(370)else RL(92);\r
489        80:if Md<>Null then RL(535)else RL(536);\r
490        87:if 7 in L[12] then begin RL(106);R[7]:=12;Score(5,24)end;\r
491        98:RL(121);\r
492       end;\r
493    53:if N1=56 then begin RL(92);Min(11)end;\r
494    39:if(7 in NounSet)or(30 in NounSet)then Score(5,24);\r
495    end; {vb}\r
496 \r
497  end; {main case}\r
498 end; { Room4 }\r
499 {----------}\r
500 overlay procedure Room5;   { Barre-An Planet }\r
501  procedure Zap; begin for x:=1 to 29 do if R[x]=Prm then Van(x) end;\r
502 begin\r
503 case Prm of\r
504 13:case Vb of  { Crossroads }\r
505    1,11:if en(7)then RL(22)else begin RL(93);move(8)end;\r
506    2:move(18);\r
507    3:move(16);\r
508    4:move(14);\r
509    28,31:if N1 in[81,88] then begin Score(5,70);RB2(5,6);Pause;end;\r
510    41:if N1=56 then RL(394);\r
511    end; {Vb}\r
512 \r
513 14:case Vb of  { Dusty Road }\r
514    3:move(13);\r
515    4:begin RC:=1;move(15)end;\r
516    end; {Vb}\r
517 \r
518 15:case Vb of  { Dusty Road (endless) }\r
519    3:begin Zap;RC:=RC-1;if RC<1 then move(14)else move(15)end;\r
520    4:begin Zap;RC:=RC+1;move(15);if RC=40 then\r
521       writeln('You notice something unusual.')end;\r
522    11,13:if RC=40 then begin RL(135);Explode(3);play(1,9999,0);play(9999,1,0);\r
523           walls(10);Explode(5);TFlag:=4;Inv:=[1,6,12,17,20,26,28,29];move(78);\r
524           T[3]:=120;T[4]:=120;T[5]:=120;PStat:=[];MugCon:=79;Bor(0,0)end;\r
525    end; {Vb}\r
526 \r
527 16:case Vb of  { Gravel Road }\r
528    2,11:begin RL(108);move(20)end;\r
529    3:begin RC:=1;move(17)end;\r
530    4:move(13);\r
531    28,31:if N1=81 then RL(109);\r
532    end; {Vb}\r
533 \r
534 17:case Vb of  { Gravel Road (endless) }\r
535    3:begin Zap;RC:=RC+1;if(RC=80)and(Inv<>[])then\r
536        begin move(17);RS(17);Inv:=[];end\r
537       else move(17)end;\r
538    4:begin Zap;RC:=RC-1;if RC<1 then move(16)else move(17)end;\r
539    end; {Vb}\r
540 \r
541 18:case Vb of  { Paved Road }\r
542    1:move(13);\r
543    2:begin RC:=1;move(19);end;\r
544    4,11:move(21);\r
545    end; {Vb}\r
546 \r
547 19:case Vb of  { Paved Road (endless) }\r
548    1:begin Zap;RC:=RC-1;if RC<1then move(18)else move(19)end;\r
549    2:if RC=60 then RS(18) else begin Zap;RC:=RC+1;move(19)end;\r
550    end; {Vb}\r
551 \r
552 20:case Vb of  { General Store }\r
553    1,13:move(16);\r
554    28:if N1=132 then RL(88);\r
555    20,26,76:if(N1 in[86,87])and(5 in L[20])then\r
556        begin RS(14);R[5]:=20;Score(15,20)end;\r
557    39:if(5 in NounSet)or(30 in NounSet)then Score(15,20);\r
558    end; {Vb}\r
559 \r
560 21:case Vb of  { Gravel Lot }\r
561    3,13:move(18);\r
562    1,4..8:RL(27);\r
563    2,9,51:if N1 in[Null,62,71] then begin RL(234);move(22)end;\r
564    28,31:if n1=81 then begin Score(5,71);RB(1,7);Pause;end;\r
565    end; {Vb}\r
566 \r
567 22:case Vb of  { Top of Ship (Barre-An) }\r
568    1:begin RL(235);move(21)end;\r
569    10,11,51:if(n1 in[null,62,64,71])then\r
570         if en(23) then begin RL(236);move(2);Score(15,72)end else RL(99);\r
571    24,28,31:case N1 of\r
572        56:if en(23) then RL(163)else RL(99);81:begin RB(1,7);Pause;end end;\r
573    50:if N1=78 then\r
574        if en(22)then begin RL(94);Min(22)end else begin RL(95);Add(22)end;\r
575    41:if N1=56 then\r
576        if en(22) then begin RL(96);Add(23);Score(5,73)end else RL(97);\r
577    53:if N1=56 then\r
578        if en(23) then begin RL(98);Min(23)end else say('hatch','closed');\r
579    59:if(N1 in[49,122])or(VStr='jump off')then move(21);\r
580    end; {Vb}\r
581 \r
582  end {main case}\r
583 end; { Room5 }\r
584 {----------}\r
585 overlay procedure Room6;   { Jungle Planet }\r
586 begin\r
587 case Prm of\r
588 23:case Vb of  { Deep Pit }\r
589     1..13,51:RL(217);\r
590     28,31:case N1 of  73:RL(218); 81,116:RS(80) end;\r
591     75:if N1=73 then move(34);\r
592    end;\r
593 \r
594 24:case Vb of { Top of Ship (Jungle planet) }\r
595    3:begin RL(235);move(25)end;\r
596    10,11,51:if(n1 in[null,62,64,71])then\r
597         if en(23) then begin Score(5,74);RL(236);move(2)end else RL(99);\r
598    24,28:if N1=56 then if en(23) then RL(163)else RL(99);\r
599    50:if N1=78 then\r
600        if en(22)then begin RL(94);Min(22)end else begin RL(95);Add(22)end;\r
601    41:if N1=56 then\r
602        if en(22) then begin RL(96);Add(23)end else RL(97);\r
603    53:if N1=56 then\r
604        if en(23) then begin RL(98);Min(23)end else say('hatch','closed');\r
605    59:if(N1 in[49,122])or(VStr='jump off')then move(25);\r
606    end; {Vb}\r
607 \r
608 25:case Vb of { Sandy Clearing }\r
609    4,9,51:if N1 in[Null,62,71] then begin RL(234);move(24)end;\r
610    1:begin move(26);Score(5,75)end;\r
611    1..8:RL(200);\r
612    end; {Vb}\r
613 \r
614 26:case Vb of { Winding Path 1 }\r
615    2:move(25);\r
616    5:begin RS(65);DEAD;end;\r
617    59:if N1=66 then\r
618        if VStr='jump in' then begin RL(288);DEAD;end\r
619        else begin RS(66);move(27);Score(25,76)end;\r
620    1..8:RL(200);\r
621    9,51:if N1=112 then RL(204);\r
622    28:if N1=66 then RS(85);\r
623    35,62:if N1=66 then begin RL(288);DEAD;end;\r
624    75,76:if N1=66 then RL(285);\r
625    83:if N1=66 then RL(286);\r
626    84:if N1=66 then begin RL(287);DEAD;end;\r
627    end;\r
628 \r
629 27:case Vb of { Winding Path 2 }\r
630    6:move(28);\r
631    8,11:begin RS(65);DEAD;end;\r
632    1..8:RL(200);\r
633    9,51:if N1=112 then RL(204);\r
634    59:if N1=66 then\r
635        if VStr='jump in' then begin RL(288);DEAD;end\r
636        else begin RS(66);move(26)end;\r
637    28:if N1=66 then RS(85);\r
638    35,62:if N1=66 then begin RL(288);DEAD;end;\r
639    75,76:if N1=66 then RL(285);\r
640    83:if N1=66 then RL(286);\r
641    84:if N1=66 then begin RL(287);DEAD;end;\r
642    end;\r
643 \r
644 28:case Vb of { Winding Path 3 }\r
645    7:move(27);\r
646    6:move(29);\r
647    8:begin RS(67);DEAD;end;\r
648    1..8:RL(200);\r
649    9,51:if N1=112 then RL(204);\r
650    28:if N1=112 then RS(86);\r
651    24:if N1=112 then RL(553);\r
652    end;\r
653 \r
654 29:case Vb of { Winding Path 4 }\r
655    7:move(28);\r
656    5:if en(29) then move(32) else\r
657       begin col(10,7);RS(72);col(11,7);T[12]:=146;Add(29);move(32)end;\r
658    9,51:if N1 in[Null,112] then begin RL(201);move(30)end;\r
659    6:begin RS(69);Prm:=31;T[11]:=4;end;\r
660    8:if en(35)or en(130)then begin RC:=1;move(59);Score(20,77)end;\r
661    1..8:RL(200);\r
662    28:case N1 of 112:RL(238);120:RL(544);\r
663        113:if Md=1 then begin RL(314);Add(130)end end;\r
664    59:if N1=120 then begin RL(541);Prm:=31;T[11]:=4;end;\r
665    end;\r
666 \r
667  end {main case}\r
668 end; { Room6 }\r
669 {----------}\r
670 overlay procedure Room7;   { Jungle Planet }\r
671 begin\r
672 case Prm of\r
673 30:case Vb of { Top of Tree }\r
674    9:RL(202);\r
675    10,51:if N1 in[Null,112] then begin RL(203);move(29)end;\r
676    1..8:RL(200);\r
677    20..28:if N1=68 then RS(79);\r
678    18,17:RL(603);\r
679    end;\r
680 \r
681 31:case Vb of { Quicksand Pit }\r
682    1..8:RL(206);\r
683    9,51:if N1=112 then RL(204);\r
684    39,42,76:if N1=47 then\r
685      if en(78)then RL(549)else begin T[11]:=0;RS(71);Prm:=29;Score(25,78)end;\r
686    28:case N1 of 47:RL(239); 120:RL(240);end\r
687    end;\r
688 \r
689 32:case Vb of { Winding Path 5 }\r
690    1:move(33);\r
691    8:begin move(29);if en(35) and not en(40) then begin RL(314);Add(40)end end;\r
692    1..8:RL(200);\r
693    9,51:if N1=112 then RL(204);\r
694    end;\r
695 \r
696 33:case Vb of { Winding Path 6 }\r
697    2:move(32);\r
698    6:if not en(28)then begin RS(68);Add(28);move(34)end else move(34);\r
699    1..8:RL(200);\r
700    9,51:if N1=112 then RL(204);\r
701    end;\r
702 \r
703 34:case Vb of { Front of Pyramid }\r
704    7:move(33);\r
705    41..44,54,75,88:if N1=56 then RL(220) else\r
706       if N1=126 then\r
707        if HingeCon<>Null then\r
708         begin writeln('The hinged mouth opens, revealing a ',FN(HingeCon),\r
709                       ' inside.');Add(31);R[HingeCon]:=34;Score(25,79)end\r
710        else begin RL(226);Add(31)end;\r
711     53:if N1=56 then RL(220) else\r
712        if N1=126 then\r
713         begin RL(227);if HingeCon<>Null then R[HingeCon]:=Null;Min(31)end;\r
714    1,11:if en(30) then begin Score(25,80);move(35)end else RL(219);\r
715    39:if(PyraCon in NounSet)or((30 in Nounset)and(PyraCon=9))then\r
716        begin RL(225);Min(30);SFlag:=false;end else\r
717       if HingeCon in NounSet then begin RL(228);SFlag:=false;end;\r
718    1..8:RL(200);\r
719    9,51:if N1=112 then RL(204);\r
720    92:if N1 in[Null,49,122] then begin RL(216);move(23) end;\r
721    31:if N1 in[81,89,119] then begin RB(8,7);Pause;end;\r
722    28,24:case N1 of 68:RS(87); 89:RS(88); 81,119:begin RB(8,7);Pause;end;\r
723           64:if PyraCon=Null then RL(241)else\r
724               writeln('The small slot contains a ',FN(PyraCon),'.');\r
725           56:if en(30) then RL(244)else RL(245);\r
726           126:if en(31)then\r
727                if HingeCon=Null then RL(242)else\r
728                writeln('The open mouth contains a ',FN(HingeCon),'.')\r
729               else RL(243);\r
730          end;\r
731    end;\r
732 \r
733  end {main case}\r
734 end; { Room7 }\r
735 {----------}\r
736 overlay procedure Room8;   { Inside Pyramid (Top Level) }\r
737 begin\r
738 case Prm of\r
739 35:case Vb of  { Vestibule }\r
740    2,13:move(34);\r
741    10,11,51:if N1 in[Null,71] then\r
742      if en(32) then move(36) else begin RS(84);Add(32);move(36)end;\r
743    28:if N1=56 then if en(30) then RL(244)else RL(245);\r
744    end;\r
745 \r
746 36:case Vb of  { Descending Stairs }\r
747    10,11,51:if N1 in[Null,71] then move(37);\r
748    9,13:move(35);\r
749    end;\r
750 \r
751 37:case Vb of  { Halcyon Hall }\r
752    1:if T[16]>1 then begin RL(278);DEAD;end else move(39);\r
753    3:move(38);\r
754    10,51:if N1 in[Null,71] then move(42);\r
755    9,13:move(36);\r
756    end;\r
757 \r
758 38:case Vb of  { Departure Room }\r
759    4,13:move(37);\r
760    28:case N1 of\r
761        73:if 10 in L[38] then begin RL(253);RL(252)end else RL(253);\r
762        10:if 10 in L[38] then RL(254);\r
763        30:if 17 in L[38] then begin SF;writeln('It''s a grey disk!')end\r
764       end;\r
765    26:if(N1=10)and(10 in L[38])then RL(255);\r
766    42,44:if N1 in[10,73] then RL(256);\r
767    75:if N1=73 then RL(257);\r
768    47,83,84:RL(258);\r
769    39:if(10 in L[38])and(10 in NounSet)then\r
770        begin L[38]:=L[38]+[17];RL(259);Score(15,81);SFlag:=false;end\r
771       else if(30 in NounSet)and(17 in L[38])then R[17]:=38;\r
772    end;\r
773 \r
774  end {main case}\r
775 end; { Room8 }\r
776 {----------}\r
777 overlay procedure Room9;   { Inside Pyramid (Top Level) }\r
778 begin\r
779 case Prm of\r
780 39:case Vb of  { Holey Hall }\r
781    2,13:if T[15]>1 then begin RL(269);move(37);Score(5,82)end else move(37);\r
782    4,11:if T[15]>1 then begin RS(95);DEAD;end else move(40);\r
783    end;\r
784 \r
785 40:case Vb of  { Pyramid Lobby }\r
786    1,11:if T[14]>1 then\r
787          begin n[68]:='podium\alter\column\';WRITE('');move(41)end;\r
788    3,13:if(18 in Inv)or(4 in Inv)then begin Brief:=Brief-[39];move(39);\r
789           T[15]:=3;T[16]:=9;col(10,7);RS(93);\r
790           for i:=500 to 5500 do sound(random(i)+random(i));\r
791           for j:=1 to 7000 do sound(random(i)+random(i));\r
792           for j:=i downto 500 do sound(random(j)+random(j));nosound;\r
793          end\r
794         else move(39);\r
795    42,44,51,75,84,94:\r
796      if N1=68 then\r
797       if T[14]>1 then RL(246) else\r
798        if en(33) then begin T[14]:=7;RL(261);Walls(8);end\r
799        else begin T[14]:=7;Score(20,33);RS(89);Walls(8);end;\r
800    28:case N1 of 56:if T[14]>1 then RL(370)else RL(92);68:RL(247)end;\r
801    end;\r
802 \r
803 41:case Vb of  { Treasure's Keeper }\r
804    2,13:if T[14]>1 then begin n[68]:='pyramid\podium\';WRITE('');move(40)end\r
805         else RL(248);\r
806    28,22:case N1 of\r
807           56:if T[14]>1 then RL(370)else RL(92);\r
808           68:if PodumCon=Null then RL(264) else\r
809              writeln('There is a ',FN(PodumCon),' on the podium.');\r
810           18:if(18 in L[41])and not en(34)then RS(90);\r
811          end;\r
812    33:if N2=68 then\r
813        if Pr=1 then\r
814         if N1 in Mov then\r
815          if PodumCon=Null then\r
816           begin Van(N1);R[N1]:=41;PodumCon:=N1;RL(266)end\r
817          else RL(268)\r
818        else crazy;\r
819    75:if N1=68 then RL(276);\r
820    50:if N1=68 then begin RL(277);Walls(8);T[14]:=7;end;\r
821    39:if(30 in NounSet)and(18 in L[41])then R[18]:=41;\r
822    end;\r
823 \r
824  end {main case}\r
825 end; { Room9 }\r
826 {----------}\r
827 overlay procedure Room10;   { Pyramid Maze }\r
828 begin\r
829 case Prm of\r
830 42:case Vb of  { Ladder Room }\r
831    1..13:if Maze then case Vb of 9,13:move(37);6:move(43);3,8:move(42)end\r
832          else case Vb of 9,13:move(37)end;\r
833    41..44,50,55:if N1=116 then RL(325);\r
834    28:if N1=116 then RL(547);\r
835    end;\r
836 \r
837 43:case Vb of  { Shifting Room NW }\r
838    1..8:if Maze then case Vb of 7:move(42)end\r
839         else case Vb of 2:move(44);8:move(45)end;\r
840    41..44,50,55:if N1=116 then RL(325);\r
841    28:if N1=116 then RL(547);\r
842    end;\r
843 \r
844 44:case Vb of  { Shifting Room W }\r
845    1..8:if Maze then case Vb of 7:move(47);2:move(45)end\r
846         else case Vb of 1:move(43);5:move(44)end;\r
847    41..44,50,55:if N1=116 then RL(325);\r
848    28:if N1=116 then RL(547);\r
849    end;\r
850 \r
851 45:case Vb of  { Shifting Room SW }\r
852    1..8:if Maze then case Vb of 1,3:move(45)end\r
853         else case Vb of 1:move(45);6:move(43)end;\r
854    41..44,50,55:if N1=116 then RL(325);\r
855    28:if N1=116 then RL(547);\r
856    end;\r
857 \r
858 46:case Vb of  { Shifting Room N }\r
859    1..8:if Maze then\r
860          case Vb of 1:begin RS(98);DEAD;end;\r
861           7:begin Score(50,84);move(50)end end\r
862         else\r
863          case Vb of 1:begin RS(98);DEAD;end;\r
864           7:begin Score(50,84);move(50)end;3:move(48);8:move(45)end;\r
865    41..44,50,55:if N1=116 then RL(325);\r
866    28:if N1=116 then RL(547);\r
867    end;\r
868 \r
869 47:case Vb of  { Shifting Room S }\r
870    1..8:if Maze then case Vb of 6:move(44)end\r
871         else case Vb of 3:move(49);1:move(47);4:move(45)end;\r
872    41..44,50,55:if N1=116 then RL(325);\r
873    28:if N1=116 then RL(547);\r
874    end;\r
875 \r
876 48:case Vb of  { Shifting Room NE }\r
877    1..8:if Maze then case Vb of 7:move(49);3,4:move(48)end\r
878         else case Vb of 4:move(46);1,2:move(48)end;\r
879    41..44,50,55:if N1=116 then RL(325);\r
880    28:if N1=116 then RL(547);\r
881    end;\r
882 \r
883 49:case Vb of  { Shifting Room SE }\r
884    1..8:if Maze then case Vb of 5:move(48)end\r
885         else case Vb of 4:move(47);2:move(45)end;\r
886    41..44,50,55:if N1=116 then RL(325);\r
887    28:if N1=116 then RL(547);\r
888    end;\r
889 \r
890 50:case Vb of  { Stairway Room E }\r
891    6:move(46);\r
892    4,10,13,51:move(51);\r
893    41..44,50,55:if N1=116 then RL(325);\r
894    end;\r
895 \r
896  end {main case}\r
897 end; { Room10 }\r
898 {----------}\r
899 overlay procedure Room11;   { Inside Pyramid (Bottom Level) }\r
900 begin\r
901 case Prm of\r
902 51:case Vb of  { Lower Stairway }\r
903    3,9,13,51:move(50);\r
904    1:move(52);\r
905    end;\r
906 \r
907 52:case Vb of  { Misty Passage }\r
908    2:if T[19]>1 then begin RS(129);DEAD;end else move(51);\r
909    4:if en(35)then begin RL(305);DEAD;end else move(53);\r
910    33:if(N1=11)and(11 in Inv)then\r
911        if Pr in[1,5,7,10] then\r
912         if N2 in[34,49,64] then\r
913          if T[19]>0 then\r
914           begin Score(40,39);Van(11);L[52]:=L[52]+[11];T[19]:=0;RS(127)end\r
915          else begin Van(N1);R[N1]:=52;RL(586)end;\r
916    39:if(11 in NounSet)and en(39)then RL(307);\r
917    28:case N1 of 11:RL(312); 64:RL(313) end;\r
918    42,44,55:case N1 of 11:RL(307); 34:RL(308); end;\r
919 \r
920    end;\r
921 \r
922 53:case Vb of  { Damp Passage }\r
923    2:begin move(54);if en(35)then begin RS(122);DEAD;end end;\r
924    3:if T[18]>1 then begin RL(305);DEAD;end else move(52);\r
925    59:if N1=66 then\r
926        begin RS(125);Brief:=Brief-[52];move(52);T[18]:=0;T[19]:=3;\r
927         col(10,7);RL(306);Walls(12);Score(20,85)end;\r
928    end;\r
929 \r
930 54:case Vb of  { Dark Passage }\r
931    1:move(53);\r
932    2:move(55);\r
933    end;\r
934 \r
935 55:case Vb of  { Circular Chamber }\r
936    1:begin Brief:=Brief-[54];move(54);\r
937       if en(35)then\r
938        if Crawl=true then\r
939         begin col(10,7);RS(119);RS(120);Pause;L[53]:=L[53]+[66];Score(20,86);\r
940          Brief:=Brief-[53];move(53);col(10,7);RS(121);Walls(12);T[18]:=4;end\r
941        else begin col(10,7);RS(118);DEAD;end end;\r
942    2:if Md=1 then RS(230)else\r
943       if random(2)=1 then begin Prm:=58;RL(563)end else begin RS(100);DEAD;end;\r
944    3:begin move(56);if 11 in Inv then begin RS(102);DEAD;end end;\r
945    4:if Md=1 then RS(231)else begin RS(99);DEAD;end;\r
946    39:if(11 in NounSet)then begin RS(101);SFlag:=false;end\r
947       else if(30 in Nounset)and(11 in L[55])then R[11]:=55;\r
948    end;\r
949 \r
950  end {main case}\r
951 end; { Room11 }\r
952 {----------}\r
953 overlay procedure Room12;   { Inside Pyramid (Bottom Level) }\r
954 begin\r
955 case Prm of\r
956 56:case Vb of  { The Erusaert }\r
957    2,11:if en(36) then begin Score(5,88);move(57)end;\r
958    4,13:if T[17]>4 then begin RS(108);DEAD;end else move(55);\r
959    22,28:case N1 of\r
960          1:if not en(35) then RL(292);\r
961          34:if 1 in L[56]then RL(291)\r
962             else if not en(35)then begin RS(103);L[56]:=L[56]+[1]end;\r
963          49:RS(105);\r
964          56:RL(370);\r
965          66:RL(295);\r
966          68:RS(104);\r
967          110:RL(293);\r
968          end;\r
969    26:if N1 in[49,68] then RL(295);\r
970    39:if 1 in NounSet then\r
971        begin\r
972         if not en(35)then RL(300) else\r
973         if T[17]>4 then\r
974          begin RS(113);T[17]:=3;Van(1);Inv:=Inv+[1];Score(50,87)end\r
975        end\r
976       else if(30 in NounSet)then RL(578);\r
977    37:if not(1 in NounSet)and(not en(35))then RL(300);\r
978    35,51,62:if N1=68 then begin RS(106);DEAD;end;\r
979    59:begin RS(107);DEAD;end;\r
980    41,88:if N1 in[68,110] then\r
981           if N2=4 then\r
982            if not en(35)then\r
983             if here(16)and en(37)then\r
984              begin RS(117);T[17]:=6;L[56]:=L[56]+[1,56];Add(35);Min(37)end\r
985             else begin RS(111);DEAD;end\r
986            else RL(273)\r
987           else RL(296);\r
988    33:if N1=16 then\r
989        begin\r
990         if Pr in[1,10] then\r
991          if N2 in[49,1] then\r
992           begin Van(16);Add(37);R[16]:=56;\r
993            if not en(35)then\r
994             if Pr=1 then RL(297)else RL(298)\r
995            else RL(297)\r
996           end\r
997          else\r
998           if(N2=34)and(Pr=10)then\r
999            begin writeln('Done.');Van(16);SF;R[16]:=56;end\r
1000           else if N2=68 then RL(299)\r
1001        end\r
1002       else\r
1003        if N2 in[68,110] then\r
1004         if Pr=1 then RL(299) else\r
1005         if Pr=5 then\r
1006          if N1=4 then\r
1007           if not en(35)then\r
1008            if here(16)and en(37)then\r
1009             begin RS(117);T[17]:=6;L[56]:=L[56]+[1];Add(35);Min(37)end\r
1010            else begin RS(111);DEAD;end\r
1011           else RL(273)\r
1012          else RL(296);\r
1013    54,75,76:case N1 of\r
1014             1:if 1 in L[56] then RL(300);\r
1015             34:RL(304);\r
1016             end;\r
1017    end; {Vb}\r
1018 \r
1019  end {main case}\r
1020 end; { Room12 }\r
1021 {----------}\r
1022 overlay procedure Room13;   { Inside Pyramid (Bottom Level) }\r
1023 begin\r
1024 case Prm of\r
1025 57:case Vb of  { Solar Chamber }\r
1026    1,13:move(56);\r
1027    28:case N1 of 56:RL(370);72,82,116:RS(149);109:RS(150)end;\r
1028    44,75:if N1=103 then begin Prm:=58;RS(233);Walls(5);Static end;\r
1029    end; {Vb}\r
1030 \r
1031 58:case Vb of  { Eternal Trap }\r
1032    9,13,51:RL(554);\r
1033    92:RL(555)\r
1034    end;\r
1035 \r
1036 59:case Vb of  { Overgrown Path }\r
1037    5:begin RC:=RC-1;if RC<1 then begin RL(309);move(29)end else RL(310)end;\r
1038    8:begin RC:=RC+1;if RC>7 then begin RL(309);move(60)end else RL(310)end;\r
1039    1..8:RL(200);\r
1040    9,51:if N1=112 then RL(204);\r
1041    end;\r
1042 \r
1043 60:case Vb of  { Antenna Building (Outside) }\r
1044    4,11:begin Door(61,25);\r
1045          if not en(43)then begin RS(137);Score(10,43)end end;\r
1046    5:move(59);\r
1047    1..8:RL(200);\r
1048    28:case N1 of 96:RL(323);115:RL(324)end;\r
1049    41..44,54,75,88:if N1=56 then RL(315);\r
1050    9,51:if N1=112 then RL(204)else RL(316);\r
1051    end;\r
1052 \r
1053 61:case Vb of  { Monitor Outpost }\r
1054    3,13:Door(60,25);\r
1055    2,11:move(62);\r
1056    28,24,31:case N1 of 37,59:RS(133);38,44:RL(322);93:RL(319);\r
1057              94:RS(134)end;\r
1058    42,44,75:if N1 in[37,38,44] then RL(318);\r
1059    end;\r
1060 \r
1061 62:case Vb of  { Booth (Jungle Planet) }\r
1062    1,13:move(61);\r
1063    42,44,75:\r
1064      case N1 of\r
1065       37,38:RL(318);\r
1066       44:begin RS(138);\r
1067           for y:=60 downto 1 do for x:=800 downto 1 do sound(x*y);\r
1068           nosound;TFlag:=3;Brief:=Brief-[70];Score(10,89);\r
1069           for x:=1 to MMax do if R[x]=62 then R[x]:=70;move(70)\r
1070          end\r
1071      end;\r
1072    28,24,31:case N1 of 37,59:RS(133);38:RL(322);93:RL(319);\r
1073              94:RS(134);44:RL(320);end;\r
1074    end; {Vb}\r
1075 \r
1076 63:case Vb of  { Booth (Ringed Planet) }\r
1077    1,13:RL(328);\r
1078    42,44,75:case N1 of\r
1079             37,38:RL(318);\r
1080             44:begin RS(138);\r
1081                 for y:=60 downto 1 do for x:=800 downto 1 do sound(x*y);\r
1082                 nosound;TFlag:=3;Brief:=Brief-[70];\r
1083                 for x:=1 to MMax do if R[x]=63 then R[x]:=70;move(70)\r
1084                end\r
1085             end;\r
1086    28,24,31:case N1 of 37,59:RS(133);38:RL(322);93:RL(319);\r
1087              94:RS(134);44:RL(320);end;\r
1088    39:if(30 in NounSet)and(20 in L[63])then R[20]:=63;\r
1089    end; {Vb}\r
1090 \r
1091  end {main case}\r
1092 end; { Room13 }\r
1093 {----------}\r
1094 overlay procedure Room14;   { Inner Planet }\r
1095 begin\r
1096 case Prm of\r
1097 64:case Vb of  { Lobby }\r
1098    1,13:begin DOpen(99);RS(139);DEAD;end;\r
1099    2,11:move(65);\r
1100    28:case N1 of 35:RL(330);49,122:RL(334);72,116:begin Score(5,90);RS(148)end;\r
1101        81:RB(5,11);86:RL(333);127:RL(351)end;\r
1102    31:if N1=81 then RB(5,11);\r
1103    20,24:if N1=127 then RS(142);\r
1104    54:if N1=127 then if Md=3 then begin RL(537);DEAD;end else RL(538);\r
1105    end;\r
1106 \r
1107 65:case Vb of  { North Corridor }\r
1108    1:move(64);\r
1109    2:move(66);\r
1110    4:Door(68,20);\r
1111    28:if N1=56 then RL(92);\r
1112    end;\r
1113 \r
1114 66:case Vb of  { Central Corridor }\r
1115    1:move(65);\r
1116    2:move(67);\r
1117    3:if T[20]>1 then begin Score(15,91);move(73)end else RL(92);\r
1118    4:move(72);\r
1119    28:case N1 of 56:if T[20]>1 then RL(370)else RL(92);64:RL(335)end;\r
1120    33:if N2=64 then\r
1121        if Pr=5 then\r
1122         if N1=12 then\r
1123          begin RL(336);T[20]:=3;DOpen(20);Score(5,92)end\r
1124         else RL(137);\r
1125    end; {Vb}\r
1126 \r
1127 67:case Vb of  { South Corridor }\r
1128    1:move(66);\r
1129    2,11:Door(75,5);\r
1130    4:move(71);\r
1131    end;\r
1132 \r
1133 71:case Vb of  { Monitor Station }\r
1134    3:move(67);\r
1135    28:case N1 of 59:if CodeSet=4 then RL(353)else RL(355);116:RL(354)end;\r
1136    31:if N1=59 then\r
1137        if CodeSet=4 then begin RB2(11,14);Pause;end else RL(355);\r
1138    end;\r
1139 \r
1140 72:case Vb of  { Reactor Control }\r
1141    3:move(66);\r
1142    28,24:case N1 of 128:RL(560);\r
1143        37,38:RL(339);46:if Md<>Null then begin Score(5,93);RL(343)end\r
1144               else RS(145);\r
1145        55:if en(46)then\r
1146            if RobotCon<>Null then\r
1147             writeln('The robot''s panel contains a ',FN(RobotCon),'.')\r
1148            else RL(346)\r
1149           else RL(344);\r
1150       end;\r
1151    33:if N2=55 then\r
1152        if Pr=5 then\r
1153         if en(46)then\r
1154          if RobotCon=Null then\r
1155           if N1 in[3,4,8,12,17]then\r
1156            begin Van(N1);RL(347);R[N1]:=72;RobotCon:=N1;end\r
1157           else RL(137)\r
1158          else RL(348)\r
1159         else RL(344);\r
1160    41:if N1 in[55,46] then\r
1161        if RobotCon=Null then RL(558)else\r
1162         begin R[RobotCon]:=72;Add(46);Score(25,94);\r
1163          writeln('The panel slides open, revealing a ',FN(RobotCon),' inside.')\r
1164         end;\r
1165    53:if N1=55 then begin Van(RobotCon);Min(46);RL(344)end;\r
1166    42,44:case N1 of\r
1167           37,38,44:begin RL(340);Walls(9);gotoxy(43,wherey-1);col(28,31);\r
1168                     writeln('BOOM!');Explode(32);DEAD;end;\r
1169           46:if(VStr='turn on')or(VStr='activat')or\r
1170                (VStr='turn off')then RL(341)\r
1171              else if(not en(94))and(not en(93))then begin RL(342);RL(559)end\r
1172                   else RL(342)\r
1173          end;\r
1174    end; {Vb}\r
1175 \r
1176  end {main case}\r
1177 end; { Room14 }\r
1178 {----------}\r
1179 overlay procedure Room15;   { Inner Planet }\r
1180 begin\r
1181 case Prm of\r
1182 68:case Vb of  { Decontamination }\r
1183    3,13:if en(45)then Door(65,20) else RL(331);\r
1184    4,11:Door(69,20);\r
1185    28,24:case N1 of 131:RL(329);end;\r
1186    42,44,75:if N1=44 then begin RL(332);Add(45);play(20,99,7);play(99,99,600);\r
1187       play(99,20,7);Score(10,95)end;\r
1188    end;\r
1189 \r
1190 69:case Vb of  { Waiting Room }\r
1191    2,11:Door(70,50);\r
1192    3,13:Door(68,20);\r
1193    28,24:case N1 of 35:RL(330);131:RL(329);end;\r
1194    end;\r
1195 \r
1196 70:case Vb of  { Transporter Booth }\r
1197    1,13:Door(69,50);\r
1198    28,24:case N1 of 44:RS(140);93:RL(319);94:RS(141);end;\r
1199    42,44,75:\r
1200      if N1 in[40..43]then\r
1201       begin Brief:=Brief-[62,63,78];RS(138);Min(45);\r
1202        for y:=60 downto 1 do for x:=800 downto 1 do sound(x*y);nosound;\r
1203         case N1 of\r
1204          40:begin for x:=1 to MMax do if R[x]=70 then R[x]:=78;\r
1205              TFlag:=4;move(78);Score(15,97)end;\r
1206          41:begin for x:=1 to MMax do if R[x]=70 then R[x]:=62;\r
1207              TFlag:=2;move(62)end;\r
1208          43:begin for x:=1 to MMax do if R[x]=70 then R[x]:=63;\r
1209              TFlag:=2;move(63);Score(10,96)end\r
1210         end;\r
1211       end;\r
1212    end; {Vb}\r
1213 \r
1214 { 71 and 72 are in Room14 }\r
1215 \r
1216  end {main case}\r
1217 end; { Room15 }\r
1218 {----------}\r
1219 overlay procedure Room16;   { Inner Planet }\r
1220 begin\r
1221 case Prm of\r
1222 73:case Vb of  { Communications }\r
1223    1:move(74);\r
1224    4:Door(66,20);\r
1225    28:case N1 of\r
1226        48:begin RL(366);writeln('The dial is set at number ',CodeSet,'.')end;\r
1227        115:RL(350);121:RL(367);127:RL(351)\r
1228       end;\r
1229    50:if N1=48 then\r
1230        if Pr>Null then\r
1231         if(code>0)and(code<11)then\r
1232          begin RL(363);CodeSet:=Code;if Code=4 then Score(10,98)end\r
1233         else RL(362)\r
1234        else RL(365);\r
1235    end; {Vb}\r
1236 \r
1237 74:case Vb of  { Computer Station }\r
1238    2:move(73);\r
1239    28:case N1 of 37:RL(349);38:RL(322);52:RL(37);\r
1240        59:begin RB2(7,10);col(26,23);RL(364);Score(5,47)end end;\r
1241    31:if N1=59 then begin RB2(7,10);col(26,23);RL(364);Add(47)end;\r
1242    end;\r
1243 \r
1244 75:case Vb of  { Elevator  1st Floor }\r
1245    1:Door(67,5);\r
1246    42,44,75:begin RS(143);play(20,42,20);sound(42);delay(5500);RL(338);\r
1247    play(42,20,20);Prm:=76;for x:=1 to MMax do if R[x]=75 then R[x]:=76;end;\r
1248    end;\r
1249 \r
1250 76:case Vb of  { Elevator  2nd  Floor }\r
1251    1:begin Score(5,99);Door(77,5)end;\r
1252    42,44,75:begin RS(144);play(20,42,20);sound(42);delay(5500);RL(338);\r
1253              play(42,20,20);Prm:=75;for x:=1 to MMax do if R[x]=76 then R[x]:=75;end;\r
1254    end;\r
1255 \r
1256 77:case Vb of  { Observatory }\r
1257    2:Door(76,5);\r
1258    28:case N1 of 34:RL(562);104:if Nstr='eyepiec' then RL(561)else RS(146)end;\r
1259    24:if N1=104 then\r
1260        if 20 in Wear then begin Score(5,100);RS(147)end\r
1261        else begin RL(368);RL(369)end;\r
1262    end;\r
1263 \r
1264  end {main case}\r
1265 end; { Room16 }\r
1266 {----------}\r
1267 overlay procedure Room17;   { Planetship }\r
1268 begin\r
1269 case Prm of\r
1270 78:case Vb of  { Icy Platform }\r
1271    3,11:door(79,25);\r
1272    28:case N1 of\r
1273        54:RL(379);93:RL(380);96:RL(381);103:RL(500);115:RL(350);118:RL(382)\r
1274       end;\r
1275    59:if N1=54 then begin RL(400);DEAD;end;\r
1276    end;\r
1277 \r
1278 79:case Vb of  { Confirmation Port }\r
1279    4,13:door(78,25);\r
1280    28:case N1 of 44:RL(383);64:RL(384);116:RL(600)end;\r
1281    44,75:if N1=44 then begin RS(156);Score(10,50);\r
1282           play(20,99,7);play(99,99,600);play(99,20,7)end;\r
1283    33:if N2=64 then\r
1284        if Pr=5 then\r
1285         if N1=17 then\r
1286          begin Explode(1);sound(50);RS(151);\r
1287           for i:=9000 downto 1 do\r
1288            for j:=1 to 4 do sound(random(i div 2 + 400)+i);nosound;\r
1289           Van(17);L[80]:=L[80]+[17];move(80);Add(7);T[22]:=3;T[26]:=91;\r
1290           delay(900);sound(70);RL(399);delay(999);nosound;Score(25,101);\r
1291           n[40]:='sockets\socket\';\r
1292           n[82]:='laser beam\laser\beam\';\r
1293           n[110]:='speaker\';\r
1294          end\r
1295         else RL(137);\r
1296    end;\r
1297 \r
1298 80:case Vb of  { Inspection Lobby }\r
1299    4,13:door(81,65);\r
1300    9:RL(523);\r
1301    28:case N1 of 55:RL(385);86:if 17 in L[80]then RL(395);72,116:RS(148)end;\r
1302    41..44,88,53:if N1=55 then RL(405);\r
1303    end;\r
1304 \r
1305  end {main case}\r
1306 end; { Room17 }\r
1307 {----------}\r
1308 overlay procedure Room18;   { Planetship }\r
1309 begin\r
1310 case Prm of\r
1311 81:case Vb of  { Circular Corridor }\r
1312    2:move(82);\r
1313    3,11:door(80,65);\r
1314    6:move(88);\r
1315    28:case N1 of 72:RL(386)end;\r
1316    end;\r
1317 \r
1318 82:case Vb of  { Circular Corridor }\r
1319    1:move(81);\r
1320    3:door(96,50);\r
1321    4:door(93,5);\r
1322    8:move(83);\r
1323    28:case N1 of 72,103:RL(387)end;\r
1324    end;\r
1325 \r
1326 83:case Vb of  { Circular Corridor }\r
1327    2,11:door(95,25);\r
1328    4:move(84);\r
1329    5:move(82);\r
1330    28:case N1 of 72,115:RL(388)end;\r
1331    end;\r
1332 \r
1333 93:case Vb of  { Central Elevator }\r
1334    3,11,13:case Floor of\r
1335       1:door(82,5);\r
1336       2..5,30..40,89..95,170..230,333..444,543..600,793..812:RL(413);\r
1337       480:if en(64)then\r
1338            begin door(98,5);delay(999);RS(217);Score(20,102);\r
1339             for x:=1 to 7 do begin i:=random(7000)+1500;j:=random(600)+400;\r
1340              play(i,i,j)end;\r
1341             RL(516)end\r
1342            else RL(413)\r
1343       else begin door(97,5);Score(5,103)end\r
1344      end;\r
1345    28:if N1 in[44,52] then RS(188);\r
1346    56:begin val(input,i,testc);\r
1347        if testc=0 then\r
1348         if(i>0)and(i<837)then\r
1349          if i<>Floor then\r
1350           begin j:=i;i:=abs(floor-i);Floor:=j;RL(411);play(20,36,35);\r
1351            sound(37);for x:=1 to 200 do delay(i div 4);\r
1352            RL(412);play(36,20,35);\r
1353           end\r
1354          else RL(410)\r
1355         else RL(410)\r
1356        else crazy\r
1357       end\r
1358    end;\r
1359 \r
1360 95:case Vb of  { Transmission Room }\r
1361    1,13:door(83,25);\r
1362    28:if N1 in[38,121]then RS(191);\r
1363    42,44,75:if N1=44 then begin Score(5,104);RL(404);play(1200,1200,99);\r
1364      if en(48)then Min(48)else Add(48)end;\r
1365    end;\r
1366 \r
1367 96:case Vb of  { Station Control }\r
1368    4,13:door(82,50);\r
1369    28:case N1 of 38:RS(192);59:begin Score(5,105);RB2(11,5);Pause;end end;\r
1370    31:if N1=59 then begin Score(5,105);RB2(11,5);Pause;end;\r
1371    end;\r
1372 \r
1373  end {main case}\r
1374 end; { Room18 }\r
1375 {----------}\r
1376 overlay procedure Room19;   { Planetship }\r
1377 begin\r
1378 case Prm of\r
1379 84:case Vb of  { Circular Corridor }\r
1380    2,11:door(94,65);\r
1381    3:move(83);\r
1382    6:move(85);\r
1383    28:case N1 of 72,46:RL(389)end;\r
1384    end;\r
1385 \r
1386 85:case Vb of  { Circular Corridor }\r
1387    1:move(86);\r
1388    4,11:door(92,65);\r
1389    7:move(84);\r
1390    28:case N1 of 72:RL(390)end;\r
1391    end;\r
1392 \r
1393 86:case Vb of  { Circular Corridor }\r
1394    2:move(85);\r
1395    4,11:if T[21]>1 then begin Score(15,107);move(91);\r
1396       if en(52)then T[23]:=2;end else RL(92);\r
1397    5:move(87);\r
1398    28:case N1 of 56:if T[21]>1 then RL(370);64:RL(335);72,69:RL(391)end;\r
1399    33:if N2=64 then\r
1400        if Pr=5 then\r
1401         if N1=12 then\r
1402          begin RL(336);T[21]:=3;DOpen(15);Score(5,106)end\r
1403         else RL(137);\r
1404    end;\r
1405 \r
1406 87:case Vb of  { Circular Corridor }\r
1407    1,11:door(89,65);\r
1408    3:move(88);\r
1409    8:move(86);\r
1410    28:case N1 of 72:RL(392)end;\r
1411    end;\r
1412 \r
1413 88:case Vb of  { Circular Corridor }\r
1414    1,11:door(90,65);\r
1415    4:move(87);\r
1416    7:move(81);\r
1417    28:case N1 of 72:RL(392)end;\r
1418    end;\r
1419 \r
1420 89:case Vb of  { Reactors West }\r
1421    2,13:door(87,65);\r
1422    3:move(90);\r
1423    28:case N1 of 38:RL(414);59:RL(401);128:RS(189)end;\r
1424    31:if N1=59 then\r
1425        case ScrnSet of\r
1426         1:RB2(8,6);   { Orange Crystal }\r
1427         2:RB2(10,10); { Green Crystal  }\r
1428         3:RB2(12,14); { Yellow Crystal }\r
1429         4:begin RB2(14,9);  { Blue Crystal (Cracked) }\r
1430            x:=wherex;y:=wherey;gotoxy(40,14);col(25,23);write('LACITIRC');\r
1431            gotoxy(x,y);Score(20,108)\r
1432           end;\r
1433        end;\r
1434     44,75:if N1=44 then\r
1435            begin RL(402);ScrnSet:=ScrnSet+1;if ScrnSet>4 then ScrnSet:=1;\r
1436             for x:=1 to 30 do\r
1437              begin i:=random(7000)+999;play(i,i,50);delay(random(15)+5)end\r
1438            end else\r
1439           if N1 in[38,128]then RL(403);\r
1440      42,75:if N1 in[38,128]then RL(403);\r
1441    end;\r
1442 \r
1443  end {main case}\r
1444 end; { Room19 }\r
1445 {----------}\r
1446 overlay procedure Room20;   { Planetship }\r
1447 begin\r
1448 case Prm of\r
1449 90:case Vb of  { Reactors East }\r
1450    2,13:door(88,65);\r
1451    4:move(89);\r
1452    28:case N1 of 38:RL(393);59:RL(402);128:RS(190)end;\r
1453    31:if N1=59 then begin Score(5,109);RB2(9,random(14)+1)end;\r
1454    42,44,75:if N1 in[38,128]then RL(403);\r
1455    end;\r
1456 \r
1457 91:case Vb of  { Emergency Override }\r
1458    3,13:begin if T[25]>2 then\r
1459       begin Col(10,7);RL(424);T[25]:=Null;T[24]:=Null;T[26]:=14;Add(52)end;\r
1460       door(86,15);\r
1461       if(T[24]>0)and not en(64)then begin T[24]:=Null;T[26]:=14;Add(52)end\r
1462      end;\r
1463    4,11:RL(92);\r
1464    28:case N1 of 37,38,51:RL(393);44:RL(469);59:RL(468);64:RL(335);\r
1465        69:if en(51)then RL(426)else if Md=1 then RL(467)else RS(182);\r
1466       end;\r
1467    31:if N1=59 then RL(468);\r
1468    24:if N1=69 then if en(51)then crazy else RL(427);\r
1469    75:if N1=69 then if en(51)then crazy else RL(428);\r
1470    54:case N1 of\r
1471        69:if en(51)then RL(426)else\r
1472           if N2 in[0,60]then RL(601)else\r
1473           if not(N2 in[10,18,29])then RL(602)else\r
1474            begin RS(160);L[91]:=L[91]+[123];L[91]:=L[91]-[44,129];T[23]:=15;\r
1475             Add(51)end;\r
1476       end;\r
1477    42,44:if(N1=69)and not en(51)then RL(470)else\r
1478          if N1=44 then begin RL(471);play(20,440,1);play(440,440,500);\r
1479           play(440,20,1);end;\r
1480    41,88:if N1=69 then if en(51)then crazy else RL(467);\r
1481    39:if N1=95 then RL(442);\r
1482    49:if N2=123 then\r
1483        if Pr=1 then\r
1484         if N1=1 then\r
1485          if(T[24]>1)and(T[24]<6)then\r
1486           begin T[24]:=Null;T[25]:=7;RS(181)end\r
1487          else RL(429)\r
1488         else RL(425);\r
1489    33:if N2=64 then\r
1490        if Pr=5 then\r
1491         if N1=12 then RL(577);\r
1492    end;\r
1493 \r
1494 92:case Vb of  { Climate Control }\r
1495    3,13:door(85,65);\r
1496    28,31:case N1 of 59:RS(152);end;\r
1497    end;\r
1498 \r
1499  end {main case}\r
1500 end; { Room20 }\r
1501 {----------}\r
1502 overlay procedure Room21;   { Planetship }\r
1503 begin\r
1504 case Prm of\r
1505 94:case Vb of  { Maintenance }\r
1506    1,13:door(84,65);\r
1507    28:case N1 of\r
1508        51:RL(489);\r
1509        87:begin RL(490);Score(15,110);\r
1510            if not en(49)then\r
1511             begin Score(10,49);RL(396);L[94]:=L[94]+[26];end\r
1512            else if 26 in L[94] then RL(397);\r
1513           end;\r
1514       end; {case}\r
1515    39:begin\r
1516        if(30 in NounSet)then\r
1517         begin if 2 in L[94] then R[2]:=94;if 26 in L[94] then R[26]:=94;end;\r
1518        if(51 in NounSet)then\r
1519         begin RL(491);NounSet:=NounSet-[51];\r
1520          if not(NounSet=[])then SFlag:=false end\r
1521       end;\r
1522    end;\r
1523 \r
1524 97:case Vb of  { Cryogenic Chamber }\r
1525    4,11,13:door(93,5);\r
1526    28:if N1=69 then RS(193);\r
1527    18:begin RS(194);Van(N1)end;\r
1528    end;\r
1529 \r
1530 98:case Vb of  { Identity Booth }\r
1531    2,11:begin door(99,0);\r
1532       if T[27]>1 then begin Col(10,7);RS(208);delay(999);Blast;DEAD end\r
1533       else begin T[27]:=2000;Col(10,7);RL(504);play(22,22,999);RS(210);\r
1534             delay(999);Blast;RL(505)end\r
1535      end;\r
1536    4,13:door(93,5);\r
1537    28,31:case N1 of 81,119:if NStr='message' then RL(517)else RB2(13,13);\r
1538           59:RL(517)end;\r
1539    end;\r
1540 \r
1541 99:case Vb of  { Security Tunnel #1 }\r
1542    1,13:door(98,0);\r
1543    2,11:begin Score(15,111);door(100,0)end;\r
1544    4:RL(506);\r
1545    41,88:if N1=55 then RL(509);\r
1546    28:case N1 of 46:RS(216);55:RL(510);88:RL(511)end;\r
1547    42,44,75:if N1=46 then begin RL(513);T[27]:=2000;Add(7)end;\r
1548    39:if 88 in NounSet then begin RL(513);T[27]:=2000;Add(7)end;\r
1549    end;\r
1550 \r
1551 100:case Vb of  { Security Tunnel #2 }\r
1552     1,13:begin door(99,0);Col(10,7);RS(208);delay(999);Blast;DEAD end;\r
1553     2,11:begin door(101,0);\r
1554        if T[28]>1 then begin Col(10,7);RS(209);delay(999);Blast;DEAD end\r
1555        else begin T[28]:=2000;Col(10,7);RL(504);play(22,22,999);RS(211);\r
1556              delay(999);Blast;RS(212);PStat:=PStat+[4];T[29]:=14;end;\r
1557       end;\r
1558     41,88:if N1=55 then RL(512);\r
1559     end;\r
1560 \r
1561  end {main case}\r
1562 end; { Room21 }\r
1563 {----------}\r
1564 overlay procedure Room22;   { Planetship (Lower Level) }\r
1565 begin\r
1566 case Prm of\r
1567 101:case Vb of  { Security Tunnel #3 }\r
1568     1,13:door(100,0);\r
1569     2,11:begin Region:=5;door(102,0);Score(20,112);\r
1570        if not(20 in Wear)then RL(492)end;\r
1571     41,88:if N1=55 then RL(509);\r
1572     28:case N1 of 46:RS(216);55:RL(510);88:RL(511)end;\r
1573     42,44,75:if N1=46 then begin RL(513);T[28]:=2000;Add(7)end;\r
1574     39:if 88 in NounSet then begin RL(513);T[28]:=2000;Add(7)end;\r
1575     end;\r
1576 \r
1577 102:if(Vb in[1..14,16,20..31,33..44,48..64,73..76,83..85,88..94])and\r
1578       not(20 in Wear)then RL(491) else\r
1579     case Vb of  { North Catwalk }\r
1580     1,11,13:begin Region:=Null;Door(101,0);Col(10,7);RS(209);delay(999);\r
1581        Blast;DEAD end;\r
1582     7:move(103);\r
1583     8:move(105);\r
1584     24,25,28:case N1 of 34,49:RL(493);\r
1585       131:if NStr='catwalk' then RL(494)else begin RS(195);RS(196)end end;\r
1586     75,76:if N1=42 then RL(495);\r
1587     51,59:if N1 in[42,54,131]then begin RL(496);DEAD;end;\r
1588     end;\r
1589 \r
1590 103:if(Vb in[1..14,16,20..31,33..44,48..64,73..76,83..85,88..94])and\r
1591       not(20 in Wear)then RL(491) else\r
1592     case Vb of  { East Catwalk }\r
1593     6:move(102);\r
1594     8:move(104);\r
1595     24,25,28:case N1 of 34,49:RL(493);\r
1596       131:if NStr='catwalk' then RL(494)else begin RS(195);RS(196)end end;\r
1597     75,76:if N1=42 then RL(495);\r
1598     51,59:if N1 in[42,54,131]then begin RL(496);DEAD;end;\r
1599     end;\r
1600 \r
1601 104:if(Vb in[1..14,16,20..31,33..44,48..64,73..76,83..85,88..94])and\r
1602       not(20 in Wear)then RL(491) else\r
1603     case Vb of  { South Catwalk }\r
1604     2,13:begin Region:=Null;Door(106,5);Score(20,113)end;\r
1605     5:move(103);\r
1606     6:move(105);\r
1607     24,25,28:case N1 of 34,49:RL(493);\r
1608       131:if NStr='catwalk' then RL(494)else begin RS(195);RS(196)end end;\r
1609     75,76:if N1=42 then RL(495);\r
1610     51,59:if N1 in[42,54,131]then begin RL(496);DEAD;end;\r
1611     end;\r
1612 \r
1613 105:if(Vb in[1..14,16,20..31,33..44,48..64,73..76,83..85,88..94])and\r
1614       not(20 in Wear)then RL(491) else\r
1615     case Vb of  { West Catwalk }\r
1616     5:move(102);\r
1617     7:move(104);\r
1618     24,25,28:case N1 of 34,49:RL(493);\r
1619       131:if NStr='catwalk' then RL(494)else begin RS(195);RS(196)end end;\r
1620     75,76:if N1=42 then RL(495);\r
1621     51,59:if N1 in[42,54,131]then begin RL(496);DEAD;end;\r
1622     end;\r
1623 \r
1624  end {main case}\r
1625 end; { Room22 }\r
1626 {----------}\r
1627 overlay procedure Room23;   { Planetship (Lower Level) }\r
1628  label JUMP;\r
1629 begin\r
1630 case Prm of\r
1631 106:case Vb of  { Junction }\r
1632     1:begin Region:=5;Door(104,5);if not(20 in Wear)then RL(492)end;\r
1633     2:RL(328);\r
1634     3:door(108,5);\r
1635     4,11,13:door(107,20);\r
1636     41..44,88:if N1=56 then RL(532);\r
1637     end;\r
1638 \r
1639 107:case Vb of  { Conference Room }\r
1640     3,13:door(106,20);\r
1641     39:if(30 in NounSet)and(19 in L[107])then R[19]:=107;\r
1642     end;\r
1643 \r
1644 108:case Vb of  { Reactor Regulators }\r
1645     4,13:door(106,5);\r
1646     41:if N1=55 then\r
1647         if not en(65)then\r
1648          begin Add(65);L[108]:=L[108]+[40];Score(5,114);\r
1649           for x:=22 to 25 do R[x]:=108;RL(519);RL(520);\r
1650          end\r
1651         else RL(521);\r
1652     53:if en(65)then RL(522)else RL(523);\r
1653     28,24:case N1 of 55:if en(65)then goto JUMP else RL(523);\r
1654          40:JUMP:\r
1655            begin RL(525);\r
1656             for x:=1 to 25 do if x in Socket then\r
1657              if x=22 then writeln('  An ',FN(x),' is in one of the sockets.')\r
1658              else writeln('  A ',FN(x),' is in one of the sockets.')\r
1659            end;\r
1660           end;\r
1661     33:if(N2 in[40,55])and en(65)then\r
1662         begin i:=0;for x:=1 to 25 do if x in Socket then i:=i+1;\r
1663          if i<4 then\r
1664           if N1 in Inv then\r
1665            if N1 in[1,22..25]then\r
1666             begin\r
1667              writeln('The ',FN(N1),' fits perfectly in an open socket.');\r
1668              Van(N1);Socket:=Socket+[N1];R[N1]:=108;\r
1669              i:=0;for x:=1 to 25 do if x in Socket then i:=i+1;\r
1670              if(i>3)and(1 in Socket) and not(25 in Socket)then\r
1671               begin { ####  You have won the game!!!!!  #### }\r
1672                Col(10,7);delay(999);Static;Static;RS(221);Static;Static;\r
1673                delay(999);explode(1);sound(20);RS(222);delay(999);RS(223);\r
1674                Pause;Bor(0,0);writeln;Score(55,115);\r
1675                Add(66);Prm:=109;PStat:=[];PlayerInput(Line);\r
1676                Col(10,15);for x:=224 to 229 do RS(x);\r
1677                writeln;writeln;Pause;writeln;\r
1678                WON;  {  <<<-----  END OF GAME !!! *************}\r
1679               end\r
1680             end\r
1681            else writeln('The ',FN(N1),' won''t fit in any of the sockets.')\r
1682           else writeln('First you must have the ',FN(N1),'.')\r
1683          else RL(526)\r
1684         end;\r
1685     end;\r
1686 \r
1687  end {main case}\r
1688 end; { Room23 }\r
1689 {----------}\r
1690 {**************************** END OF ROOM ROUTINES **************************}\r
1691 \r
1692 \r
1693 {$Ia:DEFAULT.pas   <<<<<------  LOADS IN DEFAULT ROUTINES  *******************}\r
1694 \r
1695 \r
1696 BEGIN { Main Program }\r
1697 Assign1;Assign2;Assign3;Assign4;Assign5;\r
1698 Names1;Names2;Names3;\r
1699 Title;\r
1700 Init1;Init2;Init3;\r
1701 Place1;Place2;\r
1702 Describe(Prm);\r
1703 \r
1704 repeat\r
1705 \r
1706 PlayerInput(LINE);\r
1707 if length(input)>0 then Parser_Syntax(input);\r
1708 if EFlag=Legal then\r
1709  begin\r
1710   MoreThanOne;\r
1711   if Present then\r
1712    if T[2]>1 then\r
1713     begin RL(11);Time1;\r
1714      case TFlag of 1:Time2A;2:Time2B;3:Time2C;4:Time2D;end end\r
1715    else\r
1716     begin SFlag:=false; if(Vb=71)and(Prm=55)and not en(35)then Vb:=1;\r
1717      case Prm of\r
1718        1                          :Room1;\r
1719        2,3                        :Room2;\r
1720        4..7                       :Room3;\r
1721        8..12                      :Room4;\r
1722       13..22                      :Room5;\r
1723       23..29                      :Room6;\r
1724       30..34                      :Room7;\r
1725       35..38                      :Room8;\r
1726       39..41                      :Room9;\r
1727       42..50                      :Room10;\r
1728       51..55                      :Room11;\r
1729       56                          :Room12;\r
1730       57..63                      :Room13;\r
1731       64..67,71,72                :Room14;\r
1732       68..70                      :Room15;\r
1733       73..77                      :Room16;\r
1734       78..80                      :Room17;\r
1735       81..83,93,95,96             :Room18;\r
1736       84..89                      :Room19;\r
1737       90..92                      :Room20;\r
1738       94,97..100                  :Room21;\r
1739       101..105                    :Room22;\r
1740       106..108                    :Room23;\r
1741      end; { Room Defaults }\r
1742      if not SFlag then\r
1743       case Vb of\r
1744        1..8,30,82,87              :Default0;\r
1745        16,17,18                   :Default1;\r
1746        9..15,32,35,51,77,79,62    :Default2;\r
1747        28,47                      :Default3;\r
1748        37,39                      :Default4;\r
1749        46,64                      :Default5;\r
1750        66..69,71                  :Default6;\r
1751        31,65,75,80,81,83,84,93,95 :Default7;\r
1752        41,50,88                   :Default8;\r
1753        20,22,24,26,70,76          :Default9;\r
1754        33                         :Default10;\r
1755        42,44,73,86,89,90,94       :Default11;\r
1756        48,54                      :Default12;\r
1757        19,53,56,72,74,78,91       :Default13;\r
1758        21,25,49,59,92             :Default14\r
1759       end;\r
1760      if en(128)then DEAD;Min(128);\r
1761      if not(Vb in[77..79,82,86,87,95])then\r
1762       begin Time1;case TFlag of 1:Time2A;2:Time2B;3:Time2C;4:Time2D;end end;\r
1763     end;\r
1764  end;\r
1765 \r
1766 until false;\r
1767 END. { ADGAME2 (Supernova) }\r
1768 \1a\r