1 {//-------------------------------------------------------------------------}
3 {Copyright (C) 2014 Jason Self <j@jxself.org> }
5 {This file is free software: you may copy, redistribute and/or modify it }
6 {under the terms of the GNU Affero General Public License as published by }
7 {the Free Software Foundation, either version 3 of the License, or (at your }
8 {option) any later version. }
10 {This file is distributed in the hope that it will be useful, but WITHOUT }
11 {ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or }
12 {FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}
15 {You should have received a copy of the GNU Affero General Public License }
16 {along with this program; if not, see https://gnu.org/licenses or write to: }
17 { Free Software Foundation, Inc. }
18 { 51 Franklin Street, Fifth Floor }
19 { Boston, MA 02110-1301 }
22 {This file incorporates work covered by the following copyright and }
25 {Copyright (C) 1990, 2009 - Apogee Software, Ltd. }
27 {This file is part of Beyond The Titanic. Beyond The Titanic is free }
28 {software; you can redistribute it and/or modify it under the terms of the }
29 {GNU General Public License as published by the Free Software Foundation; }
30 {either version 3 of the License, or (at your option) any later version. }
32 {This program is distributed in the hope that it will be useful, but WITHOUT}
33 {ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or }
34 {FITNESS FOR A PARTICULAR PURPOSE. }
36 {See the GNU General Public License for more details. }
38 {You should have received a copy of the GNU General Public License }
39 {along with this program; if not, write to: }
40 { Free Software Foundation, Inc. }
41 { 51 Franklin Street, Fifth Floor }
42 { Boston, MA 02110-1301 }
45 {Original Source: 1990 Scott Miller }
46 {Prepared for public release: 03/19/09 - Joe Siegler, Apogee Software, Ltd. }
48 {//-------------------------------------------------------------------------}
49 {****************************************************************************}
52 {* These are misc procedures and functions used with the main file: AdGame *}
53 {* Copyright 1984 Pending *}
54 {****************************************************************************}
59 begin FlagSA:='s' end;
61 function En(c : char) : boolean;
63 if(c in Ev)then En:=True else En:=False
66 function Here(noun : integer): Boolean;
68 if(noun=-1) then Here:=False
71 if(noun in Inven)or(r[noun]=Prm)or(noun in p[Prm])then Here:=True
78 if(random(2)=1)then RL(107+random(7))else RL(300+random(6));
85 gotoxy(1,25);for x:=1 to 7 do writeln;
86 Textcolor(1);TextBackground(m9);
88 write('*********************************************************',
89 '***********************');writeln;
90 gotoxy(1,19); for x:=1 to 3 do
94 write('*********************************************************',
95 '***********************');writeln;
96 TextColor(m0);gotoxy(32,20);writeln('YOU HAVE DIED!!!');
97 Textcolor(m2);Textbackground(0);
98 for c:=700 downto 20 do
99 for b:=70 downto 1 do sound(b*c);nosound;
100 close(Rooms1);close(rooms2);close(special1);close(special2);close(line1);
101 gotoxy(1,23);DelLine;DelLine;writeln;write('Do you wish to play again? ');
103 if(upcase(flag)<>'N')then
105 writeln('Restarting...');window(1,1,80,25);
106 SysUtils.ExecuteProcess('beyond', '', []);
114 writeln(' Beyond the Titanic');
115 writeln('A Scott Miller Production');
116 writeln(' Have a nice day...');
118 assign(FileName,'MENU.COM');
122 if IOResult <> 0 then HALT;
127 var b,c,x,y,o:Integer;
129 gotoxy(1,25);for x:=1 to 7 do writeln;
130 Textcolor(25);Textbackground(m7);
132 write('#########################################################',
133 '#######################');writeln;
134 gotoxy(1,19); for x:=1 to 3 do
138 write('#########################################################',
139 '#######################');writeln;
140 TextColor(31);gotoxy(25,20);writeln('Y O U H A V E W O N ! ! !');
141 Textcolor(m2);Textbackground(0);
142 gotoxy(1,23);DelLine;DelLine;writeln;
143 for x:=150 downto 1 do begin sound(x*55);delay(8);nosound;delay(20)end;
144 if(Sc>1000)then Sc:=1000;
145 write('You finished with a score of ',Sc,', which makes you a ');
147 begin writeln('Perfect Adventurer!!!');
150 for x:= 99+(o*430)to 998+(o*430)do begin sound(25);sound(x)end
152 else writeln('Master Adventurer!');
153 for c:=1 to 999 do for b:=1 to 61 do sound(b*c);nosound;
155 writeln('Reboot your computer to regain control...')
158 procedure Say(o : integer; p : str14);
160 writeln('The ',n[o,1],' is already ',p,'.'); SA
166 if((tic>42)and not(en('c')))or((tic>146)and not(en('n')))or(en('r'))then
168 if(tic>42)and (not(en('c')))then RL(192)
169 else if(tic>146)and not(en('n'))then RL(192);
170 if(en('r'))then RL(51)
175 procedure Monster(var NewRm : integer);
177 if(NewRm=MnRm)and(MnRm=25)then begin Attack:=False;RL(384)end else
178 if(NewRm<>35)or not(en('v'))then
180 p[Prm]:=p[Prm]-[23];p[NewRm]:=p[NewRm]+[23];MnRm:=NewRm;Attack:=False;
181 if not((NewRm=30)and(Verb in[27,28]))then
183 0:RS(71);1:RS(72);2:RL(359);3:RL(360);4:RL(361);5:RL(362);6:RL(363)
186 else begin RL(383);Attack:=False end
189 procedure DescribeRm;
191 procedure s(r : str14);
192 begin TextColor(m8);writeln(r);TextColor(m2);loc:=r;end;
194 if((en('a'))and(here(29)))or not(Prm in [6..24])then begin
196 0:s('Ship''s Fore');1:s('Ship Mid-Deck');2:s('Rear of Ship');
197 3:s('Life Boat');4:s('Ocean Surface');5:s('Huge Cavern');
198 6:s('Cave of Pins');7:s('Ocean Bottom');8:s('Squeaky Cave');
199 9:s('Stream Bend');10:s('Waterfall');13:s('Sloppy Cave');
200 11:s('Hex Cave');12:s('Shallow Cleft');20:s('Zoo');
201 14:s('Winding Tunnel');15:s('Chasm');17:s('Chasm Bottom');
202 18:s('Tiny Opening');19:s('Etched Stairs');
203 21:s('Edge of Saucer');22:s('Side of Saucer');
204 23:s('Top of Saucer');24:s('Airlock');16:s('End of Rope');
205 76:s('Locked Cabin');25:s('Central Entry');
206 26:s('Lower Entry');27:s('Ship''s Systems');
207 30:s('Time Chamber');28:s('Ship''s Lab');34:s('Bridge');
208 29:s('Inside Tube');31:s('Life Support');58,69:s('Inside Shuttle');
209 32:s('Supply Chamber');33:s('Sleep Chamber');
210 35:s('Engine Room');36:s('Cargo Deck #1');37:s('Cargo Deck #2');
211 38:s('Cargo Deck #3');39:s('Cargo Deck #4');40:s('Large Cage');
212 41:s('Wooden Bridge');42:s('Broken End');43:s('South End');
213 44..46:s('Deserted Road');47:s('Crater Edge');48:s('Crater Floor');
214 49:s('Building Front');50:s('Lobby');51..54:s('Office Room');
215 55:s('Basement');56:s('Ladder Room');57:s('Building Roof');
216 59:case ShRm of 0:s('Above Mud Lake');
217 1:s('Above Rubble');2:s('Above Desert');3:s('Above Pits');
218 4:s('Above River');5:s('Above Stream');6:s('Above Town');
219 7:s('Above Mountain');8:s('Above Crator');9:s('Above Hills');
220 10:s('Above Canyon');11:s('Above Flatland');12:s('Above Dry Lake');
221 13:s('Above Desert');14:s('Above Bridge')end;{of Above Rooms}
222 63,64:s('Above Clouds');65..68:s('Outside City');70:s('Landing Bay');
223 71:s('Power Plant');72..74:s('Dark Corridor');75:s('Food Supply')
226 if Verbose then begin FlagSA:='r';
228 2 :if(40 in p[2])then begin RR(2);RL(416)end;
229 4 :if(en('B'))then RR(4)else begin RR(4);
230 writeln('There is a safety harness here.')end;
231 11:if(en('C'))then RS(15);
232 40:if(en('g'))then RS(17);
233 12:if not(en('G'))then begin RR(12);RL(146)end;
234 31:if not(en('I'))then begin RR(31);RL(156)end;
235 34:if(74 in p[34])then begin RR(34);RL(273)end;
236 35:if(77 in p[35])then begin RR(35);RL(381);RL(382)end else
237 if(en('W'))then begin RR(35);RL(381)end;
238 42:if(13 in p[42])then begin RR(42);RL(214)end;
239 48:if(27 in p[48])then begin RR(48);RL(276)end;
241 if(Prm=59)and not(ShRm in RmSh)then
242 begin RmSh:=RmSh+[ShRm];RS(ShRm+46)end
243 else if(Prm<>59)then RR(Prm);
244 if KeyHole and here(63)then
245 writeln('The shiny key is in the keyhole.')
249 if(FlagSA='r')and(Prm<>59)then RR(Prm)end;
251 for o:= 0 to NMax do begin
254 if not((Prm in[59..69])and(KeyHole)and(o=63))then
255 begin writeln('There is a ',n[o,1],' here.');
256 if(here(ropecon))and(o=ropecon)and not(ropecon in inven)then
257 writeln(' The rope is attatched to the ',n[o,1],'.');
258 if(en('d'))and(o=70)and(here(70))then RL(147);
259 if(o=SlotCon)and(here(o))then RL(388);
260 if(o in CabiSet)and(here(o))then RL(389);
261 if(o=PanelCon)and(here(o))then RL(390);
262 if(o in KitSet)and(here(o))then RL(391);
269 begin SA; for x:=1 to 24 do writeln; nosound;
273 writeln('Remove the GAME disk and insert your SAVE/RESTORE disk ',
275 writeln('Make sure your SAVE/RESTORE disk is in drive B:');
276 writeln(' (Press any key to continue...)');flag:=ReadKey;
278 write('Save under what name? ');
281 while pos(' ',input)>0 do delete(input,pos(' ',input),1);
282 while pos('.',input)>0 do delete(input,pos('.',input),1);
283 if(input='')then input:='LastRoom';
284 writeln;writeln;input:=Drive+input;
285 writeln('If your SAVE/RESTORE disk is in drive ',Drive,
286 ' then press any key to start.');
290 aInven:=Inven;aKitSet:=KitSet;aCabiSet:=CabiSet;aPanelCon:=PanelCon;
291 aSlotCon:=SlotCon;aCompCon:=CompCon;aRopeCon:=RopeCon;aTic:=Tic;
292 aYearDial:=YearDial;aPrm:=Prm;aMnRm:=MnRm;aSc:=Sc;aShots:=Shots;
293 aShRm:=ShRm;aRx:=Rx;aEv:=Ev;aCode:=Code;aLoc:=Loc;aKeyHole:=KeyHole;
295 assign(GameSave,input+'.a');
297 write(GameSave,DiskSave);
299 assign(Objects,input+'.b');
301 for x:=0 to RMax do write(Objects,p[x]);
303 assign(WordList,input+'.c');
307 write(WordList,n[x,y]);
310 write(WordList,v[x,y]);
312 assign(Things,input+'.d');
314 for x:= 0 to NMax do write(Things,r[x]);
316 writeln; delete(input,1,2);
317 writeln('Your present game location is now',
318 ' SAVED to disk under the name ''',input,'.''');
319 if(Drive='A:')then begin writeln;
320 writeln('Remove the SAVE/RESTORE disk and insert your GAME disk.')end;
321 writeln(' (Press any key to continue...)');flag:=ReadKey;
323 if(Verb<>54)then writeln('You may now resume your game...');
324 if(Line='')then Line:='look';Tic:=Tic-2;Back:=True;
325 if(Prm in[59..68])then sound(20);
330 function Exist:Boolean;
332 assign(GameSave,input+'.a');
338 begin SA; for x:=1 to 24 do writeln; nosound;
339 window(1,3,80,25);gotoxy(1,4);
341 writeln('Remove the GAME disk and insert your SAVE/RESTORE disk ',
342 'in drive ',Drive)else
343 writeln('Make sure your SAVE/RESTORE disk is in drive B:');
344 writeln(' (Press any key to continue...)');flag:=ReadKey;
346 write('Which file name do you want to RESTORE? ');
349 while pos(' ',input)>0 do delete(input,pos(' ',input),1);
350 while pos('.',input)>0 do delete(input,pos('.',input),1);
351 if(input='')then input:='LastRoom';
352 writeln;writeln;input:=Drive+input;
353 writeln('If your SAVE/RESTORE disk is now in drive ',Drive,
354 ' then press any key to start.');
359 assign(GameSave,input+'.a');
361 read(GameSave,DiskSave);
365 Inven:=aInven;KitSet:=aKitSet;CabiSet:=aCabiSet;PanelCon:=aPanelCon;
366 SlotCon:=aSlotCon;CompCon:=aCompCon;RopeCon:=aRopeCon;Tic:=aTic;
367 YearDial:=aYearDial;Prm:=aPrm;MnRm:=aMnRm;Sc:=aSc;Shots:=aShots;
368 ShRm:=aShRm;Rx:=aRx;Ev:=aEv;Code:=aCode;Loc:=aLoc;KeyHole:=aKeyHole;
370 assign(Objects,input+'.b');
372 for x:=0 to RMax do read(Objects,p[x]);
374 assign(WordList,input+'.c');
378 read(WordList,n[x,y]);
381 read(WordList,v[x,y]);
383 assign(Things,input+'.d');
385 for x:= 0 to NMax do read(Things,r[x]);
387 writeln; delete(input,1,2);
388 writeln('Your previously SAVED game location is now',
389 ' RESTORED from the file ''',input,'.''');
390 if(Drive='A:')then begin writeln;
391 writeln('Remove the SAVE/RESTORE disk and insert your GAME disk.')end;
392 writeln(' (Press any key to continue...)');flag:=ReadKey;
395 begin writeln;TextColor(28);
396 writeln(' That name does not exist on this',
397 ' SAVE/RESTORE disk.',^g);
398 TextColor(m2);writeln;
400 writeln('Put your GAME disk back in the disk drive and press any key.')
401 else writeln(' (Press any key to continue...)');
404 writeln;writeln;writeln('You may now resume you game...');
405 if(Line='')then Line:='look';Tic:=Tic-2;Back:=True;
406 if(Prm in[59..68])then sound(20);
410 procedure Vanish(o : integer);
415 if(o=7)and not(en('I'))then Ev:=Ev+['I'];
416 if(o=13)and(13 in p[42])then p[42]:=p[42]-[13];
417 if(o=PanelCon)then PanelCon:=Null;
418 if(o=SlotCon)then SlotCon:=Null;
419 if(o in CabiSet)then CabiSet:=CabiSet-[o];
420 if(o in kitset)then kitset:=kitset-[o];
421 if(o=63)and KeyHole then KeyHole:=False;
422 if(o=74)then Ev:=Ev-['p'];
423 if(o=89)then Ev:=Ev-['i'];
424 if(o=RopeCon)and(verb=36)then begin RopeCon:=Null;RL(402)end;
425 if(o=RopeCon)and not(Verb in[9,14])then RopeCon:=Null
428 procedure Play( Start, Stop, Wait: integer);
432 for x:= Start to Stop do
433 begin sound(x); delay(Wait); end
435 for x:= Start downto Stop do
436 begin sound(x); delay(Wait); end;
437 if(Prm in[59..68])then sound(20)else nosound
447 inven:=inven-[o];writeln(n[o,1],': Dropped.');
452 function FlasOff : Boolean;
454 if not(En('a'))then FlasOff:=True
456 if(r[29]=Prm)or(29 in inven)then FlasOff:=False
460 procedure MoveTo(NewRm : integer);
463 if(57 in inven)and(ropecon<>Null)and not(ropecon in inven)
464 and(ropecon in mov)and not(ropecon=70)then
465 begin r[ropecon]:=Prm;RL(158);end
466 else if(57 in inven)and(ropecon<>Null)and(not(ropecon in mov)or
467 ((ropecon=70)and(en('d'))))then
468 begin RL(55);inven:=inven-[57];r[57]:=Prm;end
469 else if not(57 in inven)and((ropecon in inven)or
470 (ropecon in[60,56,44]))then r[57]:=NewRm
471 else if not(57 in inven)and(r[57]=Prm)and(r[ropecon]=NewRm)then
472 begin r[57]:=NewRm;RopeOld:=Prm;end
473 else if not(57 in inven)and(r[57]=Prm)and(NewRm=RopeOld)and
475 begin r[57]:=RopeOld;RopeOld:=Null;end;
476 if(ropecon=Null)or((NewRm<>RopeOld)and(Prm<>RopeOld))then RopeOld:=Null;
477 if(MnRm<>Null)then Monster(NewRm);
478 if(Prm in[63..68])and not(NewRm in[59,69])then RL(343);
479 if(Prm in[59,63..68])then for o:=0 to NMax do if(r[o]=Prm)then r[o]:=NewRm;
490 17:if not(en('A'))then begin RS(3);DEAD end else RS(5);
495 24:if(en('B'))then begin RS(8);writeln;RL(16);moveto(5);Sc:=Sc+25;
496 n[64,5]:='ship';v[26,2]:='pick' end
497 else begin RS(7);DEAD;end;
498 43:if(not(en('c'))and not(en('n')))then RL(31);
499 73:if(not(en('c'))and not(en('n')))then RL(32);
500 93:if(not(en('c'))and not(en('n')))then begin RL(33); DEAD end;
501 99:if(Prm in[6..24])and(here(29))and not(flasoff)and(not(en('s')))then
502 begin RL(41);Ev:=Ev+['s'] end;
503 147:if not(en('n'))then RL(31);
504 149:if(here(29))and not(flasoff)then RL(59);
505 153:if(Prm in[6..23])and(here(29))and not(flasoff)then
506 begin RS(14);vanish(29) end;
507 170:if not(en('n'))then RL(32);
508 181:if not(en('n'))then begin RL(33); DEAD end;
512 607:begin RL(284);DEAD;end;
516 1..3:if(tic>4)and(random(4)=1)then RL(405);
517 36..39:if(random(5)=2)then RL(219);
518 7 :if(random(8)=2)then RL(266);
519 8 :if(random(3)=2)then begin RL(265);play(6666,7000,0);end;
520 13..24:if(random(16)=2)then RL(246);
521 25..35:if(random(30)=2)then RL(267);
522 47,48:if(random(5)=2)and(inven <>[])then
524 if(Prm=48)then begin writeln;RS(40)end
525 else begin writeln;RS(44);moveto(48)end;
529 begin vanish(o);r[o]:=random(9)+41;flag:='g';end;
534 5,6,9,10:if(random(9)=2)then RL(268);
535 7,8,11..40:if(here(84))and(random(20)=2)then RL(269)
536 else if(random(75)=2)then RS(36)
537 else if(Prm in[5..22])and(random(33)=2)then
538 begin RL(265);play(6500,6950,0)end;
539 41..49:if(random(27)=2)then RL(285);
540 59 :if(random(15)=1)then RL(406);
542 if Attack and(MnRm=Prm)and(not Back)then
543 begin case random(3) of 0:RS(80); 1:RS(81); 2:RS(82)end;DEAD end
544 else if(MnRm=Prm)then Attack:=True
547 function Present : Boolean;
549 if(noun<>Null)and(noun<>1)then
552 if(here(noun2))then Present:=true
554 writeln('You can''t see any ',n[noun2,1],' here.');Present:=false end
557 writeln('You can''t see any ',n[noun,1],' here.');Present:=false end
561 procedure Initialize;
564 procedure Cn(S : Str80);
566 gotoxy(40-(length(S)div 2),wherey);
571 writeln('Prepare to engage yourself in a most exciting adventure.');
572 writeln('But first, two simple questions:');
573 gotoxy(1,4);write('Are you using a COLOR screen (Y/N)? ');
574 nosound; play(72,80,45);
575 flag:='N'; play(2500,2490,6);
576 m0:=20;m1:=14;m2:=11;m3:=4;m4:=15;m5:=28;m6:=1;m7:=4;m8:=10;m9:=10;
577 if upcase(flag)='N' then
579 writeln('No, I don''t have a color screen.');
580 m0:=31;m1:=15;m2:=15;m3:=7;m4:=0;m5:=31;m6:=7;m7:=8;m8:=7;m9:=0;
581 end else writeln('Yes, I do have a color screen.');writeln;
582 write('How many disk drives do you have (1/2)? ');
584 flag:='2';play(2500,2490,6);
586 if(upcase(flag)='O')or(flag='1')then
587 begin Drive:='A:';writeln('I have ONE disk drive.')end else
588 writeln('I have TWO disk drives.');
589 delay(999);clrscr;textcolor(15);gotoxy(1,5);writeln;textcolor(7);
590 cn('Beyond the Titanic');textcolor(6);cn('------------------');writeln;
592 cn('A Text & Sound Adventure Fantasy');writeln;writeln;
593 cn('An Apogee Software Production');writeln;writeln;writeln;
594 cn('Written and Programmed by Scott Miller');
596 gotoxy(32,24);textcolor(7);
597 write('Press any key...');{flag:=ReadKey;}clrscr;
599 { *** SHAREWARE SCREEN *** }
602 writeln('Please note that Beyond the Titanic is a SHAREWARE game.');
605 writeln('This game has been placed in the public domain for your enjoyment.');
607 writeln('If you like the game the author (Scott Miller) asks that you please');
608 writeln('contribute $5 or $10 (your discretion) to him. This minimal payment');
609 writeln('will help compensent the author for the year of work that went into');
610 writeln('Beyond the Titanic. It will also encourage the author to make new and');
611 writeln('better games, like Supernova and Kingdom of Kroz, both of which are');
612 writeln('also shareware games recently released.');
614 writeln('This fee also registers the payer for telephone support and clues.');
616 writeln('Please make checks payable to Scott Miller.');
619 writeln(' Scott Miller (214) 240-0614');
620 writeln(' 4206 Mayflower Dr.');
621 writeln(' Garland, TX 75043');
624 writeln('Thanks, enjoy the game...');
627 while keypressed do flag:=ReadKey;
628 write('Press any key to start the game...');
630 while keypressed do flag:=ReadKey;
632 { ************************ }
636 cn('APRIL 14, 1912 11:43 PM');
637 cn('You never knew the black canvas of the night was so full'+
638 ' of twinkling detail.');
639 cn('Standing on deck of the White Star''s new super luxury liner, deep at sea,');
640 cn('where the bright lights of San Francisco don''t fade the night, you');
641 cn('can view thousands of stars you never realized existed.');
642 cn('Looking out over the icy sea you can barely see small pieces of'+
644 cn('bobbing in the water. Rumor has it that icebergs the size of small');
645 cn('mountains can be found in this region. You don''t feel');
646 cn('too worried, though, the Titanic has been touted as');
647 cn('"unsinkable," and every single passenger knows');
648 cn('that White Star, the premier ship builder,');
649 cn('knows their stuff...');
650 for x:= 1 to 3 do writeln;
661 Mov :=[2,7,8,13,27,29,32,34,40,52,51,57,63,70,74,77,89];
662 OneWordCommands:=[1,4,5,7,8,16,18,19,22,31,33..35,41,43..54,56..59,61..65];
675 assignfile(rooms1,'ROOMS1');
676 assignfile(rooms2,'ROOMS2');
677 assignfile(special1,'SPECIAL1');
678 assignfile(special2,'SPECIAL2');
679 assignfile(line1,'LINE');
683 {Writeln ('Current directory is : ',S);}
697 Str(Random(9998)+1,Code);
704 for x:=1 to 80 do write(' ');
718 {***************************** END OF COMMANDS *****************************}