-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathA7.BAS.txt
1985 lines (1830 loc) · 69.8 KB
/
A7.BAS.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
' Copyright (c) 1995 Jeffrey R. Olson
'
' Permission is hereby granted, free of charge, to any person obtaining a copy
' of this software and associated documentation files (the "Software"), to deal
' in the Software without restriction, including without limitation the rights
' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
' copies of the Software, and to permit persons to whom the Software is
' furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all
' copies or substantial portions of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
' SOFTWARE.
DECLARE FUNCTION LoadGame% (comm$)
DECLARE SUB RestoreNameToMaps ()
DECLARE SUB BackupMapsToName ()
DECLARE FUNCTION LoadMaps% (mode%)
DECLARE SUB RemoveGoody (k%, p%)
DECLARE SUB HungFatEnc ()
DECLARE SUB define ()
DECLARE SUB DisplayCritter (typ%)
DECLARE FUNCTION Tasty% (num%)
DECLARE FUNCTION SmartCre% (typ%)
DECLARE SUB Target (num%, range!, dx%, dy%, avoidcolr%)
DECLARE SUB DisplayGoodies (p%)
DECLARE SUB Help (ii%)
DECLARE SUB SelectGoody (num%, colr%, pak%)
DECLARE SUB Wrong ()
DECLARE SUB SetCombatStats ()
DECLARE SUB Dead (spec%)
DECLARE SUB Printjnk (a%, b%, c%)
DECLARE SUB Ljnkbig (a%, b%, c%, d%, e%, f%, a$, n%, i%)
DECLARE SUB ljnk (a%, b%, c%, i%)
DECLARE SUB Box CDECL (BYVAL lc%, BYVAL rc%, BYVAL tc%, BYVAL bc%, BYVAL nl%, BYVAL fclr%, BYVAL pag%)
DECLARE SUB cRandomize CDECL (BYVAL seed!)
DECLARE SUB DumpBuffer ()
DECLARE FUNCTION RollDice% CDECL (BYVAL dsize%, BYVAL nroll%, BYVAL nuse%)
DECLARE SUB PutCreat (i%)
DECLARE SUB EraseCreat (i%)
DECLARE SUB FindDot CDECL (x%, y%, BYVAL i%)
DECLARE FUNCTION Fatigu! ()
DECLARE SUB ccls CDECL (BYVAL pag%)
DECLARE SUB DotCorn ()
DECLARE SUB DisplayCharacter ()
DECLARE SUB DotIt (x%, y%)
DECLARE SUB UnDotIt (x%, y%)
DECLARE SUB PauseForKey ()
DECLARE SUB MessPause (fc%, bc%)
DECLARE SUB ClearMess ()
DECLARE SUB PutSym (sym%, col%, row%, fcolr%, bcolr%, pag%)
DECLARE SUB GetSym (sym%, col%, row%, fcolr%, bcolr%, pag%)
DECLARE SUB PrintMessage (fcolr%, bcolr%)
DECLARE SUB CheckFil (a$)
DECLARE FUNCTION BadMoveCreat% CDECL (BYVAL dx%, BYVAL dy%, BYVAL n%, BYVAL c%, SEG nn%)
DECLARE FUNCTION cGetSym% CDECL (BYVAL x%, BYVAL y%, BYVAL pag%)
DECLARE SUB cPutSym CDECL (BYVAL sym%, BYVAL x%, BYVAL y%, BYVAL fc%, BYVAL bc%, BYVAL pag%)
DECLARE FUNCTION CreatNam$ (typ%, num%)
DECLARE FUNCTION Creature% (typ%, stat%)
DECLARE FUNCTION jnk$ (num%, strt%, leng%)
DECLARE FUNCTION cRd% CDECL (BYVAL x%, BYVAL y%)
DECLARE FUNCTION cRoll% CDECL (BYVAL max%)
DECLARE FUNCTION Terr$ (i%)
DECLARE FUNCTION Insect% (num%)
DECLARE FUNCTION Plant% (num%)
DECLARE FUNCTION Yuck% (num%)
DECLARE FUNCTION SameRoom% (ddx%, ddy%)
DECLARE FUNCTION Der$ (kil%, num%, i%)
DECLARE FUNCTION BerEff$ (i%)
DECLARE FUNCTION Kolr$ (i%)
DECLARE FUNCTION pmutnm$ (i%)
DECLARE FUNCTION mmutnm$ (i%)
DEFINT A-Z
REM $INCLUDE: 'alpha.dc2'
REM $INCLUDE: 'alpha.dec'
END
SUB Awaken (i)
IF ((ncre(i, 11) AND 1) = 0) THEN
typ = ncre(i, 1)
SELECT CASE typ
CASE elvis, elvimp
ClearMess
ljnk 162, 45, 16, 1
reelv: numbr = cRoll(24): a = 369 + numbr
SELECT CASE typ
CASE elvis: b = 1
SELECT CASE numbr
CASE 1: c = 29
CASE 2: c = 37
CASE 3: c = 39
CASE 4: c = 40
CASE 5: c = 38
CASE 6: c = 23
CASE 7: c = 28
CASE 8: c = 25
CASE 24: c = 31
CASE ELSE: GOTO reelv
END SELECT
CASE elvimp
SELECT CASE numbr
CASE 1: b = 30: c = 39
CASE 2: b = 38: c = 30
CASE 3: b = 40: c = 26
CASE 4: b = 41: c = 26
CASE 5: b = 39: c = 30
CASE 6: b = 24: c = 36
CASE 7: b = 29: c = 37
CASE 8: b = 26: c = 40
CASE 24: b = 32: c = 32
CASE ELSE: GOTO reelv
END SELECT
END SELECT
l2 = CHR$(14) + " ... " + jnk$(a, b, c) + " ... " + CHR$(14)
MessPause 9, 0
END SELECT
END IF
ncre(i, 11) = ncre(i, 11) OR 1
END SUB
SUB BackupMapsToName
filout$ = LEFT$(RTRIM$(LTRIM$(name$)), 8): CheckFil filout$
filout$ = filout$ + ".sav"
CLOSE #2: OPEN filout$ FOR APPEND AS #2 'to create file
CLOSE #2: KILL filout$
CLOSE #2: OPEN filout$ FOR BINARY AS #2
totnum = 0: PUT #2, , totnum
FOR endnum = -1 TO 15
smode = endnum: IF smode > 1 THEN smode = 1
smode = -smode 'smode=-1 is a castle level, smode 1 is lair
filin$ = "deleteme." + LTRIM$(STR$(endnum))
CLOSE #1: OPEN filin$ FOR BINARY AS #1
IF LOF(1) = 1 THEN CLOSE #1: KILL filin$: GOTO loopbum
totnum = totnum + 1
PUT #2, , endnum
GET #1, , zzgt!
PUT #2, , zzgt!
GET #1, , zzmainx: GET #1, , zzmainy
PUT #2, , zzmainx: PUT #2, , zzmainy
GET #1, , zzlocalx: GET #1, , zzlocaly
PUT #2, , zzlocalx: PUT #2, , zzlocaly
GET #1, , zzcurrsym: GET #1, , zzcurrf
PUT #2, , zzcurrsym: PUT #2, , zzcurrf
GET #1, , zzndropped
PUT #2, , zzndropped
FOR i = 1 TO zzndropped
GET #1, , lll: a$ = SPACE$(lll): GET #1, , a$
PUT #2, , lll: PUT #2, , a$
NEXT i
FOR i = 1 TO zzndropped
FOR j = 1 TO 16: GET #1, , zz: PUT #2, , zz: NEXT j
NEXT i
FOR i = 1 TO 20: FOR j = 1 TO 3
GET #1, , zz: PUT #2, , zz
NEXT j, i
GET #1, , zznnear
PUT #2, , zznnear
FOR i = 1 TO zznnear: FOR j = 1 TO 15
GET #1, , zz: PUT #2, , zz
NEXT j, i
FOR i = 2 TO 51: FOR j = 2 TO 21
GET #1, , zz: PUT #2, , zz
NEXT j, i
FOR i = 2 TO 51: FOR j = 2 TO 21
GET #1, , zz: PUT #2, , zz
NEXT j, i
GET #1, , zzbldg: GET #1, , zzcastle: GET #1, , zzcastlelevel: GET #1, , zzmononum
PUT #2, , zzbldg: PUT #2, , zzcastle: PUT #2, , zzcastlelevel: PUT #2, , zzmononum
GET #1, , zzlwall: GET #1, , zzrwall: GET #1, , zztwall: GET #1, , zzbwall
PUT #2, , zzlwall: PUT #2, , zzrwall: PUT #2, , zztwall: PUT #2, , zzbwall
GET #1, , zzlwscr: GET #1, , zzrwscr: GET #1, , zztwscr: GET #1, , zzbwscr
PUT #2, , zzlwscr: PUT #2, , zzrwscr: PUT #2, , zztwscr: PUT #2, , zzbwscr
GET #1, , zzdots: GET #1, , zzxenter: GET #1, , zzyenter
PUT #2, , zzdots: PUT #2, , zzxenter: PUT #2, , zzyenter
GET #1, , zzxenterscr: GET #1, , zzyenterscr: GET #1, , zzenterdir
PUT #2, , zzxenterscr: PUT #2, , zzyenterscr: PUT #2, , zzenterdir
GET #1, , zzgoodycastle
PUT #2, , zzgoodycastle
SELECT CASE smode
CASE -1 'castle level
FOR i = -10 TO 10
GET #1, , zzxstairs: GET #1, , zzystairs
PUT #2, , zzxstairs: PUT #2, , zzystairs
NEXT i
END SELECT
loopbum:
NEXT endnum
PUT #2, 1, totnum
CLOSE #2: CLOSE #1: OPEN "alphaman.3" FOR BINARY AS #1 'restore
END SUB
SUB ChangeDark
IF dark THEN
r = dark: IF r = -1 THEN r = 0
IF incastle = 0 THEN
xlo = 2: xhi = 51: ylo = 2: yhi = 21: GOSUB darkout
ELSEIF incastle = -1 THEN
PutSym 250, localx, localy, 8, 0, 1: UnDotIt localx, localy
END IF
savecorn = 0
FOR dx = -r TO r: FOR dy = -r TO r: GOSUB darkon: NEXT dy, dx
DotCorn
IF invisible THEN ffc = 8 ELSE ffc = 15
PutSym 1, localx, localy, ffc, 0, 1
ELSE
IF incastle = 0 THEN
FOR x = 1 TO 52: FOR y = 1 TO 22
GetSym sym, x, y, fc, bc, 2
SELECT CASE sym
CASE 215, 216, trap, pit, gas
IF ((pmut = 4 AND berpmut = 0) OR berdet > 0) THEN PutSym sym, x, y, fc, bc, 1
CASE ELSE: PutSym sym, x, y, fc, bc, 1
END SELECT
NEXT y, x
ELSEIF incastle = -1 THEN
PutSym 32, localx, localy, 8, 0, 1
savecorn = 0: DotIt localx, localy: DotCorn
IF invisible THEN ffc = 8 ELSE ffc = 15
PutSym 1, localx, localy, ffc, 0, 1
END IF
END IF
EXIT SUB
darkout:
FOR x = xlo TO xhi: FOR y = ylo TO yhi
IF x > 1 AND x < 52 AND y > 1 AND y < 22 THEN
GetSym sym, x, y, fc, bc, 1
SELECT CASE sym
CASE 249, 250, 15, 42, 176, 177, 126, 247, 65 TO 90, 97 TO 122
PutSym 32, x, y, 7, 0, 1
END SELECT
END IF
NEXT y, x
RETURN
darkon:
IF NOT SameRoom(dx, dy) THEN RETURN
xx = localx + dx: yy = localy + dy
IF xx > 51 OR xx < 2 OR yy > 21 OR yy < 2 THEN RETURN
GetSym sym, xx, yy, fc, bc, 2
SELECT CASE sym
CASE trap, pit, gas, 215, 216
GetSym sym1, xx, yy, fc1, bc1, 1
IF sym1 <> trap AND sym1 <> pit AND sym1 <> gas AND sym1 <> 215 AND sym1 <> 216 THEN sym = sym1: fc = fc1: bc = bc1
CASE secretdoor
GetSym s, xx + 1, yy, f, b, 2
IF f = wallcolr THEN sym = hor ELSE sym = ver
CASE um, lm, ml, mrt
savecorn = savecorn + 1
savcrn(savecorn, 1) = xx: savcrn(savecorn, 2) = yy
CASE cen
GetSym newsym, xx - 1, yy, fca, bca, 2: GetSym newsym, xx, yy - 1, fcb, bca, 2
IF (fca = wallcolr AND fcb = wallcolr) THEN
savecorn = savecorn + 1
savcrn(savecorn, 1) = xx: savcrn(savecorn, 2) = yy
END IF
END SELECT
PutSym sym, xx, yy, fc, bc, 1
RETURN
END SUB
SUB CheckFil (a$)
a$ = LEFT$(LTRIM$(RTRIM$(a$)), 8)
flen = LEN(a$)
FOR i = 1 TO flen
aa = ASC(MID$(a$, i, 1))
SELECT CASE aa
CASE 48 TO 57, 65 TO 90, 97 TO 122
CASE ELSE: MID$(a$, i, 1) = "_": IF i = 1 THEN MID$(a$, 1, 1) = "A"
END SELECT
NEXT i
IF flen = 0 THEN a$ = "AM01"
END SUB
SUB ClearMess
l1 = bl: l2 = bl: l3 = bl
END SUB
SUB clpage2
FOR i = 1 TO 52: FOR j = 1 TO 22: pag2(i, j) = 32: NEXT j, i
END SUB
FUNCTION CreatNam$ (typ, i)
IF typ < 1 THEN typ = 1
IF typ = wimp AND wimpname$ <> "" THEN
d$ = wimpname$
ELSEIF typ = magg AND ncre(i, 14) THEN
d$ = "Fly"
ELSE
FIELD #3, 20 AS nm$, 30 AS dud$: GET #3, typ
c$ = RTRIM$(LTRIM$(nm$)): d$ = SPACE$(20)
k = 1: stopit = false
DO
aa = ASC(MID$(c$, k, 1))
IF aa = 242 THEN
stopit = true
ELSE
aa = aa XOR k * 6: MID$(d$, k, 1) = CHR$(aa MOD 256)
END IF
k = k + 1
LOOP UNTIL stopit OR (k = 21)
END IF
d$ = RTRIM$(LTRIM$(d$))
IF (incastle = -1) AND (castle = 4) THEN
SELECT CASE typ
CASE trump, marla, ivana, blob, gumby, pokey, bush, quayle, mph
CASE ELSE: d$ = jnk$(246, 63, 6) + d$
END SELECT
END IF
CreatNam$ = d$
END FUNCTION
FUNCTION Creature (typ, stat)
FIELD #3, 20 AS nm$, 30 AS dud$
IF typ < 1 THEN typ = 1
GET #3, typ
iii = CVI(MID$(dud$, stat * 2 - 1, 2))
IF typ = wimp AND stat = 3 THEN iii = wimpsym + 1000 * wimpcolr
Creature = iii
END FUNCTION
FUNCTION Der$ (kil, num, i)
d$ = ""
SELECT CASE ncre(num, 1)
CASE japb, mph, gumby, pokey, blob, rodan, kong, godz, bfoot
CASE cubs 'needs to be here because of CASE IS >
IF i = 1 THEN d$ = "the " ELSE IF i = 2 THEN d$ = "The " ELSE d$ = "a "
CASE IS > ncreat + creextra + 1 '+1 for webspid
CASE ELSE
SELECT CASE i
CASE 3: a$ = LTRIM$(CreatNam$(ncre(num, 1), num))
a$ = UCASE$(LEFT$(a$, 1))
IF a$ = "A" OR a$ = "E" OR a$ = "I" OR a$ = "O" OR a$ = "U" THEN
d$ = "an "
ELSE
d$ = "a "
END IF
CASE 2: d$ = "The "
CASE ELSE: d$ = "the "
END SELECT
END SELECT
d$ = d$ + CreatNam$(ncre(num, 1), num)
IF NOT kil THEN
GetSym sym, ncre(num, 4) + localx, ncre(num, 5) + localy, fc, bc, 1
invis = true
IF (sym > 64 AND sym < 91) OR (sym > 96 AND sym < 123) THEN invis = false
IF invis THEN
IF i = 2 THEN d$ = "It" ELSE d$ = "it"
END IF
END IF
Der$ = d$
END FUNCTION
SUB DisplayCritter (ttyp) 'typ <0 means num
'---- assumes already in screen 3, calling prog will return to active screen
realcrit = false: typ = ttyp
IF typ < 0 THEN realcrit = true: num = -typ: typ = ncre(num, 1)
ccls 3: COLOR 15: LOCATE 3, 5
PRINT CreatNam$(typ, 1); SPACE$(4);
IF realcrit THEN fb = ncre(num, 7) ELSE fb = Creature(typ, 3)
IF fb \ 1000 = 0 THEN bc = 1 ELSE bc = 0
COLOR fb \ 1000, bc: PRINT bl; CHR$(fb MOD 1000); bl;
COLOR 7, 0: PRINT SPACE$(4);
COLOR 14, 0: PRINT USING jnk$(217, 1, 18); Creature(typ, 5)
LOCATE 4, 5: COLOR 13: st1 = "in "
SELECT CASE typ
CASE ncreat + 1 TO ncreat + crecas
aa = 45: bb = 61: cc = 5
CASE ncreat + crecas TO ncreat + crecas + crefor
aa = 45: bb = 19: cc = 5
CASE ncreat + crecas + crefor TO ncreat + crecas + crefor + creswa
aa = 45: bb = 35: cc = 5
CASE ncreat + crecas + crefor + creswa TO ncreat + crecas + crefor + creswa + crepla
aa = 45: bb = 24: cc = 6
CASE ncreat + crecas + crefor + creswa + crepla TO ncreat + crecas + crefor + creswa + crepla + creh2o
aa = 58: bb = 24: cc = 5
CASE ELSE
st1 = "": aa = 240: bb = 1: cc = 8
END SELECT
Printjnk 27, 63, 6: PRINT st1; : Printjnk aa, bb, cc
COLOR 9: LOCATE 5, 5
IF realcrit THEN
defnse = ncre(num, 10): susc = ncre(num, 12): robo = false
mov = ABS(ncre(num, 6)): ac = ncre(num, 9): hts = ncre(num, 2)
PRINT USING jnk$(267, 28, 13); STR$(hts); : PRINT SPACE$(4);
ELSE
IF typ = robot OR typ = rdro OR typ = ddro OR typ = sdro THEN robo = true
defnse = Creature(typ, 2): susc = Creature(typ, 4)
IF typ = roach THEN defnse = roachdef
fb = Creature(typ, 1): hd = (fb \ 10) MOD 1000
mov = fb \ 10000: ac = fb MOD 10
IF (defnse AND 16384) THEN ac = ac - 10
IF (susc AND 16384) THEN ac = ac + 10
IF (defnse AND -32768) THEN mov = mov + 4
IF NOT robo THEN
IF hd > 0 THEN
PRINT USING jnk$(267, 28, 19); STR$(hd); LTRIM$(STR$(hd * 8));
ELSE
PRINT jnk$(138, 1, 16);
END IF
ELSE
PRINT USING jnk$(270, 1, 49); CHR$(63); CHR$(63); CHR$(63)
END IF
END IF
IF NOT robo THEN PRINT USING jnk$(270, 17, 33); STR$(mov); STR$(ac)
COLOR 3: row = 7: botrow = 10
FOR l = 1 TO 5
fb = Creature(typ, 4 + 2 * l): fd = Creature(typ, 5 + 2 * l)
tohit = fb MOD 100: astr = fb \ 100
rng = fd MOD 100: atyp = fd \ 100
IF realcrit THEN
SELECT CASE typ
CASE robot, rdro, sdro, ddro
astr = ncre(num, 14) MOD 10: tohit = ncre(num, 14) \ 100
rng = (ncre(num, 14) \ 10) MOD 10
CASE webspid
astr = ncre(num, 14) MOD 100: tohit = (ncre(num, 14) \ 100)
END SELECT
END IF
IF atyp <> 0 THEN
SELECT CASE atyp
CASE 1: asiz = 6: IF astr = 0 THEN astr = 1: asiz = 3
a = 194: b = 1: c = 7
CASE 2: asiz = 5: IF astr = 0 THEN astr = 1: asiz = 3
a = 194: b = 8: c = 9
CASE 3, 4, 5: asiz = 4: IF astr = 0 THEN astr = 1: asiz = 3
a = 194: b = 17: c = 6
CASE 6: asiz = 6: IF astr = 0 THEN astr = 1: asiz = 3
a = 194: b = 23: c = 4
CASE 7: asiz = 4: IF astr = 0 THEN astr = 1: asiz = 3
a = 194: b = 27: c = 5
CASE 8: asiz = 6: a = 194: b = 32: c = 12
CASE 9: asiz = 8: IF astr = 0 THEN astr = 1: asiz = 4
a = 194: b = 44: c = 10
CASE 10: asiz = 5: IF astr = 0 THEN astr = 1: asiz = 3
a = 194: b = 54: c = 4
CASE 11: asiz = 7: IF astr = 0 THEN astr = 1: asiz = 3
a = 194: b = 58: c = 4
CASE 12: asiz = 3: a = 197: b = 21: c = 12
CASE 13: asiz = astr: astr = 1: a = 195: b = 9: c = 10
CASE 14: asiz = 0: astr = 0: a = 194: b = 62: c = 5
CASE 15: asiz = 4: a = 195: b = 19: c = 6
CASE 16: asiz = astr + 1: a = 196: b = 51: c = 12
CASE 17: asiz = 0: astr = 0: a = 222: b = 58: c = 10
CASE 18: asiz = 5: a = 196: b = 63: c = 5
CASE 19: asiz = 6: IF astr = 0 THEN astr = 1: asiz = 3
a = 225: b = 60: c = 7
CASE 20: asiz = 0: a = 239: b = 41: c = 15
CASE 21: asiz = 0: a = 239: b = 56: c = 12
CASE 22: asiz = 0: a = 250: b = 1: c = 8
CASE 23: asiz = 0: a = 250: b = 9: c = 9
CASE 24: asiz = 0: a = 320: b = 60: c = 4 'help
CASE 25: asiz = 6: IF astr = 0 THEN astr = 1: asiz = 3
a = 290: b = 65: c = 4
CASE 26: asiz = -1: astr = 1: a = 290: b = 44: c = 7 'unusual
CASE 27: asiz = 0: a = 178: b = 64: c = 5 'sleep
END SELECT
st1 = jnk$(a, b, c)
LOCATE row, 5: PRINT st1; bl; : Printjnk 195, 25, 7: PRINT SPACE$(3);
IF robo THEN
PRINT "?-? damage";
ELSE
asiz = asiz * astr
IF asiz > 0 THEN
PRINT USING jnk$(411, 57, 10); LTRIM$(STR$(astr)); LTRIM$(STR$(asiz));
ELSEIF asiz = 0 THEN
Printjnk 413, 58, 8
ELSE
Printjnk 419, 60, 8
END IF
END IF
LOCATE row + 1, 5
IF robo THEN
Printjnk 141, 58, 9
ELSE
PRINT USING jnk$(217, 45, 9); rng
END IF
row = row + 3: botrow = row + 1
END IF
NEXT l
COLOR 13: LOCATE 7, 55: Printjnk 195, 32, 11
COLOR 5: row = 8
FOR l = 0 TO 15
IF ((defnse AND 2 ^ l) AND l < 14) OR ((susc AND 2 ^ (l - 3)) AND l > 13) THEN
st1 = bl: LOCATE row, 55: row = row + 1: cc = 0
SELECT CASE l
CASE 0: aa = 195: bb = 43: cc = 16
CASE 1: aa = 194: bb = 23: cc = 4
CASE 2: aa = 196: bb = 1: cc = 11
CASE 3: aa = 194: bb = 8: cc = 9
CASE 4: aa = 194: bb = 54: cc = 4
CASE 5: aa = 194: bb = 58: cc = 4
CASE 6: aa = 195: bb = 1: cc = 6
CASE 7: aa = 196: bb = 12: cc = 20
CASE 8: IF defnse AND 2048 THEN znum = 4 ELSE znum = 1
aa = 195: bb = 59: cc = 10: st1 = STR$(znum) + jnk$(196, 32, 5)
CASE 9: aa = 196: bb = 37: cc = 14
CASE 10: aa = 194: bb = 17: cc = 6
CASE 11
IF (defnse AND 256) = 0 THEN
aa = 195: bb = 59: cc = 10: st1 = " 3" + jnk$(196, 32, 5)
ELSE
row = row - 1
END IF
CASE 12: aa = 197: bb = 1: cc = 20
CASE 13: aa = 197: bb = 1: cc = 19: st1 = "10"
CASE 14: aa = 130: bb = 51: cc = 16
CASE 15: aa = 124: bb = 59: cc = 9
END SELECT
IF cc > 0 THEN Printjnk aa, bb, cc: PRINT st1;
END IF
NEXT
COLOR 12: row = row + 1: LOCATE row, 55: Printjnk 313, 23, 16
row = row + 1: COLOR 4
FOR l = 0 TO 15
IF (susc AND 2 ^ l) THEN
LOCATE row, 55: IF row < 25 THEN row = row + 1
SELECT CASE l
CASE 0: aa = 195: bb = 52: cc = 7
CASE 1: aa = 194: bb = 23: cc = 4
CASE 2: aa = 196: bb = 1: cc = 11
CASE 3: aa = 194: bb = 8: cc = 9
CASE 4: aa = 194: bb = 54: cc = 4
CASE 5: aa = 194: bb = 58: cc = 4
CASE 6: aa = 195: bb = 1: cc = 6
CASE 7: aa = 243: bb = 60: cc = 8
CASE 8: aa = 312: bb = 56: cc = 13
CASE 9: aa = 196: bb = 37: cc = 14
CASE 10: aa = 194: bb = 17: cc = 6
CASE 15: aa = 263: bb = 60: cc = 8
CASE ELSE: row = row - 1: cc = 0
END SELECT
IF cc > 0 THEN Printjnk aa, bb, cc
END IF
NEXT
IF realcrit THEN
COLOR 10: LOCATE botrow, 5: Printjnk 267, 47, 14
IF ncre(num, 6) < 0 THEN Printjnk 267, 61, 8
IF (ncre(num, 11) AND 1) THEN Printjnk 251, 9, 6 ELSE Printjnk 237, 35, 7
IF ncre(num, 11) AND 2 THEN Printjnk 146, 62, 6
IF ncre(num, 11) AND 4 THEN Printjnk 116, 14, 9
IF ncre(num, 11) AND 8 THEN Printjnk 232, 12, 5
IF ncre(num, 11) AND 16 THEN Printjnk 268, 1, 8
IF ncre(num, 11) AND 32 THEN Printjnk 268, 9, 9
END IF
END SUB
SUB DumpBuffer
WHILE INKEY$ <> "": WEND
END SUB
SUB ErasePut
FOR i = 1 TO nnear: EraseCreat i: PutCreat i: NEXT i
END SUB
SUB Examine (tric)
IF NOT tric THEN
didstuff = false: ClearMess
IF dark = -1 THEN ljnk 241, 48, 20, 1: MessPause 7, 0: ClearMess: EXIT SUB
ljnk 259, 1, 27, 1: ljnk 259, 28, 25, 2: ljnk 8, 11, 11, 3
END IF
exam:
IF NOT tric THEN PrintMessage 7, 0: PauseForKey ELSE st1 = "S"
SELECT CASE UCASE$(st1)
CASE "?": Help 5: EXIT SUB
CASE "I" 'item
ljnk 257, 49, 13, 1: i = 0: SelectGoody i, 7, false
IF i < 1 THEN DisplayCharacter: PrintMessage 7, 0: GOTO exex
IF berconfuse THEN i = cRoll(ngoody)
SELECT CASE ABS(goody(i, 1))
CASE 1: ljnk 258, 25, 20, 2
CASE 2: ljnk 258, 45, 21, 2
CASE 3: a$ = "": IF goody(i, 9) > 0 THEN a$ = "+"
IF goody(i, 9) THEN a$ = a$ + LTRIM$(STR$(goody(i, 9))) + " to hit "
IF goody(i, 10) > 0 THEN b$ = "+"
IF goody(i, 10) THEN b$ = b$ + LTRIM$(STR$(goody(i, 10))) + " damage "
l2 = jnk$(24, 25, 7) + a$ + b$ + gdy(i)
CASE 4, 5: IF goody(i, 4) = 1 THEN lnl = 9 ELSE lnl = 10
Ljnkbig 294, 1, 14, 294, 15, lnl, STR$(goody(i, 4)), 1, 2
IF goody(i, 5) > 0 THEN a$ = "+"
IF goody(i, 5) THEN l1 = "It's " + a$ + LTRIM$(STR$(goody(i, 5))) + bl + gdy(i)
CASE 6
SELECT CASE goody(i, 6)
CASE 0: bb = 41: cc = 14
CASE 1: bb = 41: cc = 9
CASE 2: bb = 55: cc = 14
END SELECT
l2 = jnk$(129, bb, cc) + gdy(i)
CASE 7, 8
IF goody(i, 10) THEN
IF goody(i, 11) = 2 AND ABS(goody(i, 1)) = 7 THEN
DisplayGoodies 1: ClearMess: MessPause 14, 0: DisplayCharacter
GOTO exex
ELSEIF goody(i, 11) = 8 AND ABS(goody(i, 1)) = 8 THEN
DisplayGoodies 2: ClearMess: MessPause 14, 0: DisplayCharacter
GOTO exex
ELSE
c$ = jnk$(10, 61, 5) + gdy(i)
SELECT CASE goody(i, 3)
CASE 0: l2 = c$ + jnk$(261, 1, 17)
CASE 1: l2 = c$ + " has" + STR$(goody(i, 3)) + jnk$(262, 20, 9)
CASE IS > 1: l2 = c$ + " has" + STR$(goody(i, 3)) + jnk$(261, 8, 10)
CASE ELSE: Ljnkbig 259, 54, 15, 261, 9, 4, c$, 0, 2
END SELECT
END IF
ELSE
az = 144
SELECT CASE cRoll(9)
CASE 1: bz = 29: cz = 6
CASE 2: bz = 35: cz = 7
CASE 3: bz = 42: cz = 17
CASE 4: bz = 59: cz = 8
CASE 5: az = 145: bz = 1: cz = 14
CASE 6: az = 145: bz = 15: cz = 12
CASE 7: az = 145: bz = 27: cz = 7
CASE 8: az = 145: bz = 34: cz = 17
CASE 9: az = 145: bz = 51: cz = 17
END SELECT
ss$ = jnk$(az, bz, cz)
Ljnkbig 144, 1, 27, 0, 0, 0, ss$, 1, 1: ljnk 260, 26, 29, 2
END IF
CASE 9
l1 = jnk$(261, 18, 17) + gdy(i)
SELECT CASE goody(i, 3)
CASE 7, 9
SELECT CASE goody(i, 4)
CASE 0: l2 = "It" + jnk$(261, 1, 17)
CASE 1: l2 = "It has" + STR$(goody(i, 4)) + jnk$(262, 20, 9)
CASE IS > 1: l2 = "It has" + STR$(goody(i, 4)) + jnk$(261, 8, 10)
END SELECT
END SELECT
CASE 10
IF goody(i, 2) <> 1 THEN aa$ = "s" ELSE aa$ = ""
IF goody(i, 3) <> 1 THEN bb$ = "s" ELSE bb$ = ""
l1 = "You have" + STR$(goody(i, 2)) + " weight unit" + aa$ + " and" + STR$(goody(i, 3)) + " energy unit" + bb$
CASE ELSE
l2 = jnk$(261, 18, 17) + gdy(i)
END SELECT
fatadd! = 1: DisplayCharacter
CASE "S" 'screen square
Target num, 60!, dx, dy, wallcolr * (1 + tric): ClearMess
c$ = jnk$(261, 35, 7): d$ = c$ + "a ": num = -num
a = 0: b = 0: c = 0: d = 0: e = 0: f = 0: g = 0: h = 0: i = 0
SELECT CASE num
CASE 0: DisplayCharacter: GOTO exex
CASE IS < 0
IF tric THEN
SCREEN , , 3: DisplayCritter num: PauseForKey
SCREEN , , vpage: GOTO exex
ELSE
GetSym sym, localx + dx, localy + dy, fc, bc, 2
IF fc <> 0 THEN
l1 = c$ + Der$(true, -num, 3)
SELECT CASE (4 * (ncre(-num, 2) + 1)) \ (ncre(-num, 3) + 1)
CASE IS >= 3: xa = 136: xb = 62: xc = 7
CASE 2: xa = 243: xb = 30: xc = 4
CASE 1: xa = 114: xb = 59: xc = 9
CASE IS < 1: xa = 246: xb = 55: xc = 8
END SELECT
Ljnkbig 257, 35, 9, xa, xb, xc, bl, 2, 2
ELSE
a = 261: b = 53: c = 15
END IF
END IF
CASE 15: d = 63: e = 41: f = 4
CASE 42: d = 238: e = 48: f = 4
CASE 247, 126: a = 260: b = 55: c = 10
CASE 176: d = 260: e = 65: f = 3
CASE 22: Ljnkbig 1, 16, 7, 1, 34, 4, d$, 0, 2
CASE 254: d = 1: e = 16: f = 18
CASE 24 'weapon
'IF tric THEN
'ELSE
d = 177: e = 27: f = 6
'END IF
CASE 8 'armor
'IF tric THEN
'ELSE
l2 = d$ + jnk$(256, 62, 7) + bl + jnk$(177, 47, 5)
'END IF
CASE 9 'shield
'IF tric THEN
'ELSE
d = 177: e = 52: f = 6
'END IF
CASE 5, 236 'berry
'IF tric THEN
'ELSE
d = -2: e = 37: f = 5
'END IF
CASE 11, 12 'ssd
'IF tric THEN
'ELSE
d = -2: e = 52: f = 6
'END IF
CASE 21, 157 'lsd
'IF tric THEN
'ELSE
d = -2: e = 52: f = 6
'END IF
CASE 135, 128: d = 352: e = 38: f = 18
CASE 240: GetSym sym, localx + dx, localy + dy, fc, bc, 1
IF fc > 7 THEN a$ = "up" ELSE a$ = "down"
l2 = d$ + jnk$(261, 42, 8) + bl + a$
CASE pit: d = -2: e = 64: f = 3
GetSym num, localx + dx, localy + dy, fc, bc, 2
PutSym num, localx + dx, localy + dy, fc, bc, 1
CASE trap: d = 153: e = 41: f = 4
GetSym num, localx + dx, localy + dy, fc, bc, 2
PutSym num, localx + dx, localy + dy, fc, bc, 1
CASE 250, 249: a = 261: b = 53: c = 15
CASE 32
IF incastle THEN
ELSE
a = 261: b = 53: c = 15
END IF
CASE 1
IF NOT (dx OR dy) THEN
a = 261: b = 50: c = 3
ELSE
d = 257: e = 62: f = 5
END IF
CASE gas: a = 157: b = 53: c = 10
CASE 215, 216: d = 161: e = 53: f = 3 'web
GetSym num, localx + dx, localy + dy, fc, bc, 2
PutSym num, localx + dx, localy + dy, fc, bc, 1
CASE monosym: d = 160: e = 58: f = 8
CASE chasm: d = 279: e = 1: f = 17
CASE 147: GetSym num, localx + dx, localy + dy, fc, bc, 1
SELECT CASE fc
CASE 1: a = 94: b = 44: c = 10 'Mets hat
CASE 15: a = 294: b = 25: c = 17 'Skipper's hat
CASE ELSE: a = 265: b = 56: c = 12 'Ivana wig
END SELECT
CASE 167: a = 266: b = 50: c = 15 'serum
CASE 18, 29: d = 289: e = 62: f = 3 'map
CASE 145: a = 296: b = 1: c = 26 'BSshoes
CASE 234: d = 294: e = 58: f = 10 'Spacesuit
CASE 225: a = 199: b = 32: c = 11 'roastbeast
CASE 35 'bamboo raft
'IF tric THEN
'ELSE
d = 409: e = 54: f = 11
'END IF
CASE ul, um, ur, ml, mrt, ll, lm, lr, hor, ver
d = 172: e = 48: f = 4
CASE 219
IF incastle = -1 THEN
a = 268: b = 18: c = 6
ELSEIF incastle = 1 THEN
d = 172: e = 48: f = 4
END IF
CASE cen
newx = localx + dx: newy = localy + dy
GetSym sy, newx + 1, newy, fc21, bc21, 2: IF sy = 1 THEN fc21 = currf
GetSym sy, newx, newy + 1, fc22, bc21, 2: IF sy = 1 THEN fc22 = currf
GetSym sy, newx, newy - 1, fc23, bc21, 2: IF sy = 1 THEN fc23 = currf
GetSym sy, newx - 1, newy, fc24, bc21, 2: IF sy = 1 THEN fc22 = currf
IF (fc21 = 9 AND (fc22 = 9 OR fc23 = 9)) OR (fc24 = 9 AND (fc22 = 9 OR fc23 = 9)) THEN
d = 172: e = 48: f = 4
ELSE
d = 231: e = 64: f = 4
END IF
CASE lockeddoor: d = 268: e = 24: f = 11
END SELECT
CASE CHR$(27): ClearMess: DisplayCharacter: GOTO exex
CASE ELSE: GOTO exam
END SELECT
IF c > 0 THEN
l2 = c$ + jnk$(a, b, c)
ELSEIF f > 0 THEN
l2 = d$ + jnk$(d, e, f)
END IF
IF g > 0 THEN l1 = l2: ljnk g, h, i, 2
MessPause 7, 0
exex:
PrintMessage 7, 0
END SUB
FUNCTION Fatigu!
fff = 0
FOR i = 1 TO ngoody
IF goody(i, 1) < 0 THEN
fff = fff + goody(i, 2) \ 2
ELSE
fff = fff + goody(i, 2)
END IF
NEXT i
FOR i = 1 TO npack: fff = fff + backpack(i, 2) \ 2: NEXT i
FOR i = 1 TO nsafe: fff = fff + safe(i, 2) \ 2: NEXT i
fff = fff - 30 * udder
fff = fff - 15 * ((2 + (berhpmut > 0)) * (pmut = 5 AND berpmut = 0))
fff = fff + 20 * (pmut = 10 AND berpmut = 0)
IF str + stradd > -12 THEN
fff = fff * 32 / (20 + str + stradd)
ELSE
fff = fff * ABS(str + stradd) / 3
END IF
Fatigu! = (fff / (100! - 100! * boots))
END FUNCTION
SUB GetSym (sym, col, row, fcolr, bcolr, pag)
IF pag = 2 THEN
attr = pag2(col, row)
ELSE
attr = cGetSym(col, row, pag)
END IF
sym = attr MOD 256
bcolr = attr \ 4096
fcolr = (attr \ 256) MOD 16
END SUB
SUB Help (i)
SELECT CASE i
CASE 1, 2 'ones printed on separate screen ++++++++++++++++
SCREEN , , 3, vpage: ccls 3: OPEN "alphaman.6" FOR BINARY AS #2
SELECT CASE i
CASE 1 'general dumbness, at start of game
d = 15: clr = 3: COLOR 11, 0: strtnum = 280: lastnum = 286
CASE 2 'use
d = 16: clr = 6: COLOR 14, 0: strtnum = 287: lastnum = 294
END SELECT
FOR num = strtnum TO lastnum
st1 = SPACE$(74): GET #2, num * 74 - 73, st1
FOR k = 1 TO 74
MID$(st1, k, 1) = CHR$(ASC(MID$(st1, k, 1)) XOR (ABS(17 * num + 31 * k) MOD 256))
NEXT k
LOCATE 7 + num - strtnum, 4: PRINT st1;
NEXT num
CLOSE #2: Box 1, 80, 5, d, 1, clr, 3: COLOR 9, 0
LOCATE 25, 10: Printjnk 35, 1, 32: SCREEN , , , 3: PauseForKey
CASE 3 TO 8 'ones printed on lines 23-25 ++++++++++++++++++++
b = 1: e = 1: h = 1
SELECT CASE i
CASE 3 'eat
a = 322: c = 45: d = 323: f = 46: g = 327: j = 34
CASE 4 'throw
a = 328: c = 50: d = 329: f = 54: g = 330: j = 47
CASE 5 'eXamine
a = 331: c = 53: d = 332: f = 54: g = 333: j = 46
CASE 6 'Unuse
a = 334: c = 52: d = 335: f = 54: g = 336: j = 50
CASE 7 'figure
a = 337: c = 54: d = 338: f = 54: g = 339: j = 54
CASE 8 'drop
a = 344: c = 53: d = 345: f = 52: g = 346: j = 51
END SELECT 'change range in CASE 3 to 8 !!!!!!!!!!!!!!!!!!!!!!
ljnk a, b, c, 1: ljnk d, e, f, 2: ljnk g, h, j, 3: PrintMessage 13, 0
END SELECT
didstuff = false
END SUB
SUB HungFatEnc
DIM hfe AS STRING * 11
a = 23
SELECT CASE hunger
CASE IS < 0: b = 32: c = 7
CASE 0 TO 1000: b = 39: c = 9
CASE 1001 TO 2000: b = 44: c = 4
CASE 2001 TO 3000: b = 48: c = 6
CASE 3001 TO 4000: a = 392: b = 50: c = 11
CASE 4001 TO 5000: b = 54: c = 8
CASE 5001 TO 6000: a = 25: b = 1: c = 8
CASE IS > 6000: st1 = jnk$(25, 12, 10): hits = -hitmax - 1: hunger = 5000: Dead 0: GOTO hfee
END SELECT
LOCATE 13, 64: COLOR 9, 0: Printjnk a, b, c: PRINT SPACE$(11 - c);
stradd = 0
zz = FIX(fatigue!): a = 26
SELECT CASE zz
CASE IS < -2: a = 18: b = 56: c = 5: stradd = 1
CASE -2 TO 20: b = 11: c = 11
CASE 20 TO 60: b = 16: c = 6
CASE 60 TO 100: b = 6: c = 5: stradd = -1
CASE 100 TO 140: a = 390: b = 30: c = 10: stradd = -2
CASE 140 TO 180: b = 22: c = 6: stradd = -3
CASE 180 TO 240: b = 28: c = 9: stradd = -4
CASE IS > 240: b = 1: c = 10: stradd = -5
END SELECT
LOCATE 3, 65: PRINT str + stradd;
LOCATE 14, 65: Printjnk a, b, c: PRINT SPACE$(11 - c);
dexadd = 0
zz = fatig! * 100
SELECT CASE zz
CASE IS < 30: b = 22: c = 3: dexadd = 1
CASE IS < 80: b = 25: c = 10
CASE IS < 160: b = 30: c = 5
CASE IS < 250: b = 35: c = 8: dexadd = -1
CASE IS < 370: b = 48: c = 5: dexadd = -2
CASE IS < 500: b = 43: c = 10: dexadd = -3
CASE ELSE: b = 53: c = 10: dexadd = -5
END SELECT
COLOR 9: LOCATE 4, 66: PRINT dex + dexadd;
LOCATE 15, 70: Printjnk 25, b, c: PRINT SPACE$(10 - c);
IF berhpmut > 0 THEN COLOR 13
LOCATE 20, 54: IF pmutturns > 0 THEN PRINT pmutturns; ELSE PRINT " * ";
PRINT pmutn$; bl;
IF pmut = 17 THEN IF tentgrab THEN PRINT " grabbed"; ELSE PRINT SPACE$(8);
IF berhmmut > 0 THEN COLOR 13 ELSE COLOR 9
LOCATE 21, 54: IF mmutturns > 0 THEN PRINT mmutturns; ELSE PRINT " * ";
PRINT mmutn$; bl;
IF mmut = 7 THEN IF forcefield THEN PRINT " on"; ELSE PRINT " off";
hfee: SetCombatStats
END SUB
SUB Initialize
DIM iber(0 TO nberry)
DEF SEG = &HB800: RANDOMIZE TIMER + seed!
x = RND(-seed!): cRandomize (seed!)
mainx = 21 + cRoll(9): mainy = 8 + cRoll(5)
localx = 21 + cRoll(9): localy = 8 + cRoll(5)
gt! = 480: ripehrs = 12
CLOSE #1: OPEN "alphaman.3" FOR BINARY AS #1
nstuff = nwep + nrwep + nsh + narm
nstuff = nstuff + nssd + ntechwep + nstrash + nlsd + nltrash
GET #1, 6 * nstuff - 1, i
FOR i = 1 TO 10: FOR j = 1 TO 3: GET #1, , symb(i, j): NEXT j, i
FOR i = 1 TO nwep + nrwep: FOR j = 1 TO 6: GET #1, , wep(i, j): NEXT j, i
FOR i = 1 TO nsh: GET #1, , sh(i, 1): GET #1, , sh(i, 2): NEXT i
FOR i = 1 TO narm: GET #1, , arm(i, 1): GET #1, , arm(i, 2): NEXT i
FOR i = 1 TO nberry
rber: renameber = false:
iber(i) = cRoll(22) * 100 + cRoll(22)
FOR j = 1 TO i - 1
IF iber(i) = iber(j) THEN renameber = true: EXIT FOR
NEXT
IF renameber THEN GOTO rber
berry$(i) = jnk$(41, (iber(i) \ 100) * 3 - 2, 3) + jnk$(42, (iber(i) MOD 100) * 3 - 2, 3)
berord(i) = i
NEXT i
berry$(0) = jnk$(157, 63, 6): berord(0) = 0: iber(0) = 0
FOR i = 0 TO nberry - 1: FOR j = i + 1 TO nberry
IF iber(berord(i)) > iber(berord(j)) THEN SWAP berord(i), berord(j)
NEXT j, i
FOR i = 1 TO nssd
GET #1, , ssdtyp(i): FOR j = 1 TO 3: GET #1, , ssd(i, j): NEXT j
GET #1, , ssd(i, 9)
NEXT i
FOR i = nssd + 1 TO nssd + ntechwep
GET #1, , ssdtyp(i): FOR j = 1 TO 9: GET #1, , ssd(i, j): NEXT j
NEXT i
FOR i = nssd + ntechwep + 1 TO nssd + ntechwep + nstrash
GET #1, , ssdtyp(i): FOR j = 1 TO 3: GET #1, , ssd(i, j): NEXT j
GET #1, , ssd(i, 9)
NEXT i
FOR i = 1 TO nlsd + nltrash
GET #1, , lsdtyp(i): FOR j = 1 TO 4: GET #1, , lsd(i, j): NEXT j
NEXT i
elvislevel = 4 * (2 * INT(RND * 2) - 1)
grinchlevel = 5 * (2 * INT(RND * 2) - 1)
CLOSE #2: OPEN "alphaman.def" FOR APPEND AS #2: CLOSE #2
OPEN "alphaman.def" FOR INPUT AS #2
WHILE NOT EOF(2)
LINE INPUT #2, st1
SELECT CASE LEFT$(st1, 6)
CASE "WIMPNA"