-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathddact.asm
1727 lines (1531 loc) · 29.1 KB
/
ddact.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
cseg segment public 'code'
assume cs: cseg, ds: dseg
public get_action, get_surface, nocdown_detect, drop_his_weapon
public knock_over, hit_kneeing, hurt_em, score_it, hit_in_air
extrn x_vel_from_dir:near, test_snd:near
extrn hit_snd:near, thud_snd:near, linda_snd:near, will_snd:near
extrn colaps_snd:near, whip_snd:near, thumb_snd:near, splash_snd:near
extrn splat_snd:near, bounce_snd:near
extrn pnum:near
include ddeqfile
get_action:
;pushall
;mov dx,100*256
;mov cx,5
;mov al,action
;xor ah,ah
;call pnum ;okay then print the f***er
;border 6 ;change !
;popall
mov al,action
;and al,62 ;mask man !
jmptab al,action_table ;action, action_table
action_table: dw offset null_action ; dead
dw offset walk
dw offset punch
dw offset kick
dw offset jump_kick
dw offset turn_kick
dw offset elbow
dw offset head_butt
dw offset swing_club
dw offset use_whip
dw offset jump
dw offset null_action ; throw knife
dw offset null_action ; throw rock
dw offset climb
dw offset fall
dw offset collapse
dw offset null_action ; get up
dw offset null_action ;kneeing
dw offset null_action ; pick up small
dw offset null_action ; pick up large
dw offset null_action ; take punch
dw offset null_action ; stand
dw offset null_action ; lie
dw offset null_action ; throw man
dw offset be_thrown
dw offset fly_back
dw offset fly_side
dw offset hold_up ; hold up
dw offset null_action ; hu_stand
dw offset null_action ; be kneed
dw offset null_action ; kick rock
dw offset run ; running (cartwheel)
dw offset null_action ; 64 bill dying ?
dw offset null_action ; 66 specwep ?
dw offset birth_action ; 68
birth_action:
; might do summat but not for now !
ret
;dw offset cart ;the cartwheel
run: mov ax, map_x
add ax, x_vel
add ax, x_vel ;goes twice as fast !
mov test_map_x, ax
mov ax, map_y
mov y_vel,0 ;must zero !;add ax, y_vel
mov test_map_y, ax
mov al, height
mov test_height, al
call get_surface
cmp byte ptr reduced_attr, walkable
je run_run
cmp byte ptr reduced_attr, climbable
je run_climb
;cmp byte ptr reduced_attr, fallable
;je run_fall
no_run: ret
run_run: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, level
mov height, al
mov bx, frame_no
test byte ptr [bx+6], 1
jnz run_hit
ret
run_hit: cmp bx,-1
je exit_rh
call nocdown_detect
;call hurt_detect
exit_rh: ret
;run_fall: mov ax, test_map_x
; mov map_x, ax
; mov ax, test_map_y
; mov map_y, ax
; mov action, falling
; mov frame_no,-1
; call drop_own_weapon
; ret
run_climb: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov action, climbing
mov frame_no, -1
ret
;this carting is ignoring the collision detection.
cart: mov ax, map_x
add ax, x_vel
add ax, x_vel ;goes twice as fast !
mov test_map_x, ax
mov ax, map_y
mov y_vel,0 ;must zero !;add ax, y_vel
mov test_map_y, ax
mov al, height
mov test_height, al
call get_surface
cmp byte ptr reduced_attr, walkable
je cart_cart
cmp byte ptr reduced_attr, climbable
je cart_climb
;cmp byte ptr reduced_attr, fallable
;je cart_fall
no_cart: ret
;cart_fall: mov ax, test_map_x
;mov map_x, ax
;mov ax, test_map_y
;mov map_y, ax
;mov action, falling
;mov frame_no,-1
;call drop_own_weapon
;ret
cart_climb: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov action, climbing
mov frame_no, -1
ret
cart_cart: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, level
mov height, al
ret
walk: mov ax, map_x
add ax, x_vel
mov test_map_x, ax
mov ax, map_y
add ax, y_vel
mov test_map_y, ax
mov al, height
mov test_height, al
call get_surface
cmp byte ptr reduced_attr, walkable
je walk_walk
cmp byte ptr reduced_attr, climbable
je walk_climb
cmp byte ptr reduced_attr, fallable
je walk_fall_test
no_walk: ret
walk_walk: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, level
mov height, al
ret
walk_fall_test: ; attempt a simple frig for checking out the climbable thing
mov ax, map_x
add ax, x_vel
mov test_map_x, ax
mov ax, map_y
add ax, y_vel
mov test_map_y, ax
mov al, height
sub al,1 ;check a bit lower ?
mov test_height, al
call get_surface
cmp byte ptr reduced_attr, climbable
jne walk_fall
sub height,1 ;er ?
jmp walk_climb
; or continue to fallable ?
walk_fall: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov action, falling
mov frame_no,-1
call drop_own_weapon
ret
walk_climb: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov action, climbing
mov frame_no, -1
ret
punch: mov bx, frame_no
test byte ptr [bx+6], 1
jnz punch_hit
ret
punch_hit: cmp bx, -1
je exit_ph
call hurt_detect
exit_ph: ret
kick: mov bx, frame_no
test byte ptr [bx+6], 1
jnz kick_hit
ret
kick_hit: cmp bx, -1
je exit_kh
cmp type_,player1 ; players1/2 and ropers ( type_ correct?)
jne no_player_frigg
xor direction , left+right
call hurt_detect
xor direction , left+right
; This is done as a player kick is a backwards kick !
; The turn kick will be changed to the whirlwind job.
exit_kh: ret
no_player_frigg:
call hurt_detect
ret
elbow: mov bx, frame_no
test byte ptr [bx+6], 1
jnz elbow_hit
ret
elbow_hit: cmp bx, -1
je exit_eh
call nocdown_detect
exit_eh: ret
head_butt: mov bx, frame_no
test byte ptr [bx+6], 1
jnz head_butt_hit
ret
head_butt_hit: cmp bx, -1
je exit_hbh
call nocdown_detect
exit_hbh: ret
swing_club: mov bx, frame_no
test byte ptr [bx+6], 1
jnz club_hit
ret
club_hit: cmp bx, -1
je exit_ch
call nocdown_detect
exit_ch: ret
use_whip: mov bx, frame_no
test byte ptr [bx+6], 1
jnz whip_hit
ret
whip_hit: cmp bx, -1
je exit_wh
call hurt_detect
exit_wh: ret
turn_kick: mov ax, map_x
mov test_map_x, ax
mov ax, map_y
add ax, y_vel
mov test_map_y, ax
mov al, height
sub al, byte ptr y_vel
mov test_height, al
call get_surface
cmp byte ptr reduced_attr, walkable
jne tk_tk
xor byte ptr direction, left+right ; reverse direction
jmp jump_land
tk_tk: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, test_height
mov height, al
inc y_vel
mov bx, frame_no
test byte ptr [bx+6], 1
jnz tk_hit
ret
tk_hit: cmp bx, -1
je exit_tkh
call nocdown_detect
exit_tkh: ret
jump:
jump_kick: mov ax, y_vel
and ax, ax
jz j_y_vel_zero
jl j_y_vel_neg
j_y_vel_pos: mov dx, 1
jmp j_normalized
j_y_vel_neg: mov dx, -1
neg ax
jmp j_normalized
j_y_vel_zero: xor dx, dx
j_normalized: mov cx, ax
mov ax, map_x
add ax, x_vel
mov test_map_x, ax
mov ax, map_y
mov test_map_y, ax
mov al, height
mov test_height, al
j_tracking: add test_map_y, dx
sub test_height, dl
push dx
call get_surface
pop dx
cmp byte ptr reduced_attr, fallable
je j_cont_tracking
cmp byte ptr reduced_attr, background
je jump_bounce
cmp byte ptr reduced_attr, outside_map
je jump_die
cmp dx, 0
jge jump_land
jmp j_cont_tracking
jump_bounce: mov ax, test_map_x
sub ax, x_vel
mov test_map_x, ax
;mov x_vel, 0 ; ye hah ! that'l fix it.
j_cont_tracking:jcxz jump_jump
loop j_tracking
jump_jump: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, test_height
mov height, al
inc y_vel
cmp action, jump_kicking
je jk_test
ret
jk_test: mov bx, frame_no
test byte ptr [bx+6], 1
jnz jk_hit
ret
jk_hit: cmp bx, -1
je exit_jkh
call nocdown_detect
exit_jkh: ret
jump_die: mov action, being_dead
ret
jump_land: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, level
mov height, al
mov action, standing
mov frame_no, -1
mov x_vel, 0
mov y_vel, 0
call hit_snd
ret
fall: mov ax, y_vel
and ax, ax
jz f_y_vel_zero
f_y_vel_pos: mov dx, 1
jmp f_normalized
f_y_vel_zero: xor dx, dx
f_normalized: mov cx, ax
mov ax, map_x
add ax, x_vel
mov test_map_x, ax
mov ax, map_y
mov test_map_y, ax
mov al, height
mov test_height, al
f_tracking: add test_map_y, dx
sub test_height, dl
push dx
call get_surface
pop dx
cmp byte ptr reduced_attr, fallable
je f_cont_tracking
cmp byte ptr reduced_attr, outside_map
je fall_die
cmp byte ptr reduced_attr, background
jne fall_land
fall_bounce: neg x_vel
f_cont_tracking:jcxz fall_fall
loop f_tracking
fall_fall: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, test_height
mov height, al
inc y_vel
ret
fall_die: mov action, being_dead
ret
fall_land: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, test_height
mov height, al
call hit_snd
cmp byte ptr y_vel, too_high
jge fall_crunch
mov action, getting_up
mov frame_no, -1
ret
fall_crunch: mov action, lying
mov frame_no, -1
xor byte ptr direction, left+right
call thud_snd
ret
collapse: call drop_own_weapon
cmp frame_no, offset colaps_r_0
je colsnd
cmp frame_no, offset colaps_l_0
je colsnd
ret
colsnd: jmp colaps_snd
fly_back:
fly_side:
be_thrown: mov ax, y_vel
and ax, ax
jz fb_y_vel_zero
jl fb_y_vel_neg
fb_y_vel_pos: mov dx, 1
jmp fb_normalized
fb_y_vel_neg: mov dx, -1
neg ax
jmp fb_normalized
fb_y_vel_zero: xor dx, dx
fb_normalized: mov cx, ax
mov ax, map_x
add ax, x_vel
mov test_map_x, ax
mov ax, map_y
mov test_map_y, ax
mov al, height
mov test_height, al
fb_tracking: add test_map_y, dx
sub test_height, dl
push dx
call get_surface
pop dx
cmp byte ptr reduced_attr, fallable
je fb_cont_trcking
cmp byte ptr reduced_attr, background
je fb_bounce
cmp byte ptr reduced_attr, outside_map
je fb_die
and dx, dx
jge fb_land
jmp fb_cont_trcking
fb_bounce: neg x_vel
fb_cont_trcking:jcxz fb_fb
loop fb_tracking
fb_fb: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, test_height
mov height, al
inc y_vel
ret
fb_die: mov action, being_dead
ret
fb_land: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, test_height
mov height, al
mov action, lying
mov frame_no, -1
call thud_snd
ret
climb: mov ax, map_x
add ax, x_vel
mov test_map_x, ax
mov ax, map_y
add ax, y_vel
mov test_map_y, ax
mov al, height
sub al, byte ptr y_vel;subtract from height to go up?
mov test_height, al
call get_surface
cmp byte ptr reduced_attr, climbable
je climb_climb
cmp byte ptr reduced_attr, walkable
je climb_walk
;CMP byte ptr reduced_attr,fallable
;je climb_walk
no_climb: ret
climb_climb: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, test_height
mov height, al
ret
climb_walk: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, level
mov height, al
mov action, walking
mov frame_no, -1
ret
hold_up: mov ax, map_x
add ax, x_vel
mov test_map_x, ax
mov ax, map_y
add ax, y_vel
mov test_map_y, ax
mov al, height
mov test_height, al
call get_surface
cmp byte ptr reduced_attr, walkable
je hu_hu
cmp byte ptr reduced_attr, fallable
je hu_fall
no_hu: ret
hu_hu: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov al, level
mov height, al
ret
hu_fall: mov ax, test_map_x
mov map_x, ax
mov ax, test_map_y
mov map_y, ax
mov action, falling
mov frame_no, -1
call drop_own_weapon
ret
null_action: ; ******** mov x_vel, 0
; ******** mov y_vel, 0
ret
above_map: mov byte ptr reduced_attr, fallable
pop cx
ret
off_map: mov byte ptr reduced_attr, background ;outside_map
pop cx ; hmm cant see it making any difference ?
ret ; or am I going to just screw up the holes
off_rite: ; it appears this causes whole
pop cx
mov byte ptr reduced_attr,background ; make things stop.
; or bounce etc
ret
off_map_frgs:
; try to fix the bug is it this ?
mov cx,map_bottom
add cx,12 ;far off the bottom ?
cmp ax,cx
jg off_bot
mov byte ptr reduced_attr, background ;outside_map
pop cx ; hmm cant see it making any difference ?
ret ; or am I going to just screw up the holes
off_bot:
mov byte ptr reduced_attr,outside_map
pop cx
ret
get_surface:
push cx
mov bx,seg chr_map
mov ds,bx ;shouldnt be nesc but you never know ?
mov bx, test_map_x
cmp bx, 0
jl off_map
cmp bx, map_right
jg off_rite
shr bx,1
and bl,0feh ; div 4 indexed to words
mov ax,test_map_y
cmp ax,0
jl above_map
cmp ax,map_bottom
jg off_map_frgs
shr ax,1
shr ax,1 ;/4
push dx ; if necessary to save
mul map_width ;does mul do a trap ?
pop dx
add bx,ax
mov ah,[bx+offset chr_map] ;attr from char_map NO+4 as already taken care of
; pushall
; cmp si,offset person_table ;hmm
; jne no_pr
; mov ax,bx ;print the offset into map!
; mov dx,16*256
; mov cx,4
;;call pnum ; reduced attr
;no_pr:
; popall
and ah,07eh ;mask out rest of data.
shr bx,1 ;next is byte map
mov al,[bx+offset hat_map] ;the height map
; reduce attribute & update level ( hmm hat-map ?? dmm shite )
; this following stuff is from garys code
mov cx,test_map_x
and cx,3 ; only want 0-3
mov dx,test_map_y
and dx,3 ;0-3
shl dx,1
shl dx,1
; to get correct table = bx+attr*32 ( ah = attr*2)
mov bl,ah
xor bh,bh
shl bx,1
shl bx,1
shl bx,1
shl bx,1 ;=attr*32
add bx,offset attr_tabs ;attributes/+16 height modifiers
add bx,cx ;x
add bx,dx ;y*4
; bx points to attr
mov svd,ah ;before the doings
mov svd2,al
mov ah,[bx]
mov cl,[bx+16]
;shr cl,1 ;I think these are halves anyway ?
add al,cl ;add to height the height modifier
mov bx,offset cvert_attr
xchg al,ah
xlat ;convert to mikes reduced attributes
xchg al,ah ; one must hope mike DOES NOT USE
; non-reduced attributes in any code !
cmp si,offset person_table ;hmm
jne not_pl1
pushall
;mov al,ah
;xor ah,ah
;mov dx,25*256
;mov cx,3
;call pnum ; reduced attr
;mov al,test_height
;xor ah,ah
;mov dx,24*256
;mov cx,3 ; test height
;call pnum
; mov al,svd
; xor ah,ah
; mov dx,32*256
; mov cx,3
; call pnum ;attribute !?
; pop ax
;xor ah,ah
;mov dx,40*256
;mov cx,3
;call pnum ;level thats been found !
;mov ax,test_map_x
;mov cx,3 ;3 digits i believe
;mov dx,256*48
;call pnum
;mov ax,test_map_y
;mov cx,3 ;3 digits i believe
;mov dx,256*56
;call pnum
;mov al,svd2
;xor ah,ah
;mov cx,3 ;3 digits i believe
;mov dx,256*58
;call pnum
popall
not_pl1:
cmp byte ptr mission,3 ;level 3?
jne not_ze_frg
cmp word ptr test_map_x,288
jl not_ze_frg
cmp word ptr test_map_y,48
jg not_ze_frg
cmp word ptr test_map_x,322
jg not_ze_frg
mov byte ptr reduced_attr,background
mov byte ptr attribute,2 ;wall ?
mov level,90 ;a nice high height to make sure ?
pop cx
ret
not_ze_frg:
;border 13 ;must be this !
; cmp.w d2,d5
; bcs .higher ;fallable
; cmp al,240
; ja hole ; that would be -ve on 2s complement.
; or al,al ; but have to be silly as there are some high heights
; jz hole
mov byte ptr attribute,ah ;must put attrr sommeshere!
cmp al,0
jle hole ;COULD CAUSE BUG OF HEIGHTS > 127
cmp al,test_height
jc fallx
;cmp ah,background
;jne nnnn
mov level,al ;nah surely not !
;nnnn:
;jne errr
mov byte ptr reduced_attr,ah
pop cx
ret
hole: pop cx
mov ah,outside_map
mov byte ptr reduced_attr,ah
ret
errr: mov ah,background
mov byte ptr reduced_attr,ah
pop cx
ret
fallx:
;mov al,test_height ;is it to fix like this
cmp ah,outside_map
je exitt
mov ah,fallable
exitt: mov al,test_height
mov level,al ;i think but it seems daft
mov byte ptr reduced_attr,ah
;mov level,al
pop cx
ret
; move.b (a2),d7 ;attribute
; moveq.l #0,d6
; move.b (a3),d6 ;height modifier
; add.w d6,d5
; ;beq .zero_height
; cmp.w d2,d5
; bcs .higher ;fallable
; bne .error
;.;exit movem.l (sp)+,d0-d6/a0-a6
; rts
;.zero_height
; moveq.l #5,d7 ;Enter Dead bastard sequence
; bra .exit
;.error moveq.l #2,d7
; bra .exit
; ;not.w $ff8240
; ;bra .error
;.higher
; cmp.b #5,d7
; beq.s .exit
;.fallable
; moveq.l #1,d7
; bra .exit
;attr_table: dw offset reduce_walk
; dw offset reduce_br_diag
; dw offset reduce_tl_diag
; dw offset reduce_tr_diag
; dw offset reduce_bl_diag
; dw offset reduce_bkgd
; dw offset reduce_l_vert
; dw offset reduce_r_vert
; dw offset reduce_door
; dw offset reduce_ladder
; dw offset reduce_mesh
; dw offset reduce_falloff
; dw offset reduce_fall_in
; dw offset reduce_special
;
;reduce_walk:
;reduce_special:
; mov reduced_attr, walkable
; ret
;
;reduce_br_diag: mov dl, byte ptr test_map_x
; mov dh, byte ptr test_map_y
; not dl
; and dx, 0303h
; cmp dl, dh
; jle reduce_walk
; jmp reduce_l_vert
;
;reduce_tl_diag: mov dl, byte ptr test_map_x
; mov dh, byte ptr test_map_y
; not dl
; and dx, 0303h
; cmp dl, dh
; jge reduce_walk
; jmp reduce_falloff
;
;reduce_tr_diag: mov dl, byte ptr test_map_x
; mov dh, byte ptr test_map_y
; and dx, 0303h
; cmp dl, dh
; jge reduce_walk
; jmp reduce_falloff
;
;reduce_bl_diag: mov dl, byte ptr test_map_x
; mov dh, byte ptr test_map_y
; and dx, 0303h
; cmp dl, dh
; jle reduce_walk
; jmp reduce_r_vert
;
;reduce_falloff:
;reduce_fall_in:
; mov reduced_attr, fallable
; ret
;
;reduce_bkgd:
;reduce_door:
; mov dh, byte ptr test_map_y
; not dh
; and dh, 3
; add al, dh
; mov level, al
; cmp al, test_height
; jl reduce_falloff
; mov reduced_attr, background
; ret
;
;reduce_l_vert: mov dl, byte ptr test_map_x
; mov dh, byte ptr test_map_y
; not dh
; and dx, 0303h
; sub dh, dl
; add al, dh
; mov level, al
; cmp al, test_height
; jl reduce_falloff
; mov reduced_attr, background
; ret
;
;reduce_r_vert: mov dl, byte ptr test_map_x
; mov dh, byte ptr test_map_y
; and dx, 0303h
; sub dl, dh
; add al, dl
; mov level, al
; cmp al, test_height
; jl reduce_falloff
; mov reduced_attr, background
; ret
;
;reduce_ladder:
;reduce_mesh:
; mov dh, byte ptr test_map_y
; not dh
; and dh, 3
; add al, dh
; mov level, al
; cmp al, test_height
; jl reduce_falloff
; mov reduced_attr, climbable
; ret
hurt_detect: mov si, offset person_table
next_per_hd: mov al, [si+2]
cmp al, being_dead
je no_hurt
;cmp al, weapact
;je no_hurt
mov al, [si]
cmp al, name_
je no_hurt
mov bx, [si+6]
cmp bx, -1
je no_hurt
test byte ptr [bx+6], 2
jz no_hurt
call near_y
jnc no_hurt
call near_plane
jnc no_hurt
call near_x
jnc no_hurt
call hit_kneeing
call hit_in_air
jc no_hurt
mov byte ptr [si+2], taking_punch
mov word ptr [si+6], -1
call drop_his_weapon
call score_it
mov al, 1
call hurt_em
call hit_snd
no_hurt: add si, per_list_size
cmp name_, player1
je test_all_hurt
cmp name_, player2
je test_all_hurt
cmp si, offset person_table + 2 * per_list_size
jb next_per_hd
ret
test_all_hurt: cmp si, offset person_table + 7 * per_list_size
jb next_per_hd
ret
nocdown_detect: mov si, offset person_table
next_per_nd: mov al, [si+2]
cmp al, being_dead
je no_nocdown
mov al, [si]
cmp al, nobody
je no_nocdown