Radio Shack TRS-80 PC-2 Invasion Force(*).
For PC-2 or PC-1500 +4KB.
Contrib by: Steve Tabone, Neil Morrison.
Download Invasion Force (60 KB)
PC-2 Invasion Force: © Tandy Corporation. All rights reserved. Game:Explore unknown planets. Destroy enemy aliens before they destroy you. (4K RAM module required) |
(*) This software is made available for documentation purpose only, since the PC-1500 is now an obsolete computer. This is not a commercial site. If you own a copyright on this program and do not want it to be available from this site, please inform me and I will remove it.
BASIC program.
7 "INVASION FORCE
5 " ":GOSUB "E":WAIT 0:PRINT " Invasion Force":CLEAR :DIM O$(49)*6,S$(4)*8,D$(5)*10,S(4):RANDOM
10 RESTORE :FOR I=0TO 4:READ S$(I),D$(I):NEXT I:READ D$(5)
11 DATA "Drive","Sirian","Sensors","Planet","Computer","Black Hole","Lasers"
12 DATA "Pulsar","Missiles","Naval Base","CSN HQ"
20 FOR I=0TO 19:GOSUB "1":O$(I)=O$+"009":GOSUB "1":O$(I+20)=O$+"01"+STR$ RND 9:NEXT I
21 FOR I=40TO 44:GOSUB "1":O$(I)=O$+"04"+STR$ RND 3:NEXT I
22 FOR I=45TO 48:GOSUB "1":O$(I)=O$+"0"+STR$ RND (1+RND 2)+"0":NEXT I:O$(49)="111159"
30 FOR I=0TO 4:S(I)=9:NEXT I:L$="111",E=2015,S=1E3,T=5:PAUSE " Copr. 1982 Tandy Corp."
100 IF E-25*B<15LET O$="energy loss":GOTO 7E3
110 E=E-15:IF BLET E=E-25:GOSUB 5500
120 IF S<500BEEP 3:WAIT 60:PRINT "Shields low"
130 FOR I=0TO 4:H=S(I),S(I)=S(I)*1.2+1:IF S(I)>9LET S(I)=9
140 IF H<7AND S(I)>=7WAIT 60:PRINT S$(I);" repaired"
150 NEXT I
160 FOR I=45TO 48:GOSUB "7":IF K=0LET O$="a "+D$(VAL MID$ (O$(I),5,1)):GOTO 7E3
170 NEXT I
180 I=RND 20-1:IF ASC O$(I)<>57GOSUB "1":O$(I)=O$+"009"
200 FOR I=0TO 19:GOSUB "7":IF KTHEN 396
210 BEEP 5:WAIT 90:PRINT "SENSOR ALERT":M$="1":GOSUB "5":IF RND 9>7THEN 396
300 G=VAL RIGHT$ (O$(I),1):CLS :GOSUB "K":U=1,V=0,W=-1:GOSUB "S"
310 IF RND 9>7WAIT 60:CURSOR 1:PRINT "Missed!":GOTO 392
315 D=INT ((1-.001*S)*(125+RND 125+25*G))+40*(B=0):CLS :WAIT 0:GOSUB "E":U=25,V=5:GOSUB "S"
340 S=S-D-25-RND 25:IF S<0LET S=0
345 E=E-D:IF E<1LET O$="Sirian attack":GOTO 7E3
346 IF D<50THEN 392
350 FOR J=0TO 4:IF RND 3<3THEN 390
360 S(J)=S(J)*(1-RND 0*D/150):WAIT 90:PRINT S$(J);" hit!":IF S(J)<0LET S(J)=0
390 NEXT J
392 G=G-2:IF G<1GOSUB "1":O$(I)=O$+"009":WAIT 90:PRINT D$(0);" disengaged":GOTO 396
394 O$(I)=LEFT$ (O$(I),5)+STR$ G
396 NEXT I
500 WAIT 0:CLS :PRINT " Mnvr Sns Cmp Wpn Rpt Alrt"
510 GOSUB "2":GOTO 1E3*A
1000 K=0:GOSUB "4":IF KTHEN 100
1010 WAIT 0:PRINT "STAR or Local?":GOSUB "2":IF A=8THEN 500
1020 IF A=3THEN 1500
1030 IF A<>1THEN 1010
1100 D$=L$:INPUT "Destination? (xyz) ";D$
1102 FOR I=1TO 3:@(20+I)=VAL MID$ (D$,I,1):NEXT I
1103 IF U<1OR U>5OR V<1OR V>5OR W<1OR W>5OR LEN D$<>3THEN 1100
1105 INPUT "Speed? (1-8) ";L
1106 CLS :IF L<1OR L>8THEN 1100
1110 GOSUB "9":X=X-U,Y=Y-V,Z=Z-W
1120 D=?(X*X+Y*Y+Z*Z)*30*L^2:IF D+100*SGN D>EWAIT 90:PRINT "Not enough energy":GOTO 1100
1130 L$=D$,E=E-INT D:GOTO 100
1500 WAIT 0:PRINT "Orbit or Dock?":GOSUB "2":CLS :IF A=8THEN 1010
1510 IF A=3THEN 1800
1520 IF A<>1THEN 1500
1600 M=0:FOR I=20TO 39:GOSUB "7":IF KTHEN 1790
1610 M=1:GOSUB "3":WAIT 0:PRINT "Orbit? (Y) (N)"
1620 GOSUB "2":IF A=4CLS :GOTO 1790
1630 IF A<>3THEN 1620
1690 WAIT 180:PRINT "Eploratory orbit":M$="2":GOSUB "5"
1695 IF F<>2LET P=P+10+10*V
1790 NEXT I:IF M=0WAIT 90:PRINT "No planet"
1795 GOTO 100
1800 IF L$<>"111"THEN 1900
1850 WAIT :PRINT "Score";P:END
1900 F=0:FOR I=40TO 44:GOSUB "7":IF KTHEN 1930
1905 M$="1":GOSUB "5"
1910 WAIT 90:PRINT "Docked":F=1,V=VAL (RIGHT$ (O$(I),1)):IF V=0PRINT "No supplies":GOTO 1930
1912 E=2E3,S=E/2:FOR J=0TO 4:S(J)=9:NEXT J:O$(I)=LEFT$ (O$(I),5)+STR$ (V-1):IF T<3LET T=3
1915 PRINT "Resupply complete":I=44
1930 NEXT I:IF F=0WAIT 90:PRINT "No base"
1940 GOTO 100
2000 K=1:GOSUB "4":IF KTHEN 100
2010 GOSUB "9":FOR I=0TO 49:WAIT 0:PRINT "Scan from ";L$:IF INKEY$ =CHR$ 24LET I=49:GOTO 2060
2020 FOR J=1TO 3:@(20+J)=VAL MID$ (O$(I),J,1):NEXT J
2030 IF ABS (X-U)>1OR ABS (Y-V)>1OR ABS (Z-W)>1THEN 2060
2040 GOSUB "8":M$="1":GOSUB "6"
2060 NEXT I:GOTO 100
3000 K=2:GOSUB "4":IF KTHEN 100
3010 WAIT 0:PRINT "Database or Sensors?"
3020 GOSUB "2":IF A=8THEN 500
3030 IF A=4THEN 3500
3040 IF A<>1THEN 3020
3100 WAIT 0:PRINT " All Sirians Planets Bases"
3110 GOSUB "2":N=0:IF A=8THEN 3010
3120 IF A=1LET O=49:GOTO 3200
3130 IF A=2LET O=19:GOTO 3200
3140 IF A=4LET N=20,O=39:GOTO 3200
3150 IF A=6LET N=40,O=44:GOTO 3200
3160 GOTO 3110
3200 CLS :FOR I=NTO O:IF MID$ (O$(I),4,1)="1"GOSUB "8"
3210 NEXT I:GOTO 100
3500 R=0:CLS :FOR I=0TO 19:GOSUB "7":IF KTHEN 3520
3510 R=R+1:WAIT 90:PRINT D$(0);R;" reads ";RIGHT$ (O$(I),1):M$="1":GOSUB "5"
3520 NEXT I
3600 FOR I=20TO 39:GOSUB "7":IF K=0GOSUB "3"
3610 NEXT I:GOTO 100
4000 WAIT 0:PRINT "Lasers Missiles Shields"
4010 GOSUB "2":IF A=8THEN 500
4020 IF A=3THEN 4400
4030 IF A=6THEN 4600
4040 IF A<>1THEN 4010
4200 K=3:GOSUB "4":IF KTHEN 100
4210 CLS :R=0:FOR I=0TO 19:GOSUB "7":IF KTHEN 4380
4300 R=R+1
4310 CLS :WAIT 0:PRINT D$(0);R;:INPUT " power? ";K
4315 IF K<1OR K>100THEN 4310
4320 IF 1.2*K+30>EWAIT 90:PRINT "Not enough energy":GOTO 4E3
4330 CLS :GOSUB "E":U=5:V=25:W=1:GOSUB "S":E=E-30-INT (1.2*K):IF RND 9<2WAIT 90:PRINT "MISSED!":GOTO 4380
4335 CLS :GOSUB "K":U=0:V=18:W=1:GOSUB "S"
4340 G=VAL RIGHT$ (O$(I),1):D=K*(6+RND 3)/100:G=INT (G-D):WAIT 0:CURSOR 0:PRINT "Sirian ";
4350 IF G<1WAIT 90:PRINT "destroyed!":O$(I)="999000":P=P+50:GOTO 4380
4360 PRINT "hit";:IF G<4PRINT " hard";
4370 WAIT 90:PRINT "!":O$(I)=LEFT$ (O$(I),5)+STR$ G
4380 NEXT I:IF R=0WAIT 120:PRINT "No Sirians"
4390 GOTO 100
4400 K=4:GOSUB "4":IF KTHEN 100
4410 CLS :R=0:FOR I=0TO 19:IF T<1WAIT 90:PRINT "Out of missiles!":I=19:GOTO 4460
4420 GOSUB "7":IF KTHEN 4460
4430 R=R+1:GOSUB "E":U=5:V=20:W=1:GOSUB "S":T=T-1:E=E-200
4440 IF RND 9<2CURSOR 9:PRINT "MISSED!":GOTO 4460
4450 O$(I)="999000":P=P+50:CLS :GOSUB "K":U=0:V=18:W=1:GOSUB "S":WAIT 90:PRINT "kerBOOM"
4460 NEXT I:IF R=0WAIT 90:PRINT "No Sirians"
4470 GOTO 100
4600 WAIT 90:PRINT "Energy";E:PRINT "Shields";S:INPUT "Transfer amount? ";R
4610 IF S+R>1000PRINT "Overload":GOTO 4600
4620 IF S+R<1OR E-R<1PRINT "Insufficient energy":GOTO 4600
4630 S=S+R:E=E-R:GOTO 100
5000 GOSUB 5500:FOR I=0TO 4:WAIT 0:PRINT S$(I);": ";:WAIT 90
5010 IF S(I)>5ON (S(I)-5)GOTO 5030,5040,5050,5050
5020 PRINT "inoperative":GOTO 5060
5030 PRINT "almost fixed":GOTO 5060
5040 PRINT "weak":GOTO 5060
5050 PRINT "Okay"
5060 NEXT I:GOTO 100
5500 WAIT 90:PRINT "Location: ";L$:PRINT "Energy:";E:PRINT "Shields:";S:PRINT S$(4);":";T:RETURN
6000 WAIT 90:IF B=0LET B=1:CLS :CURSOR 7:PRINT "** ALERT **":GOTO 100
6010 B=0:PRINT "Alert cancelled":GOTO 100
7000 CLS :WAIT 180:PRINT "PEGASUS has been lost":WAIT :PRINT "due to ";O$;".":END
8000 WAIT 0:PRINT "Save New End Load BU Score"
8010 GOSUB "2":CLS :ON AGOTO 8100,5,1850,8200,8400,8300,,500
8100 PRINT #"S";O$(*),S(*),E,S,P,T,L$:GOTO 8E3
8200 INPUT #"S";O$(*),S(*),E,S,P,T,L$:GOTO 8E3
8300 WAIT 180:PRINT P;" points":GOTO 8E3
8400 CSAVE "FORCE":GOTO 8E3
10000 "1"O$="":FOR K=1TO 3:O$=O$+STR$ RND 5:NEXT K:IF O$="111"THEN "1"
10010 RETURN
11000 "2"BEEP 1,130,50
11010 A=ASC INKEY$ -16:IF A<1OR A>8OR A=7THEN 11010
11020 RETURN
12000 "3"WAIT 0:F=VAL MID$ (O$(I),4,1):V=VAL RIGHT$ (O$(I),1):IF F=0PRINT "New";:GOTO 12030
12010 IF F=1PRINT "Un-";
12020 PRINT "Explored";
12030 WAIT 120:PRINT " Class";V;" planet":M$="1":GOSUB "6":RETURN
13000 "4"IF S(K)<7WAIT 90:PRINT S$(K);" inoperative":K=1:RETURN
13010 K=0:RETURN
14000 "6"IF MID$ (O$(I),4,1)="2"RETURN
14010 "5"O$(I)=LEFT$ (O$(I),3)+M$+RIGHT$ (O$(I),2):RETURN
15000 "7"K=(LEFT$ (O$(I),3)<>L$):RETURN
16000 "8"WAIT 150:PRINT D$(VAL MID$ (O$(I),5,1));" at ";LEFT$ (O$(I),3):RETURN
17000 "9"FOR J=1TO 3:@(23+J)=VAL MID$ (L$,J,1):NEXT J:RETURN
20000 "E"WAIT 60:GPRINT "0103030303030363637F636360606066767E7E6E070707070606060606";:RETURN
21000 "K"GCURSOR 120:GPRINT "02060606020202020202020202020206064E4E5F5F7F7F7E7E72604040":RETURN
22000 "S"WAIT 0:FOR A=UTO VSTEP W:CURSOR A:PRINT "-";:NEXT A:RETURN
60000 END