20 HIMEM: 35070:ADRS = 35070: CALL ADRS: POKE 232,0: POKE 233,145: DEF FN DG(H) = (H / 360 - INT (H / 360)) * 360: DEF FN D(H) = FN DG( FN DG(H + 360)): DEF FN RD(X) = INT (X + .5): DEF FN RN(X) = INT ( RND (1) * X + 1):VA$ = CHR$ (129):VN$ = CHR$ (142):VI$ = CHR$ (137):VP$ = CHR$ (144):VY$ = CHR$ (153):VV$ = CHR$ (150):VW$ = CHR$ (151):VK$ = CHR$ (139):VL$ = CHR$ (140) 30 K$(4) = "CAPTAIN":CX(1) = 1 40 DEF FN RF(X) = ((3700 - X) / 3700) ^ 2.86: SCALE= 1: ROT= 0: PRINT VA$0VY$VN$VK$:K$(1) = "DETAS":K$(2) = "MILAS":K$(3) = "KAMAS": GOSUB 50000: GOSUB 10000 9999 GOTO 9999 ### main UI loop 10000 Y = 29:Z(1) = 4:Z(2) = 6:Z(3) = 8:Z(4) = 11:Z = 4: GOSUB 41000:CO = X 10005 IF CO = 4 THEN GOSUB 16000 10010 IF EN(14) > = 40 AND AL(14) > = 40 THEN EN(14) = EN(14) - 40:AL(14) = AL(14) - 40: GOTO 10090 10020 GOSUB 38000: GOSUB 39000: GOSUB 39300:Z1$ = "LIEUTENT:": GOSUB 47000:Z1$ = "WE DO NOT HAVE ENOUGH POWER TO TRANSMIT!": GOSUB 47000: GOTO 10000 # Confirm that at least one ship is alive (K(n)) and has living crew (KC(n)). 10090 IF (KC(1) > 0 AND K(1)) OR (KC(2) > 0 AND K(2)) OR (KC(3) > 0 AND K(3)) THEN 10900 10100 GOSUB 38000: GOSUB 39000: GOSUB 39300:Z1$ = "LIEUTENT:": GOSUB 47000:Z1$ = "ALL CHANNELS ARE OPEN, BUT THERE IS NO RESPONSE TO OUR HAILING REQUEST.": GOSUB 47000: GOTO 10000 10900 ON CO GOSUB 20000,21000,22000,16000: GOTO 10000 ### null strings, return to main menu 16000 FOR Z = 1 TO 4:K$(Z) = "": NEXT Z: FOR Z = 1 TO 9:Z1$(Z) = "":Z$(Z) = "": NEXT Z:Z$ = "":Z1$ = "": PRINT VA$0VN$VK$: PRINT VY$: PRINT CHR$ (4)"BLOAD CHAIN,A520": CALL 520"MAIN MENU" 16050 GOTO 16050 ### bluff 20000 REM 20010 GOSUB 38000: GOSUB 39000: GOSUB 39300:Z1$ = K$(4) + ":": GOSUB 47000:Z1$ = "LIEUTENT, OPEN A CHANNEL TO THE VEGANS. USE CHANNEL 7.": GOSUB 47000: PRINT :Z1$ = "LIEUTENT:": GOSUB 47000:Z1$ = "CHANNEL IS OPEN.": GOSUB 47000 20080 PRINT : GOSUB 39000: GOSUB 39400: GOSUB 39500:Z1$ = K$(4) + ":": GOSUB 47000:Z1$ = "THIS IS THE CAPTAIN OF THE STARSHIP RANGER.": GOSUB 47000:Z1$ = "WE WILL SELF-DESTRUCT IN 1 MINUTE.": GOSUB 47000 20110 Z1$ = "ALL SHIPS ARE TO REMAIN CLEAR OF THIS AREA.": GOSUB 47000:Z1$ = "CAPTAIN OUT.": GOSUB 47000: FOR Z = 1 TO 1000: NEXT Z: GOSUB 39000: GOSUB 39300: PRINT :Z1$ = "LIEUTENT:": GOSUB 47000: ON CB GOSUB 20200,20400,20600,20700,20800,20900:B1 = 1 20115 RETURN 20135 GOSUB 47000: PRINT : GOSUB 39000: GOSUB 39400: GOSUB 39500:Z1$ = K$(4) + ":": GOSUB 47000:Z1$ = "THIS IS THE CAPTAIN OF THE USS RANGER. WILL YOU ACCEPT OUR UNCONDITIONAL SURRENDER?": GOSUB 47000: FOR Z = 1 TO 1000: NEXT Z: ON FF GOSUB 21200,21400:F1 = 1 20190 RETURN 20200 Z1$ = "THERE'S NO RESPONSE FROM THE VEGANS. IT SEEMS THAT THEY HAVE CALLED YOUR BLUFF.": GOSUB 47000: RETURN 20400 Z1$ = "WE ARE RECEIVING A MESSAGE FROM THE VEGANS.": GOSUB 47000: PRINT : GOSUB 39000: GOSUB 39400: GOSUB 39600:Z1$ = "VEGAN COMMANDER:": GOSUB 47000:Z1$ = "DO YOU EXPECT US TO FALL FOR THAT OLD TRICK? WE VEGANS GROW TIRED OF YOUR STUPIDINESS. PREPARE TO DIE.": GOSUB 47000: RETURN 20600 Z1$ = "A MESSAGE FROM THE VEGAN COMMANDER.": GOSUB 47000: GOSUB 39000: GOSUB 39400: GOSUB 39600: PRINT :Z1$ = "VEGAN COMMANDER:": GOSUB 47000 20630 Z1$ = "CAPTAIN, WE WERE EXPECTING YOU TO DO SOMETHING AS COWARDLY AS THIS. YOU DON'T MIND IF WE HELP YOU ALONG? IT'S THE LEAST WE CAN DO.": GOSUB 47000: RETURN 20700 Z1$ = "WE ARE RECIEVING A MESSAGE FROM THE VEGANS.": GOSUB 47000: PRINT : GOSUB 39000: GOSUB 39400: GOSUB 39600:Z1$ = "VEGAN COMMANDER:": GOSUB 47000:Z1$ = "YOU EARTHLINGS MUST TAKE US FOR FOOLS. WE WILL DESTROY YOUR SHIP. YOU DON'T HAVE TO BOTHER TO SELF-DESTRUCT.": GOSUB 47000: RETURN 20800 Z1$ = "WE ARE RECIEVING A MESSAGE FROM THE VEGANS.": GOSUB 47000: PRINT : GOSUB 39000: GOSUB 39400: GOSUB 39600:Z1$ = "VEGAN COMMANDER:": GOSUB 47000:Z1$ = "WE WILL ASSIST YOU.": GOSUB 47000: RETURN 20900 Z1$ = "CAPTAIN, THE VEGANS ARE REVERSING THEIR ENGINES. THEY'RE FALLING FOR IT.": GOSUB 47000: RETURN ### surrender 21000 GOSUB 39000: GOSUB 38000:Z1$ = K$(4) + ":": GOSUB 39300: GOSUB 47000:Z1$ = "LIEUTENT, OPEN A CHANNEL TO THE VEGAN COMMAND SHIP.": GOSUB 47000: PRINT :Z1$ = "LIEUTENT:": GOSUB 47000:Z1$ = "CHANNEL IS OPEN." 21035 GOSUB 47000: PRINT : GOSUB 39000: GOSUB 39400: GOSUB 39500:Z1$ = K$(4) + ":": GOSUB 47000 21036 Z1$ = "THIS IS THE CAPTAIN OF THE USS RANGER. WILL YOU ACCEPT OUR UNCONDITIONAL SURRENDER?": PRINT : GOSUB 47000: FOR Z = 1 TO 1000: NEXT Z: ON FF GOSUB 21200,21400 21095 RETURN 21200 GOSUB 39000: GOSUB 39300: PRINT :Z1$ = "LIEUTENT:": GOSUB 47000:Z1$ = "WE ARE RECIEVING THE VEGAN REPLY." 21230 GOSUB 47000: PRINT : GOSUB 39000: GOSUB 39400: GOSUB 39600:Z1$ = "VEGAN COMMANDER:": GOSUB 47000:Z1$ = "WE DO NOT ACCEPT YOUR SURRENDER. YOU ARE OBVIOUSLY CREATURES WITH LITTLE BACKBONE. YOU WILL BE DESTROYED.": GOSUB 47000 21235 RETURN 21400 GOSUB 39000: GOSUB 39300: PRINT :Z1$ = "LIEUTENT:": GOSUB 47000:Z1$ = "WE ARE RECIEVING THE VEGAN REPLY.": GOSUB 47000 21420 PRINT : GOSUB 39000: GOSUB 39400: GOSUB 39600:Z1$ = "VEGAN COMMANDER:": GOSUB 47000:Z1$ = "LOWER YOUR SHIELDS, AND PREPARE FOR BOARDING.": GOSUB 47000 21430 EG = - 2: GOTO 51000 ### ask for surrender 22000 GOSUB 38000: GOSUB 39000: GOSUB 39300:Z1$ = K$(4) + ":": GOSUB 47000:Z1$ = "OPEN A CHANNEL TO THE VEGAN SHIP.": GOSUB 47000: PRINT :Z1$ = "LIEUTENT:": GOSUB 47000:Z1$ = "CHANNEL'S CLEARED.": GOSUB 47000: PRINT 22040 GOSUB 39000: GOSUB 39400: GOSUB 39500 22045 Z1$ = "THIS IS THE " + K$(4) + " OF THE USS RANGER. YOU ARE BADLY DAMAGED AND THERE IS NO HOPE FOR YOUR SURVIVAL. LOWER ALL YOUR SHIELDS AND SURRENDER." 22060 GOSUB 47000:Z1$ = "YOUR CREW WILL BE WELL TREATED.": GOSUB 47000: PRINT : FOR Z = 1 TO 1000: NEXT Z: GOSUB 39000: GOSUB 39300:Z1$ = "LIEUTENT:": GOSUB 47000:Z1$ = "A MESSAGE FROM THE VEGAN COMMAND SHIP.": GOSUB 47000: GOSUB 39000: GOSUB 39400: GOSUB 39600: ON F9 GOTO 22200,22300:F2 = 1: RETURN 22200 PRINT :Z1$ = "VEGAN COMMANDER:": GOSUB 47000:Z1$ = "YOU MUST BE JOKING. YOU ARE IN NO CONDITION TO DICTATE SURRENDER!": GOSUB 47000: RETURN 22300 PRINT :Z1$ = "VEGAN COMMANDER:": GOSUB 47000:Z1$ = "WE WILL LOWER OUR SHIELDS. WE GIVE YOU OUR UNCONDITIONAL SURRENDER.": GOSUB 47000:EG = 3: GOTO 51000 36000 PRINT VY$;: VTAB (22): HTAB (26): PRINT VW$;: VTAB (3): HTAB (4): PRINT VV$;: RETURN 38000 GOSUB 36000: PRINT VI$VP$;: RETURN 39000 HCOLOR= 0:Z8 = 112:Z9 = 119: GOSUB 39200:Z8 = 128:Z9 = 135: GOSUB 39200:Z8 = 152:Z9 = 159: GOSUB 39200:Z8 = 168:Z9 = 175: GOSUB 39200: RETURN 39200 FOR Z5 = 196 TO 209: HPLOT Z5,Z8 TO Z5,Z9: NEXT Z5: RETURN 39300 HCOLOR= 1:Z8 = 112:Z9 = 119: GOSUB 39200: POKE 2048,100: POKE 2049,110: CALL 2050: POKE 2048,30: POKE 2049,80: CALL 2050: RETURN 39400 HCOLOR= 1:Z8 = 128:Z9 = 135: GOSUB 39200: POKE 2048,60: POKE 2049,110: CALL 2050: POKE 2048,60: POKE 2049,110: CALL 2050: RETURN 39500 HCOLOR= 1:Z8 = 152:Z9 = 159: GOSUB 39200: POKE 2048,100: POKE 2049,50: CALL 2050: POKE 2048,60: POKE 2049,50: CALL 2050: POKE 2048,30: POKE 2049,50: CALL 2050: RETURN 39600 HCOLOR= 1:Z8 = 168:Z9 = 175: GOSUB 39200: POKE 2048,60: POKE 2049,50: CALL 2050: POKE 2048,100: POKE 2049,50: CALL 2050: POKE 2048,60: POKE 2049,50: CALL 2050: RETURN ### select menu item 41000 REM 41006 PRINT VY$VA$1VK$VI$;:Z1$ = "J":Y3 = - 1: FOR Z2 = 1 TO Z: IF Z(Z2) > 0 AND Y3 > 0 THEN X1 = Z2: GOTO 41030 41016 IF Z(Z2) > 0 THEN Y3 = Z2 41020 NEXT Z2:X1 = Y3: GOTO 41180 41030 Z1 = 250 / Z: FOR Z2 = 1 TO Z: HTAB (Y + 1): VTAB ( ABS (Z(Z2))): PRINT "E";: NEXT Z2 41079 X = INT ( PDL (0) / Z1 + .5): IF X > Z THEN X = Z 41080 IF X < 1 THEN X = 1 41081 IF Z2 > 20 THEN HTAB (Y): VTAB ( ABS (Z(X1))): PRINT " ";: POKE 2048,X1 * 5 + 50: POKE 2049,15: CALL 2050:Z2 = 0: HTAB (Y): PRINT "L"; 41082 Z2 = Z2 + 1: IF X < 1 THEN X = 1 41085 IF PEEK ( - 16287) > 127 THEN 41180 41090 IF Z(X) < 1 THEN GOTO 41079 41100 IF X1 < > X THEN HTAB (Y): VTAB (Z(X1)): PRINT " "; 41105 X1 = X: HTAB (Y): VTAB (Z(X)): PRINT "L";: GOTO 41079 41180 IF X1 < 1 THEN 41185 41183 HTAB (Y): VTAB (Z(X1)): PRINT " F"; 41185 GOSUB 45000:X = X1: RETURN 45000 POKE 2048,30: POKE 2049,30: CALL 2050: POKE 2048,80: POKE 2049,50: CALL 2050: RETURN ### print a communication string 47000 Z = LEN (Z1$):Z$ = Z1$: IF Z < 23 THEN GOSUB 47100: GOTO 47095 47010 FOR Z1 = 22 TO 1 STEP - 1:Z2 = ASC ( MID$ (Z1$,Z1,1)): IF Z2 = 32 THEN Z$ = LEFT$ (Z1$,Z1):Z1$ = RIGHT$ (Z1$,Z - Z1): GOSUB 47100: GOTO 47080 47040 NEXT Z1:Z$ = LEFT$ (Z1$,22):Z1$ = RIGHT$ (Z1$,Z - 22): GOSUB 47100 47080 GOTO 47000 47095 RETURN 47100 Z = LEN (Z$): PRINT VA$4VK$VI$;: FOR Z1 = 1 TO Z: PRINT MID$ (Z$,Z1,1);: POKE 2048,100: POKE 2049,15: CALL 2050: NEXT Z1: PRINT : RETURN ### draw frame 50000 POKE 49234,0: POKE 2072,85: POKE 2073,42: CALL 2074:Z$ = VA$ + "1" + VK$ + VI$ + " E" + VA$ + "4":Z1$ = VI$ + " " 50001 PRINT VY$;: VTAB (1): HTAB (29): PRINT VV$;: VTAB (24): HTAB (11): PRINT VW$;: VTAB (2): HTAB (1): PRINT VA$3VK$;" COMMUNIC. ";: PRINT VA$4Z1$; 50040 PRINT Z$"BLUFF ";: PRINT Z1$;: PRINT Z$"SURRENDER";: PRINT Z1$;: PRINT Z$"ASK FOR ";: PRINT " SURRENDER";: PRINT Z1$;: PRINT Z$"RETURN "; 50120 Z$ = VA$ + "1" + VN$ + " " + VI$ + VL$: PRINT : PRINT : PRINT : PRINT Z$"INTERNAL ": PRINT Z$"SHIP TO ";: PRINT " SHIP ": PRINT Z$"TRANSIMIT": PRINT Z$"RECEIVING": PRINT VN$; 50184 PRINT VY$;: HTAB (7): VTAB (1): PRINT VI$VA$3VK$"COMMUNICATIONS";VN$;: PRINT VY$;: VTAB (23): HTAB (27): PRINT VW$;: VTAB (2) 50190 HTAB (2): PRINT VV$VP$;: PRINT VI$;: PRINT VY$;: VTAB (22): HTAB (26): PRINT VW$;: VTAB (3): HTAB (3): PRINT VV$;VP$: GOSUB 38000: RETURN 51000 PRINT VA$0VK$VN$: PRINT CHR$ (4)"BLOAD CHAIN, A520": CALL 520"BYE"