Fall of the Human Race II (Revision 1) Written by mjhayes@cs.buffalo.edu September 2, 1998 This program does not use graphics, so you can use any cartridge. I didn't realize this program was such an unholy mess! This revision fixes numerous misprints and bad GOTO statements, and the comments help immensely -- the program is difficult to trace without them! I haven't tested the program since the revision, so it may be updated again shortly. The Ninth Global Rainforest is not large enough to stabilize Earth's ecology. Many people have died already, and those who remain are living in miserable conditions. To make matters worse, Robert LaThan, the bounty hunter who apprehended Dr. Hyrda, the mad scientist who destroyed the other Eight Global Rainforests, also died. David LaThan, father of Robert LaThan, has used his scienctific genius and engineering skills to build a spacecraft. Taking only the spacecraft and his supply of dehydrated food, he set off for light years beyond to find a new Earth, one that will support human life. You are David LaThan. Find a new Earth and save the human race. Everybody is depending on you. When the game begins, four numbers appear with a list of choices to make. The four numbers represent, from top to bottom, distance from Earth (in light years), your ship's energy, your shield power, and rations remaining. If you run out of energy, shield, or food, you die. Use the keyboard to make your decisions. Occasionally, other ships and celestial bodies appear. Use your head, and find a planet that will support human life. 10 FM(1)=0 ; One number will be displayed on one line, in ; regular notation, with zero places to the ; right of the decimal point. 20 FM(4)=7 ; Text will be displayed in white. 30 SET A$="1-REPAIR, 2-SHIELD," 40 SET B$="LEFT, 5-TURN RIGHT," 50 SET C$="1-IGNORE IT, 2-SEND" ; Pre-define the longer text to save memory. RUN 10 DATA 1,1,0,999999,99999,999 20 READ K,Q,B,F,G,I ; Set the values of speed, damage, distance, ; energy, shield integrity, and rations. 30 CLR ; Main loop{ 40 PRIN B,F,G,I ; Print the values of distance remaining, ; energy, shield integrity, and rations. 50 J=RN(0) 60 IF(J<4)GOTO 280 ; There is a 4% chance of a ship approaching. 70 IF(J=4)GOTO 540 ; There is a 1% chance of a celestial body. 80 PRIN"MIDDLE OF NOWHERE." 90 PUT A$ 100 PRIN"3-SPEED UP, 4-TURN" 110 PUT B$ 120 PRIN"6-SLOW DOWN." 130 INPU R ; Get command. 140 IF(R=1)Q=Q/2 ; Repair recovers half the damage sustained ; at the expense of half the energy. 150 IF(R=1)F=F/2 160 IF(R=3)K=K+1 ; Speed up? 170 IF(R=6)K=K-1 ; Slow down? 180 B=B+K ; Update the distance. 190 F=F-K/2 ; Deduct energy. 200 G=G-Q ; Deduct shield integrity by damage sustained 210 I=I-1 ; Use one ration per turn. 220 IF(R=2)G=G+RN(0) ; Raise shields slightly, waste a turn. 230 IF(B>65535)GOTO 750 ; Has the player traveled far enough? 240 IF(F<0)GOTO 670 ; Is the ship's energy depleted? 250 IF(G<0)GOTO 670 ; Is the shield integrity depleted? 260 IF(I<0)GOTO 670 ; Are the rations depleted? 270 GOTO 30 ; } 280 PRIN"SHIP APPROACHING." ; Ship approaching{ 290 PUT C$ 300 PRIN"MESSAGE, 3-ATTACK" 310 PRIN"4-GET AWAY FROM IT." 320 INPU R ; Get command. 330 IF(R>3)GOTO 180 ; Retreating? 340 IF(J>1)R=R+3 ; There was a 2% chance of a friendly ship ; approaching, and a 2% chance of a ; hostile ship approaching. At this ; Point, R= 1, 2, or 3 for a hostile ship ; or 4, 5, or 6 for a friendly ship. 350 CLR 360 IF(R=3)PRIN"YOU ATTACK SHIP." 370 IF(R=3)J=J-RN(0)/10 ; Randomly determine damage to hostile ship. 380 IF(R<4)PRIN"SHIP ATTACKS." ; Hostile ships always attack. 390 IF(R<4)Q=Q+4-R ; Damage meter is incremented for an attack. 400 IF(R=4)GOTO 180 ; If a friendly ship is ignored, it leaves. 410 IF(R=5)GOTO 460 ; Sending a message to a friendly ship makes ; it give either energy or rations. 420 IF(R=6)J=0 ; Attacking a friendly ship makes it hostile. 430 IF(J<-9)PRIN"SHIP DESTROYED." 440 IF(J<-9)GOTO 180 ; Has the ship been destroyed? 450 GOTO 330 ; Display another prompt. 460 PRIN"SHIP GIVES YOU SOME" 470 IF(J=3)GOTO 510 ; There was a 1% chance that the friendly ; ship will give energy, and a 1% chance ; that the friendly ship will give ; rations. 480 PRIN"ENERGY." 490 F=F+(RN(0)*999) ; Increase energy. 500 GOTO 180 510 PRIN"RATIONS." 520 I=I+RN(0) ; Increase rations. 530 GOTO 180 ; } 540 PRIN"CELESTIAL BODY IS ONRADAR." 550 PRIN"1-IGNORE IT, 2-TOUCHDOWN." 560 INPU J ; Celestial body{ Get command 570 IF(J<2)GOTO 180 ; Ignore it? 580 PRIN"IT CAN'T SUPPORT" 590 PRIN"HUMANS, BUT YOU GOT" 600 PRIN"MORE SHIELD POWER," 610 PRIN"ENERGY, AND RATIONS." 620 FOR J=0 TO 99 630 NEXT J ; Time delay 640 F=F+(RN(0)*999) 650 G=G+(RN(0)*99) ; Increase energy and shield integrity. 660 GOTO 520 ; Increase rations and return to main loop.} 670 CLR ; Game over{ 680 PRIN "YOU, YOUR SHIP, AND" 690 PRIN "THE FEW REMAINING" 700 PRIN "HUMANS PERISHED FOR" 710 PRIN "ETERNITY. GAME OVER" 720 PRIN "HIT RTN TO RESTART." 730 INPU J ; Wait for command. 740 GOTO 10 ; New game} 750 CLR 760 PRIN "CELESTIAL BODY IS ONRADAR." 770 PRIN "1-IGNORE IT, 2-TOUCHDOWN." 780 INPU J ; Last celestial body{ Get command 790 IF(J<2)GOTO 670 ; Ignoring the last celestial body ends the ; game. 800 CLR 810 PRIN "IT'S PERFECT. YOU" 820 PRIN "RETURN TO EARTH TO" 830 PRIN "SEND HUMANS TO THIS" 840 PRIN "DIMENSION. THE END." ; Sure beats "You win, big deal." 850 GOTO 720 ; New game}