7530 IF X < 29 AND STAT(X,ENEMY)=1 THEN GOSUB 7930: LOCATE 25,1: PRINT "ENEMY LAUNCH DETECTED";: CIRCLE (LCN(X,ENEMY,1)+4,LCN(X,ENEMY,2)+4),4,ENEMY: GOTO 7570
7540 IF X<29 THEN GOTO 7570
7550 IF STAT(X,ENEMY)<4 OR STAT(X,ENEMY)>8 THEN GOTO 7570
7560 GOSUB 8800 'FLIGHT PATH
7570 IF X<17 AND STAT(X,ENEMY)=2 THEN GOSUB 8040: GOTO 7640
7580 IF X<29 AND STAT(X,ENEMY)=4 THEN GOSUB 8040: GOTO 7640
7590 IF STAT(X,ENEMY) <> 8 THEN GOTO 7640
7600 CIRCLE (TGT(X,ENEMY,1),TGT(X,ENEMY,2)),4,3
7610 PSET (TGT(X,ENEMY,1),TGT(X,ENEMY,2)),0
7620 PAINT (TGT(X,ENEMY,1),TGT(X,ENEMY,2)),3,3
7630 GOSUB 8590 'FLASH
7640 NEXT X
7650 RETURN
7660 '
7670 'FIND A TARGET
7680 '
7690 FOR S=RANGE(T,1) TO RANGE(T,2)
7700 IF T.STAT(S,ENEMY) <> 1 GOTO 7750
7710 TGT(Y,SIDE,1)=LCN(S,ENEMY,1)
7720 TGT(Y,SIDE,2)=LCN(S,ENEMY,2)
7730 T.STAT(S,ENEMY)=2: TGT(Y,SIDE,3)=S
7740 GOTO 7830
7750 NEXT S
7760 FOR S=RANGE(T,1) TO RANGE(T,2)
7770 IF T.STAT(S,ENEMY) <> 2 GOTO 7820
7780 TGT(Y,SIDE,1)=LCN(S,ENEMY,1)
7790 TGT(Y,SIDE,2)=LCN(S,ENEMY,2)
7800 T.STAT(S,ENEMY)=2: TGT(Y,SIDE,3)=S
7810 GOTO 7830
7820 NEXT S
7830 RETURN
7840 '
7850 'UPDATE WEAPON FLIGHT
7860 '
7870 FOR X=1 TO 60
7880 IF STAT(X,SIDE) > 0 AND STAT(X,SIDE) < 999 THEN STAT(X,SIDE)=STAT(X,SIDE)+1
7890 NEXT X
7900 RETURN
7910 '
7920 '
7930 'SOUND ALARM
7940 IF A>0 THEN GOTO 8020
7950 A=1
7960 FOR S = 1 TO 5
7970 SOUND 500,12
7980 SOUND 32000,4
7990 SOUND 650,7
8000 SOUND 32000,4
8010 NEXT
8020 RETURN
8030 '
8040 'MISSILE FLIGHT
8050 '
8060 PI=3.141593
8070 IF LCN(X,ENEMY,1) < TGT(X,ENEMY,1) THEN AH=LCN(X,ENEMY,1): AV=LCN(X,ENEMY,2)
8080 IF LCN(X,ENEMY,1) < TGT(X,ENEMY,1) THEN CH=TGT(X,ENEMY,1): CV=TGT(X,ENEMY,2)
8090 IF LCN(X,ENEMY,1) > TGT(X,ENEMY,1) THEN AH=TGT(X,ENEMY,1): AV=TGT(X,ENEMY,2)
8100 IF LCN(X,ENEMY,1) > TGT(X,ENEMY,1) THEN CH=LCN(X,ENEMY,1): CV=LCN(X,ENEMY,2)
8110 IF AH<CH AND AV>CV THEN GOTO 8130
8120 IF AH<CH AND AV<CV THEN GOTO 8270
8130 BH=CH: BV=AV
8140 MH=INT((CH-AH)/2)+AH
8150 MV=INT((AV-CV)/2)+CV
8160 AB=CH-AH: BC=AV-CV
8170 R=INT(SQR(AB^2+BC^2)/2)
8180 STRT=TAN(BC/(R+R))
8190 FIN=STRT+PI
8200 CIRCLE (MH,MV),R,3,STRT,FIN
8210 CIRCLE (TGT(X,ENEMY,1),TGT(X,ENEMY,2)),4,3
8220 PSET (TGT(X,ENEMY,1),TGT(X,ENEMY,2)),0
8230 PAINT (TGT(X,ENEMY,1),TGT(X,ENEMY,2)),3,3
8240 GOSUB 8590 'FLASH
8250 GOTO 8390
8260 '
8270 MH=INT((CH-AH)/2)+AH
8280 MV=INT((AV-CV)/2)+CV
8290 AB=CH-AH: BC=AV-CV
8300 R=INT(SQR(AB^2+BC^2)/2)
8310 STRT=TAN(BC/(R+R))
8320 FIN=STRT+PI
8330 STRT=(2*PI)+STRT
8340 CIRCLE (MH,MV),R,3,STRT,FIN
8350 CIRCLE (TGT(X,ENEMY,1),TGT(X,ENEMY,2)),4,3
8360 PSET (TGT(X,ENEMY,1),TGT(X,ENEMY,2)),0
8370 PAINT (TGT(X,ENEMY,1),TGT(X,ENEMY,2)),3,3
8380 GOSUB 8590 'FLASH
8390 RETURN
8400 '
8410 'TITLE
8420 SCREEN 1: COLOR 0,0: CLS
8430 PALETTE 1,1: PALETTE 2,4: PALETTE 3,14
8440 CIRCLE (164,170),29,3,-6.283186,-3.141593
8450 PAINT (164,168),3,3
8460 COLOR 14,0
8470 COLOR 0,0
8480 PALETTE 1,1: PALETTE 2,4: PALETTE 3,14
8490 LINE (149,40)-(179,170),3,BF
8500 CIRCLE (164,20),150,3,,,5/36
8510 PAINT (164,20),3,3
8520 LOCATE 7,19: PRINT "GLOBAL"
8530 LOCATE 9,15: PRINT "THERMONUCLEAR"
8540 LOCATE 11,20: PRINT "WAR"
8550 SV.TIMER!=TIMER+6
8560 IF TIMER<SV.TIMER! THEN GOTO 8560
8570 RETURN
8580 '
8590 'SAVE,FLASH,RESTORE
8600 GET (0,0)-(319,199),SV
8610 COLOR 14,0
8620 COLOR 0,0
8630 PALETTE 1,1: PALETTE 2,4: PALETTE 3,14
8640 PUT (0,0),SV,PSET
8650 STAT(X,ENEMY)=999
8660 H.FACT=INT(RND*9)+1
8670 IF TGT(X,ENEMY,3) < 48 OR TGT(X,ENEMY,3) = 63 OR TGT(X,ENEMY,3)=64 THEN GOTO 8680 ELSE GOTO 8700
8680 IF X > 16 THEN GOTO 8700
8690 H.FACT=H.FACT-8
8700 IF (TGT(X,ENEMY,3) = 63 OR TGT(X,ENEMY,3)=64) AND STAT(TGT(X,ENEMY,3),SIDE)<999 THEN GOTO 8720
8710 IF STAT(TGT(X,ENEMY,3),SIDE) > 0 THEN GOTO 8790
8720 IF H.FACT < 2 THEN GOTO 8790
8730 IF TGT(X,ENEMY,3) > 83 THEN GOSUB 9380: GOTO 8780 'CITY
8740 FOR PP = 1 TO 7
8750 IF TGT(X,ENEMY,3) > RANGE(PP,2) THEN GOTO 8770
8760 IF STAT(TGT(X,ENEMY,3),SIDE)=0 THEN WEAPONS(PP,SIDE)=WEAPONS(PP,SIDE)-1: LOCATE 25,1: PRINT W.NAME$(PP);: GOTO 8790
8770 NEXT
8780 STAT(TGT(X,ENEMY,3),SIDE)=999
8790 RETURN
8800 'FLIGHT OF BOMBERS AND CRUISE MISSILES
8810 LOCATE 25,1: PRINT SPACE$(39);
8820 IF X<49 THEN MSG$="ENEMY CRUISE MISSILE" ELSE MSG$="ENEMY BOMBERS"
8830 LOCATE 25,1: PRINT MSG$;
8840 GOSUB 7930
8850 IF LCN(X,ENEMY,1) > TGT(X,ENEMY,1) THEN GOSUB 9110: GOTO 8880