-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc_42E100_attack_process.rb
More file actions
3825 lines (3591 loc) · 127 KB
/
func_42E100_attack_process.rb
File metadata and controls
3825 lines (3591 loc) · 127 KB
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
# 0x0042E100
def func_42E100_attack_process(global, attacker_id)
# push ebp
# mov ebp,esp
# and esp,FFFFFFF8
# sub esp,6C
# push ebx
# mov ebx,dword ptr ss:[ebp+8]
# push esi
# mov esi,ecx
# mov eax,dword ptr ds:[esi+ebx*4+194]
# mov ecx,dword ptr ds:[eax+7C]
# mov edx,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# lea ecx,dword ptr ds:[ecx+edx+7A4]
attacker = global->objects[attacker_id]
frame_id = attacker->frame_id
file = attacker->file
frame = &file->frames[frame_id]
# xor edx,edx
attack_id = 0
# cmp dword ptr ds:[eax+2E4],edx
# push edi
# mov dword ptr ss:[esp+20],ecx
# mov dword ptr ss:[esp+24],edx
@attacker_frame = frame
@attack_id = attack_id
# jle 00431ABB
# the condition of the loop below
# fldz
$fpu_st0 = 0
# 00431A9B
# mov edx,dword ptr ss:[esp+24]
# mov eax,dword ptr ds:[esi+ebx*4+194]
# add edx,1
# cmp edx,dword ptr ds:[eax+2E4]
# mov dword ptr ss:[esp+24],edx
# jl 0042E146
# attack loop
for (; @attack_id < attacker->succuessful_attacks; @attack_id++)
# 0042E146
# mov eax,dword ptr ds:[esi+ebx*4+194]
attacker = global->objects[attacker_id]
# mov edi,dword ptr ss:[esp+20]
attacker_frame = @attacker_frame
# movsx ecx,byte ptr ds:[eax+edx+2D0]
itr_id = attacker->itr_of_attack[attack_id]
# mov edi,dword ptr ds:[edi+128]
itrs_size = attacker_frame->itrs_size
# sub edi,1
itrs_size -= 1
# mov dword ptr ss:[esp+1C],ecx
@itr_id = itr_id
# cmp ecx,edi
# jg 00431AB9
if itr_id > itrs_size
break
end
# mov edi,dword ptr ds:[eax+edx*4+280]
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov edx,dword ptr ds:[eax+7C]
# mov ecx,dword ptr ds:[eax+368]
# imul edx,edx,178
# cmp byte ptr ds:[eax+ebx+F0],0
# lea edx,dword ptr ds:[edx+ecx+7A4]
# mov dword ptr ss:[esp+18],edx
# jg 00431A9B
injured_id = attacker->injured_of_attack[attack_id]
injured = global->objects[injured_id]
frame_id = injured->frame_id
file = injured->file
@injured_frame = &file->frames[frame_id]
# injured's vrest <= 0
if injured->vrest_of_objects[attacker_id] > 0
next
end
# mov eax,dword ptr ds:[esi+ebx*4+194]
# cmp byte ptr ds:[eax+EB],0
# je short 0042E1CE
attacker = global->objects[attacker_id]
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov ecx,dword ptr ds:[eax+368]
# cmp dword ptr ds:[ecx+6F8],0
# je 00431AB9
injured = global->objects[injured_id]
file = injured->file
# injured is a weapon, attack, criminal or drink
if attacker->_unknownEB == 0 or not file->type == character_type
break
end
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov edx,dword ptr ds:[eax+7C]
# mov eax,dword ptr ds:[eax+368]
# imul edx,edx,178
# cmp dword ptr ds:[edx+eax+82C],2
# jnz short 0042E234
injured = global->objects[injured_id]
frame_id = injured->frame_id
file = injured->file
cpoint_kind = file->frames[frame_id].cpoint_kind
# mov ecx,dword ptr ds:[esi+edi*4+194]
# mov edx,dword ptr ds:[ecx+90]
# mov eax,dword ptr ds:[esi+edx*4+194]
# cmp dword ptr ds:[eax+8C],edi
# jnz short 0042E234
injured = global->objects[injured_id]
cpoint_timer_id = injured->cpoint_timer
cpoint_timer = global->objects[cpoint_timer_id]
cpoint_catcher_id = cpoint_timer->cpoint_catcher
# mov edx,dword ptr ds:[ecx+90]
# mov eax,dword ptr ds:[esi+edx*4+194]
# mov ecx,dword ptr ds:[eax+7C]
# mov edx,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# cmp dword ptr ds:[ecx+edx+858],0
# je 00431A9B
cpoint_timer_id = injured->cpoint_timer
cpoint_timer = global->objects[cpoint_timer_id]
frame_id = cpoint_timer->frame_id
file = cpoint_timer->file
hurtable = file->frames[frame_id].hurtable
# injured is caught, but is not hurtable
if (cpoint_kind == caught_kind and
cpoint_catcher_id == injured_id and
hurtable == false)
next
end
# mov edx,dword ptr ss:[esp+1C]
# mov eax,dword ptr ss:[esp+20]
# lea edx,dword ptr ds:[edx+edx*4]
# shl edx,4
# add edx,dword ptr ds:[eax+130]
# cmp dword ptr ds:[edx],0
# mov dword ptr ss:[esp+C],edx
# jnz short 0042E29F
itr_id = @itr_id
attacker_frame = @attacker_frame
itr = &attacker_frame->itrs[itr_id]
kind = itr->kind
@itr = itr
# cmp dword ptr ds:[edx+2C],15
# jnz short 0042E29F
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov ecx,dword ptr ds:[eax+70]
# mov eax,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# cmp dword ptr ds:[ecx+eax+7AC],12
# je 00431AB9
injured = global->objects[injured_id]
frame_id = injured->frame_id
file = injured->file
state = file->frames[frame_id].state
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov ecx,dword ptr ds:[eax+70]
# mov eax,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# cmp dword ptr ds:[ecx+eax+7AC],13
# je 00431AB9
injured = global->objects[injured_id]
frame_id = injured->frame_id
file = injured->file
state = file->frames[frame_id].state
# injured is burning
if (kind == itr_normal_attack and
itr->effect == flame_effect and
(state == fire_state or
state == burn_run_state))
break
end
# 0042E29F
# cmp dword ptr ds:[edx],5
# jnz 0042E37E
# mov eax,dword ptr ds:[esi+ebx*4+194]
# cmp dword ptr ds:[eax+98],0
# jge 0042E37E
attacker = global->objects[attacker_id]
# mov eax,dword ptr ds:[eax+A0]
# mov ecx,dword ptr ds:[esi+eax*4+194]
# cmp dword ptr ds:[ecx+9C],ebx
# mov dword ptr ss:[esp+1C],eax
# jnz 0042E37E
holder_id = attacker->holder_id
holder = global->objects[holder_id]
@holder_id = holder_id
# attacker is a weapon being held
if (itr->kind == itr_strength_list and
attacker->weapon_type < 0 and
holder->weapon_id == attacker_id)
# mov eax,ecx
# mov ecx,dword ptr ds:[eax+7C]
# mov eax,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# mov ecx,dword ptr ds:[ecx+eax+88C]
# test ecx,ecx
# jle 0042E411
frame_id = holder->frame_id
file = holder->file
attaking = file->frames[frame_id].attaking
# cmp dword ptr ss:[esp+1C],edi
# je 0042E411
# attack is valid
if attaking > 0 and not @holder_id == injured_id
# mov eax,dword ptr ds:[edx]
# mov dword ptr ss:[esp+28],eax
# mov eax,dword ptr ds:[edx+4]
# mov dword ptr ss:[esp+2C],eax
# mov eax,dword ptr ds:[edx+8]
# mov dword ptr ss:[esp+30],eax
# mov eax,dword ptr ds:[edx+C]
# mov edx,dword ptr ds:[edx+10]
# mov dword ptr ss:[esp+38],edx
@kind = itr->kind
@x = itr->x
@y = itr->y
w = itr->w
@h = itr->h
# lea edx,dword ptr ds:[ecx+ecx*4]
# mov ecx,dword ptr ds:[esi+ebx*4+194]
# mov ecx,dword ptr ds:[ecx+368]
# shl edx,4
# mov dword ptr ss:[esp+34],eax
# mov eax,5
# lea ecx,dword ptr ds:[ecx+edx+C8]
attacker = global->objects[attacker_id]
file = attacker->file
@w = w
times = 5
attacking_itr = &file->attaking_itrs[attaking]
begin
# mov edx,dword ptr ds:[ecx-4]
# mov dword ptr ss:[esp+eax*4+28],edx
# mov edx,dword ptr ds:[ecx]
# mov dword ptr ss:[esp+eax*4+2C],edx
# mov edx,dword ptr ds:[ecx+4]
# mov dword ptr ss:[esp+eax*4+30],edx
# mov edx,dword ptr ds:[ecx+8]
# mov dword ptr ss:[esp+eax*4+34],edx
# mov edx,dword ptr ds:[ecx+C]
# mov dword ptr ss:[esp+eax*4+38],edx
# add eax,5
# add ecx,14
# cmp eax,14
# jl short 0042E344
@remaining_attrs[times - 5] = *(attacking_itr - 4)
@remaining_attrs[times - 5 + 1] = *(attacking_itr)
@remaining_attrs[times - 5 + 2] = *(attacking_itr + 4)
@remaining_attrs[times - 5 + 3] = *(attacking_itr + 8)
@remaining_attrs[times - 5 + 4] = *(attacking_itr + 12)
attacking_itr += 20
times += 5
end while times < 20
# mov dword ptr ss:[esp+28],0
# jmp 0042E409
@kind = 0
# 0042E409
# lea edx,dword ptr ss:[esp+28]
# mov dword ptr ss:[esp+C],edx
itr = &@kind
@itr = itr
end
else
# mov eax,dword ptr ds:[edx]
# mov ecx,dword ptr ds:[edx+4]
# mov dword ptr ss:[esp+28],eax
# mov eax,dword ptr ds:[edx+8]
# mov dword ptr ss:[esp+2C],ecx
# mov ecx,dword ptr ds:[edx+C]
# mov dword ptr ss:[esp+30],eax
# mov eax,dword ptr ds:[edx+10]
# mov dword ptr ss:[esp+34],ecx
# mov ecx,dword ptr ds:[edx+14]
# mov dword ptr ss:[esp+38],eax
# mov eax,dword ptr ds:[edx+18]
# mov dword ptr ss:[esp+3C],ecx
# mov ecx,dword ptr ds:[edx+1C]
# mov dword ptr ss:[esp+40],eax
# mov eax,dword ptr ds:[edx+20]
# mov dword ptr ss:[esp+44],ecx
# mov ecx,dword ptr ds:[edx+24]
# mov dword ptr ss:[esp+48],eax
# mov eax,dword ptr ds:[edx+28]
# mov dword ptr ss:[esp+4C],ecx
# mov ecx,dword ptr ds:[edx+2C]
# mov dword ptr ss:[esp+50],eax
# mov eax,dword ptr ds:[edx+30]
# mov dword ptr ss:[esp+54],ecx
# mov ecx,dword ptr ds:[edx+34]
# mov dword ptr ss:[esp+58],eax
# mov eax,dword ptr ds:[edx+38]
# mov dword ptr ss:[esp+5C],ecx
# mov ecx,dword ptr ds:[edx+3C]
# mov dword ptr ss:[esp+60],eax
# mov eax,dword ptr ds:[edx+40]
# mov dword ptr ss:[esp+64],ecx
# mov ecx,dword ptr ds:[edx+44]
# mov dword ptr ss:[esp+68],eax
# mov eax,dword ptr ds:[edx+48]
# mov dword ptr ss:[esp+6C],ecx
# mov ecx,dword ptr ds:[edx+4C]
# mov dword ptr ss:[esp+70],eax
# mov dword ptr ss:[esp+74],ecx
@kind = itr->kind
@x = itr->x
@y = itr->y
@w = itr->w
@h = itr->h
@dvx = itr->dvx
@dvy = itr->dvy
@fall = itr->fall
@arest = itr->arest
@vrest = itr->vrest
@respond = itr->respond
@effect = itr->effect
@catching_act_1 = itr->catching_act_1
@catching_act_2 = itr->catching_act_2
@caught_act_1 = itr->caught_act_1
@caught_act_2 = itr->caught_act_2
@bdefend = itr->bdefend
@injury = itr->injury
@zwidth = itr->zwidth
@_unknown4C = itr->_unknown4C
# 0042E409
# lea edx,dword ptr ss:[esp+28]
# mov dword ptr ss:[esp+C],edx
itr = &@kind
@itr = itr
end
# 0042E411
# mov eax,dword ptr ds:[esi+ebx*4+194]
# cmp dword ptr ds:[eax+320],0
# jle short 0042E461
attacker = global->objects[attacker_id]
# cmp dword ptr ds:[edx],4
# jnz short 0042E461
# attacker is a man being thrown away
if attacker->thrown_injury > 0 and itr->kind == itr_thrown
# mov dword ptr ds:[edx],0
# mov ecx,dword ptr ds:[esi+ebx*4+194]
# fcom qword ptr ds:[ecx+40]
# fstsw ax
# test ah,5
# jpe short 0042E446
itr->kind = itr_normal_attack
attacker = global->objects[attacker_id]
# cmp byte ptr ds:[ecx+80],1
# je short 0042E459
# adjust the direction
if (attacker->x_velocity > 0 and
attacker->facing == facing_left)
# 0042E459
# mov eax,dword ptr ds:[edx+14]
# neg eax
# mov dword ptr ds:[edx+14],eax
itr->dvx = -itr->dvx
end
# 0042E446
# fcom qword ptr ds:[ecx+40]
# fstsw ax
# test ah,41
# jnz short 0042E461
# cmp byte ptr ds:[ecx+80],0
# jnz short 0042E461
# adjust the direction
if (attacker->x_velocity < 0 and
attacker->facing == facing_right)
# 0042E459
# mov eax,dword ptr ds:[edx+14]
# neg eax
# mov dword ptr ds:[edx+14],eax
itr->dvx = -itr->dvx
end
end
# 0042E461
# mov eax,dword ptr ds:[esi+edi*4+194]
# cmp dword ptr ds:[eax+98],2
# jnz 0042E549
injured = global->objects[injured_id]
# cmp dword ptr ds:[edx],0
# jnz 0042E549
# mov ecx,dword ptr ds:[eax+9C]
# mov eax,dword ptr ds:[esi+ecx*4+194]
# cmp dword ptr ds:[eax+A0],edi
# jnz 0042E549
weapon_id = injured->weapon_id
weapon = global->objects[weapon_id]
# cmp dword ptr ds:[eax+98],-2
# jnz 0042E549
# injured is holding a heavy weapon
if (injured->weapon_type == heavy_weapon_type and
itr->kind == itr_normal_attack and
weapon->holder_id == injured and
weapon->weapon_type == - heavy_weapon_type)
# mov edx,dword ptr ds:[esi+edi*4+194]
# fstp st
# mov eax,dword ptr ds:[edx+9C]
# mov ecx,dword ptr ds:[esi+ebx*4+194]
# mov byte ptr ds:[eax+ecx+F0],2D
# mov edx,dword ptr ds:[esi+edi*4+194]
# xor eax,eax
# mov dword ptr ds:[edx+98],eax
# mov ecx,dword ptr ds:[esi+edi*4+194]
# mov edx,dword ptr ds:[ecx+9C]
# mov byte ptr ds:[edx+ecx+F0],1E
# mov ecx,dword ptr ds:[esi+edi*4+194]
# mov edx,dword ptr ds:[ecx+9C]
# mov ecx,dword ptr ds:[esi+edx*4+194]
# push 6
# push 0EC
# mov dword ptr ds:[ecx+98],eax
# call 00417170
injured = global->objects[injured_id]
weapon_id = injured->weapon_id
attacker = global->objects[attacker_id]
attacker->vrest_of_objects[weapon_id] = 45
injured = global->objects[injured_id]
injured->weapon_type = false
injured = global->objects[injured_id]
weapon_id = injured->weapon
injured->vrest_of_objects[weapon_id] = 30
injured = global->objects[injured_id]
weapon_id = injured->weapon
weapon = global->objects[weapon_id]
weapon->weapon_type = false
frames_range = 6
frame_id = func_417170_random frames_range
# fld qword ptr ds:[448910]
# mov edx,dword ptr ds:[esi+edi*4+194]
# mov ecx,dword ptr ds:[edx+9C]
# mov edx,dword ptr ds:[esi+ecx*4+194]
# mov dword ptr ds:[edx+70],eax
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov ecx,dword ptr ds:[eax+9C]
# mov edx,dword ptr ds:[esi+ecx*4+194]
# fstp qword ptr ds:[edx+48]
# mov edx,dword ptr ss:[esp+14]
# fldz
# add esp,8
injured = global->objects[injured_id]
weapon_id = injured->weapon_id
weapon = global->objects[weapon_id]
injured->frame_id = frame_id
injured = global->objects[injured_id]
weapon_id = injured->weapon
weapon = global->objects[weapon_id]
weapon->y_velocity = -1.0
itr = @itr
end
# 0042E549
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov ecx,dword ptr ds:[eax+368]
# cmp dword ptr ds:[ecx+6F8],2
# jnz short 0042E57B
injured = global->objects[injured_id]
file = injured->file
# injured is a heavy weapon
if file->type == heavy_weapon_type
# mov ecx,dword ptr ss:[esp+C]
# mov eax,dword ptr ds:[ecx+14]
# cdq
# sub eax,edx
# sar eax,1
# mov dword ptr ds:[ecx+14],eax
# mov eax,dword ptr ds:[ecx+18]
# cdq
# sub eax,edx
# sar eax,1
# mov dword ptr ds:[ecx+18],eax
# mov edx,ecx
itr = @itr
itr->dvx = itr->dvx / 2
itr->dvy = itr->dvy / 2
end
# 0042E57B
# cmp dword ptr ds:[edx],9
# mov dword ptr ss:[esp+1C],0
# jnz 0042E60E
@_? = 0
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov ecx,dword ptr ds:[eax+368]
# cmp dword ptr ds:[ecx+6F8],0
# je short 0042E5E1
injured = global->objects[injured_id]
file = injured->file
# mov ecx,dword ptr ds:[eax+70]
# mov eax,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# cmp dword ptr ds:[ecx+eax+7AC],3EA
# je short 0042E5E1
frame_id = injured->frame_id
file = injured->file
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov ecx,dword ptr ds:[eax+70]
# mov eax,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# cmp dword ptr ds:[ecx+eax+7AC],7D0
# jnz short 0042E60E
injured = global->objects[injured_id]
frame_id = injured->frame_id
file = injured->file
# attacker is a john's force field
if (itr->kind == itr_forcefield and
(file->type == character_type or
file->frames[frame_id].state == throwing_state or
file->frames[frame_id].state == in_the_sky_state_2))
# 0042E5E1
# mov dword ptr ds:[edx],0
# mov ecx,dword ptr ds:[esi+edi*4+194]
# mov eax,dword ptr ds:[ecx+368]
# cmp dword ptr ds:[eax+6F8],0
# jnz short 0042E61C
itr->kind = itr_normal_attack
injured = global->objects[injured_id]
file = injured->file
# injured is a character
if file->type == character_type
# mov ecx,dword ptr ds:[esi+ebx*4+194]
# mov dword ptr ds:[ecx+2FC],0
attacker = global->objects[attacker_id]
attacker->hp = 0
# mov edx,dword ptr ss:[esp+C]
itr = @itr
end
end
# 0042E60E
# mov edx,dword ptr ds:[edx]
# test edx,edx
# jnz 0043056E
# normal attack
if itr->kind == itr_normal_attack
# mov edx,dword ptr ss:[esp+C]
itr = @itr
# 0042E61C
# mov ecx,dword ptr ds:[edx+40]
# cmp ecx,64
# mov dword ptr ss:[esp+10],ecx
# je 0042E812
bdefend = itr->bdefend
@bdefend = bdefend
# mov eax,dword ptr ss:[esp+18]
# mov eax,dword ptr ds:[eax+8]
# cmp eax,8
# je 0042E812
# cmp eax,0B
# je 0042E812
# cmp eax,0C
# je 0042E812
# cmp eax,0D
# je 0042E812
# cmp eax,0E
# je 0042E812
# cmp eax,10
# je 0042E812
# cmp eax,12
# je 0042E812
injured_frame = @injured_frame
state = injured_frame->state
# check if knight can defend attack
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov ecx,dword ptr ds:[eax+368]
# mov ecx,dword ptr ds:[ecx+6F4]
# cmp ecx,25
# mov dword ptr ss:[esp+14],ecx
# jnz short 0042E6EC
injured = global->objects[injured_id]
file = injured->file
injured_file_id = file->id
@injured_file_id = injured_file_id
# cmp dword ptr ds:[eax+B8],0F
# jg short 0042E6EC
# mov edx,dword ptr ss:[esp+C]
# mov ecx,dword ptr ds:[edx+2C]
# mov eax,66666667
# imul ecx
# sar edx,2
# mov eax,edx
# shr eax,1F
# add eax,edx
itr = @itr
effect = itr->effect
effect_type = effect / 10
# cmp eax,2
# je short 0042E6E8
# cmp eax,3
# je short 0042E6E8
# cmp ecx,2
# je short 0042E6E8
# cmp ecx,3
# je short 0042E6E8
# mov eax,dword ptr ds:[esi+ebx*4+194]
# mov eax,dword ptr ds:[eax+368]
# mov eax,dword ptr ds:[eax+6F4]
# cmp eax,0D6
# je short 0042E6E8
attacker = global->objects[attacker_id]
file = attacker->file
attacker_file_id = file->id
# cmp eax,0D0
# jnz 0042FDF2
# check if louis can defend attack
# 0042E6E8
# mov ecx,dword ptr ss:[esp+14]
injured_file_id = @injured_file_id
# 0042E6EC
# cmp ecx,6
# jnz 0042E7CE
# mov eax,dword ptr ds:[esi+edi*4+194]
# cmp dword ptr ds:[eax+B8],1
# jg 0042E7CE
injured = global->objects[injured_id]
# mov ecx,dword ptr ss:[esp+C]
# mov ecx,dword ptr ds:[ecx+2C]
# mov eax,66666667
# imul ecx
# sar edx,2
# mov eax,edx
# shr eax,1F
# add eax,edx
itr = @itr
effect = itr->effect
effect_type = effect / 10
# cmp eax,2
# je 0042E7CE
# cmp eax,3
# je 0042E7CE
# cmp ecx,2
# je 0042E7CE
# cmp ecx,3
# je 0042E7CE
# mov eax,dword ptr ds:[esi+ebx*4+194]
# mov edx,dword ptr ds:[eax+368]
# mov eax,dword ptr ds:[edx+6F4]
attacker = global->objects[attacker_id]
file = attacker->file
attacker_file_id = file->id
# cmp eax,0D6
# je short 0042E7CE
# cmp eax,0D0
# je short 0042E7CE
# mov eax,dword ptr ds:[esi+edi*4+194]
# cmp dword ptr ds:[eax+70],14
# jl 0042FDF2
injured = global->objects[injured_id]
# mov ecx,dword ptr ds:[eax+70]
# mov edx,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# cmp dword ptr ds:[ecx+edx+7AC],5
# je 0042FDF2
frame_id = injured->frame_id
file = injured->file
# mov ecx,dword ptr ds:[eax+70]
# mov edx,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# cmp dword ptr ds:[ecx+edx+7AC],4
# je 0042FDF2
frame_id = injured->frame_id
file = injured->file
# mov ecx,dword ptr ds:[eax+70]
# mov edx,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# cmp dword ptr ds:[ecx+edx+7AC],7
# je 0042FDF2
frame_id = injured->frame_id
file = injured->file
# check if julian can defend attack
# 0042E7CE
# cmp dword ptr ss:[esp+14],34
# jnz short 0042E80A
# mov eax,dword ptr ds:[esi+edi*4+194]
# cmp dword ptr ds:[eax+B8],0F
# jg short 0042E80A
injured = global->objects[injured_id]
# mov eax,dword ptr ds:[esi+ebx*4+194]
# mov eax,dword ptr ds:[eax+368]
# mov eax,dword ptr ds:[eax+6F4]
# cmp eax,0D6
# je short 0042E80A
attacker = global->objects[attacker_id]
file = attacker->file
attacker_file_id = file->id
# cmp eax,0D0
# jnz 0042FDF2
# check if injured can defend attack
# 0042E80A
# mov edx,dword ptr ss:[esp+C]
# mov ecx,dword ptr ss:[esp+10]
itr = @itr
bdefend = @bdefend
# 0042E812
# mov eax,dword ptr ss:[esp+18]
# cmp dword ptr ds:[eax+8],7
# jnz short 0042E87D
# cmp ecx,3C
# jg short 0042E87D
injured_frame = @injured_frame
# mov eax,dword ptr ds:[esi+ebx*4+194]
# mov al,byte ptr ds:[eax+80]
# mov ecx,dword ptr ds:[esi+edi*4+194]
# cmp al,byte ptr ds:[ecx+80]
# jnz short 0042E870
attacker = global->objects[attacker_id]
attacker_facing = attacker->facing
injured = global->objects[injured_id]
# cmp dword ptr ds:[edx+14],0
# jl short 0042E870
# mov eax,dword ptr ds:[esi+ebx*4+194]
# mov edx,dword ptr ds:[eax+368]
# mov eax,dword ptr ds:[edx+6F4]
# cmp eax,7C
# je short 0042E870
# cmp eax,0DC
# je short 0042E870
# cmp eax,0DD
# je short 0042E870
attacker = global->objects[attacker_id]
file = attacker->file
attacker_file_id = file->id
# cmp eax,0DE
# jnz short 0042E87D
# 0042E870
# cmp dword ptr ds:[ecx+2FC],0
# jg 0042FDF2
# injured can be attacked when these conditions hold:
if (bdefend == 100 or
state == broken_defend_state or
state == injured_state_1 or
state == falling_state or
state == ice_state or
state == lying_state or
state == injured_state_2 or
state == fire_state or !((
# knight can defend attack when these conditions hold:
injured_file_id == knight_dat and
injured->bdefend <= 15 and
effect_type != fire_type_effect and
effect_type != freeze_type_effect and
effect != fire_effect and
effect != freeze_effect and
attacker_file_id != john_biscuit_dat and
attacker_file_id != henry_arrow2_dat
) or (
# louis can defend attack when these conditions hold:
injured_file_id == louis_dat and
injured->bdefend < 1 and
effect_type != fire_type_effect and
effect_type != freeze_type_effect and
effect != fire_effect and
effect != freeze_effect and
attacker_file_id != john_biscuit_dat and
attacker_file_id != henry_arrow2_dat and
(injured->frame_id < 20 or
file->frames[frame_id].state == dash_state or
file->frames[frame_id].state == jump_state or
file->frames[frame_id].state == defend_state)
) or (
# julian can defend attack when these conditions hold:
@injured_file_id == julian_dat and
injured->bdefend <= 15 and
attacker_file_id != john_biscuit_dat and
attacker_file_id != henry_arrow2_dat
))
) and !(
# injured can defend attack when these conditions hold:
injured_frame->state == defend_state and
bdefend <= 60 and
(
attacker_facing != injured->facing or
itr->dvx < 0 or
attacker_file_id == boomerang_dat or
attacker_file_id == jan_chase_dat or
attacker_file_id == firzen_chasef_dat or
attacker_file_id == firzen_chasei_dat
) and
injured->hp > 0)
# 0042E87D
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov dword ptr ds:[eax+B8],2D
# mov ecx,dword ptr ds:[esi+edi*4+194]
# mov edx,dword ptr ds:[ecx+368]
# cmp dword ptr ds:[edx+6F4],12C
# mov eax,ecx
# je 00431AC4
injured = global->objects[injured_id]
injured->bdefend = 45
injured = global->objects[injured_id]
file = injured->file
if file->id == criminal_dat
# 00431AC4
# mov ecx,dword ptr ds:[eax+70]
# fstp st
# mov edx,dword ptr ds:[eax+368]
# add ecx,6
# imul ecx,ecx,178
# cmp dword ptr ds:[ecx+edx],0
# jle short 00431ABB
frame_id = injured->frame_id
file = injured->file
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov ecx,dword ptr ds:[eax+70]
# mov edx,dword ptr ds:[eax+368]
# imul ecx,ecx,178
# mov eax,dword ptr ds:[ecx+edx+8D8]
# cmp dword ptr ds:[eax],3E8
# jle short 00431ABB
injured = global->objects[injured_id]
frame_id = injured->frame_id
file = injured->file
bdys = file->frames[frame_id].bdys
if (file->frames[frame_id].bdys_size <= 0 or
bdys[0].kind <= 1000)
break
end
# mov ecx,dword ptr ds:[esi+edi*4+194]
# mov dword ptr ds:[ecx+364],1
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov edx,dword ptr ds:[eax+70]
# mov ecx,dword ptr ds:[eax+368]
# imul edx,edx,178
# mov edx,dword ptr ds:[ecx+edx+8D8]
# mov ecx,dword ptr ds:[edx]
# sub ecx,3E8
# mov dword ptr ds:[eax+70],ecx
# mov edx,dword ptr ds:[esi+ebx*4+194]
# mov dword ptr ds:[edx+B4],3
# mov eax,dword ptr ds:[esi+edi*4+194]
# pop edi
# pop esi
# mov dword ptr ds:[eax+B4],-3
# pop ebx
# mov esp,ebp
# pop ebp
# retn 4
injured = global->objects[injured_id]
injured->team = 1
injured = global->objects[injured_id]
frame_id = injured->frame_id
file = injured->file
bdys = file->frames[frame_id].bdys
kind = bdys[0].kind
injured->frame_id = kind - 1000
attacker = global->objects[attacker_id]
attacker->shaking = -3
return
end
# mov ecx,dword ptr ds:[eax+368]
# mov ecx,dword ptr ds:[ecx+6F8]
# cmp ecx,6
# mov dword ptr ss:[esp+10],ecx
# je 0042E9F3
file = injured->file
type = file->type
@injured_type = type
if not type == drink_type
# mov eax,dword ptr ds:[eax+340]
# test eax,eax
# mov edx,dword ptr ss:[esp+C]
# mov ecx,dword ptr ds:[edx+44]
# mov dword ptr ss:[esp+14],eax
# jle short 0042E8E7
armor = injured->armor_multiplier
itr = @itr
injury = itr->injury
@armor = armor
# injured wears the armor
if armor > 0
# mov eax,ecx
# imul eax,eax,64
# cdq
# idiv dword ptr ss:[esp+14]
# mov ecx,eax
injury = injury * 100 / @armor
end
# 0042E8E7
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov edx,dword ptr ds:[eax+2FC]
# test edx,edx
# jle short 0042E955
injured = global->objects[injured_id]
hp = injured->hp
# cmp ecx,edx
# jl short 0042E955
# cmp dword ptr ss:[esp+10],0
# jnz short 0042E955
# attacter's kills + 1
if (hp > 0 and
injury >= hp and
@injured_type == character_type)
# cmp dword ptr ds:[eax+2F4],-1
# jnz short 0042E955
# mov eax,dword ptr ds:[esi+ebx*4+194]
# mov edx,dword ptr ds:[eax+354]
# mov eax,dword ptr ds:[esi+edx*4+194]
# mov edx,1
# add dword ptr ds:[eax+358],edx
# mov eax,dword ptr ds:[esi+edi*4+194]
# mov eax,dword ptr ds:[eax+344]
# test eax,eax
# jle short 0042E955
attacker = global->objects[attacker_id]
owner_id = attacker->owner_id
owner = global->objects[owner_id]
owner->kills += 1
injured = global->objects[injured_id]
_unknown344 = injured->_unknown344