-
Notifications
You must be signed in to change notification settings - Fork 6
/
A5.BAS.txt
2039 lines (1924 loc) · 69.8 KB
/
A5.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 SUB Explode (dx%, dy%, damage%, damtype%, need%, r!, slf%, clr%, div%)
DECLARE SUB KillBadMaps (mode%)
DECLARE SUB MaybeMessPause (fc%, bc%)
DECLARE SUB DisplayCritter (typ%)
DECLARE SUB Scatter (i%)
DECLARE SUB KillItem (i%)
DECLARE SUB CrDamAlter (num%, dam%, damtype%)
DECLARE SUB mphk (ch%, atktyp%)
DECLARE SUB KillCreat (i%)
DECLARE SUB TapeRecorder (i%)
DECLARE SUB RemoveCreat (i%)
DECLARE SUB ShiftDropped (rm%)
DECLARE SUB Awaken (i%)
DECLARE SUB CheckFil (a$)
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 DetermineWep (dropped%)
DECLARE SUB AddToDrop (i%)
DECLARE SUB DotIt (xdot%, ydot%)
DECLARE SUB DotCorn ()
DECLARE SUB FindDot CDECL (x%, y%, BYVAL i%)
DECLARE SUB ffEffect (damage%, ffkill%)
DECLARE SUB DamSuit (damtyp%, dam%)
DECLARE SUB Timely ()
DECLARE SUB ChangeDark ()
DECLARE SUB SetDark (dark%, olddark%, changed%)
DECLARE SUB HungFatEnc ()
DECLARE SUB RemoveGoody (i%, p%)
DECLARE SUB DisplayGoodies (p%)
DECLARE SUB DisplayCharacter ()
DECLARE SUB Dead (spec%)
DECLARE SUB ShowHits ()
DECLARE SUB PauseForKey ()
DECLARE SUB SetCombatStats ()
DECLARE SUB ClearRight CDECL (BYVAL pag%)
DECLARE SUB FindMPos (i%, mx%, my%, mlocx%, mlocy%)
DECLARE SUB SortGoody ()
DECLARE SUB DumpBuffer ()
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 FUNCTION RollDice% CDECL (BYVAL dsize%, BYVAL nroll%, BYVAL nuse%)
DECLARE SUB Box CDECL (BYVAL lc%, BYVAL rc%, BYVAL tc%, BYVAL bc%, BYVAL nl%, BYVAL fclr%, BYVAL pag%)
DECLARE SUB Wrong ()
DECLARE SUB cRandomize CDECL (BYVAL seed!)
DECLARE SUB ccls CDECL (BYVAL pag%)
DECLARE FUNCTION CreatNam$ (typ%, num%)
DECLARE FUNCTION Creature% (typ%, stat%)
DECLARE FUNCTION jnk$ (num%, strt%, leng%)
DECLARE FUNCTION cRdSimp% CDECL (BYVAL x%, BYVAL y%)
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 ssdnm$ (i%)
DECLARE FUNCTION lsdnm$ (i%)
DECLARE FUNCTION wepnm$ (i%)
DECLARE FUNCTION shnm$ (i%)
DECLARE FUNCTION armnm$ (i%)
DECLARE FUNCTION pmutnm$ (i%)
DECLARE FUNCTION mmutnm$ (i%)
DECLARE FUNCTION Kolr$ (i%)
REM $INCLUDE: 'alpha.dc2'
REM $INCLUDE: 'alpha.dec'
symbol: DATA 1,15,"You",15,10,"Thick Forest",42,2,"Light Woods",32,7,"Plains"
DATA 176,6,"Marsh",177,6,"Swamp",247,1,"Water"
DATA 30,127,94,239,234
DATA 15,10,"Tree",42,2,"Bush",249,2,"Underbrush"
DATA 250,6,"Brush",176,6,"Bog",247,9,"Deep Water",240,5,"Lair Entrance"
DATA 24,1,"Weapon",9,11,"Shield",8,7,"Armor",22,5,"Spam",254,6,"Beef-a-Roni"
DATA 5,236,4,"Berries",11,12,14,"Small Tech Device",21,157,11,"Large Shiny Device"
DATA 43,9,"Locked Door",10,8,"Pit",19,4,"Trap",240,13,"Stairs Up",240,5,"Stairs Down"
END
DEFINT A-Z
FUNCTION BerEff$ (i)
SELECT CASE i
CASE 0: a = 297: b = 48: c = 14
CASE 1: a = 32: b = 61: c = 7
CASE 2: a = 65: b = 58: c = 7
CASE 3: a = 206: b = 54: c = 14
CASE 4: a = 156: b = 60: c = 7
CASE 5: a = 207: b = 20: c = 6
CASE 6: a = 204: b = 60: c = 4
CASE 7: a = 204: b = 60: c = 9
CASE 8: a = 207: b = 33: c = 13
CASE 9: a = 207: b = 46: c = 10
CASE 10: a = 207: b = 56: c = 9
CASE 11: a = 208: b = 1: c = 10
CASE 12: a = 208: b = 11: c = 9
CASE 13: a = 208: b = 20: c = 9
CASE 14: a = 208: b = 29: c = 9
CASE 15: a = 208: b = 38: c = 11
CASE 16: a = 208: b = 49: c = 12
CASE 17: a = 209: b = 1: c = 10
CASE 18: a = 209: b = 11: c = 16
CASE 19: a = 209: b = 27: c = 14
CASE 20: a = 209: b = 41: c = 19
CASE 21: a = 210: b = 1: c = 18
CASE 22: a = 210: b = 19: c = 15
CASE 23: a = 210: b = 34: c = 11
CASE 24: a = 210: b = 45: c = 14
CASE 25: a = 208: b = 61: c = 8
CASE 26: a = 209: b = 60: c = 8
CASE 27: a = 205: b = 60: c = 7
CASE 28: a = 237: b = 45: c = 14
CASE 29: a = 241: b = 20: c = 8
CASE 30: a = 285: b = 60: c = 5
CASE 31: a = 304: b = 1: c = 15
CASE 32: a = 304: b = 40: c = 19
CASE 33: a = 305: b = 15: c = 10
CASE 34: a = 394: b = 25: c = 18
CASE 35: a = 67: b = 62: c = 7
CASE ELSE: a = 1: b = 1: c = 1
END SELECT
BerEff$ = jnk$(a, b, c)
END FUNCTION
SUB CheckFatPlus
fatadd! = fatadd! - 1.5 - .9 * (forcefield <> 0) - 5 * (mheal > 0)
fatadd! = fatadd! + (1 - 2 * (berhpmut > 0)) * (pmut = 10 AND berpmut = 0)
fatadd! = fatadd! + 3 * (berfresh > 0)
fatigue! = fatigue! + fatadd!
IF fatigue! < 0 THEN fatigue! = 0
IF fatigue! > 260 THEN fatigue! = 241: pooped = true ELSE pooped = false
hundel = 6 + (3 - 2 * (berhpmut > 0)) * (pmut = 10 AND berpmut = 0)
hundel = hundel * (1 - tapeworm)
IF asleep AND (nnear > 0) THEN hundel = hundel \ 5
hunger = hunger + hundel / 2 + hundel * fatigue! / 1600
IF neutronsuit THEN
IF berregen THEN prob = 0 ELSE prob = -2 * (lvl + 3)
IF (pmut = 8 AND berpmut = 0) THEN prob = prob \ 3
IF rr > -5 THEN prob = (prob * 15!) / (5 + rr) ELSE prob = prob * 20
ELSE
prob = (lvl + 3) * (4 - hunger / 1800!)
IF prob > 50 THEN prob = 50
IF (pmut = 10 AND berpmut = 0) THEN prob = prob + (10 - 10 * (berhpmut > 0))
IF (mmut = 3 AND bermmut = 0) THEN prob = prob * (1.3 - .3 * (berhmmut > 0))
IF berregen THEN prob = prob + 40
IF spore > 9 THEN prob = 0 ELSE IF spore > 0 THEN prob = prob * 2 \ (spore + 2)
END IF
redoregen:
roll = cRoll(100)
IF roll < prob AND mheal = 0 AND hits < hitmax THEN
hits = hits + 1: prob = prob - roll - 10: GOTO redoregen
ELSEIF prob < 0 AND roll < -prob THEN
hits = hits - 1: IF hits < 0 THEN st1 = jnk$(362, 38, 17): Dead 0
END IF
IF (cRoll(5) = 1) AND (hits > hitmax) THEN hits = hits - 1
IF asleep AND incastle AND (nnear = 0) AND (hits < hitmax) THEN hits = hits + 2
IF mheal > 0 THEN
mult = 1 - (berhmmut > 0)
hunger = hunger + mult: mheal = mheal - 1: hits = hits + 3 * mult
IF hits > hitmax THEN hits = hitmax: mheal = 0
END IF
IF wpturns > 0 THEN
wpturns = wpturns - 1
IF wpturns = 0 THEN
str = str - 3: dex = dex - 3: con = con - 3: rr = rr - 3
intl = intl - 3: hitmax = hitmax - 6 - lvl: hits = hits - 6 - lvl
IF hits < 0 THEN hits = 0
IF rdisp = 1 THEN DisplayCharacter
END IF
END IF
IF tentgrab THEN
pmutturns = 5: l2 = bl
dam = cRoll(lvl \ 2 + 3) + otherdam + strdam
IF berhpmut > 0 THEN dam = dam * 2
CrDamAlter tentgrab, dam, 1: ncre(tentgrab, 2) = ncre(tentgrab, 2) - dam
IF ncre(tentgrab, 10) AND 4096 THEN dam1 = cRoll(4)
IF ncre(tentgrab, 10) AND 8192 THEN dam2 = cRoll(10)
dam1 = dam1 + dam2: ffEffect dam1, ffkill
IF dam1 > 0 THEN
ljnk 86, 53, 16, 2: hits = hits - dam: ShowHits
IF hits < 0 THEN st1 = jnk$(296, 61, 8) + bl + Der$(true, tentgrab, 3): Dead 0
END IF
IF ffkill THEN Ljnkbig 83, 1, 5, 207, 1, 19, jnk$(205, 39, 21), 1, 2
a = 94: b = 1: c = 22: IF ncre(tentgrab, 2) < 0 THEN b = 23: c = 21
Ljnkbig a, b, c, 0, 0, 0, bl + Der$(false, tentgrab, 1), 1, 1
IF ncre(tentgrab, 2) < 0 THEN
tg = tentgrab: KillCreat tg
ELSE
MaybeMessPause 2, 0
END IF
END IF
IF invisible THEN
invisible = invisible - 1
IF invisible <= 0 THEN invisible = 0: PutSym 1, localx, localy, 15, 0, 1
END IF
IF coffee = 1 THEN con = con - 1
IF coffee THEN coffee = coffee - 1: IF coffee < 0 THEN coffee = 0
IF brandy = 1 THEN str = str - 1
IF brandy THEN brandy = brandy - 1: IF brandy < 0 THEN brandy = 0
IF hail AND incastle = 0 AND (NOT tent) AND (cRoll(40) < lvl + 3) THEN
hits = hits - 1: IF hits < 0 THEN st1 = jnk$(25, 63, 4): Dead 0
ljnk 381, 39, 20, 3: PrintMessage 15, 0
END IF
IF radint THEN
dic = (radint - rr): IF dic < 1 THEN dic = 1
dam = RollDice(2, dic, dic)
DamSuit 1, dam
IF spacesuit OR bergreen THEN
dam = 0
ELSE
ljnk 219, 1, 21, 3: PrintMessage 20, 0
END IF
ffEffect dam, ffkill: hits = hits - dam
IF hits < 0 THEN
st1 = jnk$(11, 17, 9): Dead 0
ELSEIF ffkill THEN
l1 = l3: l3 = "": Ljnkbig 83, 1, 5, 207, 1, 19, jnk$(205, 39, 21), 1, 2
MessPause 12, 0
END IF
END IF
tox = false: toxpause = false: d = 0
IF notoxin = 1 THEN 'toxin already released?
IF gt! > serum! THEN tox = true: toxpause = 1: : d = 322: e = 46: F = 23
ELSEIF gt! > 10800 AND notoxin = 0 THEN 'time to release toxin?
notoxin = 1: toxpause = true
a = 413: b = 28: c = 30: d = 415: e = 1: F = 41
IF gt! > serum! THEN tox = true
FOR i = nnear TO 1 STEP -1
IF (ncre(i, 1) = gdog) OR (ncre(i, 1) = grinch) THEN RemoveCreat i
NEXT i
ELSEIF terrain = 71 THEN 'in Grinch square?
IF notoxin = 0 AND gt! > serum! THEN
tox = true: toxpause = true: d = 322: e = 46: F = 23
END IF
END IF
IF toxpause THEN
ClearMess
IF c > 0 THEN ljnk a, b, c, 1
ljnk d, e, F, 2: PrintMessage 26, 0
IF toxpause = -1 THEN MessPause 26, 0
END IF
IF tox THEN
add = gasmask + spacesuit + 3: IF asleep THEN asleep = false: zippy = -10
hits = hits - cRoll(add): hitmax = hitmax - 1
IF hits < 0 THEN st1 = jnk$(139, 5, 11): Dead 0
END IF
IF hittox THEN
IF (cRoll(2000) < 3 - 150 * (berregen > 0)) THEN
hittox = hittox - 1: hits = hits + 1: hitmax = hitmax + 1
END IF
END IF
IF spore > 0 THEN
siz = 30 + 10 * (pmut = 10 AND berpmut = 0) * (1 - (berhpmut > 0))
siz = siz + 20 * (pmut = 7 AND berpmut = 0) * (1 - .45 * (berhpmut > 0))
IF asleep THEN siz = siz \ 6
IF cRoll(siz) = 1 THEN spore = spore - 1
END IF
IF neutronsuit THEN
suitdam = cRoll(3)
FOR icreat = nnear TO 1 STEP -1
IF cRdSimp(ncre(icreat, 4), ncre(icreat, 5)) <= 1 THEN 'creat adjacent
dam = suitdam: CrDamAlter icreat, dam, 2
ncre(icreat, 2) = ncre(icreat, 2) - dam
IF ncre(icreat, 2) < 0 THEN
Ljnkbig 362, 38, 25, 0, 0, 0, Der$(false, icreat, 1), 1, 1: l2 = ""
KillCreat icreat
END IF
END IF
NEXT icreat
END IF
SetDark dark, olddark, changed: IF changed THEN ChangeDark
Timely
IF rdisp = 1 THEN ShowHits
END SUB
SUB Dead (spec)
REDIM nn(42, 0 TO 2) AS STRING * 20, ee&(42, 0 TO 2), dd(21, 0 TO 2) AS STRING * 29, numdead(0 TO 2), numretired(0 TO 2)
IF difficulty = easyplay THEN
deadpage = 2
ELSEIF difficulty = moderateplay THEN
deadpage = 1
ELSE
deadpage = 0
END IF
killedby$ = st1
IF UCASE$(LEFT$(killedby$, 4)) = "YOUR" THEN killedby$ = "a" + RIGHT$(killedby$, LEN(killedby$) - 4)
IF LEFT$(killedby$, 3) = "The" THEN killedby$ = "a" + RIGHT$(killedby$, LEN(killedby$) - 3)
rdisp = 1: ClearMess: DisplayCharacter
IF spec = 0 OR spec = 2 THEN
Ljnkbig 3, 19, 24, 0, 0, 0, killedby$, 1, 1: ljnk 3, 1, 18, 3
MessPause 12, 0
END IF
notingrinch = NOT ((incastle = -1) AND (castle = 6) AND (castlelevel = grinchlevel))
IF spec = 0 AND notingrinch THEN
triedmedkit = false
FOR md = 1 TO ngoody
IF ABS(goody(md, 1)) = 7 AND goody(md, 11) = 4 AND goody(md, 3) > 0 AND hits < 0 THEN
triedmedkit = true
DO
diff = hitmax - hits: IF diff < 2 THEN diff = 2
add = RollDice(diff \ 2, 2, 2)
IF add > 20 THEN add = 20 ELSE IF add < 3 THEN add = 3
hits = hits + add
goody(md, 3) = goody(md, 3) - 1
LOOP UNTIL hits >= 0 OR goody(md, 3) <= 0
goody(md, 3) = 0
END IF
NEXT md
IF (hits >= 0) AND triedmedkit THEN
ClearMess
ljnk 148, 42, 24, 1: MessPause 10, 0: ShowHits: EXIT SUB
ELSEIF triedmedkit THEN
ClearMess
ljnk 265, 1, 36, 1: MessPause 12, 0
END IF
END IF
IF spec <> 1 THEN
filout$ = LEFT$(RTRIM$(LTRIM$(name$)), 8): CheckFil filout$
filout$ = UCASE$(filout$ + ".alf")
OPEN filout$ FOR BINARY AS #2: lof2 = LOF(2): CLOSE #2
IF lof2 > 0 THEN
IF spec <> 3 THEN
LOCATE 24, 1: PRINT "Delete "; filout$; " [N]:"; : PauseForKey
ELSE
st1 = "Y"
END IF
IF UCASE$(LEFT$(st1, 1)) = "Y" THEN GOSUB killsavefiles
ELSE
GOSUB killsavefiles
END IF
END IF
KillBadMaps 0 ' always kill "deleteme" files
filout$ = jnk$(3, 43, 12)
OPEN filout$ FOR APPEND AS #2: CLOSE #2: OPEN filout$ FOR INPUT AS #2
FOR deadpages = 0 TO 2
IF EOF(2) THEN numdead(deadpages) = 0 ELSE LINE INPUT #2, a$: numdead(deadpages) = VAL(a$)
IF numdead(deadpages) < 0 THEN numdead(deadpages) = 0
FOR i = 1 TO numdead(deadpages)
INPUT #2, nn(i, deadpages), ee&(i, deadpages), dd(i, deadpages)
nn(i, deadpages) = RTRIM$(LTRIM$(nn(i, deadpages)))
dd(i, deadpages) = RTRIM$(LTRIM$(dd(i, deadpages)))
NEXT i
IF EOF(2) THEN numretired(deadpages) = 0 ELSE INPUT #2, a$: numretired(deadpages) = VAL(a$)
IF numretired(deadpages) < 0 THEN numretired(deadpages) = 0
FOR ii = 1 TO numretired(deadpages)
INPUT #2, nn(ii + 21, deadpages), ee&(ii + 21, deadpages)
nn(ii + 21, deadpages) = RTRIM$(LTRIM$(nn(ii + 21, deadpages)))
NEXT ii
NEXT deadpages
CLOSE #2
IF spec <> 1 AND spec <> 2 THEN
IF spec = 3 THEN
numretired(deadpage) = numretired(deadpage) + 1
nn(numretired(deadpage) + 21, deadpage) = RTRIM$(LTRIM$(name$))
ee&(numretired(deadpage) + 21, deadpage) = expr&
ELSE
totalcastles = 0
FOR lll = 0 TO 5
totalcastles = totalcastles - ((finishedcastles AND 2 ^ lll) = 2 ^ lll)
NEXT lll
IF totalcastles > 0 THEN
expr& = expr& + 5000 * totalcastles: ClearMess: DisplayCharacter
Ljnkbig 395, 1, 11, 395, 19, 24, STR$(5000 * totalcastles), 1, 1
Ljnkbig 396, 8, 13, 395, 48, 8 + (totalcastles = 1), STR$(totalcastles), 1, 2
MessPause 10, 0
END IF
numdead(deadpage) = numdead(deadpage) + 1
nn(numdead(deadpage), deadpage) = RTRIM$(LTRIM$(name$))
ee&(numdead(deadpage), deadpage) = expr&
dd(numdead(deadpage), deadpage) = RTRIM$(LTRIM$(killedby$))
END IF
END IF
FOR deadpages = 0 TO 2
'check for duplicate dead guys:
FOR iii = numdead(deadpages) TO 2 STEP -1
FOR j = iii - 1 TO 1 STEP -1
IF UCASE$(nn(j, deadpages)) = UCASE$(nn(iii, deadpages)) THEN
IF (ee&(j, deadpages) < ee&(iii, deadpages)) THEN rid = j ELSE rid = iii
FOR iiii = rid TO numdead(deadpages) - 1
nn(iiii, deadpages) = nn(iiii + 1, deadpages)
ee&(iiii, deadpages) = ee&(iiii + 1, deadpages)
dd(iiii, deadpages) = dd(iiii + 1, deadpages)
NEXT
numdead(deadpages) = numdead(deadpages) - 1
END IF
NEXT j, iii
'sort dead guys by experience:
FOR j = 1 TO numdead(deadpages) - 1: FOR k = j + 1 TO numdead(deadpages)
IF ee&(j, deadpages) < ee&(k, deadpages) THEN
SWAP nn(j, deadpages), nn(k, deadpages)
SWAP ee&(j, deadpages), ee&(k, deadpages)
SWAP dd(j, deadpages), dd(k, deadpages)
END IF
NEXT k, j
FOR iii = numretired(deadpages) TO 1 STEP -1
'gets rid of jth dead character if character of same name has retired
FOR j = numdead(deadpages) TO 1 STEP -1
IF UCASE$(nn(j, deadpages)) = UCASE$(nn(iii + 21, deadpages)) THEN
IF j <> numdead(deadpages) THEN
SWAP nn(j, deadpages), nn(numdead(deadpages), deadpages)
SWAP ee&(j, deadpages), ee&(numdead(deadpages), deadpages)
SWAP dd(j, deadpages), dd(numdead(deadpages), deadpages)
END IF
numdead(deadpages) = numdead(deadpages) - 1
END IF
NEXT j
'check for duplicate retirees:
FOR j = iii - 1 TO 1 STEP -1
IF UCASE$(nn(j + 21, deadpages)) = UCASE$(nn(iii + 21, deadpages)) THEN
IF (ee&(j + 21, deadpages) < ee&(iii + 21, deadpages)) THEN rid = j ELSE rid = iii
FOR iiii = rid + 21 TO numretired(deadpages) + 20
nn(iiii, deadpages) = nn(iiii + 1, deadpages)
ee&(iiii, deadpages) = ee&(iiii + 1, deadpages)
NEXT iiii
numretired(deadpages) = numretired(deadpages) - 1
END IF
NEXT j
NEXT iii
'sort retirees by experience:
FOR iii = numretired(deadpages) TO 1 STEP -1
FOR j = 1 TO iii - 1
IF ee&(j + 21, deadpages) < ee&(iii + 21, deadpages) THEN
SWAP nn(j + 21, deadpages), nn(iii + 21, deadpages)
SWAP ee&(j + 21, deadpages), ee&(iii + 21, deadpages)
END IF
NEXT j
NEXT iii
NEXT deadpages
OPEN filout$ FOR OUTPUT AS #2
SCREEN , , 3
FOR deadpages = 0 TO 2
IF numdead(deadpages) > 20 THEN numdead(deadpages) = 20
WRITE #2, numdead(deadpages)
IF numdead(deadpages) > 0 THEN
ccls 3: Box 1, 80, 1, 24, 2, 12, 3
COLOR 12, 0: LOCATE 2, 4: Printjnk 87, 14, 16
COLOR 4: LOCATE 2, 26: Printjnk 279, 46, 17: LOCATE 2, 44
SELECT CASE deadpages
CASE 0: b = 4: c = 6
CASE 1: b = 29: c = 13
CASE ELSE: b = 50: c = 4
END SELECT
Printjnk 280, b, c
FOR j = 1 TO numdead(deadpages)
WRITE #2, RTRIM$(nn(j, deadpages)), ee&(j, deadpages), RTRIM$(dd(j, deadpages))
COLOR 11: LOCATE j + 3, 4: PRINT nn(j, deadpages); TAB(25);
COLOR 9: PRINT STR$(ee&(j, deadpages)); bl;
Printjnk 6, 51, 10: PRINT CHR$(44); bl;
COLOR 3
c$ = RTRIM$(dd(j, deadpages)): Printjnk 11, 57, 10: PRINT c$;
NEXT j
COLOR 10: LOCATE 25, 10: Printjnk 35, 1, 32: DumpBuffer: PauseForKey
END IF
IF numretired(deadpages) > 20 THEN numretired(deadpages) = 20
WRITE #2, numretired(deadpages)
IF numretired(deadpages) > 0 THEN
ccls 3: Box 1, 80, 1, 24, 2, 13, 3
COLOR 13, 0: LOCATE 2, 4: Printjnk 410, 37, 12
COLOR 5: LOCATE 2, 26: Printjnk 279, 46, 17: LOCATE 2, 44
SELECT CASE deadpages
CASE 0: b = 4: c = 6
CASE 1: b = 29: c = 13
CASE ELSE: b = 50: c = 4
END SELECT
Printjnk 280, b, c
FOR j = 22 TO numretired(deadpages) + 21
WRITE #2, RTRIM$(nn(j, deadpages)), ee&(j, deadpages)
COLOR 11: LOCATE j - 18, 4: PRINT nn(j, deadpages); TAB(25);
COLOR 9: PRINT STR$(ee&(j, deadpages)); bl; : Printjnk 6, 51, 10
COLOR 3: PRINT SPACE$(3);
SELECT CASE cRoll(5)
CASE 1: a = 100: b = 22: c = 18
CASE 2: a = 100: b = 40: c = 17
CASE 3: a = 100: b = 57: c = 9
CASE 4: a = 101: b = 21: c = 13
CASE 5: a = 101: b = 34: c = 19
END SELECT
Printjnk a, b, c
NEXT j
COLOR 10: LOCATE 25, 10: Printjnk 35, 1, 32: DumpBuffer: PauseForKey
END IF
NEXT deadpages
CLOSE #2
bitit = true: IF spec THEN bitit = 1
EXIT SUB
killsavefiles:
KILL filout$: KillBadMaps -1 'kill saved files
RETURN
END SUB
SUB DetermineArmor (dropped)
IF dropped THEN GOTO darm
typ = narm - cRoll(cRoll(narm - 1))
goody(ngoody, 1) = 4
goody(ngoody, 2) = arm(typ, 1)
goody(ngoody, 3) = typ
goody(ngoody, 5) = (cRoll(20) = 1) + (cRoll(20) = 1) - (cRoll(14) = 1) - (cRoll(14) = 1)
goody(ngoody, 4) = (cRoll(arm(typ, 2)) * 2 + arm(typ, 2)) / 3 + goody(ngoody, 5)
IF goody(ngoody, 4) = 0 THEN goody(ngoody, 4) = 1
gdy(ngoody) = armnm$(typ)
darm: ClearMess
Ljnkbig 1, 1, 13, 2, 62, 5, RTRIM$(gdy(ngoody)), 2, 2
PrintMessage 7, 0
IF rdisp <> 1 THEN DisplayGoodies false
END SUB
SUB DetermineBerry (dropped)
IF dropped THEN GOTO dber
typ = cRoll(nberry)
goody(ngoody, 1) = 6: goody(ngoody, 2) = 1
goody(ngoody, 3) = typ
d = cRoll(6): goody(ngoody, 4) = d
zz = cRoll(10000)
IF zz < 5 THEN v = 2 ELSE IF zz < 100 THEN v = 1 ELSE v = 0
goody(ngoody, 5) = v
SELECT CASE v
CASE 0: a = -2: b = 37: c = 5
CASE 1: a = 7: b = 63: c = 6
CASE ELSE: a = 6: b = 61: c = 7
END SELECT
gdy(ngoody) = Kolr$(d) + berry$(typ) + bl + jnk$(a, b, c)
goody(ngoody, 6) = cRoll(3) - 1 'age
dber: ClearMess
SELECT CASE d
CASE 2: st1 = "an "
CASE ELSE: st1 = "a "
END SELECT
Ljnkbig 1, 1, 13, 0, 0, 0, st1 + RTRIM$(gdy(ngoody)), 1, 2
PrintMessage 12, 0
IF rdisp <> 1 THEN DisplayGoodies false
END SUB
SUB DetermineLsd (dropped)
IF dropped < 0 THEN GOTO dlsd
IF dropped > 0 THEN
k = dropped
ELSE
rdlsd: k = cRoll(nlsd + nltrash)
IF incastle AND (k = 4 OR k = 8 OR k = 10 OR k = 12) THEN GOTO rdlsd
END IF
IF k = 8 THEN 'safe
bad = false
FOR i = 1 TO ngoody
IF (ABS(goody(i, 1)) = 8) AND (goody(i, 11) = 8) THEN bad = true
NEXT
FOR i = 1 TO ndropped 'remove dropped safe if there is one
IF ABS(drgoody(i, 1)) = 8 AND drgoody(i, 11) = 8 THEN
IF drgoody(i, 13) = mainx AND drgoody(i, 14) = mainy THEN
GetSym sym, drgoody(i, 15), drgoody(i, 16), fc, bc, 1
IF sym = 21 OR sym = 157 THEN sc = -1 ELSE sc = 2
PutSym 250, drgoody(i, 15), drgoody(i, 16), 8, 0, sc
END IF
ShiftDropped i: EXIT FOR
END IF
NEXT
IF bad THEN k = nlsd + cRoll(nltrash) 'make cabinet
END IF
SELECT CASE cRoll(3)
CASE 1: a = -2: b = 44: c = 7
CASE 2: a = -2: b = 51: c = 7
CASE ELSE: a = 253: b = 61: c = 7
END SELECT
a$ = jnk$(a, b, c)
SELECT CASE cRoll(3)
CASE 1: a = 155: b = 7: c = 5
CASE 2: a = 155: b = 25: c = 4 'shiny, tech, bizarre
CASE 3: a = 163: b = 31: c = 7
END SELECT
bb$ = jnk$(a, b, c)
FOR j = 1 TO 12: goody(ngoody, j) = 0: NEXT
goody(ngoody, 1) = 8
FOR j = 1 TO 3: goody(ngoody, j + 1) = lsd(k, j): NEXT j
num = lsd(k, 2)
IF num > 0 THEN goody(ngoody, 3) = RollDice(num, 2, 1) ELSE goody(ngoody, 3) = -1
goody(ngoody, 10) = lsdknown(k)
goody(ngoody, 11) = k
IF lsdknown(k) THEN
gdy(ngoody) = lsdnm$(k)
ELSE
gdy(ngoody) = jnk$(-2, 58, 6) + bb$ + a$
END IF
dlsd: ClearMess
SELECT CASE UCASE$(LEFT$(gdy(ngoody), 1))
CASE "A", "E", "I", "O", "U": aa$ = "an "
CASE ELSE: aa$ = "a "
END SELECT
Ljnkbig 1, 1, 13, 0, 0, 0, aa$ + gdy(ngoody), 1, 2
PrintMessage 11, 0
IF (goody(ngoody, 1) = 8) AND (goody(ngoody, 11) = 8) AND (nsafe > 0) THEN goody(ngoody, 1) = -8
IF rdisp <> 1 THEN DisplayGoodies false
END SUB
SUB DetermineParts (dropped)
IF dropped THEN GOTO dparts
FOR j = 1 TO 12: goody(ngoody, j) = 0: NEXT
goody(ngoody, 1) = 10
goody(ngoody, 2) = RollDice(5, 3, 3)
goody(ngoody, 3) = cRoll(4) + cRoll(3)
gdy(ngoody) = jnk$(319, 50, 17)
dparts: ClearMess
Ljnkbig 1, 1, 13, 0, 0, 0, "some " + gdy(ngoody), 1, 2
PrintMessage 13, 0
IF rdisp <> 1 THEN DisplayGoodies false
END SUB
SUB DetermineShield (dropped)
IF dropped THEN GOTO dsh
typ = nsh - cRoll(cRoll(nsh - 1))
IF typ < 5 THEN typ = nsh - cRoll(cRoll(nsh - 1))
goody(ngoody, 1) = 5
goody(ngoody, 2) = sh(typ, 1)
goody(ngoody, 3) = typ
goody(ngoody, 5) = (cRoll(20) = 1) + (cRoll(20) = 1) - (cRoll(14) = 1) - (cRoll(14) = 1)
goody(ngoody, 4) = (cRoll(sh(typ, 2)) * 2 + sh(typ, 2)) / 3 + goody(ngoody, 5)
IF goody(ngoody, 4) = 0 THEN goody(ngoody, 4) = 1
gdy(ngoody) = shnm$(typ) + jnk$(3, 55, 7)
dsh: ClearMess: Ljnkbig 1, 1, 15, 0, 0, 0, gdy(ngoody), 1, 2
PrintMessage 3, 0
IF rdisp <> 1 THEN DisplayGoodies false
END SUB
SUB DetermineSpecial (dropped, num)
ClearMess
IF num <> 1 THEN aa$ = "a " ELSE aa$ = ""
Ljnkbig 1, 1, 13, 0, 0, 0, aa$ + gdy(ngoody), 1, 2
PrintMessage 15, 0
goody(ngoody, 1) = 9: goody(ngoody, 2) = dropped: goody(ngoody, 3) = num
FOR i = 4 TO 11: goody(ngoody, i) = 0: NEXT
IF num = 7 THEN goody(ngoody, 4) = RollDice(5, 7, 4): goody(ngoody, 5) = 0
IF num = 9 THEN goody(ngoody, 4) = RollDice(3, 2, 2) 'wig condition
IF rdisp <> 1 THEN DisplayGoodies false
END SUB
SUB DetermineSsd (dropped)
IF dropped < 0 THEN GOTO dssd
IF dropped > 0 THEN
k = dropped
ELSE
k = cRoll(INT((nssd + ntechwep + nstrash) * 1.16))
IF k > nssd + ntechwep + nstrash THEN
zz = cRoll(8)
SELECT CASE zz
CASE 1 TO 3: k = 6 'powerpack
CASE 4: k = 23 'tricorder
CASE 5: k = 2 'backpack
CASE 6: k = 28 'microcomputer
CASE 7: k = nssd + ntechwep + 16 'wristwatch
CASE 8: k = 4 'medkit
END SELECT
END IF
IF k = 5 THEN bad = true
END IF
IF k = 2 THEN 'backpack
FOR i = 1 TO ngoody
IF (ABS(goody(i, 1)) = 7) AND (goody(i, 11) = 2) THEN bad = true
NEXT
FOR i = 1 TO ndropped 'remove dropped backpack if there is one
IF ABS(drgoody(i, 1)) = 7 AND drgoody(i, 11) = 2 THEN
IF drgoody(i, 13) = mainx AND drgoody(i, 14) = mainy THEN
GetSym sym, drgoody(i, 15), drgoody(i, 16), fc, bc, 1
IF sym = 11 OR sym = 12 THEN sc = -1 ELSE sc = 2
PutSym 250, drgoody(i, 15), drgoody(i, 16), 8, 0, sc
END IF
ShiftDropped i: EXIT FOR
END IF
NEXT
FOR i = 1 TO nsafe
IF safe(i, 1) = 7 AND safe(i, 11) = 2 THEN bad = true
NEXT
END IF
IF bad THEN k = nssd + ntechwep + cRoll(nstrash) 'trash
SELECT CASE cRoll(3)
CASE 1: a = -2: b = 44: c = 7
CASE 2: a = -2: b = 51: c = 7 'device, object, gadget
CASE 3: a = 253: b = 61: c = 7
END SELECT
a$ = jnk$(a, b, c)
SELECT CASE cRoll(3)
CASE 1: a = 155: b = 7: c = 5
CASE 2: a = 155: b = 25: c = 4 'shiny, tech, bizarre
CASE 3: a = 163: b = 31: c = 7
END SELECT
bb$ = jnk$(a, b, c)
FOR j = 1 TO 12: goody(ngoody, j) = 0: NEXT
goody(ngoody, 1) = 7
FOR i = 1 TO 8: goody(ngoody, i + 1) = ssd(k, i): NEXT i
num = ssd(k, 2)
IF num > 0 THEN goody(ngoody, 3) = RollDice(num, 2, 1) ELSE goody(ngoody, 3) = -1
goody(ngoody, 10) = ssdknown(k)
goody(ngoody, 11) = k
IF ssdknown(k) THEN
gdy(ngoody) = ssdnm$(k)
ELSE
gdy(ngoody) = jnk$(3, 62, 6) + bb$ + a$
END IF
SELECT CASE k
CASE 19 'ID
goody(ngoody, 5) = cRoll(cRoll(cRoll(3)))
CASE nssd + ntechwep + 13 'voodoo
typ = cRoll(ncreat + creextra + 1): goody(ngoody, 5) = typ
IF ssdknown(k) THEN gdy(ngoody) = CreatNam$(typ, 0) + bl + gdy(ngoody)
IF LEFT$(UCASE$(gdy(ngoody)), 3) = "THE" THEN
gdy(ngoody) = RIGHT$(gdy(ngoody), LEN(gdy(ngoody)) - 4)
END IF
CASE ELSE
END SELECT
dssd: ClearMess
SELECT CASE UCASE$(LEFT$(LTRIM$(gdy(ngoody)), 1))
CASE "A", "E", "I", "O", "U": a$ = "an "
CASE ELSE: a$ = "a "
END SELECT
Ljnkbig 1, 1, 13, 0, 0, 0, a$ + gdy(ngoody), 1, 2
PrintMessage 14, 0
IF (goody(ngoody, 1) = 7) AND (goody(ngoody, 11) = 2) AND (npack > 0) THEN goody(ngoody, 1) = -7
IF rdisp <> 1 THEN DisplayGoodies false
END SUB
SUB DetermineWep (dropped)
IF dropped THEN typ = 0: GOTO dwep
SELECT CASE cRoll(12)
CASE 1, 2, 3 'range
typ = cRoll(cRoll(nrwep - 2)) + nwep 'all but Ti, duralloy weps
CASE 4, 5 'range
typ = cRoll(cRoll(nrwep)) + nwep
CASE 6, 7, 8, 9
typ = cRoll(cRoll(nwep - 5)) 'all but Ti, duralloy weps
CASE ELSE
typ = cRoll(cRoll(nwep))
END SELECT
IF (typ < 1) OR (typ > nwep + nrwep) THEN typ = 1
goody(ngoody, 1) = 3
FOR jj = 1 TO 6: goody(ngoody, jj + 1) = wep(typ, jj): NEXT jj
goody(ngoody, 8) = typ
' + to hit, dam:
goody(ngoody, 9) = (cRoll(20) = 1) + (cRoll(20) = 1) - (cRoll(14) = 1) - (cRoll(14) = 1)
goody(ngoody, 10) = (cRoll(20) = 1) + (cRoll(20) = 1) - (cRoll(14) = 1) - (cRoll(14) = 1)
gdy(ngoody) = wepnm$(typ)
dwep: bb$ = ""
IF typ > nwep THEN
num = RollDice(goody(ngoody, 3), 2, 1): goody(ngoody, 3) = num
END IF
SELECT CASE UCASE$(LEFT$(gdy(ngoody), 1))
CASE "A", "E", "I", "O", "U": aa$ = "an "
CASE ELSE: aa$ = "a "
END SELECT
IF goody(ngoody, 3) > 1 THEN aa$ = LTRIM$(STR$(goody(ngoody, 3))) + bl: bb$ = CHR$(115)
ClearMess
Ljnkbig 1, 1, 13, 0, 0, 0, aa$ + gdy(ngoody) + bb$, 1, 2
PrintMessage 9, 0
IF rdisp <> 1 THEN DisplayGoodies false
END SUB
SUB DisplayCharacter
IF rdisp <> 1 THEN DisplayGoodies false: EXIT SUB
rside = true
ClearRight vpage: SCREEN , , vpage: HungFatEnc: SetCombatStats
COLOR 11, 0: LOCATE 2, 55: PRINT name$; : COLOR 1
colm = 55
row = 3: a = 4: b = 1: c = 10: GOSUB locatnpr
row = 4: b = 11: c = 11: GOSUB locatnpr
row = 5: b = 22: c = 14: GOSUB locatnpr
row = 6: b = 36: c = 22: GOSUB locatnpr
row = 7: a = 5: b = 1: c = 19: GOSUB locatnpr
row = 8: b = 20: c = 14: GOSUB locatnpr
LOCATE 10, 54: COLOR 9: PRINT hits; bl;
COLOR 1: Printjnk 5, 34, 11: COLOR 9: PRINT hitmax; : COLOR 1
row = 11: a = 5: b = 45: c = 13: GOSUB locatnpr
row = 13: a = 6: b = 1: c = 8: GOSUB locatnpr
row = 14: b = 23: c = 9: GOSUB locatnpr
row = 15: b = 9: c = 14: GOSUB locatnpr
row = 17: b = 32: c = 12: GOSUB locatnpr
row = 18: b = 44: c = 7: GOSUB locatnpr
COLOR 9
LOCATE 3, 65: PRINT str + stradd;
LOCATE 4, 66: PRINT dex + dexadd;
LOCATE 5, 69: PRINT con;
LOCATE 6, 77: PRINT rr;
LOCATE 7, 74: PRINT mr;
LOCATE 8, 69: PRINT intl;
LOCATE 11, 68: PRINT ac;
LOCATE 17, 68: PRINT expr&;
LOCATE 18, 63: PRINT lvl;
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";
EXIT SUB
locatnpr:
LOCATE row, colm: Printjnk a, b, c
RETURN
END SUB
SUB DisplayGoodies (pak)
rside = false: SortGoody: ClearRight vpage: SCREEN , , vpage
IF pak = 1 THEN
n = npack
ELSEIF pak = 2 THEN
n = nsafe
ELSE
n = ngoody
END IF
FOR i = 1 TO n
IF pak = 1 THEN
mm = ABS(backpack(i, 1)): nums = backpack(i, 3): nm$ = bakpak(i)
aaa = backpack(i, 11)
ELSEIF pak = 2 THEN
mm = ABS(safe(i, 1)): nums = safe(i, 3): nm$ = saf(i)
aaa = safe(i, 11)
ELSE
mm = ABS(goody(i, 1)): nums = goody(i, 3): nm$ = gdy(i)
aaa = goody(i, 11)
END IF
j$ = nm$
SELECT CASE mm
CASE 1, 2
IF nums = 1 THEN st1 = bl + jnk$(2, 47, 7) ELSE st1 = jnk$(2, 53, 9)
j$ = LTRIM$(STR$(nums) + st1 + RTRIM$(nm$))
IF mm = 1 THEN fc = 13 ELSE fc = 6
CASE 3
IF nums > 1 THEN
j$ = LTRIM$(STR$(nums) + bl + RTRIM$(nm$) + CHR$(115))
END IF
fc = 1
CASE 4: fc = 7
CASE 5: fc = 3
CASE 6: fc = 12: IF knownb(nums) THEN j$ = j$ + " *"
CASE 7
IF aaa = 19 AND ssdknown(19) THEN
a = 263
IF pak = 1 THEN
gg = backpack(i, 5)
ELSEIF pak = 2 THEN
gg = safe(i, 5)
ELSE
gg = goody(i, 5)
END IF
SELECT CASE gg
CASE 2: b = 1: c = 10
CASE 3: b = 11: c = 8
CASE 4: b = 19: c = 12
CASE ELSE: a = 262: b = 58: c = 8
END SELECT
j$ = jnk$(a, b, c) + bl + nm$
END IF
fc = 14
CASE 8: fc = 11
CASE 9: fc = 15
CASE ELSE: fc = 13
END SELECT
COLOR fc, 0
IF (pak = 0) AND (goody(i, 1) < 0) THEN
LOCATE i + 1, 54: PRINT CHR$(42);
END IF
LOCATE i + 1, 55: PRINT CHR$(i + 96); bl; LEFT$(RTRIM$(j$), 23);
NEXT i
END SUB
SUB EquipCharacter (super)
num = (str + dex) \ 2: IF pmut = 2 OR pmut = 3 THEN num = num - 6
IF super THEN num = 1
SELECT CASE num
CASE IS < 5: weapon = 8
CASE IS < 8: weapon = 7
CASE 8, 9, 10: weapon = 6
CASE 11, 12: weapon = 5
CASE 13, 14: weapon = 4
CASE 15, 16: weapon = 3
CASE 17, 18: weapon = 2
CASE ELSE: weapon = 1
END SELECT
gdy(1) = wepnm$(weapon): goody(1, 1) = -3
FOR i = 1 TO 6: goody(1, i + 1) = wep(weapon, i): NEXT i
goody(1, 8) = weapon
num = 16 - hits: IF super THEN num = 4
SELECT CASE num 'nwep selection
CASE IS < 0: del = 1
CASE 0, 1: del = 2
CASE 2: del = 3
CASE 3: del = 4
CASE ELSE: del = 5
END SELECT
gdy(2) = wepnm$(nwep + del): goody(2, 1) = 3
FOR i = 1 TO 6: goody(2, i + 1) = wep(nwep + del, i): NEXT i
goody(2, 8) = nwep + del
dic = (str + dex + con + mr + rr + intl) \ 3: dic = 50 - dic
IF dic < 12 THEN dic = 12
num = RollDice(dic, 3, 1): goody(2, 3) = goody(2, 3) * num / 20
num = (con + rr) \ 2
IF pmut = 7 OR pmut = 8 THEN num = num - 6 ELSE IF pmut = 5 THEN num = 15
ridarmor = false: IF super THEN num = 1
SELECT CASE num
CASE IS < 5: armor = 8
CASE IS < 8: armor = 9
CASE 8 TO 10: armor = 10
CASE 11 TO 14: armor = 11
CASE ELSE: armor = 11: ridarmor = true
END SELECT
gdy(3) = armnm$(armor)
goody(3, 1) = -4: goody(3, 2) = arm(armor, 1)
goody(3, 3) = armor: goody(3, 4) = arm(armor, 2)
gdy(4) = "Spam": goody(4, 1) = 1: goody(4, 2) = 0: goody(4, 3) = 1 - (hits < 14)
ngoody = 4
num = (intl + mr) \ 2: IF mmut = 2 OR mmut = 3 THEN num = num - 6
IF pmut = 5 THEN num = 16
IF super THEN num = 1
SELECT CASE num
CASE IS < 5: shield = 4
CASE IS < 7: shield = 5
CASE IS < 9: shield = 6
CASE 10 TO 11: shield = 7
CASE 12 TO 15: shield = 8
CASE ELSE: shield = 9
END SELECT
IF shield < 9 THEN
gdy(5) = shnm$(shield) + jnk$(3, 55, 7): goody(5, 1) = -5
goody(5, 2) = sh(shield, 1): goody(5, 3) = shield: goody(5, 4) = sh(shield, 2)
ngoody = 5
END IF
SELECT CASE mmut
CASE 2, 3: GOSUB givber