home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Glitch Apple Disk Collection
/
2014.glitch.apple.collection.zip
/
indexed
/
IMPERIU1.DSK
/
GSTART.bas
next >
Wrap
BASIC Source File
|
2014-09-09
|
7KB
|
178 lines
1 DA = 22272: GOTO 1000
2 POKE -16368,0: CALL 2822: HTAB 1: VTAB 21: RETURN
10 & DEL "GSTART": & SAVE "GSTART
11 STOP
100 REM LOAD/SAVE FILES SV=1 MEANS SAVE
102 ONERR GOTO 102
103 GOSUB 2: PRINT "WHAT IS THE NAME OF THE FILE (TYPE CAT FOR CATALOG)": INPUT I$
104 IF I$ = "CAT" THEN 210
105 IF LEN(I$) >8 OR I$ = "" THEN 102
128 & RECALL I$
200 RETURN
210 HOME : & C AT
220 GOTO 102
310 HTAB 1: VTAB 5: PRINT "1) ";: IF GM = 1 THEN INVERSE
315 PRINT "NEW GAME";: NORMAL : HTAB 19: IF GM = 2 THEN INVERSE
316 PRINT "SAVED GAME": NORMAL : RETURN
320 HTAB 1: VTAB 6 +I: PRINT I +1;") PLAYER ";I;: HTAB 19: IF P(I) = 1 THEN INVERSE
325 PRINT "HUMAN";: NORMAL : PRINT " ";: IF P(I) = 2 THEN INVERSE
326 PRINT "COMPUTER";: NORMAL : PRINT " ";: IF P(I) = 3 THEN INVERSE
327 PRINT "NONE": NORMAL : RETURN
330 HTAB 1: VTAB 13: PRINT "6) SOLITAIRE LEVEL";: HTAB 28: FOR Z4 = 1 TO 4: IF LV = Z4 THEN INVERSE
335 PRINT Z4;: NORMAL : IF Z4 <4 THEN PRINT " ";
336 NEXT Z4: RETURN
340 HTAB 1: VTAB 16: PRINT "7) NON-PLAYER LIFE";: HTAB 28:Z9 = NP: GOTO 365
360 HTAB 1: VTAB 17: PRINT "8) RANDOM SETUP";: HTAB 28:Z9 = RS
365 IF Z9 = 1 THEN INVERSE
366 PRINT "YES";: NORMAL : HTAB 36: IF Z9 = 2 THEN INVERSE
367 PRINT "NO": NORMAL : RETURN
380 GOSUB 2: PRINT "WHAT IS THE NAME OF ": PRINT "PLAYER ";H +1;: INPUT N$: IF N$ = "" OR LEN(N$) >17 THEN 380
390 N$ = N$ +" "
395 N$ = LEFT$(N$,17): FOR Z7 = 1 TO 17: POKE 22296 +H *17 +Z7, ASC( MID$ (N$,Z7,1)): NEXT Z7
397 TR = 0: IF PEEK(HC +16 +H) = 1 THEN TR = 25 *(4 -LV)
398 IF TR = 0 THEN 500
400 TF = 18584 +H *256: POKE TF,TR: POKE TF +1,TR: POKE TF +4,S: POKE TF +5,S: POKE TF +7,0
500 RETURN
1000 REM INITIALIZATION
1001 HOME : & RECALL "IMPER",2816: & RECALL "IMPER2",22784
1002 DIM P(4)
1003 ST = 17884:PT = 16384:SD = 21656:HC = 21912:DV = 21932
1004 HOME
1010 HTAB 17: PRINT "IMPERIUM"
1020 HTAB 17: PRINT "GALACTUM"
1030 GM = 1:P(1) = 1:P(2) = 2:P(3) = 2:P(4) = 2:LV = 3:NP = 1:RS = 2: GOTO 1050
1040 GM = 2:P(1) = 0:P(2) = 0:P(3) = 0:P(4) = 0:LV = 0:NP = 0:RS = 0
1050 GOSUB 310: FOR I = 1 TO 4: GOSUB 320: NEXT I: GOSUB 330: GOSUB 340: GOSUB 360
1060 HTAB 18: VTAB 14: PRINT "1= HARDEST 4=EASIEST"
1070 HTAB 4: VTAB 19: PRINT "PRESS NUMBER TO CHANGE ITEM. PRESS <SPC> TO START GAME."
1075 HTAB 4: VTAB 23: PRINT "VERSION 1.2"
1080 POKE -16368,0
1085 IF PEEK( -16384) <128 THEN 1085
1090 I = PEEK( -16384) -128: POKE -16368,0: IF I < >49 THEN 1100
1095 ON GM GOTO 1040,1030
1100 IF I = 32 THEN 1170
1102 I = I -49
1103 IF I >4 THEN 1120
1110 P(I) = P(I) +1: IF P(I) = 4 THEN P(I) = 1
1115 GOSUB 320: GOTO 1080
1120 ON I -5 GOTO 1130,1150
1125 LV = LV +1: IF LV >4 THEN LV = 1
1126 GOSUB 330: GOTO 1080
1130 NP = 3 -NP: GOSUB 340: GOTO 1080
1150 RS = 3 -RS: GOSUB 360: GOTO 1080
1170 HOME
1270 IF GM = 1 THEN 1999
1280 HOME : PRINT "INSERT YOUR SAVE GAME DISK"
1290 PRINT "PRESS ANY KEY TO CONTINUE.": GOSUB 8001
1300 GOSUB 100: GOTO 7000
1999 I$ = "IMP": GOSUB 128
2000 POKE DA,9
2001 HOME : PRINT "INITIALIZING"
2010 POKE DA +1,LV
2020 FOR I = 1 TO 4: POKE HC +11 +I,1: IF P(I) = 2 THEN POKE HC +11 +I,4 -LV
2030 POKE HC +15 +I,3 -P(I)
2070 IF P(I) < >2 THEN 2130
2080 FOR I1 = 1 TO 4: IF I1 = I OR P(I1) = 3 THEN 2120
2090 Z = INT( RND(1) *20 +118):DZ = DV +(I -1) *28 +(I1 -1) *7
2100 IF P(I1) = 1 THEN Z = Z +20 -LV *5
2110 POKE DZ,Z: FOR I2 = 1 TO 4: POKE DZ +I2,0: NEXT I2: POKE DZ +5,1
2120 NEXT I1
2130 NEXT I
2140 FOR P = 0 TO 74:PA = 20 *P +PT: POKE PA +14,50: NEXT P
2150 IF RS = 2 THEN 4000
2160 HOME : HGR : CALL 2876: HOME : TEXT
2170 POKE 22283,10: CALL 2816: GOSUB 2: PRINT "ACCEPTABLE (Y OR N)?";
2180 POKE -16368,0: GET A$: IF A$ = "" THEN 2180
2182 IF A$ = "N" THEN 2160
2184 IF A$ < >"Y" THEN 2180
2188 HOME : TEXT
2190 FOR I = 0 TO 3
2200 S = INT( RND(1) *50):I1 = 0: IF PEEK(ST +14 *S) = 1 OR PEEK(ST +14 *S) = 5 THEN 2200
2210 IF I = I1 THEN 2230
2220 ON PEEK(21920 +I1) = S GOTO 2200:I1 = I1 +1: GOTO 2210
2230 POKE 21920 +I,S
2250 NEXT I: POKE -16368,0
4000 DIM D(9,6)
4010 POKE 22372,255
4020 FOR I = 1 TO 6: FOR I1 = 1 TO 9
4030 READ D(I1,I)
4040 NEXT I1
4050 NEXT I
4060 GOTO 5000
4070 DATA 3,5,8,10,20,36,61,100,166
4075 DATA 0,0,0,0,26,64,128,179,218
4080 DATA 26,51,77,102,128,154,179,205,230
4085 DATA 90,195,212,225,230,236,241,246,251
4090 DATA 233,236,238,241,243,246,248,251,253
4095 DATA 0,0,0,0,0,0,0,26,230
4201 I = I -1
4202 I = I -1
4203 I = I -1
4204 I = I -1
4205 I = I -1
4210 I1 = 1
4220 IF Z > = D(I1,I) THEN I1 = I1 +1: IF I1 <10 THEN 4220
4230 Z = INT( RND(1) *10) +1 +(I1 -1) *10
4240 RETURN
4300 REM MAXIMUM SELF SUFFICIENT
4305 PP = PEEK(PA +1) *4: POKE PA +3,PP
4310 MU = PP *7/16:ML = PEEK(PA +4):MO = ML -5: IF MO <0 THEN MO = 0
4320 IF MU >MO THEN MU = MO
4330 IF MU *2 >PP THEN MU = PP/2
4340 POKE PA +5,MU: POKE PA +7,MU: POKE PA +19,MU: POKE PA +18,PP
4350 RETURN
4400 POKE PA +10, PEEK(PA +7)/3: POKE PA +11, PEEK(PA +10): POKE PA +12, PEEK(PA +7): RETURN
5000 GOSUB 2: POKE -16368,0: PRINT "MINIMUM STARTING INDUSTRY (0-60)";: ONERR GOTO 5000
5001 INPUT SP: IF SP <0 OR SP >60 THEN 5000
5004 Z4 = 80 -LV *5
5005 ONERR GOTO 1010
5010 P = 4
5020 FOR S = 49 TO 0 STEP -1:SA = ST +14 *S:T = PEEK(SA)
5030 H = 0:P3 = 1
5040 IF PEEK(H +21920) = S AND PEEK(HC +16 +H) >0 THEN P2 = H:T = 6:P1 = 1: GOSUB 380: GOTO 5120
5050 H = H +1: IF H <4 THEN 5040
5060 P1 = 1
5070 Z = INT( RND(1) *10):P4 = 0
5080 IF T = 1 AND Z <7 THEN 5110
5090 IF T = 5 AND Z <2 THEN 5110
5100 IF Z >T +2 OR T = 1 OR T = 5 THEN P2 = 75: GOTO 5310
5110 P2 = P:P = P +1: IF P >75 THEN P = 75: GOTO 5310
5120 Z = INT( RND(1) *256):I = 6:P4 = 1
5130 ON T GOSUB 4201,4202,4202,4204,4205,4202
5140 PA = 20 *P2 +PT
5150 POKE PA +4,Z
5160 Z = INT( RND(1) *256):I = 6
5170 ON T GOSUB 4205,4203,4202,4201,4204,4210
5180 POKE PA,Z
5190 IF T = 6 THEN 5280
5200 Z1 = Z:Z = INT( RND(1) *100)
5210 IF Z >Z1 -50 OR NP = 2 THEN 5300
5220 POKE PA +9,165
5230 POKE PA +1,( PEEK(PA) -50) * RND(1) +1
5240 GOSUB 4300: IF RND(1) >.1 THEN GOSUB 4400
5250 Z = 0:I = 1
5260 Z = Z + INT( RND(1) *256/80) *I:I = I *4: IF I <256 THEN 5260
5270 POKE PA +17,Z: GOTO 5300
5280 POKE PA +9,(H +1) *32 +H +1
5290 POKE PA +1, PEEK(PA) -50: GOSUB 4300: GOSUB 4400: IF T = 6 AND (MU <SP OR (MU <Z4 AND PEEK(HC +16 +P2) = 1)) THEN 5120
5295 Z = PEEK(SA +H +1): IF Z <128 THEN POKE SA +H +1,Z +128
5300 POKE PA +14,S
5310 Z = INT( PEEK(SA +P1)/128) *128: POKE SA +P1 +(P3 = 1 AND P4 = 0),P2 +Z
5320 T = PEEK(SA): IF P3 = 1 THEN P3 = 2:P1 = P1 +P4: GOTO 5070
5330 NEXT S
5335 ONERR GOTO 5335
5341 GOSUB 8000: POKE 22288,0: & RUN "VECTOR",44800
7000 ONERR GOTO 7000
7001 GOSUB 8000: ON PEEK(DA +98) +1 GOTO 7020,7040
7010 POKE DA +98,0: GOTO 7030
7020 POKE DA +98,1
7030 ONERR GOTO 7035
7031 POKE 22288,3: & RUN "VECTOR",44800
7035 GOSUB 8000: GOTO 7030
7040 ONERR GOTO 7045
7041 POKE 22288,0: & RUN "VECTOR",44800
7045 GOSUB 8000: GOTO 7040
8000 HOME : PRINT "INSERT YOUR GAME DISK. PRESS ANY KEY": PRINT "TO CONTINUE."
8001 POKE -16368,0
8002 IF PEEK( -16384) <128 THEN 8002
8003 POKE -16368,0: RETURN