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