Iron Crab [094 Giant Jelly]
push ebp
mov ebp,esp
sub esp,0x74
mov [ebp-0070],0x00000110 ; WALK B
mov [ebp-006C],0x00000000
mov [ebp-0068],0x00000128
mov [ebp-0064],0x00000020
mov [ebp-0060],0x00000110 ; WALK A
mov [ebp-005C],0x00000020
mov [ebp-0058],0x00000128
mov [ebp-0054],0x00000040
mov [ebp-0050],0x00000110 ; WALK C
mov [ebp-004C],0x00000040
mov [ebp-0048],0x00000128
mov [ebp-0044],0x00000060
mov [ebp-0040],0x00000110 ; WALK A
mov [ebp-003C],0x00000020
mov [ebp-0038],0x00000128
mov [ebp-0034],0x00000040
mov [ebp-0030],0x00000128 ; FIRE A
mov [ebp-002C],0x00000020
mov [ebp-0028],0x00000140
mov [ebp-0024],0x00000040
mov [ebp-0020],0x00000128 ; FIRE B
mov [ebp-001C],0x00000040
mov [ebp-0018],0x00000140
mov [ebp-0014],0x00000060
mov [ebp-0010],0x00000128 ; SPAWN WORM
mov [ebp-000C],0x00000000
mov [ebp-0008],0x00000140
mov [ebp-0004],0x00000020
mov edx,[ebp+0008] ; We'll keep ebp+08 in edx as much as possible.
mov ecx,[edx+0078] ; Increment the script timer. It'll be in ecx for now.
add ecx,0x01
mov [edx+0078],ecx
mov eax,[edx+0074] ; Jump based on the state.
jmp [eax*4+X]
0 cmp ecx,0x64 ; --- State 0
jl A
mov [edx+0074],0x00000003
xor ecx,ecx
mov [edx+0078],ecx
A mov eax,[edx+0064] ; Increment the frame counter.
add eax,0x01
mov [edx+0064],eax
cmp eax,0x10
jl E
mov eax,[0049E658] ; Move towards player.
mov ecx,[edx+000C]
cmp eax,ecx
jle B
mov ecx,0x00000C01
nop
jmp C
B mov ecx,0xFFFFF000
nop
C mov [edx+0014],ecx
xor eax,eax
mov [edx+0064],eax
mov eax,[edx+0068] ; Increment the frame ID.
add eax,0x01
cmp eax,0x04
jl D
xor eax,eax
D mov [edx+0068],eax
E mov eax,[0049E658] ; Is it aligned with the player?
mov ecx,[edx+000C]
sub eax,ecx
cmp eax,0x00000800
jg I
cmp eax,0xFFFFF800
jg F
jmp I
F mov [edx+0074],0x00000001 ; --- State 1.a
xor ecx,ecx
mov [edx+0078],ecx
1 cmp ecx,0x14 ; --- State 1.b
jg J
jl G
mov eax,[0049E658] ; Are we still aligned with the player?
mov ecx,[edx+000C]
sub eax,ecx
cmp eax,0x00001000
jg J
cmp eax,0xFFFFF000
jg K
G mov eax,[edx+0068] ; Nope. So update the frame.
mov ecx,0x00000004
cmp eax,0x05
je H
inc ecx
H mov [edx+0068],ecx
I jmp L
nop
nop
nop
nop
nop
J xor eax,eax ; Set the state back to 0.
mov [edx+0074],eax
jmp L
K mov [edx+0074],0x00000002 ; --- State 2.a
xor ecx,ecx
mov [edx+0078],ecx
2 push 0x01 ; --- State 2.b
push 0x10
call 0040F350
add esp,0x08
mov edx,[ebp+0008]
shl eax,0x06
sub eax,0x00000580 ; eax = -580 to 580
push 0x00000100
push 0x00
push 0x00
push eax
push 0xFFFFF600
mov eax,[edx+000C]
push eax
mov eax,[edx+0008]
push eax
push 0x0B
call 0046EFD0 ; spawn fireball
add esp,0x20
push 0x01
push 0x38
call 00420640 ; play sound
add esp,0x08
mov edx,[ebp+0008]
mov ecx,[edx+0078] ; check timer
cmp ecx,0x10
jle M ; exit
mov [edx+0074],0x00000000 ; set state to 0
xor eax,eax
mov [edx+0078],eax ; set timer to 0
L jmp M ; exit
3 mov [edx+0074],0x00000004 ; --- State 3
push 0x00000100
push 0x00
push 0x00
push 0x00
push 0x00
mov eax,[edx+000C]
push eax
mov eax,[edx+0008]
push eax
push 0x000000EB
call 0046EFD0 ; spawn worm
add esp,0x20
push 0x01
push 0x17
call 00420640 ; play sound
add esp,0x08
mov edx,[ebp+0008]
mov [edx+0068],0x00000006
4 mov ecx,[edx+0078] ; --- State 4 ; check timer
cmp ecx,0x18
jle M ; exit
mov [edx+0074],0x00000000 ; set state to 0
xor eax,eax
mov [edx+0078],eax ; set timer to 0
M mov eax,[edx+000C] ; --- exit - Render
mov ecx,[edx+0014]
add eax,ecx
mov [edx+000C],eax
mov ecx,[edx+0068]
shl ecx,0x04
lea eax,[ebp+ecx-70]
add edx,0x54
mov ecx,[eax]
mov [edx],ecx
mov ecx,[eax+0004]
mov [edx+0004],ecx
mov ecx,[eax+0008]
mov [edx+0008],ecx
mov ecx,[eax+000C]
mov [edx+000C],ecx
mov esp,ebp
pop ebp
ret
X --- 0
--- 1
--- 2
--- 3
--- 4
43A220 55 8B EC 83 EC 74 C7 45 90 10 01 00 00 C7 45 94
43A230 00 00 00 00 C7 45 98 28 01 00 00 C7 45 9C 20 00
43A240 00 00 C7 45 A0 10 01 00 00 C7 45 A4 20 00 00 00
43A250 C7 45 A8 28 01 00 00 C7 45 AC 40 00 00 00 C7 45
43A260 B0 10 01 00 00 C7 45 B4 40 00 00 00 C7 45 B8 28
43A270 01 00 00 C7 45 BC 60 00 00 00 C7 45 C0 10 01 00
43A280 00 C7 45 C4 20 00 00 00 C7 45 C8 28 01 00 00 C7
43A290 45 CC 40 00 00 00 C7 45 D0 28 01 00 00 C7 45 D4
43A2A0 20 00 00 00 C7 45 D8 40 01 00 00 C7 45 DC 40 00
43A2B0 00 00 C7 45 E0 28 01 00 00 C7 45 E4 40 00 00 00
43A2C0 C7 45 E8 40 01 00 00 C7 45 EC 60 00 00 00 C7 45
43A2D0 F0 28 01 00 00 C7 45 F4 00 00 00 00 C7 45 F8 40
43A2E0 01 00 00 C7 45 FC 20 00 00 00 8B 55 08 8B 4A 78
43A2F0 83 C1 01 89 4A 78 8B 42 74 FF 24 85 A6 A4 43 00
43A300 83 F9 64 7C 0C C7 42 74 03 00 00 00 31 C9 89 4A
43A310 78 8B 42 64 83 C0 01 89 42 64 83 F8 10 7C 33 8B
43A320 05 58 E6 49 00 8B 4A 0C 39 C8 7E 08 B9 01 0C 00
43A330 00 90 EB 06 B9 00 F0 FF FF 90 89 4A 14 31 C0 89
43A340 42 64 8B 42 68 83 C0 01 83 F8 04 7C 02 31 C0 89
43A350 42 68 8B 05 58 E6 49 00 8B 4A 0C 29 C8 3D 00 08
43A360 00 00 7F 46 3D 00 F8 FF FF 7F 02 EB 3D C7 42 74
43A370 01 00 00 00 31 C9 89 4A 78 83 F9 14 7F 33 7C 19
43A380 8B 05 58 E6 49 00 8B 4A 0C 29 C8 3D 00 10 00 00
43A390 7F 1F 3D 00 F0 FF FF 7F 1F 8B 42 68 B9 04 00 00
43A3A0 00 83 F8 05 74 01 41 89 4A 68 EB 73 90 90 90 90
43A3B0 90 31 C0 89 42 74 EB 67 C7 42 74 02 00 00 00 31
43A3C0 C9 89 4A 78 6A 01 6A 10 E8 83 4F FD FF 83 C4 08
43A3D0 8B 55 08 C1 E0 06 2D 80 05 00 00 68 00 01 00 00
43A3E0 6A 00 6A 00 50 68 00 F6 FF FF 8B 42 0C 50 8B 42
43A3F0 08 50 6A 0B E8 D7 4B 03 00 83 C4 20 6A 01 6A 38
43A400 E8 3B 62 FE FF 83 C4 08 8B 55 08 8B 4A 78 83 F9
43A410 10 7E 61 C7 42 74 00 00 00 00 31 C0 89 42 78 EB
43A420 53 C7 42 74 04 00 00 00 68 00 01 00 00 6A 00 6A
43A430 00 6A 00 6A 00 8B 42 0C 50 8B 42 08 50 68 EB 00
43A440 00 00 E8 89 4B 03 00 83 C4 20 6A 01 6A 17 E8 ED
43A450 61 FE FF 83 C4 08 8B 55 08 C7 42 68 06 00 00 00
43A460 8B 4A 78 83 F9 18 7E 0C C7 42 74 00 00 00 00 31
43A470 C0 89 42 78 8B 42 0C 8B 4A 14 01 C8 89 42 0C 8B
43A480 4A 68 C1 E1 04 8D 44 0D 90 83 C2 54 8B 08 89 11
43A490 8B 48 04 89 4A 04 8B 48 08 89 4A 08 8B 48 0C 89
43A4A0 4A 0C 89 EC 5D C3 00 A3 43 00 79 A3 43 00 C4 A3
43A4B0 43 00 21 A4 43 00 60 A4 43 00