-
Notifications
You must be signed in to change notification settings - Fork 6
/
A1.BAS.txt
1817 lines (1795 loc) · 66.8 KB
/
A1.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 GetTextArray ()
DECLARE SUB UseMutat (i%)
DECLARE SUB SaveMaps (mode%)
DECLARE SUB Trapp (fc%)
DECLARE SUB EndScreen (num%)
DECLARE SUB clpage2 ()
DECLARE SUB MapLevel ()
DECLARE SUB Awaken (i%)
DECLARE SUB Help (i%)
DECLARE SUB UseMono ()
DECLARE SUB Lightning ()
DECLARE SUB DotIt (x%, y%)
DECLARE SUB DotCorn ()
DECLARE SUB SelectGoody (num%, colr%, pak%)
DECLARE SUB PrintJnk (a%, b%, c%)
DECLARE SUB ErasePut ()
DECLARE SUB Ljnkbig (a%, b%, c%, d%, e%, f%, a$, n%, i%)
DECLARE SUB Ljnk (a%, b%, c%, i%)
DECLARE SUB LeaveCastle ()
DECLARE SUB DrawLair ()
DECLARE SUB ccls CDECL (BYVAL pag%)
DECLARE SUB Compute (main%)
DECLARE SUB cRandomize CDECL (BYVAL seed!)
DECLARE SUB ffEffect (dam%, ffkill%)
DECLARE SUB Examine (tricorder%)
DECLARE SUB SetDark (dk%, odk%, ch%)
DECLARE SUB ChangeDark ()
DECLARE SUB define ()
DECLARE SUB ActiveMod ()
DECLARE SUB HungFatEnc ()
DECLARE SUB IntroScreen ()
DECLARE SUB Initialize ()
DECLARE SUB KillCreat (i%)
DECLARE SUB MakeCommandScreen ()
DECLARE SUB PrintCommandScreen ()
DECLARE SUB RemoveGoody (i%, pak%)
DECLARE SUB Target (num%, range!, dx%, dy%, avoidcolr%)
DECLARE SUB DetailedMap (loadmappossible%)
DECLARE SUB Look (scope%)
DECLARE SUB MainMap (lode%)
DECLARE SUB PolyCreat (dx%, dy%)
DECLARE SUB MphK (ch%, atktyp%)
DECLARE SUB DisplayCharacter ()
DECLARE SUB Dead (spec%)
DECLARE SUB ShowHits ()
DECLARE SUB PauseForKey ()
DECLARE SUB SetCombatStats ()
DECLARE SUB CheckFatPlus ()
DECLARE SUB EquipCharacter (dr%)
DECLARE SUB MakeSymbolScreen ()
DECLARE SUB MakeKnownScreen ()
DECLARE SUB MakeCharacter (dr%)
DECLARE SUB TapeRecorder (i%)
DECLARE FUNCTION Confuse% CDECL (BYVAL r%, BYVAL i%)
DECLARE SUB BerryEffect ()
DECLARE SUB Drop ()
DECLARE SUB Eat ()
DECLARE SUB Figure ()
DECLARE SUB Search (s%)
DECLARE SUB Remove ()
DECLARE SUB Sneak ()
DECLARE SUB DumpBuffer ()
DECLARE SUB MaybeMessPause (fc%, bc%)
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 PrintMessageNoSave (fcolr%, bcolr%)
DECLARE FUNCTION RollDice% CDECL (BYVAL dsize%, BYVAL nroll%, BYVAL nuse%)
DECLARE SUB Wrong ()
DECLARE SUB Save ()
DECLARE SUB Ride (num%, dis%)
DECLARE SUB Use ()
DECLARE SUB Move (num%)
DECLARE SUB UnYooz (numb%, i%)
DECLARE SUB UnUse ()
DECLARE SUB Explode (dx%, dy%, damage%, damtype%, need%, r!, slf%, clr%, div%)
DECLARE SUB Throw (launch%)
DECLARE SUB CreatDo ()
DECLARE SUB DrawDungeon ()
DECLARE SUB teleport (b%)
DECLARE FUNCTION creatnam$ (typ%, num%)
DECLARE FUNCTION Creature% (typ%, stat%)
DECLARE FUNCTION Fatigu! ()
DECLARE FUNCTION jnk$ (num%, strt%, leng%)
DECLARE FUNCTION LoadGame% (c$)
DECLARE FUNCTION Nc% ()
DECLARE FUNCTION Nf% ()
DECLARE FUNCTION Crd% CDECL (BYVAL x%, BYVAL y%)
DECLARE FUNCTION cRoll% CDECL (BYVAL max%)
DECLARE FUNCTION Terr$ (i%)
DECLARE FUNCTION Tasty% (n%)
DECLARE FUNCTION Insect% (n%)
DECLARE FUNCTION Plant% (n%)
DECLARE FUNCTION Yuck% (n%)
DECLARE FUNCTION SameRoom% (x%, y%)
DECLARE FUNCTION Der$ (kil%, n%, 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 kolr$ (i%)
DEFINT A-Z
REM $INCLUDE: 'alpha.dc2'
REM $INCLUDE: 'alpha.dec'
Comm$ = COMMAND$
verytop:
ccls 0: ccls 1: ccls 3: clpage2: LOCATE , , 0: SCREEN , , 0
st1 = "alphaman.": CLOSE
OPEN st1 + "1" FOR BINARY AS #1
IF LOF(1) > 0 THEN ok1 = true ELSE ok1 = false
CLOSE #1
OPEN st1 + "2" FOR BINARY AS #1
IF LOF(1) > 0 THEN ok2 = true ELSE ok2 = false
CLOSE #1
OPEN st1 + "3" FOR BINARY AS #1
IF LOF(1) > 0 THEN ok3 = true ELSE ok3 = false
CLOSE #1
OPEN st1 + "4" FOR BINARY AS #1
IF LOF(1) > 0 THEN ok4 = true ELSE ok4 = false
CLOSE #1
IF NOT (ok1 AND ok2 AND ok3 AND ok4) THEN
CLS : a$ = "Can't find " + st1
IF NOT ok1 THEN PRINT a$; "1 ": KILL st1 + "1"
IF NOT ok2 THEN PRINT a$; "2 ": KILL st1 + "2"
IF NOT ok3 THEN PRINT a$; "3 ": KILL st1 + "3"
IF NOT ok4 THEN PRINT a$; "4": KILL st1 + "4"
END
END IF
CLOSE
OPEN st1 + "3" FOR BINARY AS #1: OPEN st1 + "2" FOR RANDOM AS #3 LEN = 50
DEF SEG = 0: POKE (&H417), PEEK(&H417) AND 15: DEF SEG = &HB800
COLOR 11, 0: LOCATE 10, 20: PRINT "Loading data ";
GetTextArray
firsttime = true: name$ = ""
newgame:
IF Comm$ = "" THEN IntroScreen
IF firsttime THEN Initialize
vpage = 0
IF Comm$ = "" THEN
RANDOMIZE seed!: x = RND(-seed!): cRandomize (seed!)
super = (UCASE$(name$) = UCASE$(jnk$(277, 20, 13))) 'true or false
MakeCharacter super: EquipCharacter super
LOCATE 21, 27: COLOR 9, 0: PrintJnk 321, 1, 27: PauseForKey
IF UCASE$(st1) = "Y" THEN
ccls 0: Help 1: SCREEN , , 0, 0
didstuff = false: MakeCommandScreen
SCREEN , , , 3: PauseForKey
IF UCASE$(st1) = "P" THEN PrintCommandScreen
SCREEN , , vpage: ClearMess: PrintMessage 1, 0
END IF
castlelevel = 0: incastle = 0
weather = RollDice(3, 2, 1): wind = RollDice(4, 2, 1)
weather = 4 - weather: wind = 5 - wind
firstlocal = true: starting = -1: answer = true
ccls 0: rdisp = 1: fatig! = Fatigu!: DisplayCharacter: MainMap false
ELSE
IF LoadGame(Comm$) THEN
firstlocal = false
RANDOMIZE seed!: x = RND(-seed!): cRandomize (seed!)
ccls 0: rdisp = 1: fatig! = Fatigu!: DisplayCharacter: MainMap true
ELSE
firsttime = false
GOSUB ToLC: name$ = Comm$: Comm$ = "": GOTO newgame
END IF
END IF
IF incastle = 0 THEN DetailedMap false: firstlocal = false
IF Comm$ <> "" THEN DisplayCharacter
didstuff = true 'for first weather check
mainloop: 'Main Loop of program ==========================================
fatig! = Fatigu!: fastfight = fastfightlocal
IF bitit THEN
ccls 0: ccls 1: ccls 3: clpage2: SCREEN , , 0
IF bitit < 0 THEN
COLOR 13: LOCATE 10, 25: PrintJnk 170, 41, 27: PauseForKey
COLOR 2: LOCATE 13, 25: PrintJnk 273, 23, 34
COLOR 10: LOCATE 12, 25: PrintJnk 273, 1, 22
IF UCASE$(st1) = "Y" THEN
CLEAR , , 10000: INPUT " ", Comm$: ccls 0: GOTO verytop
END IF
END IF
EndScreen 1: ccls 0: END
END IF
messturn = messturn + 1
IF messturn > 5 THEN
messturn = 0
month = (INT(gt!) \ 17280 + 9) MOD 12: moon = (INT(gt!) \ 5220 + 1) MOD 8
days = INT(gt!) \ 1440: hrs = INT(gt!) \ 60 MOD 24
mins = INT(gt!) MOD 60: gt$ = RIGHT$(STR$(mins), 2)
IF mins < 10 THEN MID$(gt$, 1, 1) = CHR$(48)
gt$ = LTRIM$(RIGHT$(STR$(hrs), 2)) + CHR$(58) + gt$
IF mins = 0 AND didstuff THEN
weather = RollDice(3, 2, 1): wind = RollDice(4, 2, 1)
weather = 4 - weather: wind = 5 - wind
IF weather = 3 AND cRoll(50) = 1 THEN hail = true ELSE hail = false
END IF
a = 333: b = 55: c = 8
SELECT CASE month
CASE 1: b = 47: c = 7
CASE 2: b = 54
CASE 3: a = 334: b = 54: c = 5
CASE 4: a = 335: b = 64: c = 5
CASE 5: a = 337: b = 62: c = 3
CASE 6: a = 334: b = 59: c = 4
CASE 7: a = 337: b = 65: c = 4
CASE 8: a = 334: b = 63: c = 6
CASE 9: a = 335: c = 9
CASE 10: b = 62
CASE 11: a = 338
CASE ELSE: a = 339
END SELECT
gt$ = jnk$(342, 57, 11) + RTRIM$(gt$) + bl + jnk$(a, b, c) + STR$(days + 1)
t = gt! MOD 1440
IF (t < 440 OR t > 1200) AND incastle = 0 THEN
SELECT CASE moon
CASE 3: a = 338: b = 63: c = 3
CASE 2, 4: a = 341: b = 62: c = 7
CASE 1, 5: a = 339: b = 63: c = 4
CASE 0, 6: a = 343: b = 54: c = 7
CASE ELSE: a = 373: b = 23: c = 3
END SELECT
gt$ = gt$ + SPACE$(2) + jnk$(343, 44, 10) + jnk$(a, b, c) + jnk$(340, 64, 5)
END IF
l1 = gt$: l2 = jnk$(391, 59, 10) + bl + LEFT$(TIME$, LEN(TIME$) - 3)
IF incastle = 0 THEN
SELECT CASE weather
CASE 1: a = 357: b = 59: c = 9
CASE 2: a = 358: b = 58: c = 7
CASE 3: c = 7: IF hail THEN a = 360: b = 61 ELSE a = 375: b = 60
END SELECT
a$ = "It's " + jnk$(a, b, c) + " and "
SELECT CASE wind
CASE 1: a = 380: b = 63: c = 4
CASE 2: a = 379: b = 61: c = 6
CASE 3: a = 381: b = 59: c = 5
CASE 4: a = 388: b = 55: c = 10
END SELECT
l3 = a$ + jnk$(a, b, c)
ELSE
l3 = bl
END IF
COLOR 9, 0: LOCATE 23, 1: PRINT l1;
LOCATE 24, 1: PRINT l2; : LOCATE 25, 1: PRINT l3;
END IF
IF incastle = 0 AND weather = 3 AND wind > 2 AND cRoll(50) = 1 AND didstuff THEN Lightning
shock = 0: mirror = 0: sousa = 0
IF asleep THEN
Ljnk 252, 28, 5, 1: st1 = CHR$(46): forcefield = false: tentgrab = 0
ELSEIF (mheal <= 0) THEN
PauseForKey
ELSE
st1 = CHR$(46)
END IF
response = 1000 * (LEN(st1) - 1) + ASC(RIGHT$(st1, 1))
respsave2 = respsave1: respsave1 = response: agin = false
rsv: didstuff = true: didmusk = false: fatadd! = 0
SELECT CASE response
CASE 1071 TO 1083, 46, 100, 101, 102, 109, 112, 114, 115, 116, 117, 85, 88, 90, 60, 62
IF berconfuse > 0 THEN
response = Confuse(response, 0)
ELSEIF cRoll(3000) < brandy - 450 THEN
response = Confuse(response, 2)
END IF
IF (attractx OR attracty) AND (grabbed = 0) THEN
response = Confuse(response, 0)
END IF
IF berhic THEN
response = 46: ClearMess: l2 = ber$
MaybeMessPause 10, 0
ELSEIF pooped THEN
mheal = 0: forcefield = false: ClearMess: Ljnk 82, 1, 28, 1
MessPause 4, 0: response = 46: asleep = true
ELSEIF (sick <> 0) AND (response <> 46) AND (RND < .2 + (.1 - .2 * (berhpmut > 0)) * (pmut = 4 AND berpmut = 0) + (.1 - .2 * (berhmmut > 0)) * (mmut = 3 AND bermmut = 0)) THEN
mheal = 0: forcefield = false: ClearMess: Ljnk 248, 59, 9, 1
IF tapeworm AND cRoll(40) = 1 THEN tapeworm = false: Ljnk 342, 29, 28, 1
MaybeMessPause 2, 0
response = 223
END IF
END SELECT
SELECT CASE response
CASE 1071 TO 1081 '78946123
IF vpage <> 1 THEN
vpage = 1: SCREEN , , 1: Ljnk 63, 1, 12, 4: SetCombatStats
PrintMessage 7, 0: DisplayCharacter
END IF
SELECT CASE vehicle
CASE 1: Ride response, 5 * turbo!: fatadd! = 0 'hover
CASE 3: Ride response, 2 * turbo!: fatadd! = 0 'golf
CASE 4: Ride response, 1 * turbo!: fatadd! = 5 'pogo
CASE 5: Ride response, 2 * turbo!: fatadd! = 3 'kayak
CASE 6: Ride response, 1 * turbo!: fatadd! = 3 'rub raft
CASE 7: Ride response, 1 * turbo!: fatadd! = 3 'bamboo raft
CASE ELSE: Move response
END SELECT
IF (didstuff = false) AND berconfuse THEN didstuff = true: fatadd! = -2
CASE 46, 1083 '. del
fastfight = false: fatadd! = -6: IF asleep THEN fatadd! = -12
CASE 27 'esc
didstuff = false: ClearMess: PrintMessage 7, 0
CASE 97 'a(gain)
IF respsave2 = 97 GOTO mainloop
agin = true: response = respsave2: respsave1 = respsave2: GOTO rsv
CASE 63 '?
didstuff = false: MakeCommandScreen
SCREEN , , , 3: PauseForKey
IF UCASE$(st1) = "P" THEN PrintCommandScreen
SCREEN , , vpage: ClearMess: PrintMessage 1, 0
CASE 100 'd(rop)
SELECT CASE currsym
CASE 5, 8, 9, 11, 12, 21, 22, 24, 43, 206, 157, 236, 254, trap, pit, gas, 240, chasm, monosym, 215, 216, 146, 167, 18, 29, 145, 234, 225, 35, 135, 128
didstuff = false: ClearMess: Ljnk 82, 29, 31, 2: PrintMessage 4, 0
CASE ELSE: Drop
END SELECT
CASE 101 'e(at)
Eat
CASE 102 'f(igure)
Figure
CASE 109, 112 'm(ental mutation use), p(hysical mutation use)
agin = true: keysave2 = true: keysave1 = -1 + (response = 109): Use
keysave1 = 0: keysave2 = false
CASE 114 'r(emove trap)
Remove
CASE 115 's(earch)
Search true
CASE 116 't(hrow)
Throw 0: DisplayCharacter
CASE 117 'u(se)
Use
CASE 70 'F(astfight toggle)
didstuff = false: fastfightlocal = NOT fastfightlocal: ClearMess
IF fastfightlocal THEN a = 281: b = 1: c = 28 ELSE a = 281: b = 29: c = 29
Ljnk a, b, c, 1: PrintMessage 4, 0
CASE 85 'U(nuse)
UnUse
DisplayCharacter
CASE 80 'P(revious message)
lsave(1, lpoint) = "_" + lsave(1, lpoint)
lsave(2, lpoint) = "_" + lsave(2, lpoint)
lsave(3, lpoint) = "_" + lsave(3, lpoint)
lpoint = lpoint - 1: IF lpoint < 0 THEN lpoint = 10
COLOR 9, 0
LOCATE 23, 1: PRINT lsave(1, lpoint);
LOCATE 24, 1: PRINT lsave(2, lpoint);
LOCATE 25, 1: PRINT lsave(3, lpoint);
messturn = 0: didstuff = false
CASE 81 'Q(uit)
ClearMess
Ljnk 311, 17, 21, 2: PrintMessage 12, 0: PauseForKey
IF UCASE$(st1) = CHR$(89) THEN
Save
expr& = -1000: st1 = "no": Dead 1
ELSEIF UCASE$(st1) = CHR$(78) THEN
st1 = jnk$(71, 53, 9): Dead 2
ELSE
Ljnk 81, 54, 15, 2: PrintMessage 7, 0: didstuff = false
END IF
CASE 83 'S(ave)
didstuff = false: Save
CASE 87 'W(impy define)
didstuff = false: define
CASE 88 'X(amine)
IF vpage <> 1 THEN
vpage = 1: SCREEN , , 1
Ljnk 63, 1, 12, 4: PrintMessage 3, 0: DisplayCharacter
END IF
Examine false
CASE 90 'Z(leep)
SELECT CASE hrs
CASE 7 TO 20: chan! = .02
CASE 21, 22: chan! = .2
CASE ELSE: chan! = .6
END SELECT
IF coffee > 0 THEN chan! = chan! / 10
IF brandy > 0 THEN chan! = chan! * 10
ClearMess
IF RND < chan! THEN
Ljnk 250, 48, 20, 1: asleep = true: berhic = 0: sick = 0
ELSE
Ljnk 251, 1, 28, 1
IF incastle AND (nnear = 0) THEN
a = 252: IF RND < .5 THEN b = 1: c = 27 ELSE b = 33: c = 17
ELSEIF incastle = 0 THEN
a = 251: b = 45: c = 23
ELSE
a = 251: b = 45: c = 15
END IF
Ljnk a, b, c, 2: IF coffee > 0 THEN Ljnk 289, 1, 31, 2
IF hrs > 6 AND hrs < 21 THEN Ljnk 290, 1, 25, 1: l2 = ""
END IF
fatadd! = -5: PrintMessage 1, 0: DumpBuffer
IF asleep THEN MessPause 1, 0
CASE 60, 62 '<> go down,up
IF grabbed THEN
ClearMess
Ljnk 240, 9, 26, 1: Ljnk 240, 35, 29, 2
PrintMessage 10, 0: ClearMess: DumpBuffer
didstuff = false
ELSE
IF incastle = -1 THEN
res60 = response - 60
IF currsym = 240 AND currf = 5 + 4 * res60 THEN
SaveMaps -1
castlelevel = castlelevel + res60 - 1
fatadd! = fatig! * (1 + res60): DrawDungeon
ELSE
didstuff = false
END IF
ELSEIF incastle = 1 THEN
IF currsym = 240 AND currf = 5 + 4 * (response - 60) THEN
IF currf = 13 THEN
SaveMaps 1
LeaveCastle
localx = xenter: localy = yenter
DetailedMap true
localx = xenter: localy = yenter 'need this?
DisplayCharacter
ELSE
didstuff = false 'go down stuff later on
END IF
ELSE
didstuff = false 'go down stuff later on
END IF
ELSEIF currsym = 240 THEN
FOR kl = 1 TO ngoody
IF ABS(goody(kl, 1)) = 8 THEN
typ = goody(kl, 11)
IF typ = 4 OR typ = 8 OR typ = 10 OR typ = 12 THEN
didstuff = false: ClearMess
Ljnkbig 10, 61, 5, 308, 32, 24, gdy(kl), 1, 2
MessPause 11, 0
END IF
END IF
NEXT kl
IF didstuff THEN SaveMaps 0: DrawLair
END IF
END IF
IF didstuff THEN grabbed = 0: tentgrab = 0
CASE 1059, 49 'F1,1
rdisp = 1: DisplayCharacter: didstuff = false
CASE 1060, 50 'F2
rdisp = 2: DisplayCharacter: didstuff = false
CASE 1061, 51 'F3
MakeKnownScreen
PauseForKey
SCREEN , , vpage: didstuff = false
CASE 1062, 52 'F4
ActiveMod
PauseForKey
SCREEN , , vpage: didstuff = false
CASE 1063, 53 'F5
SetCombatStats
vpage = 0: SCREEN , , 0: ClearMess: DisplayCharacter
FOR idum = 2 TO 51: FOR jdum = 2 TO 21
IF (goodythere(idum, jdum) AND 512) THEN
GetSym sym, idum, jdum, fc, bc, 0
IF bc = 0 THEN bc = 1: PutSym sym, idum, jdum, fc, bc, 0
END IF
NEXT jdum, idum
Ljnk 396, 30, 36, 1: Ljnk 1, 38, 8, 4: MessPause 1, 0
FOR idum = 2 TO 51: FOR jdum = 2 TO 21
IF (goodythere(idum, jdum) AND 512) THEN
GetSym sym, idum, jdum, fc, bc, 0
IF bc = 1 THEN bc = 0: PutSym sym, idum, jdum, fc, bc, 0
END IF
NEXT jdum, idum
vpage = 1: SCREEN , , 1: ClearMess
Ljnk 63, 1, 12, 4: PrintMessage 1, 0
didstuff = false: DisplayCharacter
CASE 1064, 54 'F6
vpage = 1: SCREEN , , 1
Ljnk 63, 1, 12, 4: PrintMessage 7, 0
didstuff = false: SetCombatStats: DisplayCharacter
CASE 1065, 55 'F7
didstuff = false: MakeSymbolScreen
SCREEN , , , 3: PauseForKey: SCREEN , , , vpage
CASE 1067, 57 'F9
Ljnk 201, 1, 51, 1: Ljnk 202, 1, 51, 2: Ljnk 203, 1, 51, 3
PrintMessage 5, 0: didstuff = false
CASE 1068, 48 'F10
didstuff = false: Sneak
CASE 223 'barf
IF RND < .5 THEN
hits = hits - 1: IF hits < 0 THEN st1 = jnk$(249, 58, 7): Dead 0
END IF
respsave1 = 46: respsave2 = 46: fatadd! = 2
REM don't $INCLUDE: 'zalpha.db2'
REM don't $INCLUDE: 'zalpha.dbg'
REM don't $INCLUDE: 'zalpha.db3'
CASE ELSE: didstuff = false
IF agin THEN ClearMess: l2 = "Huh?": PrintMessage cRoll(15) + 1, 0
END SELECT
attractx = 0: attracty = 0
IF (NOT didstuff) OR bitit GOTO mainloop
BerryEffect
SELECT CASE response
CASE 1070, 46, 1083, 101, 102, 109, 112, 114, 115, 116, 117, 85, 90, 223
'1070 is passed back by move,ride if doing trap is okay
IF currsym = trap THEN
dotrap = (incastle = 0)
IF NOT dotrap THEN
dotrap = (currf <> 1 AND currf <> 5) OR (currf = 1 AND (NOT asleep)) OR (currf = 5 AND (NOT inglue))
END IF
IF dotrap AND (currf = 5 AND vehicle <> 0 AND (incastle = 0)) THEN dotrap = false
IF dotrap THEN Trapp currf
ELSEIF currsym = gas THEN
dic = (1.5 * lvl + 21 - con) / 3: IF dic < 1 THEN dic = 1
dam = RollDice(4, dic, dic)
IF (pmut = 7 AND berpmut = 0) THEN dam = (dam + 1) / (2 - 2 * (berhpmut > 0))
IF gasmask OR spacesuit THEN dam = 0: l2 = bl ELSE hits = hits - dam
IF hits < 0 THEN MessPause 8, 0: st1 = jnk$(157, 53, 10): Dead 0
IF bitit GOTO mainloop
IF dam > 0 THEN ClearMess: ShowHits: Ljnk 157, 34, 19, 2: MessPause 8, 0
END IF
END SELECT
IF sick > 0 THEN
sick = sick - 1: IF mheal OR asleep THEN sick = sick - 4
IF pmut = 10 AND berpmut = 0 THEN sick = sick - 2 + 2 * (berhpmut > 0)
IF mmut = 3 AND bermmut = 0 THEN sick = sick - 1 + 2 * (berhmmut > 0)
ELSE
sick = 0
END IF
IF flare > 0 THEN flare = flare - 1
oldfatadd! = fatadd!
IF (pmut = 4 AND berpmut = 0 AND dark > -1) OR uvhelmet THEN Search false
IF pmut = 4 AND berhpmut > 0 AND dark > -1 THEN Search false
IF berdet > 0 AND dark > -1 THEN Search false
fatadd! = oldfatadd!: CheckFatPlus
IF zippy > 0 THEN
zippy = zippy - 1
IF (zippy / 2 <> INT(zippy / 2)) THEN ErasePut: GOTO skipcre
END IF
CreatDo
IF zippy < 0 THEN zippy = zippy + 1: shock = 0: CreatDo
skipcre: IF pmutturns > 0 THEN pmutturns = pmutturns - 1
IF mmutturns > 0 THEN mmutturns = mmutturns - 1
IF bitit GOTO mainloop
IF rdisp = 1 THEN HungFatEnc
gt! = gt! + .18 - .18 * (zippy < 0) + .09 * (zippy > 0)
IF asleep AND (nnear = 0) THEN gt! = gt! + 2
IF inwater OR insand THEN
IF (NOT wetsuit) AND (vehicle <> 1) AND (vehicle <> 5) AND (vehicle <> 6) AND (vehicle <> 7) THEN
IF (pmut = 10 AND berpmut = 0) THEN
IF cRoll(6) < waterturns THEN hits = hits - cRoll(waterturns - 3)
waterturns = waterturns + 1
ELSEIF (mmut = 3 AND bermmut = 0) THEN
IF cRoll(6) < waterturns THEN hits = hits - cRoll(waterturns - 1)
waterturns = waterturns + 2 + insand
ELSE
IF cRoll(6) < waterturns THEN hits = hits - cRoll(2 * waterturns - 2)
waterturns = waterturns + 3 + insand
END IF
ShowHits
IF hits < 0 THEN st1 = jnk$(59, 58, 8): Dead 0
END IF
END IF
GOTO mainloop
ToLC:
firstletter = true
FOR ii = 1 TO LEN(Comm$)
aa = ASC(MID$(Comm$, ii, 1))
SELECT CASE aa
CASE 65 TO 90
IF NOT firstletter THEN MID$(Comm$, ii, 1) = LCASE$(CHR$(aa))
firstletter = false
CASE 32: firstletter = true
CASE ELSE: firstletter = false
END SELECT
NEXT ii
RETURN
END
SUB Use
SetCombatStats
IF agin AND keysave2 THEN
iuse = keysave1
ELSE
iuse = 0
IF pmutturns <= 0 THEN iuse = 1
IF mmutturns <= 0 THEN iuse = iuse + 2
IF currsym = monosym THEN iuse = iuse + 4
Ljnk 65, 3, 24, 1: SelectGoody iuse, 14, false
END IF
ClearMess
IF iuse = 0 THEN didstuff = false: agin = false: PrintMessage 7, 0: GOTO ud3
keysave1 = iuse: keysave2 = false
a = 0: b = 0: c = 0: d = 0: e = 0: f = 0: addgdy = 0
IF iuse = -10 THEN Help 2: SCREEN , , vpage: ClearMess: PrintMessage 1, 0: GOTO ud3
IF iuse = -3 THEN UseMono: GOTO ud3
IF iuse < 0 THEN UseMutat iuse: SetCombatStats: GOTO ud3
IF berconfuse THEN iuse = cRoll(ngoody)
IF goody(iuse, 1) < 0 THEN
IF NOT (ABS(goody(iuse, 1)) = 7) AND (goody(iuse, 11) = 2) THEN
d = 68: e = 1: f = 25: IF berconfuse = 0 THEN didstuff = false
GOTO ud
END IF
END IF
deplete = false: PrintMessage 14, 0
SELECT CASE ABS(goody(iuse, 1))
CASE 1, 2, 6
d = 68: e = 26: f = 21: IF berconfuse = 0 THEN didstuff = false
CASE 3
IF goody(iuse, 8) <= nwep THEN
goody(iuse, 1) = -3: d = 68: e = 47: f = 15: addgdy = 2
UnYooz 3, iuse
ELSE
d = 385: e = 1: f = 28: IF berconfuse = 0 THEN didstuff = false
END IF
CASE 4
worn = false
FOR j = 1 TO ngoody
IF goody(j, 1) = -4 THEN worn = true: EXIT FOR
NEXT j
IF worn THEN
d = 69: e = 1: f = 28: IF berconfuse = 0 THEN didstuff = false
d = 69: e = 1: f = 28: GOTO ud
END IF
armor = goody(iuse, 3): goody(iuse, 1) = -4
d = 69: e = 29: f = 17: addgdy = 2
CASE 5
shield = goody(iuse, 3): goody(iuse, 1) = -5
d = 68: e = 47: f = 15: addgdy = 2
UnYooz 5, iuse
CASE 7, 8
IF NOT goody(iuse, 10) THEN
IF berconfuse = 0 THEN didstuff = false
d = 77: e = 1: f = 32: GOTO ud
END IF
IF goody(iuse, 3) = 0 THEN
fatadd! = 1: d = 77: e = 33: f = 15: GOTO ud
END IF
IF (incastle = -1 AND castle = 6 AND castlelevel = grinchlevel) THEN
IF NOT ((ABS(goody(iuse, 1)) = 7 AND goody(iuse, 11) = 2) OR (ABS(goody(iuse, 1)) = 8 AND goody(iuse, 11) = 8)) THEN
fatadd! = 1: a = 77: b = 33: c = 15
d = 95: e = 27: f = 36: GOTO ud
END IF
END IF
deplete = true
numbr = goody(iuse, 11) + 100 * (ABS(goody(iuse, 1)) - 7)
SELECT CASE numbr
CASE 1 'lava lamp
IF flashlight THEN
IF berconfuse = 0 THEN didstuff = false
d = 315: e = 23: f = 33: GOTO ud
END IF
fatadd! = 1: goody(iuse, 1) = -7: flashlight = true
a = 68: b = 47: c = 15: d = 159: e = 35: f = 8: addgdy = 1
CASE 2 'Backpack
IF npack > 9 THEN
IF berconfuse = 0 THEN didstuff = false
Ljnk 229, 35, 21, 2: PrintMessage 2, 8: GOTO ud
END IF
Ljnk 229, 1, 34, 1: k = 0: SelectGoody k, 14, false
IF k < 1 OR k = iuse THEN didstuff = false: ClearMess: GOTO ud
IF ABS(goody(k, 1)) = 4 OR ABS(goody(k, 1)) = 8 THEN
didstuff = false: ClearMess: Ljnk 230, 38, 30, 2
PrintMessage 7, 0: GOTO ud
ELSEIF goody(k, 1) < 0 THEN
didstuff = false: ClearMess: Ljnk 234, 41, 28, 2
PrintMessage 7, 0: GOTO ud
END IF
npack = npack + 1: goody(iuse, 1) = -7: bakpak(npack) = gdy(k)
FOR j = 1 TO 12: backpack(npack, j) = goody(k, j): NEXT j
backpack(npack, 1) = ABS(backpack(npack, 1)): deplete = false
RemoveGoody k, 0: fatadd! = fatig! + 1: keysave2 = true
CASE 3 'gas mask
IF gasmask OR mask OR uvhelmet THEN d = 88: e = 45: f = 22: didstuff = false: GOTO ud
fatadd! = 2: goody(iuse, 1) = -7: gasmask = true
d = 68: e = 47: f = 15: addgdy = 2
CASE 4 'medkit
fatadd! = 1: fatigue! = fatigue! / 2
d = 171: e = 1: f = 14
diff = hitmax - hits: IF diff < 2 THEN diff = 2
add = RollDice(diff \ 2, 3, 2)
IF add > 40 THEN add = 40 ELSE IF add < 3 THEN add = 3
IF berscience THEN add = add * 2
hits = hits + add: IF hitmax < hits THEN hitmax = hitmax + 1
IF hunger > 0 THEN hunger = hunger * .75
IF berconfuse THEN berconfuse = 1
IF berblind THEN berblind = 1
IF berpmut THEN berpmut = 1
IF bermmut THEN bermmut = 1
IF sick THEN sick = 1
IF strtox > 0 THEN strtox = strtox - 1: str = str + 1
IF dextox > 0 THEN dextox = dextox - 1: dex = dex + 1
IF contox > 0 THEN contox = contox - 1: con = con + 1
IF hittox > 0 THEN
delhit = (hittox + 1) / 2: hittox = hittox - delhit
hits = hits + delhit: hitmax = hitmax + delhit
END IF
spore = 0: tapeworm = false: keysave2 = true
CASE 5 'tape recorder
TapeRecorder iuse: ClearMess: deplete = false: GOTO ud2
CASE 6 'powerpak
Ljnk 223, 36, 14, 1: k = 0: SelectGoody k, 14, false
IF k < 1 THEN didstuff = false: ClearMess: PrintMessage 3, 0: GOTO ud3
deplete = false
SELECT CASE ABS(goody(k, 1))
CASE 1 TO 5: d = 224: e = 1: f = 19: didstuff = false
CASE 6: Ljnkbig 223, 50, 17, 0, 0, 0, gdy(k), 1, 2: f = 0
IF k < iuse THEN SWAP k, iuse
RemoveGoody k, false: RemoveGoody iuse, false
CASE 7, 8
IF goody(k, 1) < 0 THEN
d = 225: e = 1: f = 38: IF berconfuse = 0 THEN didstuff = false
ELSE
Ljnkbig 224, 20, 22, 0, 0, 0, gdy(k), 1, 2: f = 0
IF ABS(goody(k, 1)) = 7 THEN
num = ssd(goody(k, 11), 2): recharge = ssd(goody(k, 11), 9)
ELSE
num = lsd(goody(k, 11), 2): recharge = lsd(goody(k, 11), 4)
END IF
IF num = -1 OR (NOT recharge) THEN
IF num = -1 THEN e = 13: f = 25 ELSE e = 38: f = 29
d = 269: didstuff = false: GOTO ud
END IF
aa = -(goody(k, 3) >= num) - (goody(k, 3) >= num \ 2)
IF goody(k, 11) = 6 THEN aa = 1 'powerpack
goody(k, 3) = num + aa
IF goody(iuse, 3) < 2 THEN RemoveGoody iuse, false ELSE deplete = true
END IF
END SELECT
CASE 7 'chemical analyzer
Ljnk 175, 42, 13, 1: k = 0: SelectGoody k, 11, false
IF k < 1 THEN didstuff = false: ClearMess: PrintMessage 3, 0: GOTO ud3
Ljnk 175, 55, 8, 2
a = 176: b = 0: c = 0
SELECT CASE ABS(goody(k, 1))
CASE 1: b = 1: c = 21
CASE 2: b = 22: c = 15
CASE 3
SELECT CASE goody(k, 8)
CASE 13, 14, nwep + 11, nwep + 12: b = 46: c = 18
CASE 2, nwep + 4, nwep + 6, nwep + 8: b = 38: c = 8
CASE ELSE: b = 36: c = 10
END SELECT
CASE 4
SELECT CASE goody(k, 3)
CASE 1, 2: b = 46: c = 18
CASE IS < 10: b = 36: c = 10
CASE ELSE: b = 38: c = 8
END SELECT
CASE 5
SELECT CASE goody(k, 3)
CASE 1, 2: b = 46: c = 18
CASE 7, 8: b = 38: c = 8
CASE ELSE: b = 36: c = 10
END SELECT
CASE 6: knownb(goody(k, 3)) = true
l2 = RTRIM$(l2) + jnk$(177, 1, 14) + BerEff$(goody(k, 3))
CASE 9
SELECT CASE goody(k, 3)
CASE 5, 9: b = 36: c = 10
CASE ELSE: b = 38: c = 8
END SELECT
CASE ELSE: b = 36: c = 10
END SELECT
IF c > 0 THEN Ljnkbig a, b, c, 0, 0, 0, RTRIM$(l2) + bl, 0, 2: c = 0
fatadd! = 3: keysave2 = true
CASE 8 'visiscope
IF sunglasses THEN
d = 88: e = 19: f = 26: didstuff = false
ELSEIF mask THEN
d = 88: e = 45: f = 22: didstuff = false
ELSEIF incastle THEN
d = 53: e = 51: f = 15: fatadd! = 2
ELSEIF dark > 0 THEN
d = 241: e = 48: f = 20: didstuff = false
ELSE
keysave2 = true: fatadd! = 3: Look true
END IF
CASE 9 'tylenol
fatadd! = 1: keysave2 = true
IF (cRoll(20) > 1) OR berscience THEN
hits = hits + cRoll(lvl + 5): sick = sick \ 2
IF cRoll(2) = 1 THEN tapeworm = false
IF spore THEN spore = spore - 1
IF hittox > 0 THEN
hits = hits + 1: hitmax = hitmax + 1: hittox = hittox - 1
END IF
d = 78: e = 1: f = 15
ELSE
hits = hits - cRoll(2 * lvl + 8) - cRoll(2 * lvl + 8)
sick = sick + 20: con = con - 1: contox = contox + 1
tapeworm = false
a = 9: b = 56: c = 12: d = 173: e = 28: f = 28
IF hits < 0 THEN
MessPause 6, 0: st1 = jnk$(78, 16, 22): Dead 0
END IF
END IF
CASE 10 'mask
IF mask OR gasmask OR uvhelmet THEN d = 88: e = 45: f = 22: didstuff = false: GOTO ud
fatadd! = 1: mask = true: goody(iuse, 1) = -7
FOR id = 1 TO nnear: ncre(id, 6) = -ABS(ncre(id, 6)): NEXT
d = 69: e = 29: f = 17: addgdy = 2
CASE 11 'boots
IF bsshoes OR boots THEN
a = 308: b = 1: c = 31: didstuff = false
ELSE
fatadd! = fatig! / 2: boots = true: goody(iuse, 1) = -7
a = 69: b = 29: c = 17: d = 173: e = 1: f = 27: addgdy = 1
END IF
CASE 12 'answering machine
fatadd! = 1: keysave2 = true
IF answer OR berscience THEN
SELECT CASE cRoll(7)
CASE 1: a1 = 165: b1 = 45: c1 = 11: d = 166: e = 1: f = 31 'mom
CASE 2: a1 = 198: b1 = 1: c1 = 10 'gri
SELECT CASE cRoll(5)
CASE 1: d1 = 294: e1 = 58: f1 = 10 'spc suit
CASE 2: d1 = 117: e1 = 29: f1 = 15 'serum
CASE 3: d1 = 296: e1 = 11: f1 = 16 'bss
CASE 4: d1 = 167: e1 = 29: f1 = 20 'id
CASE 5: d1 = 199: e1 = 32: f1 = 11 'rst bst
END SELECT
Ljnkbig 167, 1, 28, d1, e1, f1, bl, 2, 2
CASE 3: a1 = 197: b1 = 33: c1 = 5: d = 170: e = 1: f = 40 'elvi
CASE 4: a1 = 61: b1 = 18: c1 = 14: d = 168: e = 1: f = 50 'hmun
CASE 5: a1 = 294: b1 = 25: c1 = 11: d = 169: e = 1: f = 50 'skp
CASE 6: a1 = 118: b1 = 57: c1 = 12: d = 264: e = 1: f = 42 'don
CASE 7: a1 = 165: b1 = 56: c1 = 11: d = 166: e = 32: f = 36'buz
END SELECT
Ljnkbig 165, 21, 24, a1, b1, c1, bl, 2, 1: answer = false
ELSE
d = 165: e = 1: f = 20
END IF
CASE 13 'force field gen
IF ffgen THEN d = 77: e = 1: f = 32: didstuff = false: GOTO ud
fatadd! = fatig! / 2: goody(iuse, 1) = -7
ffgen = goody(iuse, 3) - 1: goody(iuse, 3) = ffgen
d = 68: e = 47: f = 15: addgdy = 2
CASE 14 'bion crainium
SELECT CASE cRoll(100 + 15 * (berscience <> 0))
CASE IS < 10
addi = cRoll(3): addm = cRoll(3)
intl = intl + addi: mr = mr + addm
d = 226: e = 1: f = 31
CASE 10 TO 85
intl = intl + 1: mr = mr + 1
d = 226: e = 1: f = 31
CASE IS > 85
intl = intl - 1: mr = mr - 1
Ljnkbig 226, 1, 9, 226, 32, 5, bl, 2, 2
END SELECT
fatadd! = 5: zippy = zippy - 2
RemoveGoody iuse, false: deplete = false
CASE 15 'bion muscles
SELECT CASE cRoll(100 + 15 * (berscience <> 0))
CASE IS < 10
str = str + cRoll(3) + strtox: dex = dex + cRoll(3) + dextox
strtox = 0: dextox = 0
d = 226: e = 1: f = 31
CASE 10 TO 85
str = str + 1: dex = dex + 1
IF strtox > 0 THEN str = str + 1: strtox = strtox - 1
IF dextox > 0 THEN dex = dex + 1: dextox = dextox - 1
d = 226: e = 1: f = 31
CASE IS > 85
str = str - 1: dex = dex - 1
Ljnkbig 226, 1, 9, 226, 32, 5, bl, 2, 2
END SELECT
fatadd! = 5: zippy = zippy - 2
RemoveGoody iuse, false: deplete = false
CASE 16, 17 'duct tape, TP
typ = goody(iuse, 11): fatadd! = fatig!: rng! = 1.5 - 3 * (typ = 17)
Target num, rng!, dx, dy, wallcolr: ClearMess
IF NOT didstuff THEN
PrintMessage 1, 0: didstuff = false: GOTO ud3
END IF
IF num <= 0 GOTO ud2
dam = 1: crenum = ncre(num, 1)
SELECT CASE typ
CASE 16: damtype = 12: needed = 15 - lvl \ 2
CASE 17: damtype = 15: needed = 13 - lvl \ 2
IF crenum = dung OR crenum = sgull THEN dam = RollDice(8, 8, 8)
END SELECT
keysave2 = true: IF berscience THEN needed = needed - 5
Ljnkbig 229, 35, 5, 0, 0, 0, gdy(iuse), 1, 1
Explode dx, dy, dam, damtype, needed, 0!, false, 14, 3
GOTO ud2
CASE 18 'sunscreen
sunscreen = 6: fatadd! = 3: d = 235: e = 55: f = 12
CASE 19 'ID
d = 263: e = 31: f = 29: fatadd! = 1: numid = goody(iuse, 5)
IF numid > 4 OR numid < 1 THEN numid = 1
IF numid = 4 OR incastle THEN
FOR iid = -1 TO 1: FOR jid = -1 TO 1
GetSym sym, localx + iid, localy + jid, fc, bc, 2
IF sym = lockeddoor THEN
PutSym cen, localx + iid, localy + jid, fc, bc, -1
IF numid = 4 AND mainx = radzone(grinchzone, 1) AND mainy = radzone(grinchzone, 2) THEN
RemoveGoody iuse, false: deplete = false
a = d: b = e: c = f: d = 420: e = 29: f = 28
END IF
END IF
NEXT jid, iid
END IF
FOR iid = 1 TO nnear: typ = ncre(iid, 1): remid = false
SELECT CASE typ
CASE rdro: remid = true
CASE ddro: IF numid > 1 + sunglasses + pinsuit THEN remid = true
CASE sdro: IF numid > 2 + sunglasses + pinsuit THEN remid = true
CASE robot: IF numid > 3 + sunglasses + pinsuit THEN remid = true
END SELECT
IF remid THEN ncre(iid, 11) = ncre(iid, 11) AND (NOT 1)
NEXT iid
keysave2 = true
CASE 20 'flare
fatadd! = 2
IF incastle THEN
Ljnk 256, 18, 34, 2: dam = RollDice(4, 2, 2)
damage = dam: ffEffect damage, ffkill
hits = hits - damage
IF hits < 0 THEN
MessPause 12, 0: st1 = "a " + gdy(iuse): Dead 0
ELSEIF ffkill THEN
MessPause 12, 0: ClearMess
Ljnkbig 83, 1, 5, 207, 1, 19, jnk$(205, 39, 21), 1, 2
END IF
MessPause 12, 0: ClearMess
Ljnkbig 73, 1, 5, 0, 0, 0, gdy(iuse), 1, 1
Explode 0, 0, dam, 10, 6, 6!, false, 12, 3
IF goody(iuse, 3) < 1 THEN deplete = false: RemoveGoody iuse, false
GOTO ud2
ELSE
flar = RollDice(20, 12, 8): IF flare < flar THEN flare = flar
IF berscience THEN flare = flare * 2
d = 256: e = 1: f = 17
SetDark dark, olddark, changed: IF changed THEN ChangeDark
IF goody(iuse, 3) < 1 THEN deplete = false: RemoveGoody iuse, false
END IF
CASE 21 'mirror
mirror = iuse: fatadd! = 1: d = 255: e = 51: f = 16
deplete = false: keysave2 = true
CASE 22 'misty
d = 285: e = 16: f = 32: didstuff = false
CASE 23 'tricorder
fatadd! = 1: MapLevel: Examine true: IF dark THEN ChangeDark
aaa = 272: bbb = 1: ccc = 19 'only used by elvis/grinch special
IF incastle = -1 AND castle = 1 THEN
IF elvislevel > 0 THEN aaa = 271: bbb = 38: ccc = 20
Ljnkbig 271, 1, 15, aaa, bbb, ccc, bl, 1, 1
ELSEIF incastle = -1 AND castle = 6 THEN
IF grinchlevel > 0 THEN aaa = 271: bbb = 38: ccc = 20
Ljnkbig 271, 17, 20, aaa, bbb, ccc, bl, 1, 1
END IF
CASE 24 'massager
d = 287: e = 1: f = 39: fatadd! = 0: fatigue! = 0
berfresh = berfresh + RollDice(25, 4, 4)
CASE 25 'thermos
d = 286: e = 39: f = 30: fatadd! = 0
IF coffee = 0 THEN con = con + 1
coffee = coffee + RollDice(150, 4, 4): brandy = brandy * .51
berconfuse = berconfuse * .51
keysave2 = true: hunger = hunger - 100
IF zippy < 0 THEN zippy = 0
CASE 26 'grenade launcher
IF goody(iuse, 3) < 0 THEN
Throw 1: fatadd! = 3: DisplayCharacter: GOTO ud3