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 in Inven)or(r[noun]=Prm)or(noun in p[Prm])then Here:=True
74 if(random(2)=1)then RL(107+random(7))else RL(300+random(6));
81 gotoxy(1,25);for x:=1 to 7 do writeln;
82 Textcolor(1);TextBackground(m9);
84 write('*********************************************************',
85 '***********************');writeln;
86 gotoxy(1,19); for x:=1 to 3 do
90 write('*********************************************************',
91 '***********************');writeln;
92 TextColor(m0);gotoxy(32,20);writeln('YOU HAVE DIED!!!');
93 Textcolor(m2);Textbackground(0);
94 for c:=700 downto 20 do
95 for b:=70 downto 1 do sound(b*c);nosound;
96 close(Rooms1);close(rooms2);close(special1);close(special2);close(line1);
97 gotoxy(1,23);DelLine;DelLine;writeln;write('Do you wish to play again? ');
99 if(upcase(flag)<>'N')then
101 writeln('Restarting...');window(1,1,80,25);
102 assign(rooms1,'BEYOND.com');
111 writeln(' Beyond the Titanic');
112 writeln('A Scott Miller Production');
113 writeln(' Have a nice day...');
115 assign(FileName,'MENU.COM');
119 if IOResult <> 0 then HALT;
124 var b,c,x,y,o:Integer;
126 gotoxy(1,25);for x:=1 to 7 do writeln;
127 Textcolor(25);Textbackground(m7);
129 write('#########################################################',
130 '#######################');writeln;
131 gotoxy(1,19); for x:=1 to 3 do
135 write('#########################################################',
136 '#######################');writeln;
137 TextColor(31);gotoxy(25,20);writeln('Y O U H A V E W O N ! ! !');
138 Textcolor(m2);Textbackground(0);
139 gotoxy(1,23);DelLine;DelLine;writeln;
140 for x:=150 downto 1 do begin sound(x*55);delay(8);nosound;delay(20)end;
141 if(Sc>1000)then Sc:=1000;
142 write('You finished with a score of ',Sc,', which makes you a ');
144 begin writeln('Perfect Adventurer!!!');
147 for x:= 99+(o*430)to 998+(o*430)do begin sound(25);sound(x)end
149 else writeln('Master Adventurer!');
150 for c:=1 to 999 do for b:=1 to 61 do sound(b*c);nosound;
152 writeln('Reboot your computer to regain control...')
155 procedure Say(o : integer; p : str14);
157 writeln('The ',n[o,1],' is already ',p,'.'); SA
163 if((tic>42)and not(en('c')))or((tic>146)and not(en('n')))or(en('r'))then
165 if(tic>42)and (not(en('c')))then RL(192)
166 else if(tic>146)and not(en('n'))then RL(192);
167 if(en('r'))then RL(51)
172 procedure Monster(var NewRm : integer);
174 if(NewRm=MnRm)and(MnRm=25)then begin Attack:=False;RL(384)end else
175 if(NewRm<>35)or not(en('v'))then
177 p[Prm]:=p[Prm]-[23];p[NewRm]:=p[NewRm]+[23];MnRm:=NewRm;Attack:=False;
178 if not((NewRm=30)and(Verb in[27,28]))then
180 0:RS(71);1:RS(72);2:RL(359);3:RL(360);4:RL(361);5:RL(362);6:RL(363)
183 else begin RL(383);Attack:=False end
186 procedure DescribeRm;
188 procedure s(r : str14);
189 begin TextColor(m8);writeln(r);TextColor(m2);loc:=r;end;
191 if((en('a'))and(here(29)))or not(Prm in [6..24])then begin
193 0:s('Ship''s Fore');1:s('Ship Mid-Deck');2:s('Rear of Ship');
194 3:s('Life Boat');4:s('Ocean Surface');5:s('Huge Cavern');
195 6:s('Cave of Pins');7:s('Ocean Bottom');8:s('Squeaky Cave');
196 9:s('Stream Bend');10:s('Waterfall');13:s('Sloppy Cave');
197 11:s('Hex Cave');12:s('Shallow Cleft');20:s('Zoo');
198 14:s('Winding Tunnel');15:s('Chasm');17:s('Chasm Bottom');
199 18:s('Tiny Opening');19:s('Etched Stairs');
200 21:s('Edge of Saucer');22:s('Side of Saucer');
201 23:s('Top of Saucer');24:s('Airlock');16:s('End of Rope');
202 76:s('Locked Cabin');25:s('Central Entry');
203 26:s('Lower Entry');27:s('Ship''s Systems');
204 30:s('Time Chamber');28:s('Ship''s Lab');34:s('Bridge');
205 29:s('Inside Tube');31:s('Life Support');58,69:s('Inside Shuttle');
206 32:s('Supply Chamber');33:s('Sleep Chamber');
207 35:s('Engine Room');36:s('Cargo Deck #1');37:s('Cargo Deck #2');
208 38:s('Cargo Deck #3');39:s('Cargo Deck #4');40:s('Large Cage');
209 41:s('Wooden Bridge');42:s('Broken End');43:s('South End');
210 44..46:s('Deserted Road');47:s('Crater Edge');48:s('Crater Floor');
211 49:s('Building Front');50:s('Lobby');51..54:s('Office Room');
212 55:s('Basement');56:s('Ladder Room');57:s('Building Roof');
213 59:case ShRm of 0:s('Above Mud Lake');
214 1:s('Above Rubble');2:s('Above Desert');3:s('Above Pits');
215 4:s('Above River');5:s('Above Stream');6:s('Above Town');
216 7:s('Above Mountain');8:s('Above Crator');9:s('Above Hills');
217 10:s('Above Canyon');11:s('Above Flatland');12:s('Above Dry Lake');
218 13:s('Above Desert');14:s('Above Bridge')end;{of Above Rooms}
219 63,64:s('Above Clouds');65..68:s('Outside City');70:s('Landing Bay');
220 71:s('Power Plant');72..74:s('Dark Corridor');75:s('Food Supply')
223 if Verbose then begin FlagSA:='r';
225 2 :if(40 in p[2])then begin RR(2);RL(416)end;
226 4 :if(en('B'))then RR(4)else begin RR(4);
227 writeln('There is a safety harness here.')end;
228 11:if(en('C'))then RS(15);
229 40:if(en('g'))then RS(17);
230 12:if not(en('G'))then begin RR(12);RL(146)end;
231 31:if not(en('I'))then begin RR(31);RL(156)end;
232 34:if(74 in p[34])then begin RR(34);RL(273)end;
233 35:if(77 in p[35])then begin RR(35);RL(381);RL(382)end else
234 if(en('W'))then begin RR(35);RL(381)end;
235 42:if(13 in p[42])then begin RR(42);RL(214)end;
236 48:if(27 in p[48])then begin RR(48);RL(276)end;
238 if(Prm=59)and not(ShRm in RmSh)then
239 begin RmSh:=RmSh+[ShRm];RS(ShRm+46)end
240 else if(Prm<>59)then RR(Prm);
241 if KeyHole and here(63)then
242 writeln('The shiny key is in the keyhole.')
246 if(FlagSA='r')and(Prm<>59)then RR(Prm)end;
248 for o:= 0 to NMax do begin
251 if not((Prm in[59..69])and(KeyHole)and(o=63))then
252 begin writeln('There is a ',n[o,1],' here.');
253 if(here(ropecon))and(o=ropecon)and not(ropecon in inven)then
254 writeln(' The rope is attatched to the ',n[o,1],'.');
255 if(en('d'))and(o=70)and(here(70))then RL(147);
256 if(o=SlotCon)and(here(o))then RL(388);
257 if(o in CabiSet)and(here(o))then RL(389);
258 if(o=PanelCon)and(here(o))then RL(390);
259 if(o in KitSet)and(here(o))then RL(391);
266 begin SA; for x:=1 to 24 do writeln; nosound;
270 writeln('Remove the GAME disk and insert your SAVE/RESTORE disk ',
272 writeln('Make sure your SAVE/RESTORE disk is in drive B:');
273 writeln(' (Press any key to continue...)');flag:=ReadKey;
275 write('Save under what name? ');
278 while pos(' ',input)>0 do delete(input,pos(' ',input),1);
279 while pos('.',input)>0 do delete(input,pos('.',input),1);
280 if(input='')then input:='LastRoom';
281 writeln;writeln;input:=Drive+input;
282 writeln('If your SAVE/RESTORE disk is in drive ',Drive,
283 ' then press any key to start.');
287 aInven:=Inven;aKitSet:=KitSet;aCabiSet:=CabiSet;aPanelCon:=PanelCon;
288 aSlotCon:=SlotCon;aCompCon:=CompCon;aRopeCon:=RopeCon;aTic:=Tic;
289 aYearDial:=YearDial;aPrm:=Prm;aMnRm:=MnRm;aSc:=Sc;aShots:=Shots;
290 aShRm:=ShRm;aRx:=Rx;aEv:=Ev;aCode:=Code;aLoc:=Loc;aKeyHole:=KeyHole;
292 assign(GameSave,input+'.a');
294 write(GameSave,DiskSave);
296 assign(Objects,input+'.b');
298 for x:=0 to RMax do write(Objects,p[x]);
300 assign(WordList,input+'.c');
304 write(WordList,n[x,y]);
307 write(WordList,v[x,y]);
309 assign(Things,input+'.d');
311 for x:= 0 to NMax do write(Things,r[x]);
313 writeln; delete(input,1,2);
314 writeln('Your present game location is now',
315 ' SAVED to disk under the name ''',input,'.''');
316 if(Drive='A:')then begin writeln;
317 writeln('Remove the SAVE/RESTORE disk and insert your GAME disk.')end;
318 writeln(' (Press any key to continue...)');flag:=ReadKey;
320 if(Verb<>54)then writeln('You may now resume your game...');
321 if(Line='')then Line:='look';Tic:=Tic-2;Back:=True;
322 if(Prm in[59..68])then sound(20);
327 function Exist:Boolean;
329 assign(GameSave,input+'.a');
335 begin SA; for x:=1 to 24 do writeln; nosound;
336 window(1,3,80,25);gotoxy(1,4);
338 writeln('Remove the GAME disk and insert your SAVE/RESTORE disk ',
339 'in drive ',Drive)else
340 writeln('Make sure your SAVE/RESTORE disk is in drive B:');
341 writeln(' (Press any key to continue...)');flag:=ReadKey;
343 write('Which file name do you want to RESTORE? ');
346 while pos(' ',input)>0 do delete(input,pos(' ',input),1);
347 while pos('.',input)>0 do delete(input,pos('.',input),1);
348 if(input='')then input:='LastRoom';
349 writeln;writeln;input:=Drive+input;
350 writeln('If your SAVE/RESTORE disk is now in drive ',Drive,
351 ' then press any key to start.');
356 assign(GameSave,input+'.a');
358 read(GameSave,DiskSave);
362 Inven:=aInven;KitSet:=aKitSet;CabiSet:=aCabiSet;PanelCon:=aPanelCon;
363 SlotCon:=aSlotCon;CompCon:=aCompCon;RopeCon:=aRopeCon;Tic:=aTic;
364 YearDial:=aYearDial;Prm:=aPrm;MnRm:=aMnRm;Sc:=aSc;Shots:=aShots;
365 ShRm:=aShRm;Rx:=aRx;Ev:=aEv;Code:=aCode;Loc:=aLoc;KeyHole:=aKeyHole;
367 assign(Objects,input+'.b');
369 for x:=0 to RMax do read(Objects,p[x]);
371 assign(WordList,input+'.c');
375 read(WordList,n[x,y]);
378 read(WordList,v[x,y]);
380 assign(Things,input+'.d');
382 for x:= 0 to NMax do read(Things,r[x]);
384 writeln; delete(input,1,2);
385 writeln('Your previously SAVED game location is now',
386 ' RESTORED from the file ''',input,'.''');
387 if(Drive='A:')then begin writeln;
388 writeln('Remove the SAVE/RESTORE disk and insert your GAME disk.')end;
389 writeln(' (Press any key to continue...)');flag:=ReadKey;
392 begin writeln;TextColor(28);
393 writeln(' That name does not exist on this',
394 ' SAVE/RESTORE disk.',^g);
395 TextColor(m2);writeln;
397 writeln('Put your GAME disk back in the disk drive and press any key.')
398 else writeln(' (Press any key to continue...)');
401 writeln;writeln;writeln('You may now resume you game...');
402 if(Line='')then Line:='look';Tic:=Tic-2;Back:=True;
403 if(Prm in[59..68])then sound(20);
407 procedure Vanish(o : integer);
412 if(o=7)and not(en('I'))then Ev:=Ev+['I'];
413 if(o=13)and(13 in p[42])then p[42]:=p[42]-[13];
414 if(o=PanelCon)then PanelCon:=Null;
415 if(o=SlotCon)then SlotCon:=Null;
416 if(o in CabiSet)then CabiSet:=CabiSet-[o];
417 if(o in kitset)then kitset:=kitset-[o];
418 if(o=63)and KeyHole then KeyHole:=False;
419 if(o=74)then Ev:=Ev-['p'];
420 if(o=89)then Ev:=Ev-['i'];
421 if(o=RopeCon)and(verb=36)then begin RopeCon:=Null;RL(402)end;
422 if(o=RopeCon)and not(Verb in[9,14])then RopeCon:=Null
425 procedure Play( Start, Stop, Wait: integer);
429 for x:= Start to Stop do
430 begin sound(x); delay(Wait); end
432 for x:= Start downto Stop do
433 begin sound(x); delay(Wait); end;
434 if(Prm in[59..68])then sound(20)else nosound
444 inven:=inven-[o];writeln(n[o,1],': Dropped.');
449 function FlasOff : Boolean;
451 if not(En('a'))then FlasOff:=True
453 if(r[29]=Prm)or(29 in inven)then FlasOff:=False
457 procedure MoveTo(NewRm : integer);
460 if(57 in inven)and(ropecon<>Null)and not(ropecon in inven)
461 and(ropecon in mov)and not(ropecon=70)then
462 begin r[ropecon]:=Prm;RL(158);end
463 else if(57 in inven)and(ropecon<>Null)and(not(ropecon in mov)or
464 ((ropecon=70)and(en('d'))))then
465 begin RL(55);inven:=inven-[57];r[57]:=Prm;end
466 else if not(57 in inven)and((ropecon in inven)or
467 (ropecon in[60,56,44]))then r[57]:=NewRm
468 else if not(57 in inven)and(r[57]=Prm)and(r[ropecon]=NewRm)then
469 begin r[57]:=NewRm;RopeOld:=Prm;end
470 else if not(57 in inven)and(r[57]=Prm)and(NewRm=RopeOld)and
472 begin r[57]:=RopeOld;RopeOld:=Null;end;
473 if(ropecon=Null)or((NewRm<>RopeOld)and(Prm<>RopeOld))then RopeOld:=Null;
474 if(MnRm<>Null)then Monster(NewRm);
475 if(Prm in[63..68])and not(NewRm in[59,69])then RL(343);
476 if(Prm in[59,63..68])then for o:=0 to NMax do if(r[o]=Prm)then r[o]:=NewRm;
487 17:if not(en('A'))then begin RS(3);DEAD end else RS(5);
492 24:if(en('B'))then begin RS(8);writeln;RL(16);moveto(5);Sc:=Sc+25;
493 n[64,5]:='ship';v[26,2]:='pick' end
494 else begin RS(7);DEAD;end;
495 43:if(not(en('c'))and not(en('n')))then RL(31);
496 73:if(not(en('c'))and not(en('n')))then RL(32);
497 93:if(not(en('c'))and not(en('n')))then begin RL(33); DEAD end;
498 99:if(Prm in[6..24])and(here(29))and not(flasoff)and(not(en('s')))then
499 begin RL(41);Ev:=Ev+['s'] end;
500 147:if not(en('n'))then RL(31);
501 149:if(here(29))and not(flasoff)then RL(59);
502 153:if(Prm in[6..23])and(here(29))and not(flasoff)then
503 begin RS(14);vanish(29) end;
504 170:if not(en('n'))then RL(32);
505 181:if not(en('n'))then begin RL(33); DEAD end;
509 607:begin RL(284);DEAD;end;
513 1..3:if(tic>4)and(random(4)=1)then RL(405);
514 36..39:if(random(5)=2)then RL(219);
515 7 :if(random(8)=2)then RL(266);
516 8 :if(random(3)=2)then begin RL(265);play(6666,7000,0);end;
517 13..24:if(random(16)=2)then RL(246);
518 25..35:if(random(30)=2)then RL(267);
519 47,48:if(random(5)=2)and(inven <>[])then
521 if(Prm=48)then begin writeln;RS(40)end
522 else begin writeln;RS(44);moveto(48)end;
526 begin vanish(o);r[o]:=random(9)+41;flag:='g';end;
531 5,6,9,10:if(random(9)=2)then RL(268);
532 7,8,11..40:if(here(84))and(random(20)=2)then RL(269)
533 else if(random(75)=2)then RS(36)
534 else if(Prm in[5..22])and(random(33)=2)then
535 begin RL(265);play(6500,6950,0)end;
536 41..49:if(random(27)=2)then RL(285);
537 59 :if(random(15)=1)then RL(406);
539 if Attack and(MnRm=Prm)and(not Back)then
540 begin case random(3) of 0:RS(80); 1:RS(81); 2:RS(82)end;DEAD end
541 else if(MnRm=Prm)then Attack:=True
544 function Present : Boolean;
546 if(noun<>Null)and(noun<>1)then
549 if(here(noun2))then Present:=true
551 writeln('You can''t see any ',n[noun2,1],' here.');Present:=false end
554 writeln('You can''t see any ',n[noun,1],' here.');Present:=false end
558 procedure Initialize;
561 procedure Cn(S : Str80);
563 gotoxy(40-(length(S)div 2),wherey);
568 writeln('Prepare to engage yourself in a most exciting adventure.');
569 writeln('But first, two simple questions:');
570 gotoxy(1,4);write('Are you using a COLOR screen (Y/N)? ');
571 nosound; play(72,80,45);
572 flag:='Y'; play(2500,2490,6);
573 m0:=20;m1:=14;m2:=11;m3:=4;m4:=15;m5:=28;m6:=1;m7:=4;m8:=10;m9:=10;
574 if upcase(flag)='N' then
576 writeln('No, I don''t have a color screen.');
577 m0:=31;m1:=15;m2:=15;m3:=7;m4:=0;m5:=31;m6:=7;m7:=8;m8:=7;m9:=0;
578 end else writeln('Yes, I do have a color screen.');writeln;
579 write('How many disk drives do you have (1/2)? ');
581 flag:='2';play(2500,2490,6);
583 if(upcase(flag)='O')or(flag='1')then
584 begin Drive:='A:';writeln('I have ONE disk drive.')end else
585 writeln('I have TWO disk drives.');
586 delay(999);clrscr;textcolor(15);gotoxy(1,5);writeln;textcolor(7);
587 cn('Beyond the Titanic');textcolor(6);cn('------------------');writeln;
589 cn('A Text & Sound Adventure Fantasy');writeln;writeln;
590 cn('An Apogee Software Production');writeln;writeln;writeln;
591 cn('Written and Programmed by Scott Miller');
593 gotoxy(32,24);textcolor(7);
594 write('Press any key...');{flag:=ReadKey;}clrscr;
596 { *** SHAREWARE SCREEN *** }
599 writeln('Please note that Beyond the Titanic is a SHAREWARE game.');
602 writeln('This game has been placed in the public domain for your enjoyment.');
604 writeln('If you like the game the author (Scott Miller) asks that you please');
605 writeln('contribute $5 or $10 (your discretion) to him. This minimal payment');
606 writeln('will help compensent the author for the year of work that went into');
607 writeln('Beyond the Titanic. It will also encourage the author to make new and');
608 writeln('better games, like Supernova and Kingdom of Kroz, both of which are');
609 writeln('also shareware games recently released.');
611 writeln('This fee also registers the payer for telephone support and clues.');
613 writeln('Please make checks payable to Scott Miller.');
616 writeln(' Scott Miller (214) 240-0614');
617 writeln(' 4206 Mayflower Dr.');
618 writeln(' Garland, TX 75043');
621 writeln('Thanks, enjoy the game...');
624 while keypressed do flag:=ReadKey;
625 write('Press any key to start the game...');
627 while keypressed do flag:=ReadKey;
629 { ************************ }
633 cn('APRIL 14, 1912 11:43 PM');
634 cn('You never knew the black canvas of the night was so full'+
635 ' of twinkling detail.');
636 cn('Standing on deck of the White Star''s new super luxury liner, deep at sea,');
637 cn('where the bright lights of San Francisco don''t fade the night, you');
638 cn('can view thousands of stars you never realized existed.');
639 cn('Looking out over the icy sea you can barely see small pieces of'+
641 cn('bobbing in the water. Rumor has it that icebergs the size of small');
642 cn('mountains can be found in this region. You don''t feel');
643 cn('too worried, though, the Titanic has been touted as');
644 cn('"unsinkable," and every single passenger knows');
645 cn('that White Star, the premier ship builder,');
646 cn('knows their stuff...');
647 for x:= 1 to 3 do writeln;
658 Mov :=[2,7,8,13,27,29,32,34,40,52,51,57,63,70,74,77,89];
659 OneWordCommands:=[1,4,5,7,8,16,18,19,22,31,33..35,41,43..54,56..59,61..65];
672 assignfile(rooms1,'ROOMS1');
673 assignfile(rooms2,'ROOMS2');
674 assignfile(special1,'SPECIAL1');
675 assignfile(special2,'SPECIAL2');
676 assignfile(line1,'LINE');
680 {Writeln ('Current directory is : ',S);}
694 Str(Random(9998)+1,Code);
701 for x:=1 to 80 do write(' ');
715 {***************************** END OF COMMANDS *****************************}