mirror of https://github.com/zeldaret/tmc.git
Decompile remainder of Enemy4D
This commit is contained in:
parent
eed39c54b6
commit
df21aa7eb5
|
@ -1,579 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EBB4
|
|
||||||
sub_0803EBB4: @ 0x0803EBB4
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r0, #0x7c
|
|
||||||
ldrb r1, [r0]
|
|
||||||
subs r1, #0xa
|
|
||||||
strb r1, [r0]
|
|
||||||
movs r0, #1
|
|
||||||
bl sub_08049DF4
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803EBE4
|
|
||||||
ldr r0, _0803EC10 @ =gUnk_020000B0
|
|
||||||
ldr r1, [r0]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl GetFacingDirection
|
|
||||||
adds r0, #4
|
|
||||||
movs r1, #0x18
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0
|
|
||||||
bl sub_0803E94C
|
|
||||||
_0803EBE4:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803E9A4
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x80
|
|
||||||
ldrh r1, [r0]
|
|
||||||
adds r0, #2
|
|
||||||
ldrh r2, [r0]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r3, #2
|
|
||||||
bl EntityWithinDistance
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803EC14
|
|
||||||
movs r0, #4
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0x10
|
|
||||||
bl sub_0803E94C
|
|
||||||
b _0803EC24
|
|
||||||
.align 2, 0
|
|
||||||
_0803EC10: .4byte gUnk_020000B0
|
|
||||||
_0803EC14:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803EF20
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803EC24
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803EEA4
|
|
||||||
_0803EC24:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EC28
|
|
||||||
sub_0803EC28: @ 0x0803EC28
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7c
|
|
||||||
ldrb r0, [r1]
|
|
||||||
subs r0, #0x10
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803E9A4
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7e
|
|
||||||
ldrb r0, [r1]
|
|
||||||
cmp r0, #0x1c
|
|
||||||
bls _0803EC4A
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r1]
|
|
||||||
_0803EC4A:
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x78
|
|
||||||
ldrh r0, [r1]
|
|
||||||
subs r0, #1
|
|
||||||
strh r0, [r1]
|
|
||||||
lsls r0, r0, #0x10
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803EC64
|
|
||||||
movs r0, #3
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
adds r1, #3
|
|
||||||
movs r0, #0
|
|
||||||
strb r0, [r1]
|
|
||||||
_0803EC64:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EC68
|
|
||||||
sub_0803EC68: @ 0x0803EC68
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7c
|
|
||||||
ldrb r0, [r1]
|
|
||||||
subs r0, #0xa
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803E9A4
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7e
|
|
||||||
ldrb r0, [r1]
|
|
||||||
cmp r0, #0x27
|
|
||||||
bhi _0803EC8C
|
|
||||||
adds r0, #1
|
|
||||||
strb r0, [r1]
|
|
||||||
b _0803EC92
|
|
||||||
_0803EC8C:
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803EE8C
|
|
||||||
_0803EC92:
|
|
||||||
pop {r4, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EC94
|
|
||||||
sub_0803EC94: @ 0x0803EC94
|
|
||||||
push {r4, r5, r6, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7c
|
|
||||||
ldrb r0, [r1]
|
|
||||||
subs r0, #0xa
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803E9A4
|
|
||||||
adds r5, r4, #0
|
|
||||||
adds r5, #0x80
|
|
||||||
ldrh r1, [r5]
|
|
||||||
adds r6, r4, #0
|
|
||||||
adds r6, #0x82
|
|
||||||
ldrh r2, [r6]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r3, #1
|
|
||||||
bl EntityWithinDistance
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803ECD8
|
|
||||||
ldrh r0, [r5]
|
|
||||||
strh r0, [r4, #0x2e]
|
|
||||||
ldrh r0, [r6]
|
|
||||||
strh r0, [r4, #0x32]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803EE8C
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0
|
|
||||||
bl sub_0803E94C
|
|
||||||
b _0803ED02
|
|
||||||
_0803ECD8:
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x42
|
|
||||||
ldrb r0, [r0]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803ED02
|
|
||||||
movs r1, #0x2e
|
|
||||||
ldrsh r0, [r4, r1]
|
|
||||||
movs r2, #0x32
|
|
||||||
ldrsh r1, [r4, r2]
|
|
||||||
ldrh r2, [r5]
|
|
||||||
ldrh r3, [r6]
|
|
||||||
bl CalculateDirectionTo
|
|
||||||
strb r0, [r4, #0x15]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0x10
|
|
||||||
bl sub_0803E94C
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl ProcessMovement0
|
|
||||||
_0803ED02:
|
|
||||||
pop {r4, r5, r6, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_0803ED04
|
|
||||||
sub_0803ED04: @ 0x0803ED04
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r0, #0x7c
|
|
||||||
ldrb r1, [r0]
|
|
||||||
subs r1, #0xc
|
|
||||||
strb r1, [r0]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803E9A4
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7e
|
|
||||||
ldrb r0, [r1]
|
|
||||||
subs r0, #4
|
|
||||||
strb r0, [r1]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bgt _0803ED3C
|
|
||||||
movs r0, #0
|
|
||||||
strb r0, [r1]
|
|
||||||
movs r0, #6
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #0xf
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
adds r1, #0x20
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitAnimationForceUpdate
|
|
||||||
_0803ED3C:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803ED40
|
|
||||||
sub_0803ED40: @ 0x0803ED40
|
|
||||||
push {lr}
|
|
||||||
adds r2, r0, #0
|
|
||||||
ldrb r0, [r2, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r2, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803ED74
|
|
||||||
movs r0, #7
|
|
||||||
strb r0, [r2, #0xc]
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r2, #0xe]
|
|
||||||
ldr r1, _0803ED78 @ =gUnk_080D08C4
|
|
||||||
ldrb r0, [r2, #0x14]
|
|
||||||
adds r0, r0, r1
|
|
||||||
ldrb r1, [r0]
|
|
||||||
adds r0, r2, #0
|
|
||||||
adds r0, #0x7c
|
|
||||||
strb r1, [r0]
|
|
||||||
adds r1, r2, #0
|
|
||||||
adds r1, #0x7f
|
|
||||||
movs r0, #0xf6
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, #0x65
|
|
||||||
bl EnqueueSFX
|
|
||||||
_0803ED74:
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0803ED78: .4byte gUnk_080D08C4
|
|
||||||
|
|
||||||
thumb_func_start sub_0803ED7C
|
|
||||||
sub_0803ED7C: @ 0x0803ED7C
|
|
||||||
push {lr}
|
|
||||||
adds r2, r0, #0
|
|
||||||
adds r0, #0x5a
|
|
||||||
ldrb r1, [r0]
|
|
||||||
movs r0, #0x80
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803ED94
|
|
||||||
adds r0, r2, #0
|
|
||||||
bl UpdateAnimationSingleFrame
|
|
||||||
b _0803EDD0
|
|
||||||
_0803ED94:
|
|
||||||
ldrb r0, [r2, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r2, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
adds r1, r2, #0
|
|
||||||
adds r1, #0x7f
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803EDAE
|
|
||||||
movs r0, #2
|
|
||||||
strb r0, [r2, #0xe]
|
|
||||||
ldrb r0, [r1]
|
|
||||||
adds r0, #1
|
|
||||||
strb r0, [r1]
|
|
||||||
_0803EDAE:
|
|
||||||
ldrb r0, [r1]
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803EDC0
|
|
||||||
adds r1, r2, #0
|
|
||||||
adds r1, #0x7e
|
|
||||||
ldrb r0, [r1]
|
|
||||||
adds r0, #5
|
|
||||||
strb r0, [r1]
|
|
||||||
b _0803EDD0
|
|
||||||
_0803EDC0:
|
|
||||||
movs r0, #8
|
|
||||||
strb r0, [r2, #0xc]
|
|
||||||
movs r0, #0x1e
|
|
||||||
strb r0, [r2, #0xe]
|
|
||||||
movs r0, #8
|
|
||||||
movs r1, #0
|
|
||||||
bl InitScreenShake
|
|
||||||
_0803EDD0:
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EDD4
|
|
||||||
sub_0803EDD4: @ 0x0803EDD4
|
|
||||||
push {lr}
|
|
||||||
adds r1, r0, #0
|
|
||||||
ldrb r0, [r1, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r1, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803EDE8
|
|
||||||
movs r0, #9
|
|
||||||
strb r0, [r1, #0xc]
|
|
||||||
_0803EDE8:
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EDEC
|
|
||||||
sub_0803EDEC: @ 0x0803EDEC
|
|
||||||
push {lr}
|
|
||||||
adds r2, r0, #0
|
|
||||||
adds r1, r2, #0
|
|
||||||
adds r1, #0x7e
|
|
||||||
ldrb r0, [r1]
|
|
||||||
subs r0, #2
|
|
||||||
strb r0, [r1]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
lsrs r0, r0, #0x18
|
|
||||||
cmp r0, #0xa
|
|
||||||
bhi _0803EE26
|
|
||||||
movs r0, #0xa
|
|
||||||
strb r0, [r2, #0xc]
|
|
||||||
movs r0, #0x3c
|
|
||||||
strb r0, [r2, #0xe]
|
|
||||||
ldrb r0, [r2, #0x14]
|
|
||||||
lsls r0, r0, #3
|
|
||||||
strb r0, [r2, #0x15]
|
|
||||||
subs r1, #2
|
|
||||||
movs r0, #0
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r1, #3
|
|
||||||
movs r0, #0xfe
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r2, #0
|
|
||||||
movs r1, #0x10
|
|
||||||
bl sub_0803E94C
|
|
||||||
b _0803EE34
|
|
||||||
_0803EE26:
|
|
||||||
cmp r0, #0x12
|
|
||||||
bhi _0803EE34
|
|
||||||
ldr r2, [r2, #0x54]
|
|
||||||
ldrb r1, [r2, #0x10]
|
|
||||||
movs r0, #0x7f
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r2, #0x10]
|
|
||||||
_0803EE34:
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EE38
|
|
||||||
sub_0803EE38: @ 0x0803EE38
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldrb r0, [r4, #0xe]
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803EE60
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803EE88
|
|
||||||
ldr r0, [r4, #0x54]
|
|
||||||
ldrb r1, [r0, #0x10]
|
|
||||||
movs r2, #0x80
|
|
||||||
orrs r1, r2
|
|
||||||
strb r1, [r0, #0x10]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0
|
|
||||||
bl sub_0803E94C
|
|
||||||
b _0803EE88
|
|
||||||
_0803EE60:
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7c
|
|
||||||
ldrb r0, [r1]
|
|
||||||
subs r0, #0xa
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803E9A4
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7e
|
|
||||||
ldrb r0, [r1]
|
|
||||||
adds r0, #1
|
|
||||||
strb r0, [r1]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
lsrs r0, r0, #0x18
|
|
||||||
cmp r0, #0x27
|
|
||||||
bls _0803EE88
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803EE8C
|
|
||||||
_0803EE88:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EE8C
|
|
||||||
sub_0803EE8C: @ 0x0803EE8C
|
|
||||||
push {lr}
|
|
||||||
movs r1, #1
|
|
||||||
strb r1, [r0, #0xc]
|
|
||||||
adds r2, r0, #0
|
|
||||||
adds r2, #0x7a
|
|
||||||
movs r1, #0x1e
|
|
||||||
strb r1, [r2]
|
|
||||||
movs r1, #0
|
|
||||||
bl sub_0803E94C
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EEA4
|
|
||||||
sub_0803EEA4: @ 0x0803EEA4
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
movs r1, #1
|
|
||||||
bl sub_08049FDC
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803EEF8
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0x4e
|
|
||||||
bl sub_0803EF04
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803EEF8
|
|
||||||
ldr r0, _0803EEF4 @ =gUnk_020000B0
|
|
||||||
ldr r1, [r0]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r2, #0x12
|
|
||||||
bl sub_0804A044
|
|
||||||
adds r2, r0, #0
|
|
||||||
cmp r2, #0xff
|
|
||||||
beq _0803EEF8
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7a
|
|
||||||
ldrb r0, [r1]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r1]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0803EF00
|
|
||||||
movs r0, #5
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
strb r2, [r4, #0x15]
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0
|
|
||||||
bl sub_0803E94C
|
|
||||||
movs r0, #1
|
|
||||||
b _0803EF02
|
|
||||||
.align 2, 0
|
|
||||||
_0803EEF4: .4byte gUnk_020000B0
|
|
||||||
_0803EEF8:
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7a
|
|
||||||
movs r0, #0x1e
|
|
||||||
strb r0, [r1]
|
|
||||||
_0803EF00:
|
|
||||||
movs r0, #0
|
|
||||||
_0803EF02:
|
|
||||||
pop {r4, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EF04
|
|
||||||
sub_0803EF04: @ 0x0803EF04
|
|
||||||
push {r4, lr}
|
|
||||||
adds r3, r1, #0
|
|
||||||
ldr r1, _0803EF1C @ =gUnk_020000B0
|
|
||||||
ldr r2, [r1]
|
|
||||||
movs r4, #0x2e
|
|
||||||
ldrsh r1, [r2, r4]
|
|
||||||
movs r4, #0x32
|
|
||||||
ldrsh r2, [r2, r4]
|
|
||||||
subs r2, #4
|
|
||||||
bl EntityWithinDistance
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0803EF1C: .4byte gUnk_020000B0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EF20
|
|
||||||
sub_0803EF20: @ 0x0803EF20
|
|
||||||
push {r4, r5, r6, r7, lr}
|
|
||||||
adds r5, r0, #0
|
|
||||||
ldr r6, _0803EF5C @ =gEntityLists + 16
|
|
||||||
ldr r4, [r6, #4]
|
|
||||||
cmp r4, r6
|
|
||||||
beq _0803EF6A
|
|
||||||
ldr r7, _0803EF60 @ =gUnk_080D08C8
|
|
||||||
_0803EF2E:
|
|
||||||
ldrb r0, [r4, #8]
|
|
||||||
cmp r0, #8
|
|
||||||
bne _0803EF64
|
|
||||||
ldrb r0, [r4, #9]
|
|
||||||
lsls r0, r0, #2
|
|
||||||
adds r0, r0, r7
|
|
||||||
ldr r2, [r0]
|
|
||||||
adds r0, r5, #0
|
|
||||||
adds r1, r4, #0
|
|
||||||
bl _call_via_r2
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803EF64
|
|
||||||
movs r0, #2
|
|
||||||
strb r0, [r5, #0xc]
|
|
||||||
adds r1, r5, #0
|
|
||||||
adds r1, #0x78
|
|
||||||
movs r0, #0xb4
|
|
||||||
strh r0, [r1]
|
|
||||||
adds r1, #3
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r1]
|
|
||||||
b _0803EF6C
|
|
||||||
.align 2, 0
|
|
||||||
_0803EF5C: .4byte gEntityLists + 16
|
|
||||||
_0803EF60: .4byte gUnk_080D08C8
|
|
||||||
_0803EF64:
|
|
||||||
ldr r4, [r4, #4]
|
|
||||||
cmp r4, r6
|
|
||||||
bne _0803EF2E
|
|
||||||
_0803EF6A:
|
|
||||||
movs r0, #0
|
|
||||||
_0803EF6C:
|
|
||||||
pop {r4, r5, r6, r7, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EF70
|
|
||||||
sub_0803EF70: @ 0x0803EF70
|
|
||||||
movs r0, #0
|
|
||||||
bx lr
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EF74
|
|
||||||
sub_0803EF74: @ 0x0803EF74
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r5, r0, #0
|
|
||||||
adds r4, r1, #0
|
|
||||||
movs r0, #0x2e
|
|
||||||
ldrsh r1, [r4, r0]
|
|
||||||
movs r0, #0x32
|
|
||||||
ldrsh r2, [r4, r0]
|
|
||||||
adds r0, r5, #0
|
|
||||||
movs r3, #0x50
|
|
||||||
bl EntityWithinDistance
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803EFA8
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r1, r5, #0
|
|
||||||
bl GetFacingDirection
|
|
||||||
ldrb r1, [r4, #0x15]
|
|
||||||
subs r1, r1, r0
|
|
||||||
adds r1, #2
|
|
||||||
movs r0, #0x1f
|
|
||||||
ands r1, r0
|
|
||||||
cmp r1, #4
|
|
||||||
bhi _0803EFA8
|
|
||||||
movs r0, #1
|
|
||||||
b _0803EFAA
|
|
||||||
_0803EFA8:
|
|
||||||
movs r0, #0
|
|
||||||
_0803EFAA:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EFAC
|
|
||||||
sub_0803EFAC: @ 0x0803EFAC
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r5, r0, #0
|
|
||||||
adds r4, r1, #0
|
|
||||||
movs r2, #0x50
|
|
||||||
movs r3, #0x50
|
|
||||||
bl EntityInRectRadius
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803EFD6
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r1, r5, #0
|
|
||||||
movs r2, #0x1c
|
|
||||||
bl sub_0804A044
|
|
||||||
cmp r0, #0xff
|
|
||||||
beq _0803EFD6
|
|
||||||
ldrb r4, [r4, #0x15]
|
|
||||||
cmp r0, r4
|
|
||||||
bne _0803EFD6
|
|
||||||
movs r0, #1
|
|
||||||
b _0803EFD8
|
|
||||||
_0803EFD6:
|
|
||||||
movs r0, #0
|
|
||||||
_0803EFD8:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
|
@ -27401,11 +27401,6 @@
|
||||||
"size": 4,
|
"size": 4,
|
||||||
"type": "animation"
|
"type": "animation"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "enemy4D/gUnk_080D08C4.bin",
|
|
||||||
"start": 854212,
|
|
||||||
"size": 4
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "animations/gSpriteAnimations_Ghini_0.bin",
|
"path": "animations/gSpriteAnimations_Ghini_0.bin",
|
||||||
"start": 854408,
|
"start": 854408,
|
||||||
|
@ -45592,46 +45587,6 @@
|
||||||
"start": 1199820,
|
"start": 1199820,
|
||||||
"size": 4
|
"size": 4
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "gyorgBossObject/gUnk_08124F08.bin",
|
|
||||||
"start": 1199880,
|
|
||||||
"size": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "gyorgBossObject/gUnk_08124F28.bin",
|
|
||||||
"start": 1199912,
|
|
||||||
"size": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "gyorgBossObject/gUnk_08124F48.bin",
|
|
||||||
"start": 1199944,
|
|
||||||
"size": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "gyorgBossObject/gUnk_08124F68.bin",
|
|
||||||
"start": 1199976,
|
|
||||||
"size": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "gyorgBossObject/gUnk_08124F88.bin",
|
|
||||||
"start": 1200008,
|
|
||||||
"size": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "gyorgBossObject/gUnk_08124FA8.bin",
|
|
||||||
"start": 1200040,
|
|
||||||
"size": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "gyorgBossObject/gUnk_08124FC8.bin",
|
|
||||||
"start": 1200072,
|
|
||||||
"size": 20
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "gyorgBossObject/gUnk_08124FDC.bin",
|
|
||||||
"start": 1200092,
|
|
||||||
"size": 20
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "windcrest/gUnk_08125010.bin",
|
"path": "windcrest/gUnk_08125010.bin",
|
||||||
"start": 1200144,
|
"start": 1200144,
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.section .rodata
|
|
||||||
.align 2
|
|
||||||
|
|
||||||
Enemy4D_Functions:: @ 080D0880
|
|
||||||
.4byte Enemy4D_OnTick
|
|
||||||
.4byte Enemy4D_OnCollision
|
|
||||||
.4byte Enemy4D_OnKnockback
|
|
||||||
.4byte Enemy4D_OnDeath
|
|
||||||
.4byte GenericConfused
|
|
||||||
.4byte Enemy4D_OnGrabbed
|
|
||||||
|
|
||||||
gUnk_080D0898:: @ 080D0898
|
|
||||||
.4byte sub_0803EB44
|
|
||||||
.4byte sub_0803EBB4
|
|
||||||
.4byte sub_0803EC28
|
|
||||||
.4byte sub_0803EC68
|
|
||||||
.4byte sub_0803EC94
|
|
||||||
.4byte sub_0803ED04
|
|
||||||
.4byte sub_0803ED40
|
|
||||||
.4byte sub_0803ED7C
|
|
||||||
.4byte sub_0803EDD4
|
|
||||||
.4byte sub_0803EDEC
|
|
||||||
.4byte sub_0803EE38
|
|
||||||
|
|
||||||
gUnk_080D08C4:: @ 080D08C4
|
|
||||||
.incbin "enemy4D/gUnk_080D08C4.bin"
|
|
||||||
|
|
||||||
gUnk_080D08C8:: @ 080D08C8
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF74
|
|
||||||
.4byte sub_0803EFAC
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EFAC
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EFAC
|
|
||||||
.4byte sub_0803EFAC
|
|
||||||
.4byte sub_0803EFAC
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EF70
|
|
||||||
.4byte sub_0803EFAC
|
|
|
@ -210,7 +210,7 @@ void TorchTrap(Entity*);
|
||||||
void VaatiRebornEnemy(Entity*);
|
void VaatiRebornEnemy(Entity*);
|
||||||
void VaatiProjectile(Entity*);
|
void VaatiProjectile(Entity*);
|
||||||
void BallChainSoldier(Entity*);
|
void BallChainSoldier(Entity*);
|
||||||
void Enemy4D(Entity*);
|
void Enemy4D();
|
||||||
void Ghini();
|
void Ghini();
|
||||||
void VaatiTransfigured(Entity*);
|
void VaatiTransfigured(Entity*);
|
||||||
void Enemy50();
|
void Enemy50();
|
||||||
|
|
|
@ -25,7 +25,7 @@ extern void DrawDirect(u32, u32); // trampoline to sub_080B27F4
|
||||||
extern void DrawEntities(void);
|
extern void DrawEntities(void);
|
||||||
extern void DrawOAMCmd(void);
|
extern void DrawOAMCmd(void);
|
||||||
extern void EnemyFunctionHandlerAfterCollision(Entity*, void (*const[])());
|
extern void EnemyFunctionHandlerAfterCollision(Entity*, void (*const[])());
|
||||||
extern u32 EntityWithinDistance(Entity*, s32, s32, s32);
|
extern bool32 EntityWithinDistance(Entity*, s32, s32, s32);
|
||||||
extern void FlushSprites(void);
|
extern void FlushSprites(void);
|
||||||
extern void GenericKnockback2(Entity*);
|
extern void GenericKnockback2(Entity*);
|
||||||
extern LayerStruct* GetLayerByIndex(u32);
|
extern LayerStruct* GetLayerByIndex(u32);
|
||||||
|
|
|
@ -402,7 +402,6 @@ SECTIONS {
|
||||||
src/enemy/vaatiProjectile.o(.text);
|
src/enemy/vaatiProjectile.o(.text);
|
||||||
src/enemy/ballChainSoldier.o(.text);
|
src/enemy/ballChainSoldier.o(.text);
|
||||||
src/enemy/enemy4D.o(.text);
|
src/enemy/enemy4D.o(.text);
|
||||||
asm/enemy/enemy4D.o(.text);
|
|
||||||
src/enemy/ghini.o(.text);
|
src/enemy/ghini.o(.text);
|
||||||
src/enemy/vaatiTransfigured.o(.text);
|
src/enemy/vaatiTransfigured.o(.text);
|
||||||
src/enemy/enemy50.o(.text);
|
src/enemy/enemy50.o(.text);
|
||||||
|
@ -1076,7 +1075,7 @@ SECTIONS {
|
||||||
src/enemy/ballChainSoldier.o(.rodata);
|
src/enemy/ballChainSoldier.o(.rodata);
|
||||||
data/const/enemy/ballChainSoldier.o(.rodata);
|
data/const/enemy/ballChainSoldier.o(.rodata);
|
||||||
data/animations/enemy/ballChainSoldier.o(.rodata);
|
data/animations/enemy/ballChainSoldier.o(.rodata);
|
||||||
data/const/enemy/enemy4D.o(.rodata);
|
src/enemy/enemy4D.o(.rodata);
|
||||||
src/enemy/ghini.o(.rodata);
|
src/enemy/ghini.o(.rodata);
|
||||||
data/animations/enemy/ghini.o(.rodata);
|
data/animations/enemy/ghini.o(.rodata);
|
||||||
src/enemy/vaatiTransfigured.o(.rodata);
|
src/enemy/vaatiTransfigured.o(.rodata);
|
||||||
|
|
|
@ -446,7 +446,7 @@ u32 sub_0806FCAC(Entity* this, Entity* other) {
|
||||||
return sub_0806F5B0(GetFacingDirection(this, other));
|
return sub_0806F5B0(GetFacingDirection(this, other));
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 EntityWithinDistance(Entity* ent, s32 x, s32 y, s32 distance) {
|
bool32 EntityWithinDistance(Entity* ent, s32 x, s32 y, s32 distance) {
|
||||||
return PointInsideRadius(ent->x.HALF.HI - x, ent->y.HALF.HI - y, distance);
|
return PointInsideRadius(ent->x.HALF.HI - x, ent->y.HALF.HI - y, distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,59 +4,333 @@
|
||||||
*
|
*
|
||||||
* @brief enemy 4D
|
* @brief enemy 4D
|
||||||
*/
|
*/
|
||||||
|
#define NENT_DEPRECATED
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
#include "enemy.h"
|
#include "enemy.h"
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
|
|
||||||
extern void sub_0803EE8C(Entity*);
|
typedef struct {
|
||||||
|
/*0x00*/ Entity base;
|
||||||
|
/*0x68*/ u8 unk_68[0x5];
|
||||||
|
/*0x6d*/ u8 unk_6d;
|
||||||
|
/*0x6e*/ u8 unk_6e;
|
||||||
|
/*0x6f*/ u8 unk_6f;
|
||||||
|
/*0x70*/ u16 unk_70;
|
||||||
|
/*0x72*/ u16 unk_72;
|
||||||
|
/*0x74*/ u8 unk_74[0x4];
|
||||||
|
/*0x78*/ u16 unk_78;
|
||||||
|
/*0x7a*/ u8 unk_7a;
|
||||||
|
/*0x7b*/ u8 unk_7b;
|
||||||
|
/*0x7c*/ u8 unk_7c;
|
||||||
|
/*0x7d*/ u8 unk_7d;
|
||||||
|
/*0x7e*/ u8 unk_7e;
|
||||||
|
/*0x7f*/ u8 unk_7f;
|
||||||
|
/*0x80*/ u16 unk_80;
|
||||||
|
/*0x82*/ u16 unk_82;
|
||||||
|
/*0x84*/ u16 unk_84;
|
||||||
|
/*0x86*/ u16 unk_86;
|
||||||
|
} Enemy4DEntity;
|
||||||
|
|
||||||
extern void (*const Enemy4D_Functions[])(Entity*);
|
extern void sub_0803E9A4(Entity*); // ballChainSoldier
|
||||||
extern void (*const gUnk_080D0898[])(Entity*);
|
extern void sub_0803E94C(Entity*, u32); // ballChainSoldier
|
||||||
|
|
||||||
void Enemy4D(Entity* this) {
|
extern Entity* gUnk_020000B0;
|
||||||
EnemyFunctionHandler(this, Enemy4D_Functions);
|
|
||||||
|
void sub_0803EE8C(Enemy4DEntity*);
|
||||||
|
bool32 sub_0803EF20(Enemy4DEntity*);
|
||||||
|
bool32 sub_0803EEA4(Enemy4DEntity*);
|
||||||
|
bool32 sub_0803EF04(Enemy4DEntity*, u32);
|
||||||
|
void Enemy4D_OnTick(Enemy4DEntity*);
|
||||||
|
void Enemy4D_OnCollision(Enemy4DEntity*);
|
||||||
|
void Enemy4D_OnKnockback(Enemy4DEntity*);
|
||||||
|
void Enemy4D_OnDeath(Enemy4DEntity*);
|
||||||
|
void Enemy4D_OnGrabbed(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Init(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Action1(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Action2(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Action3(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Action4(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Action5(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Action6(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Action7(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Action8(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Action9(Enemy4DEntity*);
|
||||||
|
void Enemy4D_Action10(Enemy4DEntity*);
|
||||||
|
bool32 sub_0803EF70(Entity*, Entity*);
|
||||||
|
bool32 sub_0803EF74(Entity*, Entity*);
|
||||||
|
bool32 sub_0803EFAC(Entity*, Entity*);
|
||||||
|
|
||||||
|
void (*const Enemy4D_Functions[])(Enemy4DEntity*) = {
|
||||||
|
Enemy4D_OnTick,
|
||||||
|
Enemy4D_OnCollision,
|
||||||
|
Enemy4D_OnKnockback,
|
||||||
|
Enemy4D_OnDeath,
|
||||||
|
(void (*)(Enemy4DEntity*))GenericConfused,
|
||||||
|
Enemy4D_OnGrabbed,
|
||||||
|
};
|
||||||
|
|
||||||
|
void Enemy4D(Enemy4DEntity* this) {
|
||||||
|
EnemyFunctionHandler(super, (EntityActionArray)Enemy4D_Functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Enemy4D_OnTick(Entity* this) {
|
void Enemy4D_OnTick(Enemy4DEntity* this) {
|
||||||
gUnk_080D0898[this->action](this);
|
static void (*const Enemy4D_Actions[])(Enemy4DEntity*) = {
|
||||||
|
Enemy4D_Init, Enemy4D_Action1, Enemy4D_Action2, Enemy4D_Action3, Enemy4D_Action4, Enemy4D_Action5,
|
||||||
|
Enemy4D_Action6, Enemy4D_Action7, Enemy4D_Action8, Enemy4D_Action9, Enemy4D_Action10,
|
||||||
|
};
|
||||||
|
Enemy4D_Actions[super->action](this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Enemy4D_OnCollision(Entity* this) {
|
void Enemy4D_OnCollision(Enemy4DEntity* this) {
|
||||||
EnemyFunctionHandlerAfterCollision(this, Enemy4D_Functions);
|
EnemyFunctionHandlerAfterCollision(super, Enemy4D_Functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Enemy4D_OnKnockback(Entity* this) {
|
void Enemy4D_OnKnockback(Enemy4DEntity* this) {
|
||||||
GenericKnockback(this);
|
GenericKnockback(super);
|
||||||
Enemy4D_OnTick(this);
|
Enemy4D_OnTick(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Enemy4D_OnDeath(Entity* this) {
|
void Enemy4D_OnDeath(Enemy4DEntity* this) {
|
||||||
CreateDeathFx(this, 0xff, 0x57);
|
CreateDeathFx(super, 0xff, 0x57);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Enemy4D_OnGrabbed(Entity* this) {
|
void Enemy4D_OnGrabbed(Enemy4DEntity* this) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0803EB44(Entity* this) {
|
void Enemy4D_Init(Enemy4DEntity* this) {
|
||||||
Entity* pEVar1;
|
Entity* projectile;
|
||||||
|
|
||||||
sub_0804A720(this);
|
sub_0804A720(super);
|
||||||
pEVar1 = CreateProjectileWithParent(this, BALL_AND_CHAIN, 0);
|
projectile = CreateProjectileWithParent(super, BALL_AND_CHAIN, 0);
|
||||||
if (pEVar1 != NULL) {
|
if (projectile != NULL) {
|
||||||
pEVar1->parent = this;
|
projectile->parent = super;
|
||||||
this->child = pEVar1;
|
super->child = projectile;
|
||||||
COLLISION_ON(this);
|
COLLISION_ON(super);
|
||||||
this->spriteSettings.draw = TRUE;
|
super->spriteSettings.draw = TRUE;
|
||||||
this->animationState = 2;
|
super->animationState = 2;
|
||||||
*((u8*)&this->field_0x7a + 1) = 0;
|
this->unk_7b = 0;
|
||||||
*(u8*)&this->field_0x7c = 0;
|
this->unk_7c = 0;
|
||||||
*((u8*)&this->field_0x7c + 2) = 0x28;
|
this->unk_7e = 0x28;
|
||||||
*((u8*)&this->field_0x7c + 3) = 0xfe;
|
this->unk_7f = 0xfe;
|
||||||
this->field_0x80.HWORD = this->x.HALF.HI;
|
this->unk_80 = super->x.HALF.HI;
|
||||||
this->field_0x82.HWORD = this->y.HALF.HI;
|
this->unk_82 = super->y.HALF.HI;
|
||||||
InitAnimationForceUpdate(this, this->animationState << 2);
|
InitAnimationForceUpdate(super, super->animationState << 2);
|
||||||
sub_0803EE8C(this);
|
sub_0803EE8C(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void Enemy4D_Action1(Enemy4DEntity* this) {
|
||||||
|
this->unk_7c -= 0xa;
|
||||||
|
if (sub_08049DF4(1)) {
|
||||||
|
super->direction = DirectionRoundUp(GetFacingDirection(super, gUnk_020000B0));
|
||||||
|
sub_0803E94C(super, 0);
|
||||||
|
}
|
||||||
|
sub_0803E9A4(super);
|
||||||
|
if (EntityWithinDistance(super, this->unk_80, this->unk_82, 2) == FALSE) {
|
||||||
|
super->action = 4;
|
||||||
|
sub_0803E94C(super, 0x10);
|
||||||
|
} else {
|
||||||
|
if (sub_0803EF20(this) == FALSE) {
|
||||||
|
sub_0803EEA4(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Enemy4D_Action2(Enemy4DEntity* this) {
|
||||||
|
this->unk_7c -= 0x10;
|
||||||
|
sub_0803E9A4(super);
|
||||||
|
if (this->unk_7e > 0x1c) {
|
||||||
|
this->unk_7e--;
|
||||||
|
}
|
||||||
|
if (--this->unk_78 == 0) {
|
||||||
|
super->action = 3;
|
||||||
|
this->unk_7b = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Enemy4D_Action3(Enemy4DEntity* this) {
|
||||||
|
this->unk_7c -= 0xa;
|
||||||
|
sub_0803E9A4(super);
|
||||||
|
if (this->unk_7e < 0x28) {
|
||||||
|
this->unk_7e++;
|
||||||
|
} else {
|
||||||
|
sub_0803EE8C(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Enemy4D_Action4(Enemy4DEntity* this) {
|
||||||
|
this->unk_7c -= 0xa;
|
||||||
|
sub_0803E9A4(super);
|
||||||
|
if (EntityWithinDistance(super, this->unk_80, this->unk_82, 1)) {
|
||||||
|
super->x.HALF.HI = this->unk_80;
|
||||||
|
super->y.HALF.HI = this->unk_82;
|
||||||
|
sub_0803EE8C(this);
|
||||||
|
sub_0803E94C(super, 0);
|
||||||
|
} else {
|
||||||
|
if (super->knockbackDuration == 0) {
|
||||||
|
super->direction = CalculateDirectionTo(super->x.HALF.HI, super->y.HALF.HI, this->unk_80, this->unk_82);
|
||||||
|
sub_0803E94C(super, 0x10);
|
||||||
|
ProcessMovement0(super);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Enemy4D_Action5(Enemy4DEntity* this) {
|
||||||
|
s32 tmp;
|
||||||
|
this->unk_7c -= 0xc;
|
||||||
|
sub_0803E9A4(super);
|
||||||
|
tmp = this->unk_7e - 4;
|
||||||
|
this->unk_7e = tmp;
|
||||||
|
if ((tmp * 0x1000000) < 1) {
|
||||||
|
this->unk_7e = 0;
|
||||||
|
super->action = 6;
|
||||||
|
super->actionDelay = 0x0f;
|
||||||
|
InitAnimationForceUpdate(super, super->animationState + 0x20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Enemy4D_Action6(Enemy4DEntity* this) {
|
||||||
|
|
||||||
|
static const u8 gUnk_080D08C4[] = {
|
||||||
|
0,
|
||||||
|
68,
|
||||||
|
128,
|
||||||
|
188,
|
||||||
|
};
|
||||||
|
if (--super->actionDelay == 0) {
|
||||||
|
super->action = 7;
|
||||||
|
super->actionDelay = 1;
|
||||||
|
this->unk_7c = gUnk_080D08C4[super->animationState];
|
||||||
|
this->unk_7f = 0xf6;
|
||||||
|
EnqueueSFX(SFX_15B);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Enemy4D_Action7(Enemy4DEntity* this) {
|
||||||
|
if ((super->frame & 0x80) == 0) {
|
||||||
|
UpdateAnimationSingleFrame(super);
|
||||||
|
} else {
|
||||||
|
if (--super->actionDelay == 0) {
|
||||||
|
super->actionDelay = 2;
|
||||||
|
this->unk_7f++;
|
||||||
|
}
|
||||||
|
if (this->unk_7f != 0) {
|
||||||
|
this->unk_7e += 5;
|
||||||
|
} else {
|
||||||
|
super->action = 8;
|
||||||
|
super->actionDelay = 0x1e;
|
||||||
|
InitScreenShake(8, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Enemy4D_Action8(Enemy4DEntity* this) {
|
||||||
|
if (--super->actionDelay == 0) {
|
||||||
|
super->action = 9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Enemy4D_Action9(Enemy4DEntity* this) {
|
||||||
|
u8 tmp;
|
||||||
|
tmp = this->unk_7e = this->unk_7e - 2;
|
||||||
|
if (tmp < 0xb) {
|
||||||
|
super->action = 0xa;
|
||||||
|
super->actionDelay = 0x3c;
|
||||||
|
super->direction = super->animationState << 3;
|
||||||
|
this->unk_7c = 0;
|
||||||
|
this->unk_7f = 0xfe;
|
||||||
|
sub_0803E94C(super, 0x10);
|
||||||
|
} else if (tmp < 0x13) {
|
||||||
|
super->child->flags &= ~ENT_COLLIDE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Enemy4D_Action10(Enemy4DEntity* this) {
|
||||||
|
if (super->actionDelay != 0) {
|
||||||
|
if (--super->actionDelay == 0) {
|
||||||
|
super->child->flags |= ENT_COLLIDE;
|
||||||
|
sub_0803E94C(super, 0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this->unk_7c -= 0xa;
|
||||||
|
sub_0803E9A4(super);
|
||||||
|
if (++this->unk_7e > 0x27) {
|
||||||
|
sub_0803EE8C(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0803EE8C(Enemy4DEntity* this) {
|
||||||
|
super->action = 1;
|
||||||
|
this->unk_7a = 0x1e;
|
||||||
|
sub_0803E94C(super, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool32 sub_0803EEA4(Enemy4DEntity* this) {
|
||||||
|
s32 tmp;
|
||||||
|
if (sub_08049FDC(super, 1)) {
|
||||||
|
if (sub_0803EF04(this, 0x4e) != 0) {
|
||||||
|
tmp = sub_0804A044(super, gUnk_020000B0, 0x12);
|
||||||
|
if (tmp != 0xff) {
|
||||||
|
if (--this->unk_7a == 0) {
|
||||||
|
super->action = 5;
|
||||||
|
super->direction = tmp;
|
||||||
|
sub_0803E94C(super, 0);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this->unk_7a = 0x1e;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool32 sub_0803EF04(Enemy4DEntity* this, u32 distance) {
|
||||||
|
return EntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI - 4, distance);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool32 sub_0803EF20(Enemy4DEntity* this) {
|
||||||
|
static bool32 (*const gUnk_080D08C8[])(Entity*, Entity*) = {
|
||||||
|
sub_0803EF70, sub_0803EF70, sub_0803EF70, sub_0803EF74, sub_0803EFAC, sub_0803EF70, sub_0803EF70, sub_0803EF70,
|
||||||
|
sub_0803EF70, sub_0803EF70, sub_0803EF70, sub_0803EF70, sub_0803EF70, sub_0803EF70, sub_0803EF70, sub_0803EFAC,
|
||||||
|
sub_0803EF70, sub_0803EFAC, sub_0803EFAC, sub_0803EFAC, sub_0803EF70, sub_0803EF70, sub_0803EFAC,
|
||||||
|
};
|
||||||
|
Entity* it;
|
||||||
|
LinkedList* list = ((LinkedList*)&gEntityLists + 2);
|
||||||
|
|
||||||
|
for (it = list->first; it != (Entity*)list; it = it->next) {
|
||||||
|
if ((it->kind == 8) && gUnk_080D08C8[it->id](super, it)) {
|
||||||
|
super->action = 2;
|
||||||
|
this->unk_78 = 0xb4;
|
||||||
|
this->unk_7b = 1;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool32 sub_0803EF70(Entity* param_1, Entity* param_2) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool32 sub_0803EF74(Entity* param_1, Entity* param_2) {
|
||||||
|
if (EntityWithinDistance(param_1, param_2->x.HALF.HI, param_2->y.HALF.HI, 0x50)) {
|
||||||
|
if (4 >= (((param_2->direction - GetFacingDirection(param_2, param_1)) + 2) & 0x1f)) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool32 sub_0803EFAC(Entity* param_1, Entity* param_2) {
|
||||||
|
if (EntityInRectRadius(param_1, param_2, 0x50, 0x50)) {
|
||||||
|
u32 tmp = sub_0804A044(param_2, param_1, 0x1c);
|
||||||
|
if (tmp != 0xff) {
|
||||||
|
if (tmp == param_2->direction) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue