2 PRINT CHR$(26)
5 RANDOMIZE
7 PRINT CHR$(26)
10 PRINT:PRINT TAB(18);"Space Adventure!"
15 PRINT:PRINT TAB(20);"by Dan Daetz"
20 PRINT:PRINT"**************************************************"
25 PRINT:PRINT"   This is a computer adventure for the Osborne"
26 PRINT"Computer.  The object is to deliver secret plans"
27 PRINT"to an Earth outpost in outer space.  On the way,"
28 PRINT"you may encounter hostile (and friendly) aliens,"
29 PRINT"treacherous asteroid fields, and other dangers."
30 PRINT"If you succeed, you will gain fame and fortune,"
31 PRINT"but if you fail the mission, it's curtains for"
32 PRINT"you!"
33 PRINT:PRINT"   What is your current ranking?:"
34 PRINT"     1. Ensign"
35 PRINT"     2. Lieutenant"
36 PRINT"     3. Commander"
37 PRINT"     4. Captain"
38 PRINT"     5. Commodore"
39 INPUT R:IF R>5 OR R<1 THEN 33
40 ON R GOTO 41,42,43,44,45
41 R$="Ensign":GOTO 50
42 R$="Lieutenant":GOTO 50
43 R$="Commander":GOTO 50
44 R$="Captain":GOTO 50
45 R$="Commodore":GOTO 50
50 PRINT CHR$(26)
55 PRINT"What is your name, ";R$;"?":INPUT N$
60 PRINT:PRINT"My greetings to you, ";R$;" ";N$;"!"
65 PRINT:PRINT:PRINT"   You may choose from several different Star"
66 PRINT"Cruisers for your mission, or you may create your"
67 PRINT"own.  The characteristics of each are shown below:"
68 PRINT:PRINT"_____________Name________Sp._FP__Sh.__EL___"
69 PRINT"   Ship 1: USS Antares    5   1   4   10
70 PRINT"   Ship 2: USS Discovery  3   3   4   10
71 PRINT"   Ship 3: USS Starfire   2   5   3   10
72 PRINT"   Ship 4: (Your own)    Sp.+FP+Sh.=10"
73 PRINT:PRINT"   Sp.=Speed  FP=Firepower  Sh.=Shielding"
74 PRINT"   EL=Energy Level (begins at 10 for all ships)
75 PRINT:PRINT"What ship number would you like, ";R$;"?"
80 INPUT S:IF S>4 OR S<1 THEN GOTO 75
85 ON S GOTO 90,92,94,96
89 REM *** SHIP CHARACTERISTICS
90 S$="Antares":S1=5:S2=1:S3=4:S4=10:GOTO 110
92 S$="Discovery":S1=3:S2=3:S3=4:S4=10:GOTO 110
94 S$="Starfire":S1=2:S2=5:S3=3:S4=10:GOTO 110
96 PRINT CHR$(26):PRINT"Enter ship name:":INPUT S$
97 PRINT"Enter 'Speed' value:":INPUT S1:IF S1<1 THEN GOTO 97
98 PRINT"Enter 'Firepower' value:":INPUT S2:IF S2<1 THEN GOTO 98
99 PRINT"Enter 'Shielding' value:":INPUT S3:IF S3<1 THEN GOTO 99
100 IF S1+S2+S3<>10 THEN PRINT"*** Your ship characteristics do not total 10 ***":GOTO 97
102 PRINT:PRINT"Are you satisfied with your ship (Y/N)?":INPUT Q1$
103 IF Q1$="N" THEN GOTO 96
104 S4=10:GOTO 110
110 PRINT CHR$(26):PRINT"Just to remind you, ";R$;" ";N$;", your ship,"
111 PRINT"the USS ";S$;", has the following traits:"
112 PRINT"Speed= ";S1;"  Firepower= ";S2;"  Shielding= ";S3
113 PRINT"               Energy Level= ";S4
115 SH=INT(5*RND(1)+3)
116 PRINT"Your ship has";SH;"shuttlecraft available."
120 PRINT:PRINT:PRINT"In addition to your ship, you will also be"
122 C=INT(25*RND(1)+10)
124 PRINT"provided with ";C;" crewmen to help you.  However,"
125 PRINT"if all your crewmen die, you will be virtually"
126 PRINT"helpless."
127 PRINT"In addition, you should treat them fairly, or they"
128 PRINT"may turn against you."
130 PRINT:PRINT:PRINT"Are you ready to begin your mission";:INPUT Q2$
131 IF LEFT$(Q2$,1)="Y" THEN GOTO 150
135 PRINT"OK, ";R$;" ";N$;", take a short break and"
137 PRINT"press 'Return' when ready.": INPUT I1: GOTO 200
150 GOTO 200
200 PRINT CHR$(26)
205 PRINT"You have just been handed the secret plans, ";R$
206 PRINT N$;". You must deliver these plans as soon as"
207 PRINT "possible to the Earth outpost station (which is"
208 D=INT(75*RND(1)+50)
209 T=1:V=0:P=1:M=100
210 PRINT D;" star units away). "
211 PRINT:PRINT"It is now Day 1.  You may blast off in your ship"
212 PRINT"immediately or you may spend a day inspecting the"
213 PRINT S$;" before launch.  Do you want to make the"
214 PRINT"inspection, ";R$;" ";N$;:INPUT Q3$
215 IF LEFT$(Q3$,1)="N" THEN GOTO 230
216 M=M-5
217 IF INT(3*RND(1)+1)<3 THEN GOTO 220
218 PRINT:PRINT"You have found a minor malfunction, but luckily"
219 PRINT"manage to fix it before launch.":V=50:GOTO 225
220 PRINT:PRINT"You find nothing unusual, and your ship is now"
221 PRINT"ready for launch.":V=15
225 T=T+1
230 PRINT:PRINT R$;" ";N$;", it is now Day ";T;".  The USS"
231 PRINT S$;" and your crew of ";C;" are ready for launch"
232 PRINT"and are awaiting your order.  Press 'Return' to"
233 PRINT"launch, ";R$;:INPUT I2
235 PRINT CHR$(26)
240 PRINT:PRINT"10...9...8...7...6...5...4...3...IGNITION!...1..."
245 PRINT"... L A U N C H   ! ! !"
246 IF INT (100*RND(1))<((30*(SQR(R)/2))-V) THEN GOTO 250
247 GOTO 275
250 PRINT:PRINT:PRINT:PRINT:PRINT".....fizzle.....fizzle......fizzle......"
251 PRINT:PRINT"YELLOW ALERT!  YELLOW ALERT!"
252 PRINT:PRINT R$;" ";N$;"!  The number 3 ion drive seems to"
253 PRINT"be overheating!  Should we shut it down";:INPUT Q4$
255 IF LEFT$(Q4$,1)="Y" THEN GOTO 265
256 IF INT(100*RND(1))<75 THEN GOTO 258
257 PRINT:PRINT"Luckily, the ion drive cooled down, and the launch                              continued successfully.": GOTO 275
258 IF INT(4*RND(1)+1)=4 THEN GOTO 260
259 GOTO 261
260 PRINT"Sorry, ";R$;" ";N$;", but the drive exploded!":GOTO 5000
261 PRINT"RED ALERT! RED ALERT! We need immediate shutdown";:INPUT Q5$
262 IF LEFT$(Q5$,1)<>"Y" THEN GOTO 260
263 PRINT"We managed to shut down the drive, but suffered 1"
264 PRINT"point of Speed damage.":S1=S1-1:S4=S4-1:GOTO 275
265 IF INT(3*RND(1))=2 THEN GOTO 267
266 PRINT"The drive has been shut down, and the launch is now                             continuing as planned.":GOTO 275
267 PRINT:PRINT"RED ALERT! RED ALERT! Drive will not shut down!"
268 PRINT"Should we attempt manual override, ";R$;:INPUT Q7$
269 IF LEFT$(Q7$,1)="N" THEN GOTO 256
270 IF INT(4*RND(1)+1)=4 THEN GOTO 260
272 GOTO 266
275 PRINT:PRINT"The ";S$;" is now in Earth orbit, ";R$;"."
300 T=T+1:D=D-S1:M=M-1
302 FOR W=1 TO 3000:NEXT W
304 PRINT CHR$(26)
305 PRINT
310 PRINT R$;" ";N$;", it is now Day ";T;" of your"
311 PRINT"mission, and the ";S$;" is ";D;" space units"
312 PRINT"from the outpost."
313 PRINT SH;"shuttlecraft remain.":PRINT
314 S4=S1+S2+S3
315 PRINT"Sp.=";S1;" FP=";S2;" Sh.=";S3;" EL=";S4;" Crew=";C
316 PRINT"Morale is at ";M;"%."
317 PRINT
318 GOSUB 320
319 GOTO 400
320 IF INT(100*RND(1))>M THEN GOTO 4200
321 PRINT:PRINT"   *** Status Report ***":PRINT
322 IF C=<0 THEN GOTO 4030
323 IF S4=<0 THEN GOTO 5000
325 IF S1=<0 THEN GOTO 3950
330 IF S2=<0 THEN GOTO 4010
335 IF S3=<0 THEN GOTO 4020
340 IF SH<=0 THEN GOTO 4025
345 IF D=<8 THEN GOTO 4100
347 IF P=0 THEN GOTO 4250
360 PRINT"Nothing else to report, ";R$;" ";N$;".":RETURN
400 PRINT:PRINT"Press 'Return' to discover the day's proceedings";:INPUT I
405 PRINT CHR$(26)
410 REM *** Aliens?
415 IF INT(100*RND(1))<(10*(SQR(R)/2)) THEN GOTO 500
420 REM *** Asteroid field?
425 IF INT(100*RND(1))<(10*(SQR(R)/2)) THEN GOTO 700
430 REM *** Black Hole?
435 IF INT(100*RND(1))<(10*(SQR(R)/2)) THEN GOTO 850
440 REM *** Planet?
445 IF INT(100*RND(1))<(10*(SQR(R)/2)) THEN GOTO 1000
450 REM *** Space Mine?
455 IF INT(100*RND(1))<(10*(SQR(R)/2)) THEN GOTO 1200
460 REM *** Plague/Disease?
465 IF INT(100*RND(1))<(15*(SQR(R)/2)) THEN GOTO 1400
470 REM *** Computer Failure?
475 IF INT(100*RND(1))<(15*(SQR(R)/2)) THEN GOTO 1600
480 REM *** Radiation Field?
485 IF INT(100*RND(1))<(15*(SQR(R)/2)) THEN GOTO 1800
490 PRINT CHR$(26):PRINT R$;" ";N$;", nothing of interest occurred today."
492 PRINT:GOTO 300
500 PRINT"You have encountered an alien ship during your"
505 A=INT(4*RND(1)+1)
507 REM*** If A=1 or 2, friendly; 3=hostile; 4=pirates
509 ON A GOTO 510,520,530,540
510 REM***Friendly aliens#1
511 A1=5:A3=INT(4*RND(1)+1):A2=5-A3:A4=10
512 H=0:PR=0
515 GOTO 550
520 REM***Friendly aliens #2
521 A3=5:A1=INT(4*RND(1)+1):A2=5-A1:A4=10
522 H=0:PR=0
525 GOTO 550
530 REM***Hostile aliens
531 A2=5:A3=INT(4*RND(1)+1):A1=5-A3:A4=10
532 H=1:PR=0
535 GOTO 550
540 REM***Pirates
541 A1=5:A2=INT(4*RND(1)+1):A3=5-A2:A4=10
542 H=0:PR=1
545 GOTO 550
550 PRINT"journey.  What do you wish to do?"
552 PRINT:PRINT"1. Attack  2. Wait  3. Communicate  4.Escape"
553 PRINT"5. Scan the alien ship.":PRINT"What is your choice, ";R$;:INPUT B
554 PRINT CHR$(26):IF SD0=1 THEN S3=SD1:SD0=0
555 ON B GOTO 559,600,630,660,690
557 GOTO 552
559 IF S2<=0 THEN PRINT"Negative.  No firepower.  Re-select.":GOTO 552
560 IF INT(100*RND(1))>(20*(SQR(R)/2)) THEN GOTO 577
561 PRINT"Your attack on the aliens failed, ";R$;".":M=M-2
562 IF INT(100*RND(1))<(20*(SQR(R)/2)) AND A2>0 THEN GOSUB 564:GOTO 572
563 PRINT"The alien attack had no effect on the ";S$;".":M=M+3:GOTO 552
564 DA=INT(2*RND(1)+1)+A2-S3:IF DA<0 THEN DA=0
565 DP=INT(3*RND(1)+1):ON DP GOTO 566,568,570
566 D$="speed":S1=S1-DA:IF S1<0 THEN S1=0
567 D1=S1:RETURN
568 D$="firepower":S2=S2-DA:IF S2<0 THEN S2=0
569 D1=S2:RETURN
570 D$="shielding":S3=S3-DA:IF S3<0 THEN S3=0
571 D1=S3:RETURN
572 S4=S1+S2+S3:IF S4=<0 THEN GOTO 5000
573 PRINT"The alien attack did ";DA;" points damage to your":M=M-DA
574 PRINT D$;" generator (";D$;" is now = ";D1;" )."
575 IF RND(1)<.25 AND SH<>0 THEN PRINT"The attack also destroyed a shuttle (";SH-1;"remain).":SH=SH-1
576 GOTO 552:REM *** Damage to Aliens Below
577 DS=INT(3*RND(1)+1)+S2-A3:IF DS<0 THEN DS=0
579 DP2=INT(3*RND(1)+1):ON DP2 GOTO 582,585,588
582 A1=A1-DS:IF A1<0 THEN A1=0
583 GOTO 590
585 A2=A2-DS:IF A2<0 THEN A2=0
586 GOTO 590
588 A3=A3-DS:IF A3<0 THEN A3=0
590 A4=A1+A2+A3
592 PRINT"Your attack did ";DS;" points damage to the aliens.":M=M+DS
594 IF A4=<0 THEN PRINT"Aliens destroyed!!!":M=M+5:GOTO 596
595 GOTO 562
596 IF INT(3*RND(1)+1)<=2 THEN GOTO 300
597 S3=S3-INT(3*RND(1)+1):IF S3<0 THEN S3=0
598 S4=S1+S2+S3:PRINT"The explosion of the alien ship damaged your"
599 PRINT"shielding generator (it is now ";S3;").":GOTO 300
600 PRINT:PRINT"Waiting, ";R$;" ";N$;"...."
601 FOR W=1 TO 3000
602 NEXT W
605 IF H=1 THEN PRINT"The aliens attacked the ";S$;"!!!":GOTO 562
607 IF INT(3*RND(1)+1)=3 THEN GOTO 635
609 PRINT"The aliens waited, too.":GOTO 552
630 IF H=0 THEN GOTO 635
631 IF INT(3*RND(1)+1)=3 THEN PRINT"The aliens say that they will only let you be if":GOTO 633
632 PRINT"The aliens will not talk to you, and attack.":GOTO 562
633 PRINT"you give them the secret plans.  Will you (Y/N)";:INPUT Q11$:IF Q11$="N" THEN GOTO 632
634 PRINT"The aliens are given the plans and leave.":P=0:GOTO 300
635 PRINT"The aliens wish to communicate with you."
637 IF INT(3*RND(1)+1)=3 THEN PRINT"They simply want you to let them go their own way.":GOTO 300
638 PRINT"They want to come on board to talk.Your response";:INPUT Q12$
639 IF Q12$="Y" THEN GOTO 642
640 IF PR=1 THEN PRINT"Insulted, these pirates attack!":GOTO 562
641 GOTO 637
642 PRINT"The aliens come aboard and chat for a while."
643 IF PR=0 THEN GOTO 650
644 PRINT"Suddenly, one of them grabs the plans and runs off"
645 PRINT"with the others. Should we try to get them back";:INPUT Q13$
646 IF Q13$="N" THEN P=0:GOTO 300
647 CK=INT(5*RND(1)):IF CK>C THEN GOTO 647
648 IF INT(3*RND(1)+1)=3 THEN PRINT"You succeeded, but ";CK;" of your crewmen were killed.":C=C-CK:P=1:GOTO 300
649 PRINT"You failed, and ";CK;" of your crewmen were killed.":C=C-CK:P=0:GOTO 300
650 IF P=0 THEN PRINT"The aliens also return the plans you had lost (and":GOTO 652
651 GOTO 653
652 PRINT"which they found).  They then leave.":P=1:GOTO 300
653 IF S1=<1 THEN PRINT"The aliens also repaired your speed generator.":S1=S1+INT(4*RND(1)+1):GOTO 656
654 IF S2=<0 THEN PRINT"The aliens also repaired your firepower generator.":S2=S2+INT(4*RND(1)+1):GOTO 656
655 IF S3=<0 THEN PRINT"The aliens also repaired your shielding generator.":S3=S3+INT(4*RND(1)+1):GOTO 656
656 CG=INT(10*RND(1)+1):PRINT"Before leaving, the aliens give you a gift of ";CG
657 PRINT"crewmen to help you.":C=C+CG:M=M+10:GOTO 300
660 IF S1>=A1 THEN PRINT"You escape successfully, ";R$;".":GOTO 300
665 PRINT"The alien ship is faster than yours.  Should we"
666 PRINT"try to escape anyway";:INPUT Q14$
668 IF Q14$="N" THEN GOTO 552
670 IF INT(100*RND(1))<(50*(SQR(R)/2)) THEN PRINT"The attempt fails, and the angered aliens attack.":GOTO 562
675 PRINT"Your escape succeeded!!!":GOTO 300
690 PRINT"The alien ship has the following characteristics:":SD1=S3:S3=0:SD0=1
691 PRINT"Sp.=";A1;" FP=";A2;" Sh.=";A3;" EL=";A4
692 IF H=1 THEN GOTO 695
693 PRINT:PRINT"The alien ship did not react to your scan.":GOTO 552
695 PRINT:PRINT"While you were scanning, the aliens attacked!":GOTO 562
700 PRINT R$;" ";N$;", we have encountered an asteroid"
705 PRINT"field.  Shall we:"
707 PRINT"1. Navigate through it"
708 PRINT"2. Try to go around it; or"
709 PRINT"3. Clear a path with our lasers"
710 INPUT AS:PRINT:ON AS GOTO 720,750,770:GOTO 710
720 SR=((40+S1)*(2/SQR(R))):PRINT"Aye, aye, sir.  Success rate calculated at ";SR;"%"
725 PRINT:PRINT"Here we go..."
726 FOR W=1 TO 3000
727 NEXT W
730 IF (100*RND(1))<SR THEN GOTO 744
731 PRINT:PRINT"ALERT! ALERT! We have been hit by a small asteroid"
732 AD=INT(S1*RND(1)+1):ON INT(3*RND(1)+1) GOTO 733,735,737
733 D$="speed":S1=S1-AD:IF S1<0 THEN S1=0
734 D2=S1:GOTO 739
735 D$="firepower":S2=S2-AD:IF S2<0 THEN S2=0
736 D2=S2:GOTO 739
737 D$="shielding":S3=S3-AD:IF S3<0 THEN S3=0
738 D2=S3
739 S4=S1+S2+S3:PRINT"We suffered ";AD;" points damage to the ";D$
740 PRINT"generator (";D$;" is now ";D2;")."
741 PRINT"Press 'Return' to continue";:INPUT I
743 GOTO 300
744 PRINT"...Navigation successful!!!":GOTO 300
750 IF INT(3*RND(1)+1)=3 THEN PRINT"There is no way to go around the asteroid field,":GOTO 752
751 GOTO 755
752 PRINT R$;" ";N$;". Shall we: 1. Navigate; or 2. Use"
753 PRINT"lasers";:INPUT AA:ON AA GOTO 720,770
754 GOTO 752
755 PRINT"We have found an alternate path. Here we go..."
756 FOR W=1 TO 3000:NEXT W
757 IF INT(3*RND(1)+1)=3 THEN PRINT"We have been hit by a stray asteroid!!!":GOTO 732
760 GOTO 744
770 IF S2=<0 THEN PRINT"No firepower, ";R$;". Re-select":GOTO 707
772 PRINT"Aye, aye. Lasers ready. Here we go..."
773 FOR W=1 TO 3000:NEXT W
775 IF INT(S2*RND(1)+1)<=2 THEN PRINT"ALERT! We have been hit by fragments of a partially":GOTO 777
776 GOTO 780
777 PRINT"disintegrated asteroid!":IF S3>=S2 THEN PRINT"Luckily, though, our shielding absorbed them.":GOTO 300
778 GOTO 732
780 PRINT:PRINT"We successfully blasted through the asteroid field.":GOTO 300
850 PRINT"We have been pulled in by a black hole, ";R$"!"
851 PRINT"The G-forces are almost tearing the ";S$;" apart!"
852 PRINT"We're going in...":FOR W=1 TO 3000:NEXT W
855 IF INT((2/SQR(R))*RND(1)+S4)=<5 THEN GOTO 5000
860 BH=INT(30*RND(1)-10):D=D-BH:IF D=<0 THEN GOTO 860
862 PRINT:PRINT"We emerged from the black hole.  We are now ";D
865 PRINT"space units from the Earth outpost.":GOTO 305
1000 PRINT"You have discovered a new planet! Should we:"
1005 PRINT:PRINT"     1. Land to investigate"
1006 PRINT"     2. Use the planet's gravitational pull to"
1007 PRINT"        accelerate the ";S$;"; or"
1008 PRINT"     3. Just take scientific measurements"
1010 PRINT"Your choice";:INPUT PL:ON PL GOTO 1020,1080,1120
1015 GOTO 1010
1020 IF C<=0 THEN PRINT"Sorry, ";R$;", but there are no more crewmen":GOTO 1023
1021 GOTO 1024
1023 PRINT"left for an expedition.  Re-select.":GOTO 1010
1024 IF SH<=0 THEN PRINT"Sorry, but no shuttles remain. Re-select.":GOTO 1010
1025 PE=INT(5*RND(1)+1):IF C-PE<0 THEN GOTO 1025
1027 PRINT:PRINT"Aye, aye, ";R$;". ";PE;" of your crewmen are in"
1028 PRINT"the planetary shuttle and are ready for the landing."
1030 PRINT"Press 'Return' to launch the shuttle.":INPUT I
1035 PRINT:PRINT"Shuttle entering atmosphere...":FOR W=1 TO 2000:NEXT W
1036 IF INT(5*RND(1)+1)=5 THEN PRINT"SHIELDING MALFUNCTION! The shuttle burned up in":GOTO 1038
1037 GOTO 1040
1038 PRINT"the atmosphere, and all ";PE;" crewmen were killed!":C=C-PE:SH=SH-1:M=M-20:GOTO 300
1040 PRINT"...landing successful!"
1041 PRINT"The crew is now going out to investigate..."
1043 FOR W=1 TO 1000:NEXT W
1045 PR=INT(4*RND(1)+1):ON PR GOTO 1046,1051,1057,1065
1046 PRINT"The crew has found some strange leaves. Should they"
1047 PRINT"take them aboard";:INPUT Q15$:IF Q15$="N" THEN GOTO 1070
1048 IF INT(3*RND(1)+1)=3 THEN PRINT"The leaves were poisonous, and the crew died.":C=C-PE:SH=SH-1:M=M-10:GOTO 300
1049 PRINT"They seem to have mysterious healing properties.":ML=1:GOTO 1070
1051 H=0
1052 PRINT"You have encountered strange, alien beings on the"
1053 PRINT"planet. Will you: 1. Be friendly, or 2. Attack":INPUT PA:ON PA GOTO 1054,1059:GOTO 1052
1054 IF H=0 THEN PRINT"The aliens gave you 5 crewmen and Quyzlapvox                                    Crystals (used for warp travel).":C=C+5:S1=S1+5:GOTO 1070
1055 PRINT"The aliens attacked and killed the entire crew!":SH=SH-1:M=M-10:GOTO 300
1057 H=1:GOTO 1052
1059 IF H=0 AND P=0 THEN PRINT"You killed the aliens and found the secret plans!":GOTO 1070
1060 IF H=0 AND P=1 THEN PRINT"You killed the aliens,but they had nothing of value.":GOTO 1070
1061 PRINT"You killed the aliens, and you find a mysterious"
1062 PRINT"black box.":S2=S2+3:S3=S3+2:GOTO 1070
1065 PRINT"Your crew found nothing unusual, ";R$;".":M=M+10:GOTO 1070
1070 PRINT:PRINT"Your crew has returned successfully to the ship"
1071 PRINT"with their findings.":GOTO 300
1080 IF INT(S1*RND(1)+1)=1 THEN PRINT"You approached to close to the planet, were":GOTO 1083
1081 GOTO 1090
1083 PRINT"pulled in by its gravity, and eventually crashed"
1084 PRINT"into the alien world. R.I.P.":FOR W=1 TO 3000:NEXT W:GOTO 5000
1090 PRINT"The planet's gravity sent you shooting through"
1092 D=D-5:S1=S1+1
1094 PRINT"space at ";S1;" units per turn.":GOTO 300
1120 PRINT"You made several new scientific discoveries, and"
1122 PRINT"your crew's spirits were lifted.":M=M+20:GOTO 300
1200 PRINT"Forward scanners have detected a pulsating object"
1201 SO=INT(4*RND(1)+1)
1202 REM *** If SO=1 or 2 -- drifting ship   3 -- Mine
1203 REM *** If SO=1 or 2 -- Space Mine ... 3 -- Derelict Ship ... 4 -- Asteroid
1205 PRINT"in the distance. Should we:"
1210 PRINT:PRINT"  1. Destroy it"
1211 PRINT"  2. Move in closer"
1212 PRINT"  3. Try to avoid it; or"
1213 PRINT"  4. Send out a shuttle to attempt identification"
1214 PRINT:PRINT"  Your choice";:INPUT SM:ON SM GOTO 1220,1240,1300,1330:GOTO 1214
1220 REM *** Destroy it
1222 IF S2<=0 THEN PRINT"Not possible, ";R$;". No firepower.":GOTO 1210
1224 ON SO GOTO 1225,1225,1227,1230
1225 PRINT R$;", what was apparently a Space Mine exploded"
1226 PRINT"harmlessly before you.":M=M+2:GOTO 300
1227 PRINT"The object was destroyed in a flash of light, and"
1228 PRINT"pieces of an alien ship are all that remain.":GOTO 300
1230 PRINT"The object was an asteroid and broke into pieces."
1231 IF INT(3*RND(1)+1)=1 THEN PRINT"Luckily, though, nothing happened to your ship.":GOTO 300
1232 PRINT R$;"! We were hit by asteroid fragments!"
1233 IF S3=>S2 THEN PRINT"Our shielding absorbed them and no damage occurred.":GOTO 300
1234 A2=6:GOSUB 564
1235 S4=S1+S2+S3:IF S4=<0 THEN GOTO 5000
1236 PRINT"The asteroid did";DA;"points damage to the"
1237 PRINT D$;" generator (power is now";D1;")."
1238 IF RND(1)<.2 AND SH<>0 THEN PRINT"A shuttle was also destroyed (";SH-1;"remain).":SH=SH-1
1239 GOTO 300
1240 REM *** Move in closer
1241 PRINT"OK, ";R$;" ";N$;", moving in closer...":FOR W=1 TO 1000:NEXT W
1242 ON SO GOTO 1244,1244,1250,1280
1244 PRINT"The object was a space mine, and it exploded!":A2=10:GOSUB 564
1245 S4=S1+S2+S3:IF S4<=0 THEN GOTO 5000
1246 PRINT"The explosion did";DA;"points damage to the"
1247 PRINT D$;" generator (now power is";D1;")."
1248 IF RND(1)<.5 AND SH<>0 THEN PRINT SH-1;"shuttles remain (one was destroyed).":SH=SH-1
1249 GOTO 300
1250 PRINT"You have received S.O.S. signals from the object--"
1251 PRINT"a derelict. Will you shuttle men aboard to help";:INPUT Q17$
1253 IF LEFT$(Q17$,1)<>"Y"THEN PRINT"OK, ";R$;". You avoid the derelict and leave.":GOTO 300
1254 IF C<5 OR SH=0 THEN PRINT"Sorry, but you can't. You have no choice but to go.":GOTO 300
1255 CL=INT(3*RND(1)+2)
1256 PRINT CL;"men have left in a shuttle and arrive safely"
1258 PRINT"in the derelict ship. They are now investigating...":FOR W=1 TO 1000:NEXT W
1260 IF INT(3*RND(1)+1)=3 THEN GOTO 1270
1261 PRINT"Your crew rescued stranded aliens. Your reward:":M=M+10
1262 IF RND(1)<.5 THEN PRINT"   Quyzlapvox Crystals":S1=S1+5
1263 IF RND(1)<.5 THEN PRINT"   A black box":S2=S2+3:S3=S3+2
1264 IF P=0 THEN PRINT"   The secret plans!":P=1
1265 IF RND(1)<.5 THEN PRINT"   A Shuttlecraft":SH=SH+1
1266 CG=INT(3*RND(1)+3):PRINT"  ";CG;"crewmen":C=C+CG
1267 PRINT"Your crew returns with the aliens and you leave."
1268 GOTO 300
1270 PRINT"The derelict appears deserted. Continue search";:INPUT Q18$
1272 IF LEFT$(Q18$,1)<>"Y" THEN PRINT"OK. Your crewmen return and you leave.":GOTO 300
1273 IF INT(3*RND(1)+1)<>3 THEN GOTO 1260
1274 PRINT"Your crewmen accidentally damage one of the ship's"
1275 PRINT"generators, and the entire vessel explodes!"
1276 M=M-(2*CL):A2=8:SH=SH-1
1277 GOSUB 564
1278 GOTO 1245
1280 PRINT"The object--an asteroid--seems a likely place for"
1281 PRINT"mining. Should we shuttle down a crew to try";:INPUT Q19$
1282 IF LEFT$(Q19$,1)<>"Y" THEN PRINT"OK. We are leaving, ";R$;"...":GOTO 300
1283 IF C<10 OR SH=0 THEN PRINT"Not possible. We leave, ";R$;".":GOTO 300
1284 CL=INT(4*RND(1)+5):DM=INT(3*RND(1)+1)
1285 PRINT CL;" crewmen have landed a shuttle on the asteroid,"
1286 PRINT"and spent";DM;"days mining.":T=T+DM
1287 IF INT(3*RND(1)+1)=3 THEN PRINT"They find nothing, return, and you leave.":GOTO 300
1288 PRINT"They found a rich metal deposit! Are now mining...":FOR W=1 TO 1500:NEXT W
1289 IF INT(4*RND(1)+1)<>4 THEN GOTO 1294
1290 PRINT"Unfortunately, the metal was volatile, and":SH=SH-1:C=C-CL:M=M-(2(CL))
1291 PRINT"exploded, shattering the asteroid.":GOTO 1232
1294 PRINT"The metal was rare Krylaz, and can be used in the"
1295 PRINT S$;"'s generators! The crew then returned."
1297 M=M+10:S1=S1+INT(3*RND(1)+1):S2=S2+INT(3*RND(1)+1):S3=S3+INT(3*RND(1)+1)
1298 S4=S1+S2+S3:GOTO 300
1300 REM *** Try to Avoid
1301 PRINT
1302 IF INT(S1*RND(1)+1)=<1 THEN GOTO 1306
1304 PRINT"The object was successfully avoided, ";R$;".":GOTO 300
1306 PRINT"While attempting this, you strayed closer."
1308 ON SO GOTO 1310,1310,1318,1318
1310 PRINT"Unfortunately, the object was a mine and exploded!"
1311 M=M-3:A2=10:GOSUB 564
1313 GOTO 1245
1318 IF INT(3*RND(1)+1)=1 THEN PRINT"Your ship was hit by the object and destroyed!":FOR W=1 TO 2000:NEXT W:GOTO 5000
1320 IF SO=4 THEN PRINT"You managed to identify the object as an asteroid.":GOTO 1280
1322 PRINT"The object was then identified as a derelict ship.":GOTO 1250
1330 REM *** Send Shuttle to Ientify
1332 IF C<5 OR SH=0 THEN PRINT"Sorry, but you can't, ";R$;".":GOTO 1210
1335 CL=INT(3*RND(1)+2)
1337 PRINT"Aye, aye.";CL;"crewmen have gone out on a mission...":FOR W=1 TO 1500:NEXT W
1340 ON SO GOTO 1342,1342,1345,1350
1342 PRINT"As the shuttle approached, a mine exploded!"
1343 M=M-(2*CL):SH=SH-1:GOTO 300
1345 PRINT"Your crew identified the object as a derelict ship.":GOTO 1355
1350 PRINT"Your crew identified the object as an asteroid.":GOTO 1355
1355 PRINT:PRINT"You may now: 1. Destroy the object"
1356 PRINT"             2. Move closer; or"
1357 PRINT"             3. Try to avoid it"
1358 PRINT"Your choice";:INPUT SM
1360 ON SM GOTO 1220,1240,1300:GOTO 1358
1400 PRINT R$;"! A mysterious alien disease has swept the"
1405 IF ML=1 THEN PRINT"ship, but the healing leaves you found cured it.":GOTO 300
1410 DP=INT(C/3):C=C-DP:M=M-DP
1415 PRINT"ship, and";DP;" of your crewmen were killed (";C
1416 PRINT"now remain).":GOTO 300
1600 REM *** COMPUTER FAILURE
1605 PRINT R$;" ";N$;", we suffered a computer failure!"
1607 IF CW<>1 THEN GOTO 1650
1610 IF C<5 THEN PRINT"The computer can no longer replace your crew. You":GOTO 4037
1612 PRINT"We must shut down a generator. Which one?"
1615 PRINT"          1. Speed generator"
1617 PRINT"          2. Firepower generator; or"
1619 PRINT"          3. Shielding generator"
1620 PRINT" Your choice";:INPUT CF1
1622 ON CF1 GOTO 1625,1630,1635:GOTO 1620
1625 S1=0:GOTO 1640
1630 S2=0:GOTO 1640
1635 S3=0:GOTO 1640
1640 PRINT"Aye, aye. Being shut down...":CW=0:S4=S1+S2+S3:GOTO 300
1650 CF0=INT(3*RND(1)+1)
1652 ON CF0 GOTO 1655,1660,1665
1655 CF$="speed"
1656 S1=S1-INT(3*RND(1)+1):IF S1<0 THEN S1=0
1658 CF2=S1:GOTO 1670
1660 CF$="firepower"
1661 S2=S2-INT(3*RND(1)+1):IF S2<0 THEN S2=0
1663 CF2=S2:GOTO 1670
1665 CF$="shielding"
1666 S3=S3-INT(3*RND(1)+1):IF S3<0 THEN S3=0
1668 CF2=S3:GOTO 1670
1670 PRINT"Power to the ";CF$;" generator was automatically"
1672 PRINT"diminished (";CF$;" is now";CF2;")."
1675 FOR W=1 TO 2500:NEXT W
1676 S4=S1+S2+S3
1677 IF S4=<0 THEN GOTO 5000
1679 GOTO 300
1800 PRINT"Our sensors report that we are entering an intense"
1805 PRINT"radiation field! The field has affected the ship"
1810 PRINT"and crew in the following ways:"
1815 IF INT(2*RND(1)+1)=2 THEN S1=S1-1:GOTO 1825
1820 S1=S1+1:GOTO 1825
1825 IF INT(2*RND(1)+1)=2 THEN S2=S2-2:GOTO 1835
1830 S2=S2+2:GOTO 1835
1835 IF INT(2*RND(1)+1)=2 THEN S3=S3-3:GOTO 1845
1840 S3=S3+3:GOTO 1845
1845 IF S1<0 THEN S1=0
1846 IF S2<0 THEN S2=0
1847 IF S3<0 THEN S3=0
1848 S4=S1+S2+S3
1850 RF=INT(SQR(C)):C=C-RF:M=M-RF
1855 FOR W=1 TO 1000:NEXT W
1860 PRINT
1865 PRINT"Speed is now........";S1
1870 PRINT"Firepower is now....";S2
1875 PRINT"Shielding is now....";S3
1880 PRINT"Energy Level is now.";S4
1885 PRINT"Crewmen killed......";RF
1890 PRINT"Crewmen remaining...";C
1895 GOTO 300
3950 IF TN<>0 THEN GOTO 3960
3952 PRINT"Our speed generators are not functioning, but we"
3954 PRINT"have hooked up a temporary (5-day) navigating"
3956 PRINT"system. We only have enough fuel to use this"
3958 PRINT"manual system for five days; after that, the"
3959 PRINT S$;" will drift aimlessly.":TN=1:GOTO 330
3960 IF TN=5 THEN PRINT"We can no longer use the manual navigation system.":GOTO 4000
3962 TN=TN+1
3964 GOTO 330
4000 PRINT"The ";S$;" can no longer move on course, and it":S1=0
4001 IF INT(100*RND(1))<(50*(SQR(R)/2)) THEN GOTO 4004
4002 PRINT"is drifting through space.  Luckily, though, a"
4003 PRINT"space tug found you and towed you back to Earth.": GOTO 5500
4004 PRINT"is drifting through space.  Your crew abandons"
4005 PRINT"ship in a rescue vessel, but you remain.  Even"
4006 PRINT"though you are destined to monotony for the"
4007 PRINT"remainder of your life, take heart: if your ship"
4008 PRINT"becomes a new satellite, at least it might be"
4009 PRINT"named '";N$;"' in your memory!":GOTO 5500
4010 PRINT"Your ship now has no firepower, ";R$;".":S2=0:GOTO 335
4020 PRINT"There is no more shield energy left, ";R$;".":S3=0:GOTO 340
4025 PRINT"No shuttlecraft remain, ";R$;".":SH=0:GOTO 345
4030 PRINT R$;" ";N$;", none of your crewmen remain. You":C=0:IF CW=1 THEN GOTO 4033
4031 IF INT(100*RND(1))<(30*(SQR(R))) THEN GOTO 4037
4033 PRINT"were able to hook up a computer to do their work":IF CW=1 THEN GOTO 4035
4034 PRINT"(with an energy drain).":CW=1:S1=S1-1:S2=S2-1:S3=S3-1:S4=S4-3
4035 PRINT:PRINT"Press 'Return' to continue";:INPUT I
4036 GOTO 323
4037 PRINT"can no longer manage the ";S$;", and drift"
4038 PRINT"aimlessly through space for the remainder of your"
4039 PRINT"sorrowfull life.":GOTO 5500
4100 PRINT R$;", the USS ";S$;" is within ";D;" space"
4102 PRINT"units of the Earth outpost. Shall we spend a day"
4104 PRINT"checking equipment before docking";:INPUT Q8$
4106 IF LEFT$(Q8$,1)="Y" THEN GOTO 4125
4108 PRINT"OK, ";R$;", docking will occur in ";(D/S1)
4110 PRINT"hours.":V=0:GOTO 4150
4125 IF INT(4*RND(1)+1)=4 THEN GOTO 4130
4126 PRINT"You find nothing unusual, ";R$;".":V=15:GOTO 4150
4130 PRINT"There was a minor equipment failure, but it was"
4131 PRINT"detected in the check.":V=30
4150 PRINT"Everything is AOK for docking.  Press 'Return'"
4152 PRINT"to begin docking procedure";:INPUT I
4154 PRINT CHR$(26)
4156 PRINT"Ready for docking....10...9...8...7...6...5...4..."
4157 PRINT"3...2...1.....":PRINT:PRINT
4160 IF INT(100*RND(1))<((30*(SQR(R)/2))-V) THEN GOTO 4163
4161 GOTO 4175
4163 PRINT".....DOCKING MALFUNCTION!!! EXPLOSION IMMINENT!!!"
4165 PRINT:PRINT"Abandon ship";:INPUT Q9$
4166 IF INT(3*RND(1)+1)<3 THEN GOTO 4173
4167 IF LEFT$(Q9$,1)="Y" THEN GOTO 4170
4168 PRINT"Sorry, ";R$;" ";N$;", but both the ";S$
4169 PRINT"and the outpost were destroyed. R.I.P.": GOTO 5500
4170 PRINT"You and your crew managed to abandon ship, but"
4171 PRINT"both the ";S$;" and the outpost were destroyed"
4172 PRINT"in a huge explosion.":GOTO 5500
4173 IF LEFT$(Q9$,1)="Y" THEN PRINT"You abandoned ship, but nothing happened, coward!":GOTO 4177
4174 PRINT"You valiantly stayed with the ship, but luckily                                 nothing happened.":GOTO 4177
4175 PRINT"......DOCKING SUCCESSFUL!"
4177 PRINT"(Press 'Return' to continue)";:INPUT I
4178 PRINT CHR$(26):PRINT CHR$(7):PRINT"                   Space Bulletin"
4179 PRINT:PRINT"The USS ";S$;", under the command of ";R$
4180 PRINT N$;", has arrived at the Earth outpost after a"
4181 PRINT T;"-day mission."
4183 IF P=0 THEN GOTO 4190
4185 PRINT:PRINT R$;" ";N$;" safely delivered the secret plans,"
4187 PRINT"and he (and his crew of ";C;") is to be commended"
4188 PRINT"for this success."
4189 BF=((C+S4+SH)/T):PRINT:PRINT"Battle Factor: ";BF: GOTO 4900
4190 PRINT:PRINT"Unfortunately, the ";R$;" did not deliver the"
4192 PRINT"secret plans, and must undergo questioning by"
4194 PRINT"authorities.  In the meantime, ";R$;" ";N$
4196 PRINT"is to be relieved as Commander of the ";S$;",and":GOTO 5040
4200 PRINT"The crewmen have turned against you, ";R$;","
4202 C1=INT(20*RND(1)):IF C-C1<0 THEN GOTO 4202
4204 PRINT"and ";C1;" of them have decided to abandon ship"
4206 PRINT"(you now have ";C-C1;" crewmen left)."
4208 C=C-C1
4210 IF INT(100*RND(1))<(30*(R/2)) THEN GOTO 4215
4211 GOTO 4232
4215 PRINT"While leaving, one of your mutinous crewmen"
4217 C2=INT(5*RND(1)+1)
4218 ON C2 GOTO 4220,4222,4224,4222,4224
4220 C2$="Speed":S4=S4-S1
4221 S1=0:GOTO 4230
4222 C2$="Firepower":S4=S4-S2
4223 S2=0:GOTO 4230
4224 C2$="Shielding":S4=S4-S3
4225 S3=0:GOTO 4230
4230 PRINT"destroyed the ";S$;"'s ";C2$;" generator."
4232 PRINT:PRINT"Press 'RETURN' to continue";:INPUT I
4233 GOTO 321
4250 PRINT"*** Remember, you don't have the secret plans! ***":GOTO 360
4900 IF BF>=1.5 THEN GOTO 4910
4902 IF BF<.5 THEN GOTO 4970
4905 PRINT"You have remained at your present rank.":GOTO 5500
4910 ON R GOSUB 4915,4920,4925,4930,4935,4940,4945:GOTO 4960
4913 R$="Ensign":R=1:RETURN
4915 R$="Lieutenant":R=2:RETURN
4920 R$="Commander":R=3:RETURN
4925 R$="Captain":R=4:RETURN
4930 R$="Commodore":R=5:RETURN
4935 R$="Admiral":R=6:RETURN
4940 R$="Fleet Admiral":R=7:RETURN
4945 PRINT"You have fulfilled your duty to the Earth Fleet,"
4946 PRINT"and can now retire with fame and fortune."
4947 PRINT"Congratulations, Fleet Admiral ";N$;"!":END
4960 PRINT"Congratulations! You have been promoted to"
4962 PRINT R$;"!":GOTO 5500
4970 IF R<=1 THEN PRINT"You have been discharged from the Earth Fleet.":END
4975 ON (R-1) GOSUB 4913,4915,4920,4925,4930,4935
4980 PRINT"You have been demoted to ";R$;".":GOTO 5500
5000 PRINT CHR$(26):PRINT:PRINT"               Space Bulletin":PRINT CHR$(7)
5001 PRINT:PRINT"We have just been informed that the Star Cruiser"
5002 PRINT"'USS ";S$;"', under the command of ";R$
5003 PRINT N$;", has been destroyed ";T;" days into its"
5004 PRINT"mission.  The ";R$;" and all ";C;" remaining"
5005 PRINT"crewmen on board are presumed dead."
5007 PRINT:PRINT"The ";S$;" came within ";D;" space units"
5008 PRINT"of the Earth outpost, where it was to deliver"
5009 PRINT"secret plans."
5010 IF D<=10 OR T>=100 THEN R1$="excellent":GOTO 5020
5011 IF D<=25 OR T>=75 THEN R1$="valiant":GOTO 5020 
5012 IF D<=50 OR T>=50 THEN R1$="commendable":GOTO 5020
5013 IF D<=75 OR T>=25 THEN R1$="decent":GOTO 5020
5014 IF D<=90 OR T>=10 THEN R1$="terrible":GOTO 5020
5015 R1$="disastrous"
5020 PRINT:PRINT"This was a ";R1$;" performance by ";R$;" ";N$;"."
5030 PRINT"If, however, ";R$;" ";N$;" returns, he/she"
5040 IF R=<1 THEN PRINT"will be discharged from the Earth Fleet.":END
5050 ON (R-1) GOSUB 4913,4915,4920,4925,4930,4935
5060 PRINT"will be demoted to ";R$;".":GOTO 5500
5500 PRINT:PRINT"Would you like another mission, ";R$;:INPUT Q6$
5505 ML=0:TN=0:CW=0
5510 IF LEFT$(Q6$,1)<>"Y" THEN GOTO 5600
5511 PRINT"Same setup";:INPUT Q10$
5512 IF LEFT$(Q10$,1)<>"Y" THEN GOTO 2
5513 PRINT"Same ship as before";:INPUT Q75$
5515 IF LEFT$(Q75$,1)<>"Y" THEN GOTO 75
5516 IF (S1+S2+S3)>=10 AND S1<>0 AND S2<>0 AND S3<>0 THEN GOTO 110
5520 PRINT"Making repairs...":FOR W=1 TO 2000:NEXT W
5522 IF S1=0 THEN S1=S1+INT(3*RND(1)+1)
5524 IF S2=0 THEN S2=S2+INT(3*RND(1)+1)
5526 IF S3=0 THEN S3=S3+INT(3*RND(1)+1)
5528 S4=S1+S2+S3:IF S4>=10 THEN GOTO 110
5530 RP=INT(5*RND(1)+1)
5532 ON RP GOTO 5535,5535,5540,5545,5545
5535 S1=S1+INT(3*RND(1)+1):GOTO 5528
5540 S2=S2+INT(3*RND(1)+1):GOTO 5528
5545 S3=S3+INT(3*RND(1)+1):GOTO 5528
5600 PRINT"OK, ";R$;" ";N$;". Return to Earth Base."
5605 END
T(3*RND(1)+1):GOTO 5528
5545 S3=S3+INT(3*RND(1)+1):GOTO 5528
5600 PRINT"OK, ";R$;" ";N$;". Return to Earth Base."
5