140 FOR I = 770 TO 790: READ D: POKE I,D: NEXT : DATA 173,48,192,136,208,5,206,1,3,240,9,202,208,245,174,0,3,76,2,3,96
150 REM MAP INIT
160 DIM PM%(40,2),MM%(14,12),SH%(2,13,6),DI%(13,4),PF%(2),T$(13): FOR I = 1 TO 13: READ D$:T$(I) = D$: NEXT : DATA CAR#1,CAR#2,DES#1,DES#2,SUB#1,SUB#2,SUB#3,ADV#1,ADV#2,ADV#3,ADV#4,TAN#1,TAN#2
170 DIM H$(5),H%(25): FOR I = 1 TO 5: READ A$:H$(I) = A$: NEXT : FOR I = 1 TO 25: READ A:H%(I) = A: NEXT : DATA QUANTITY-,ATT.RNG.-,MOBILITY-,"ENDUR.- ",FUEL.CAP-
180 DATA 2,2,3,4,2,3,2,1,1,0,1,1,2,3,1,5,3,2,1,1,40,30,30,15,200
190 FOR X = 1 TO 14:MM%(X,1) = -1:MM%(X,12) = -1: NEXT : FOR Y = 1 TO 12:MM%(1,Y) = -1:MM%(2,Y) = -1:MM%(13,Y) = -1:MM%(14,Y) = -1: NEXT Y
200 MM%(7,7) = -1:MM%(8,6) = -1: FOR Y = 7 TO 9:MM%(1,Y) = 0:MM%(14,Y -3) = 0:MM%(2,Y) = 0:MM%(13,Y -3) = 0: NEXT :PF%(1) = 100:PF%(2) = 100
210 P = 1: FOR S = 1 TO 13: READ X,Y,D:MM%(X,Y) = D:SH%(P,S,5) = X:SH%(P,S,6) = Y: NEXT : DATA 3,2,6,6,4, 6,3,4,7,3,6,7,3, 3,8,3,5,8,3,10,8,2,8,9,3,8,9,2,9,9,3,11,9,6,7,10,8,5,10
220 P = 2: FOR S = 1 TO 13: READ X,Y,D:MM%(X,Y) = D:SH%(P,S,5) = X:SH%(P,S,6) = Y: NEXT : DATA 12,11,1, 9,9,1,12,9,2,12,7,2,12,10,3,12,8,3,12,3,3,13,5,4,12,5,4,13,4,4,12,2,4,9,6,5,7,8,5
230 FOR S = 1 TO 13: FOR I = 1 TO 4: READ D:DI%(S,I) = D: NEXT : NEXT : DATA 3,1,5,40,3,1,5,40,2,1,3,30,2,1,3,30,1,2,2,30,1,2,2,30,1,2,2,30,1,3 ,1,15,1,3,1,15,1,3,1,15,1,3,1,15,0,1,1,200,0,1,1,200
240 FOR P = 1 TO 2: FOR S = 1 TO 13: FOR I = 1 TO 4:SH%(P,S,I) = DI%(S,I): NEXT I,S,P
250 REM SCREEN SETUP
260 HGR : ROT= 0: SCALE= 1: HCOLOR= 1: FOR X = 0 TO 13: DRAW 14 AT X *20,13: DRAW 14 AT X *20,156: NEXT : DRAW 12 AT 119,91: DRAW 12 AT 141,78
270 FOR Y = 2 TO 6: DRAW 14 AT 0,Y *13: DRAW 14 AT 260,(Y +5) *13: DRAW 14 AT 20,Y *13: DRAW 14 AT 240,(Y +5) *13: NEXT
280 FOR Y = 2 TO 3: DRAW 14 AT 240,Y *13: DRAW 14 AT 260,Y *13: DRAW 14 AT 0,(Y +8) *13: DRAW 14 AT 20,(Y +8) *13: NEXT
290 HCOLOR= 5: ROT= 32: DRAW 13 AT 278,40: DRAW 13 AT 278,53: DRAW 13 AT 278,66
300 HCOLOR= 6: ROT= 0: DRAW 13 AT 1,91: DRAW 13 AT 1,104: DRAW 13 AT 1,117: HCOLOR= 7
310 FOR P = 1 TO 2: FOR S = 1 TO 13: XDRAW MM%(SH%(P,S,5),SH%(P,S,6)) AT SH%(P,S,5) *20 -18,SH%(P,S,6) *13 -3: NEXT S,P
410 GOSUB 1010:P2 = 1:AB = SH%(P,S,1): IF P = 1 THEN P2 = 2
420 P2 = 1:AB = SH%(P,S,1):X = SH%(P,S,5):Y = SH%(P,S,6): IF P = 1 THEN P2 = 2
430 REM PRECHECK FOR ENEMIES
440 FOR S1 = 1 TO 13:XM = SH%(P2,S1,5):YM = SH%(P2,S1,6):DF = ABS(XM -X) + ABS(YM -Y): IF DF < = AB THEN S1 = 13: NEXT : GOTO 470
450 NEXT : HOME : PRINT "THERE ARE NO ENEMY SHIPS IN ATTACK RANGE": FOR Z = 1 TO 3: POKE 768,20: POKE 769,10: CALL 770: NEXT : FOR Q = 1 TO 2500: NEXT : GOTO 340
460 REM SELECT OR SHOOT
470 FOR S1 = 1 TO 13:XM = SH%(P2,S1,5):YM = SH%(P2,S1,6):DF = ABS(XM -X) + ABS(YM -Y)
480 IF DF < = AB AND SH%(P2,S1,5) < >20 THEN 500
490 NEXT : GOTO 470
500 XDRAW 15 AT XM *20 -20,YM *13: HOME : PRINT "'<-->'=SELECT ANOTHER TARGET <RET>=FIRE": HTAB 13: PRINT "<ESC> TO ABORT'";: GET W$
510 XDRAW 15 AT XM *20 -20,YM *13: IF ASC(W$) = 27 THEN S1 = 13: NEXT : GOTO 340
520 IF ASC(W$) = 8 OR ASC(W$) = 21 THEN 490
530 IF ASC(W$) < >13 THEN GOSUB 1430: GOTO 500
540 REM HIT SHIP
550 SH%(P2,S1,3) = SH%(P2,S1,3) -1: FOR Q = 1 TO 5: POKE 768,200: POKE 769,10: CALL 770: XDRAW 11 AT XM *20 -20,YM *13: NEXT : XDRAW 11 AT XM *20 -20,YM *13: IF SH%(P2,S1,3) < = 0 THEN GOSUB 620
560 REM CHECK FOR WINNER
570 PW = 1:R = 2: FOR SW = 1 TO 11: ON SH%(PW,SW,5) < >20 GOTO 580: NEXT : GOTO 1450
580 SW = 13: NEXT SW:R = 1:PW = 2: FOR SW = 1 TO 11: ON SH%(PW,SW,5) < >20 GOTO 590: NEXT : GOTO 1450
590 SW = 13: NEXT SW
600 NEXT T: GOSUB 1210: NEXT P: GOSUB 1480: GOTO 330
610 REM SINK SHIP
620 FOR Z = 1 TO 20: XDRAW MM%(XM,YM) AT XM *20 -18,YM *13 -3: POKE 768,10 +5 *Z: POKE 769,10: CALL 770: NEXT : XDRAW MM%(XM,YM) AT XM *20 -18,YM *13 -3
630 FOR Z = 16 TO 20: XDRAW Z AT XM *20 -18,YM *13 -3: POKE 768,Z *10: POKE 769,10: CALL 770: FOR U = 1 TO 200: NEXT : XDRAW Z AT XM *20 -18,YM *13 -3: NEXT : GOSUB 1430:SH%(P2,S1,5) = 20:MM%(XM,YM) = 0: RETURN
900 SH%(P,S,5) = XM:SH%(P,S,6) = YM: XDRAW MM%(X,Y) AT X *20 -18,Y *13 -3:MM%(XM,YM) = MM%(X,Y):MM%(X,Y) = 0: XDRAW MM%(XM,YM) AT XM *20 -18,YM *13 -3
910 XDRAW 15 AT (XM -1) *20,YM *13
920 REM REFILL TANKER?
930 ST = MM%(XM,YM): IF ST < >5 AND ST < >10 THEN GOTO 600
940 IF (XM = 7 AND YM = 6) OR (XM = 8 AND YM = 5) OR (XM = 7 AND YM = 8) OR (XM = 8 AND YM = 7) THEN 960
950 GOTO 600
960 FOR PH = 1 TO 2: FOR SR = 12 TO 13: IF SH%(PH,SR,5) = XM AND SH%(PH,SR,6) = YM AND SH%(PH,SR,4) < = 100 THEN SR = 13:PH = 2: NEXT : NEXT : GOTO 990
970 NEXT : NEXT
980 GOTO 600
990 HOME : PRINT T$(S);" AT ";XM;",";YM;" IS FILLING UP ": FOR Q = 1 TO 1000: NEXT :SH%(P,S,4) = 200: FOR Q = 200 TO 0 STEP -10: POKE 768,Q: POKE 769,10: CALL 770: NEXT : GOTO 600
1000 REM FIND SHIP
1010 S = 0
1020 S = S +1
1030 IF S = 12 AND F$ = "F" THEN 1010
1040 ON S = 14 GOTO 1010
1050 IF SH%(P,S,5) < >20 THEN GOTO 1070
1060 GOTO 1020
1070 X = SH%(P,S,5):Y = SH%(P,S,6): GOSUB 1190: GOSUB 1180
1080 GET W$: IF W$ = "H" THEN GOSUB 1190: GOSUB 1590: POP : ON F$ = "F" GOTO 400: GOTO 650
1090 IF ASC(W$) = 27 THEN GOSUB 1190: POP : GOTO 340
1100 IF ASC(W$) = 13 THEN GOSUB 1190: RETURN
1110 IF ASC(W$) < >21 AND ASC(W$) < >8 AND ASC(W$) < >11 AND ASC(W$) < >10 THEN GOSUB 1430: GOTO 1080
1120 IF ASC(W$) = 21 OR ASC(W$) = 10 THEN GOSUB 1190: GOTO 1020
1330 IF V <Z THEN SH%(PP,S,4) = SH%(PP,S,4) +V:PF%(PP) = 0: PRINT "PLAYER #";PP;" PORT IS OUT OF FUEL!": FOR Q = 1 TO 5: GOSUB 1440: NEXT : FOR Q = 1 TO 2500: NEXT : RETURN
1340 REM NORMALIZE FACTORS
1350 FOR I = 1 TO 4: IF SH%(PP,S,I) < >DI%(S,I) THEN PRINT "REPAIR:> PLAYER #";PP;" SHIP ";T$(S);" FACTOR #";I
1360 NEXT :PF%(PP) = PF%(PP) -Z:SH%(PP,S,4) = SH%(PP,S,4) +Z: RETURN
1370 STOP
1380 REM FILL PORT TANKS
1390 FOR S2 = 12 TO 13: IF SH%(PP,S2,5) = X AND SH%(PP,S2,6) = Y THEN 1410
1460 VTAB 23: PRINT : PRINT "CONGRATULATIONS PLAYER #";R;" YOU HAVE": PRINT "CONQUERED THE ATLANTIC TERRITORY!!": FOR I = 1 TO 4: FOR Q = 1 TO 200 STEP 10: POKE 768,Q: POKE 769,10: CALL 770: NEXT
1470 FOR Q = 200 TO 0 STEP -10: POKE 768,Q: POKE 769,10: CALL 770: NEXT : NEXT : END
1480 REM ENEMIES IN PORT
1490 FOR PZ = 1 TO 2: FOR SP = 1 TO 7:LX = SH%(PZ,SP,5):LY = SH%(PZ,SP,6): IF LX = 14 AND PZ = 1 THEN GOSUB 1520
1500 IF LX = 1 AND PZ = 2 THEN GOSUB 1520
1510 NEXT : NEXT : RETURN
1520 REM DEPLETE PORT FUEL
1530 R = 1: IF PZ = 1 THEN R = 2
1540 IF PF%(R) = 0 THEN RETURN
1550 IF PF%(R) <50 THEN PF%(R) = 0: GOTO 1570
1560 PF%(R) = PF%(R) -50
1570 FOR Q = 1 TO 5: GOSUB 1430: NEXT : HOME : PRINT "PORT #";R;" LOSES FUEL UNITS DUE TO ENEMY": FOR Q = 1 TO 2500: NEXT : POKE 34,20: RETURN
1580 REM HELP SCREEN
1590 TEXT : HOME : PRINT "** ATLANTIC CONVOY BY BRIAN J. PARRY **"