-
Notifications
You must be signed in to change notification settings - Fork 5
/
SHOTS.ASM
3153 lines (2618 loc) · 46.4 KB
/
SHOTS.ASM
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
**************************************************************
*
* Software: Mark Turmell
* Initiated: 8/30/90
*
* Modified: Shawn Liptak, 10/27/91 -Orcus mods
*
* COPYRIGHT (C) 1992 WILLIAMS ELECTRONICS GAMES, INC.
*
*.Last mod - 1/9/92 17:07
**************************************************************
.FILE 'SHOTS.ASM'
.TITLE 'PROJECTILES FROM PLAYERS STUFF'
.WIDTH 132
.OPTION B,D,L,T
.MNOLIST
.INCLUDE "MPROC.EQU" ;MPROC EQUATES
.INCLUDE "DISP.EQU" ;DISPLAY PROC. EQUATES
.INCLUDE "\VIDEO\SYS\SYS.INC" ;Z UNIT SYSTEM EQUATES
.INCLUDE "\VIDEO\SYS\MACROS.HDR" ;MACROS DEFINITIONS
.INCLUDE "IMGTBL.GLO"
.INCLUDE "GAME.EQU"
.INCLUDE "FINGRNT.TBL"
.INCLUDE "THROW.TBL"
.include "shawn.hdr" ;Macros
;
;SOUNDS EXTERNAL
;
.REF EXP2HI,SHOT,TOTCARN,FLAMSND,SHOT2,SCASH,KEYSND,WOO1
.REF WOO2,GRNSND,THUMP,THUMP2,MTING,GETWPN,SEXP2HI,SALTXP4,TING
.REF SETDWN,GULP,TING2,TING3,NOWAY,ONESNDOVR
.REF TORCH,SCASH2,GAMSTATE
;
;SYMBOLS EXTERNALLY DEFINED
;
.REF missile_fire2,DONT_WARP,WAVE,ORCHINT,PLYROBJS,RANDPER
.REF PCNT,OUT_FLG,FRANIM,FRANIMQ,BCURRENT,CLEANUP,SKIPR_CNT
.ref SHAKER,INHERE,RINGS,AHMD_CNT,FND_CNT,JEEP2,JEEP,JEEP4
.REF SCRADD2,P1DATA,P2DATA,DO_EXTRA,FREETOT,KILL_H1,PEXIST,TBOMBD2
.REF KILL_F2,GETFPAL,BGDO,HALT,KILL_LY,COMEOUT,BLUEEXP
.REF WARPOUT,PLYRPRCS,GETUGH,CYCLEON
.ref slt_smartbomb,NEUTRONB,DOBINGO,HULK_CNT,DODUD
.ref AKHLIMO
.ref SPAWN_MISL_GOOD
;
;SYMBOLS DEFINED IN THIS FILE
;
.DEF STRT_MISLS,DOIT,ONHEAD
.DEF BMBLTSON,ADDBMB,TINGSND
.DEF STRT_WPN,KILL_BULL,SPRAYON,NSTPON,EXPCNT,FLAMING
.DEF KEYON,RINGON,SMRTON,SHOEON,EXTRA,BMBON,DEL_BULL,TCSH,BOOMS
.DEF FIREON,GRENON,SPDGON,CLNICN,CHK_BULL,SBOMB,KILL_BULL2
.def SBSND,KILL_BULLG
;UNINITIALIZED RAM DEFINITIONS
.BSS EXPCNT,16 ;SMART BOMB EXP CNT
;EQUATES FIRST ORIGINATED IN THIS FILE
;PUT IN ANGLE VELOCITIES!
BLTYVEL .EQU 072000H ;>164000
BLTXVEL .EQU 072000H ;>164000
BL3YVEL .EQU 032000H ;>164000
BL3XVEL .EQU 039000H ;>164000
BLT5YVEL .EQU 038000H ;>164000
BLT5XVEL .EQU 040000H ;>164000
GRNYVEL .EQU 000H
GRNXVEL .EQU 2000H
;-18000 FOR FLATFACE
;GRNYVEL2 .EQU -018000H
;
;GRNXVEL2 .EQU -018000H
.TEXT
msllnchsnd .word >f290,10,>80b9,0 ;Missile launch
;msllnchsnd .word >f290,10,>80b6,0 ;Missile launch
;msllnchsnd .word >f290,10,>812C,0 ;Missile launch
STRT_MISLS
; DIE
MOVK 4,A11
MOVE @WAVE,A0
CMPI 1,A0
JRZ SM1
MOVK 4,A11 ;MISL CNT FOR BASEMENT AREA #1
CMPI 38,A0
JRZ SM1
MOVK 14,A11
CMPI 18,A0
JRNZ SM1
MOVK 3,A11 ;INTO AIRPORT GATE
SM1
MOVE *A8(OYPOS),A0
MOVE @WORLDTLY+16,A1
ADDI 240,A1
CMP A0,A1
JRLT SMD
SLEEP 110
MOVE @HALT,A0
JRNZ SM1
MOVE @WAVE,A0
CMPI 38,A0
JRNZ SM50
MOVI 400,A0
CALLA RANDPER
JRC SM1
JRUC SM01
SM50 SUBK 1,A0
JRNZ SM01
MOVI 850,A0
CALLA RANDPER
JRC SM1
SM01
movi msllnchsnd,a0
calla ONESND
MOVK 8,A10
MOVE *A8(OFLAGS),A0
BTST B_FLIPH,A0
JRZ SM2
MOVK 24,A10
SM2 MOVI missileo_t,A9
CREATE BOSSPID,missile_fire2
;missile_fire ;A8=*Src obj, A9=*Offset_t, A10=Dir 0-31
DSJ A11,SM1
SMD DIE
missileo_t
.word 12H,6
RINGON:
;TURN RING ON AROUND PLAYER ICON PICKUP
;REDUCE MMTM!!!
MMTM SP,A1,A7,A9
MOVE @GAMSTATE,A1
CMPI INAMODE,A1
JRZ ROUT
MOVE *A0(OPLINK),A0,L
MOVE *A0(PNUM),A9
MOVI GULP,A0
CALLA ONESND
MOVI 50,A10 ;TIME RINGS ARE ON
; MOVE @RINGTIME,A10
;GOOD PLAYERS WILL GET RING TIME CUT DOWN
CMPI 1,A9
JRZ SM16
MOVE @timerp2,A1
CMPI 280,A1
JRGE MKHRD0 ;IF CURRENT GAME IS TOO LONG!
MOVE @timerp2sd,A1 ;Player 2 seconds since death
CMPI 170,A1
JRLT NOCHNG6
MKHRD0 MOVI 39,A10
JRUC NOCHNG6
SM16
MOVE @timerp1,A1
CMPI 280,A1
JRGE MKHRD0 ;IF CURRENT GAME IS TOO LONG!
MOVE @timerp1sd,A1 ;Player 1 seconds since death
CMPI 170,A1
JRLT NOCHNG6
MOVI 39,A10
NOCHNG6
MOVE @WAVE,A0
CMPI 38,A0
JRNZ PAT
MOVK 19,A10
PAT
;IF ALREADY A RING FOR THIS PLYR
;KILL OLD PROC AND RESTART ANEW
CMPI 1,A9
JRZ ONEP
MOVI B2PID,A0
CALLA KIL1C
MOVI RNG2PID,A0
CLR A1
NOT A1
CALLA EXISTP
JRZ STRT2
move *A0(PA9),A1,L
CALLA KILL
MOVE A1,A0
CALLA DELOBJ
STRT2
; MOVI 50,A10 ;TIME RINGS ARE ON
CREATE RNG2PID,RINGS ;PLACE RING AROUND PLAYER X
JRUC ROUT
ONEP
MOVI B1PID,A0
CALLA KIL1C
MOVI RNG1PID,A0
CLR A1
NOT A1
CALLA EXISTP
JRZ STRT1
move *A0(PA9),A1,L
CALLA KILL
MOVE A1,A0
CALLA DELOBJ
STRT1
; MOVI 50,A10 ;TIME RINGS ARE ON
CREATE RNG1PID,RINGS ;PLACE RING AROUND PLAYER X
ROUT CALLR CLNICN
MMFM SP,A1,A7,A9
RETS
BMBLTSON
MMTM SP,A1,A7,A9,A11
MOVE *A0(OPLINK),A11,L
MOVE *A11(PNUM),A9
CMPI 1,A9
JRZ ONEP4
MOVI BMBLT2PID,A0
CLR A1
NOT A1
CALLA EXISTP
JRZ STRT4
CALLA KILL
STRT4
MOVK 10,A10 ;# OF BOMBS TO DROP FOR PLYR
CREATE BMBLT2PID,DOBMBS
JRUC ADSHOE
ONEP4
MOVI BMBLT1PID,A0
CLR A1
NOT A1
CALLA EXISTP
JRZ STRT14
CALLA KILL
STRT14
MOVK 10,A10
CREATE BMBLT1PID,DOBMBS
ADSHOE
;TURN ON FAST SHOES ALSO
MOVE *A11(LEG_PRC),A9,L
;PICKED UP TENNIS SHOES!
MOVI 08140H,A1
MOVE A1,*A9(SHOECNT),W
CALLR CLNICN
MMFM SP,A1,A7,A9,A11
RETS
DOBMBS
;A9=1 OR 2 FOR PLYR #
;A10=# OF BOMBS TO DROP
MOVE A9,A1
DEC A1
SLL 5,A1
MOVI PLYRPRCS,A11
ADD A1,A11
MOVE *A11,A11,L
DB2
MOVE @WARPOUT,A0
JRNZ DI ;NOBM
MOVE @HALT,A0
JRNZ NOBM
;PLACE TIME BOMB HERE
MOVE *A11(DEAD),A0
JRNZ DI
;PLACE BOMB ON GROUND
CREATE BMBPID,TBOMBD2
MOVI SETDWN,A0 ;SET DOWN SND
CALLA ONESND
DEC A10
JRZ DI
NOBM SLEEPK 25
JRUC DB2
EXTRA:
;A0=PLYR
;A8=ICON
MMTM SP,A1,A2,A3,A4,A5,A6,A7
MOVE *A8(OIMG),A1,L
CMPI ORCHINT,A1 ;HINTS
JRZ AWARP
CMPI SPIN1,A1 ;WARP
JRZ AWARP
CMPI MAPBUTN,A1
JRNZ EX1
;THIS IS A MAPBUTN
MOVI BGDO,A7
MOVK 1,A0
MOVE A0,@HALT
EX2 MOVE *A8(OPLINK),A0,L
CLR A1
CALLA XFERPROC
MOVE *A8(OFLAGS),A0
ORI M_NOCOLL,A0
MOVE A0,*A8(OFLAGS)
EX3 MOVK 1,A0
MOVE A0,@OUT_FLG
NOPE MMFM SP,A1,A2,A3,A4,A5,A6,A7
RETS
AWARP MOVE @DONT_WARP,A7 ;NEUTRON BMB BLOWING UP!
JRNZ EX3
MOVI COMEOUT,A7
MOVE A0,A9
JRUC EX2
EX1 CMPI PLAYER,A1
JRNZ NOPE
;FREE MAN ICON TOUCHED
MOVE *A0(OPLINK),A10,L
CREATE0 FLASHME
MOVE *A10(PNUM),A10
MOVI P1DATA,A2
CMPI 1,A10
JRZ TAG1
MOVI P2DATA,A2
TAG1 CALLA DO_EXTRA
; MOVE *A8(OPLINK),A0,L
; JRZ TAG2 ;BR=BONUS MAN SITTING INSIDE A WARP
;CHECK TO SEE IF PIXSCAN BIT IS SET!
;IF SO, WE HAVE A BONUS MAN IN A WARP!
MOVE *A8(OFLAGS),A0
BTST B_PIXSCAN,A0 ;.EQU 10
JRNZ TAG2
;
; MOVE *A8(OYPOS),A0
;;CHECK IF WARP LOCKDOWN FREE MAN
; CMPI 127+200+60,A0
; JRNZ TAG1A
; MOVE *A8(OXPOS),A0
; CMPI 180+200-3,A0
; JRZ TAG2
; CMPI 220+200-3,A0
; JRZ TAG2
;TAG1A
MOVE @FREETOT,A0
INC A0
MOVE A0,@FREETOT
JRUC FLYCONT
TAG2
CLR A11
JRUC FLYCONTA
KEYON:
;PLAYER NOW CARRIES KEY
;A0=PLYR
;A8=ICON
MMTM SP,A1,A2,A3,A4,A5,A6,A7
MOVE *A0(OPLINK),A10,L
CREATE0 FLASHME
MOVE *A10(PNUM),A10
MOVI P1DATA,A2
; MOVE A2,@MAPON
MOVI KEYPT,A1
CMPI 1,A10
JRZ KEY1
MOVI P2DATA,A2
KEY1
MOVE *A2(TKEYS),A0
INC A0
MOVE A0,*A2(TKEYS)
CALLA SCRADD2
MOVI KEYSND,A0 ;KEY VOICE CALL
CALLA ONESND
FLYCONT
MOVK 1,A11
FLYCONTA
MOVI CLSDEAD,A0
MOVE A0,*A8(OID)
MOVI DMAWNZ|M_NOCOLL,A0
MOVE A0,*A8(OFLAGS)
MOVI 300,A0
MOVE A0,*A8(OZPOS)
MOVE *A8(OPLINK),A0,L
DEC A10
FLYCONT2
MOVI ICONPID,A1
MOVI INHERE,A7 ;FLOAT TOWARD SCORE BOARD
CALLA XFERPROC
MOVK 1,A0
MOVE A0,@OUT_FLG
MMFM SP,A1,A2,A3,A4,A5,A6,A7
RETS
ONHEAD
CMPI P1DATA,A9
JRNZ ONH1
;P1
CLR A10
MOVE @PLYROBJS,A7,L
ONH2 MOVE *A7(OXVAL),A0,L
CLR A11
SUBI [1,0],A0
MOVE *A7(OYVAL),A1,L
ADDI [1,0],A1
MOVI PLAYER,A2
MOVI 300,A3
MOVI DMAWNZ|M_NOCOLL,A4
MOVI CLSDEAD,A5
CLR A6
CLR A7
CALLA BEGINOBJ2
MOVI ICONPID,A0
MOVE A0,*A13(PROCID)
SLEEPK 20 ;SHOW HIM!
JAUC INHERE
ONH1 MOVE @PLYROBJS+32,A7,L
MOVK 1,A10
JRUC ONH2
TCSH:
;TOUCH CASH ON FLOOR
;A0=PLYR
;A8=BMB IMG
MMTM SP,A1,A2,A3,A4,A5,A6,A7
MOVE *A0(OPLINK),A0,L
MOVE *A0(PNUM),A10
MOVI P1DATA,A1
DEC A10
JRZ X0
MOVI P2DATA,A1
X0 MOVE *A8(OIMG),A0,L
CMPI DET1,A0
JRNZ NOT_BMB
;PLAYER PICKED UP EXTRA BOMB
PUSH A0
MOVI P1DATA+BMB_CNT,A0
MOVE A10,A10
JRZ TBMB0
MOVI P2DATA+BMB_CNT,A0
TBMB0
CALLR ADDBMB
PULL A0
MOVI SCASH2,A0
JRUC X2A
NOT_BMB
CMPI PLAYER,A0 ;FREE MAN?
JRNZ NOTMAN
MOVI P1DATA,A2
MOVE A10,A10
JRZ TKEY10
MOVI P2DATA,A2
TKEY10
CALLA DO_EXTRA
;DO_EXTRA
;EXTRA MAN
;A2 = P1DATA OR P2DATA
JRUC X2AA
NOTMAN CMPI KEY,A0
JRNZ NOT_KEY
MOVI P1DATA,A2
MOVI KEYPT,A1
MOVE A10,A10
JRZ TKEY1
MOVI P2DATA,A2
TKEY1
MOVE *A2(TKEYS),A0
INC A0
MOVE A0,*A2(TKEYS)
CALLA SCRADD2
MOVI KEYSND,A0 ;KEY VOICE CALL
JRUC X2A
NOT_KEY CMPI USFLG,A0
JRNZ X1
MOVE *A1(TFLAGS),A0 ;TOTAL FLAGS PICKED UP
INC A0
MOVE A0,*A1(TFLAGS)
JRUC X2
X1 MOVE *A1(CASHCNT),A0
INC A0
MOVE A0,*A1(CASHCNT)
X2 MOVE @WAVE,A0
CMPI 40,A0
JRNZ X3Z
;PLEASURE DOME CASH
MOVI P1DATA,A2
MOVI PLSRPTS,A1 ;PLEASURE DOME PNTS
MOVE A10,A10
JRZ TPL
MOVI P2DATA,A2
TPL
CALLA SCRADD2
;SUBTRACT OUT TWPNS PICKED UP
X3Z MOVI SCASH,A0 ;GET CASH PICKUP SND
X2A CALLA ONESND
X2AA MOVE *A1(TWPNS),A0
DEC A0
MOVE A0,*A1(TWPNS)
MOVI CLSDEAD,A0
MOVE A0,*A8(OID)
MOVI DMAWNZ|M_NOCOLL,A0
MOVE A0,*A8(OFLAGS)
MOVI 500,A0 ;300
MOVE A0,*A8(OZPOS)
MOVE *A8(OPLINK),A0,L
JRZ X3
CALLA KILL
X3
;JEWEL ON GROUND JUMPS IN HERE
;A10=0 OR 1 FOR PLYR #
;A8=ICON IMG
;A11=1 IF FROM KEY FLOATING TO SCORE BOARD
CLR A11
CREATE FUTUREPID,INHERE
MMFM SP,A1,A2,A3,A4,A5,A6,A7
RETS
;CSHSND .LONG SCASH1,SCASH2,SCASH3,SCASH4,SCASH5
; .LONG SCASH4,SCASH2,SCASH5
BMBON:
;PLAYER PICKED UP EXTRA BOMB
;A0=PLYR
;A8=BMB IMG
MMTM SP,A1,A2,A3,A4,A5,A6,A7
MOVE *A0(OPLINK),A0,L
MOVE *A0(PNUM),A10
MOVI SCASH2,A0
CALLA ONESND
MOVI P2DATA+BMB_CNT,A0
CMPI 1,A10
JRNZ FLY
MOVI P1DATA+BMB_CNT,A0
FLY CALLR ADDBMB
MOVI CLSDEAD,A0
MOVE A0,*A8(OID)
MOVI DMAWNZ|M_FLIPH|M_NOCOLL,A0
MOVE A0,*A8(OFLAGS)
MOVI 300,A0
MOVE A0,*A8(OZPOS)
MOVE *A8(OPLINK),A0,L
DEC A10
CLR A11
JRUC FLYCONT2
ADDBMB MOVE *A0,A2,W ;@P1DATA+BMB_CNT,A2
CMPI 15,A2 ;CAN CARRY MAXIMUM OF 18 BMBS
JRNC NOADD
INC A2
MOVE A2,*A0,W ;@P1DATA+BMB_CNT
NOADD RETS
FLASHME
;A10=PROC OF PLYR TO FLASH (TORSO STRUCTURE)
MOVE *A10(TSO_PTR),A8,L
MOVE *A10(LEG_PTR),A11,L
; MOVE *A8(OPAL),A10,W
;GIVE THESE IMAGES OTHER PAL
MOVI nup2a,A0
CALLA GETFPAL ;GET A COLOR MAP ASSIGNMENT
MOVE A0,*A8(OPAL),W ;STORE THE NEW PALETTE
MOVE A0,*A11(OPAL),W ;STORE THE NEW PALETTE
SLEEPK 8
;GIVE THESE IMAGES OTHER PAL
MOVI nup1,A0
MOVE *A10(PNUM),A1
CMPI 1,A1
JRZ XS
MOVI nup2,A0
XS CALLA GETFPAL ;GET A COLOR MAP ASSIGNMENT
MOVE A0,*A8(OPAL),W ;STORE THE NEW PALETTE
MOVE A0,*A11(OPAL),W
DIE
SHOEON:
;A8=SHOE ICON
;FAST SHOES
;REDUCE MMTM!!!
MMTM SP,A1,A7,A9,A10
MOVE *A0(OPLINK),A10,L
PUSH A0
CREATE0 FLASHME
PULL A0
MOVE *A10(LEG_PRC),A9,L
MOVE *A10(PNUM),A7
MOVE *A8(OIMG),A10,L
CMPI SHOES,A10
JRZ BOOTS
;PICKED UP TENNIS SHOES!
MOVI 08280H,A1
CMPI 1,A7
JRZ SM15
MOVE @timerp2sd,A7 ;Player 2 seconds since death
CMPI 80,A7
JRLT SH3
MOVI 081C0H,A1
JRUC SH3
SM15
MOVE @timerp1sd,A7 ;Player 1 seconds since death
CMPI 80,A7
JRLT SH3
MOVI 081C0H,A1
JRUC SH3
BOOTS
MOVE *A9(SHOECNT),A1
JRZ SHOE2
BTST 15,A1
JRZ SH2
;HAVE TENNIS SHOES ON! TAKE'EM OFF
SHOE2 MOVE A0,A10
CREATE0 FLOAT
SH2 MOVI 0A0H,A1 ;150 ;TIME SHOES ARE ON
SH3 MOVE A1,*A9(SHOECNT),W
CALLR CLNICN
MOVI FEET,A0
CALLA ONESND
MMFM SP,A1,A7,A9,A10
RETS
FEET .WORD >F06E,>18,>80CA,0 ;FAST FEET PICKUP
FLOAT
;A10=LEG IMG
;A9=LEG PROCESS
MOVE *A9(TSO_PTR),A8,L
MOVK 15,A11
FLT2
SLEEPK 8
MOVE *A9(SHOECNT),A0
JRZ DI
BTST 15,A0
JRNZ DI
MOVE *A10(OYPOS),A0
XORI 1,A0
MOVE A0,*A10(OYPOS)
DSJ A11,FLT2
MOVK 15,A11
MOVE A8,A0
MOVE A10,A8
CALLA GETANIXY
MOVE *A8(OFLAGS),A4,W
ORI M_NOCOLL,A4
CALLA GANISAG
MOVE A0,A8
;TURN BACK ON TORSO OBJECT
JRUC FLT2
DI DIE
SMRTON:
;SMART BOMB EVERYTHING ON SCREEN
MMTM SP,A1,A7,A10
MOVE A0,A9
MOVE *A0(OPLINK),A10,L
CREATE0 FLASHME
PUSH A9
CALLR CLNICN
PULL A9
MOVI 100,A0 ;230
MOVE *A10(PNUM),A1
CMPI 1,A1
JRZ SM1T
;GOOD PLAYERS WILL GET SMART BOMB 80% DUD RATE
.REF timerp2sd,timerp1sd,timerp1,timerp2
MOVE @timerp2,A1
CMPI 360,A1
JRGE MKHRD01 ;IF CURRENT GAME IS TOO LONG!
MOVE @timerp2sd,A1 ;Player 2 seconds since death
CMPI 90,A1
JRLT NOCHNG
JRUC MKHRD01
SM1T
MOVE @timerp1,A1
CMPI 360,A1
JRGE MKHRD01 ;IF CURRENT GAME IS TOO LONG!
MOVE @timerp1sd,A1 ;Player 1 seconds since death
CMPI 90,A1
JRLT NOCHNG
MKHRD01 MOVI 450,A0
NOCHNG
CALLA RANDPER
JRNC ZSM1
MOVE @WAVE,A0
JRZ ZSM1
CMPI 10,A0
JRZ ZSM1
;DUD!
CREATE0 DODUD
MOVI WHAWHA,A0
CALLA ONESNDOVR
JRUC XSM1
WHAWHA .WORD >FBEE,90,>8088,0 ;WHAWHA
ZSM1
CREATE0 DOBINGO
CREATE0 SBSND
MOVE @WAVE,A0
SUBK 32,A0
JRZ XSM1
CREATE0 SBOMB
MOVI 30,A10
CALLA SHAKER
XSM1
MMFM SP,A1,A7,A10
RETS
SBSND
MOVI SALTXP4,A0
MOVK 2,A1 ;REPEAT IT 3 TIMES
CALLA SNDLD ;GO DO IT
JSRP BOOMS
MOVI TOTCARN,A0 ;SPEECH
CALLA ONESND
DIE
BOOMS
MOVI SEXP2HI,A0
MOVK 1,A1 ;REPEAT IT 3 TIMES
CALLA SNDLD ;GO DO IT
SLEEPK 5
MOVI SEXP2HI,A0
MOVK 1,A1 ;REPEAT IT 3 TIMES
CALLA SNDLD ;GO DO IT
SLEEPK 5
MOVI SEXP2HI,A0
MOVK 1,A1 ;REPEAT IT 3 TIMES
CALLA SNDLD ;GO DO IT
SLEEPK 5
MOVI SEXP2HI,A0
MOVK 1,A1 ;REPEAT IT 3 TIMES
CALLA SNDLD ;GO DO IT
SLEEPK 21
RETP
SBOMB
;SMART BOMB
;A9=PLYR IMG PTR WHO GOT ME
CLR A0
MOVE A0,@EXPCNT ;SMART BOMB EXP CNT - MAX OUT AT 15!
MOVE *A9(OPLINK),A0,L
MOVE *A0(PNUM),A0
MOVI P1DATA,A9
DEC A0
JRZ BAD0
MOVI P2DATA,A9
;A9=P1 OR P2DATA FOR SCORING SMART BOMB POINTS
BAD0
MOVI CLSENMY|TYPHULK,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD10
;FOUND A HULK
MOVE A0,A8
CALLA KILL_H1 ;KILL_HULK
JRUC BAD0
BAD10 CLR A0
MOVE A0,@HULK_CNT
BAD1
MOVI CLSENMY|TYPFND,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD2A
;FOUND A FIEND
MOVE A0,A8
CALLA KILL_F2 ;KILL_FIEND
JRUC BAD1
BAD2A CLR A0
MOVE A0,@FND_CNT
BAD2
MOVI CLSENMY|TYPGOO,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD3
;FOUND A GOOB
MOVE A0,A8
MOVE *A8(OPLINK),A0,L
CALLA PEXIST
JRZ NOK
CALLA KILL
NOK CALLA DELOBJA8
JRUC BAD2
BAD3
MOVI CLSENMY|TYPGRW,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD4
;FOUND A HULK GROWING
MOVE A0,A8
CALLA KILL_H1 ;KILL_HULK
JRUC BAD3
BAD4
MOVI CLSENMY|TYPLAYR,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD5
;FOUND A MINE LAYER
MOVE A0,A8
CALLA KILL_LY ;KILL MINE LAYER TOO!
JRUC BAD4
BAD5
MOVI CLSPLYR|TYPHLPR|SUBLAY,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD6
MOVE *A0(OIMG),A8,L
; CMPI T72TNK,A8
; JRZ BAD6 ;BR=DON'T SMART BOMB T72 TANK!
; CMPI BTR60,A8
; JRZ BAD6 ;BR=DON'T SMART BOMB BTR60!
; CMPI BTRECK,A8
; JRZ BAD6 ;BR=DON'T SMART BOMB BTR60 WRECK!
; CMPI JEEP,A8
; JRZ BAD6 ;BR=DON'T SMART BOMB JEEP!
; CMPI JEEP2,A8
; JRZ BAD6 ;BR=DON'T SMART BOMB JEEP!
; CMPI JEEP4,A8
; JRZ BAD6 ;BR=DON'T SMART BOMB JEEP!
; CMPI SCUD1,A8
; JRZ BAD6 ;BR=DON'T SMART BOMB SCUD TRUCK!
; CMPI NEUTRONB,A8
; JRZ BAD6 ;BR=DON'T SMART BOMB NEUTBONB!
; CMPI AKHLIMO,A8
; JRZ BAD6
MOVI TANK_LIST,A2
LOOP MOVE *A2+,A3,L
JRZ BAD6
CMP A8,A3
JRNZ LOOP
;FOUND A MINE LAYER WITH CLSPLYR BIT SET FOR A MOMENT!
MOVE A0,A8
CALLA KILL_LY ;KILL MINE LAYER TOO!
JRUC BAD5
TANK_LIST
.LONG MTNK10,RTNK,MTNK11,MTNK12,MTNK12B,MTNK6
.LONG MTNK6B,MTNK7,MTNK8,MTNK9,MTNK9B,0
BAD6
MOVI CLSENMY|TYPAHMD,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD7A
MOVE A0,A8
CALLA KILL_H1 ;KILL HULK AS WELL AS AHMED
JRUC BAD6
BAD7A CLR A0
MOVE A0,@AHMD_CNT
BAD7
MOVI CLSENMY|TYPLAYR|SUBFLM,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BAD8
;FOUND A FLAME
CALLA DELOBJ
JRUC BAD7
BAD8
movi CLSENMY|TYPSL,a0
movi >ff00,a1
calla EXISTOBJ
jrz BAD9
move a0,a8
calla slt_smartbomb
jruc BAD8
BAD9 movi SHRAPPID,a0
calla KIL1C
clr a0
move a0,@SKIPR_CNT
;
;INSERT OTHERS HERE
;
;HULKFIX MOVI HULKPID,A0
; CLR A1
; NOT A1
; CALLA EXISTP
;* Z BIT SET = NO MATCH, A0 = 0
;* Z BIT CLR = MATCH, A0 = PTR TO PROCESS
; JRZ BADCLN
; MOVE A0,A2
; move *A0(PA8),A0,L
; CALLA ISOBJ
;* Z BIT SET = NO OBJECT, A0 = 0 *
;* Z BIT CLR = NO OBJECT, A0 = PTR TO OBJECT *
; JRZ KILLIT
; MOVE *A0(OID),A1
; CMPI CLSDEAD,A1
; JRZ HULKFIX
; CMPI CLSENMY|TYPGRW,A1
; JRZ HULKFIX
; CMPI CLSENMY|TYPHULK,A1
; JRZ HULKFIX
;KILLIT MOVE A2,A0
; CALLA KILL
; JRUC HULKFIX
BADCLN
MOVI CLSENMY|TYPSHOT,A0
MOVI 0FFFFH,A1
CALLA EXISTOBJ
JRZ BADO
;FOUND A CBALL/SHRAPNEL
;NO SCORE
MOVE A0,A8
;ALSO USED FOR SHRAPNEL FROM FAT MAN
MOVE *A8(OPLINK),A0,L
JREQ BADCLN
CLR A1
MOVE A1,*A8(OPLINK),L
CALLA KILL
CALLA DELOBJA8
JRUC BADCLN
BADO
;RESET ALL CNTS!
DIE
SNDA
MOVI GETWPN,A0
CALLA ONESND
SLEEPK 18H
MOVI WOO2,A0
CALLA ONESND
DIE
********************************
* Collision code for weapon icons
* A0=*Plyr leg obj
* A8=*Icon obj
NSTPON
PUSH a1,a2,a7,a9,a10
MOVK SUBNOSTP,A2 ;BULLET SUBTYPE
JRUC ICONIN
SPDGON
PUSH a1,a2,a7,a9
MOVK SUBSPDG1,A2 ;BULLET SUBTYPE
JRUC ICONIN
GRENON
PUSH a1,a2,a7,a9
MOVK SUBGRND,A2 ;BULLET SUBTYPE
JRUC ICONIN
FIREON
PUSH a1,a2,a7,a9
MOVK SUBTHROW,A2
MOVE @PCNT,A7
SLL 32-2,A7
JRZ ICONIN
MOVK SUBFIRE1,A2 ;BULLET SUBTYPE
JRUC ICONIN
SPRAYON
PUSH a1,a2,a7,a9
MOVK SUBSPRY,A2 ;BULLET SUBTYPE
ICONIN move *a0(OPLINK),a10,L
CALLR DO_CNT
CREATE0 SNDA
CALLR CLNICN
CREATE0 FLASHME
PULL a1,a2,a7,a9,a10
RETS
********************************
* Setup new weapon
* A2=Weapon #
* A10=*Plyr process
* Trashes A0-A2,A7,A9
DO_CNT
move a2,*a10(WPN_TYP)
sll 4,a2
addi TIMERS,a2
movi timerp1,a14
move *a10(PNUM),a1
subk 1,a1
jreq dc40
movi timerp2,a14
dc40 move *a14+,a7 ;Seconds since buyin
cmpi 240,a7
jrgt dc150 ;Hard?
move *a14,a1 ;Seconds since death
cmpi 80,a1
jrlt dc300 ;Normal?
dc150 cmpi 290,a7
jrlt dc200 ;No missile?
move a0,a9 ;A9=*Plyr leg obj
move @PCNT,a0
sll 32-1,a0
jrnz dc200 ;50%?
move @WAVE,a0
subk 16,a0
jrlt dc180 ;Msl launch ok?
subk 18-16,a0