Merge pull request #58 from notyouraveragehooman/master

tektiteGolden.c OK, tektite.c OK
This commit is contained in:
notyouraveragehooman 2020-08-16 17:33:11 -07:00 committed by GitHub
commit bbf4c44bba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 342 additions and 757 deletions

View File

@ -1,483 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start Tektite
Tektite: @ 0x0802F118
push {r4, lr}
adds r4, r0, #0
ldr r1, _0802F134 @ =gUnk_080CDED0
bl EnemyFunctionHandler
movs r3, #0x10
rsbs r3, r3, #0
adds r0, r4, #0
movs r1, #0
movs r2, #1
bl SetChildOffset
pop {r4, pc}
.align 2, 0
_0802F134: .4byte gUnk_080CDED0
thumb_func_start sub_0802F138
sub_0802F138: @ 0x0802F138
push {lr}
ldr r2, _0802F14C @ =gUnk_080CDEE8
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_0802F14C: .4byte gUnk_080CDEE8
thumb_func_start sub_0802F150
sub_0802F150: @ 0x0802F150
push {r4, lr}
adds r4, r0, #0
adds r0, #0x43
ldrb r0, [r0]
cmp r0, #0
beq _0802F164
adds r0, r4, #0
movs r1, #0x1c
bl sub_0804A9FC
_0802F164:
ldr r1, _0802F18C @ =gUnk_080CDED0
adds r0, r4, #0
bl sub_0804AA30
adds r0, r4, #0
adds r0, #0x41
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _0802F1E8
movs r0, #0x3f
ands r0, r1
cmp r0, #0x14
beq _0802F196
cmp r0, #0x14
bgt _0802F190
cmp r0, #0xe
beq _0802F1E0
b _0802F1E8
.align 2, 0
_0802F18C: .4byte gUnk_080CDED0
_0802F190:
cmp r0, #0x15
beq _0802F1E0
b _0802F1E8
_0802F196:
movs r0, #0
movs r1, #1
strb r1, [r4, #0xc]
strb r0, [r4, #0xd]
ldrb r0, [r4, #0xa]
cmp r0, #0
beq _0802F1A8
movs r0, #0xc0
b _0802F1B6
_0802F1A8:
bl Random
ldr r2, _0802F1DC @ =gUnk_080CDEF8
movs r1, #3
ands r1, r0
adds r1, r1, r2
ldrb r0, [r1]
_0802F1B6:
strb r0, [r4, #0xe]
movs r1, #0
strb r1, [r4, #0xf]
adds r0, r4, #0
adds r0, #0x7c
strb r1, [r0]
movs r1, #0x36
ldrsh r0, [r4, r1]
cmp r0, #0
beq _0802F1CE
ldr r0, [r4, #0x20]
asrs r0, r0, #2
_0802F1CE:
str r0, [r4, #0x20]
adds r0, r4, #0
movs r1, #0
bl InitializeAnimation
b _0802F1E8
.align 2, 0
_0802F1DC: .4byte gUnk_080CDEF8
_0802F1E0:
adds r1, r4, #0
adds r1, #0x45
movs r0, #0
strb r0, [r1]
_0802F1E8:
pop {r4, pc}
.align 2, 0
thumb_func_start nullsub_16
nullsub_16: @ 0x0802F1EC
bx lr
.align 2, 0
thumb_func_start sub_0802F1F0
sub_0802F1F0: @ 0x0802F1F0
push {r4, lr}
adds r4, r0, #0
bl sub_08001242
movs r1, #0x36
ldrsh r0, [r4, r1]
cmp r0, #0
beq _0802F20C
adds r0, r4, #0
adds r0, #0x80
ldrh r1, [r0]
adds r0, r4, #0
bl sub_08003FC4
_0802F20C:
pop {r4, pc}
.align 2, 0
thumb_func_start sub_0802F210
sub_0802F210: @ 0x0802F210
push {r4, r5, lr}
adds r5, r0, #0
bl sub_0804A720
movs r4, #0
movs r0, #1
strb r0, [r5, #0xc]
strb r4, [r5, #0xd]
bl Random
ldr r2, _0802F280 @ =gUnk_080CDEF8
movs r1, #3
ands r1, r0
adds r1, r1, r2
ldrb r0, [r1]
strb r0, [r5, #0xe]
bl Random
movs r1, #0x1f
ands r0, r1
ldrb r1, [r5, #0xe]
adds r0, r0, r1
strb r0, [r5, #0xe]
strb r4, [r5, #0xf]
adds r0, r5, #0
adds r0, #0x7c
strb r4, [r0]
ldrb r0, [r5, #0xa]
movs r2, #0xa0
lsls r2, r2, #6
adds r1, r2, #0
cmp r0, #0
bne _0802F258
movs r0, #0xc0
lsls r0, r0, #5
adds r1, r0, #0
_0802F258:
adds r0, r5, #0
adds r0, #0x80
strh r1, [r0]
ldrb r0, [r5, #0xa]
movs r2, #0xc0
lsls r2, r2, #6
adds r1, r2, #0
cmp r0, #0
bne _0802F270
movs r0, #0xa0
lsls r0, r0, #6
adds r1, r0, #0
_0802F270:
adds r0, r5, #0
adds r0, #0x82
strh r1, [r0]
adds r0, r5, #0
movs r1, #0
bl InitializeAnimation
pop {r4, r5, pc}
.align 2, 0
_0802F280: .4byte gUnk_080CDEF8
thumb_func_start sub_0802F284
sub_0802F284: @ 0x0802F284
push {r4, lr}
adds r4, r0, #0
ldrb r0, [r4, #0xe]
cmp r0, #0x60
bls _0802F298
adds r0, r4, #0
movs r1, #2
bl UpdateAnimationVariableFrames
b _0802F29E
_0802F298:
adds r0, r4, #0
bl GetNextFrame
_0802F29E:
ldrb r0, [r4, #0xe]
cmp r0, #0
beq _0802F2AA
subs r0, #1
strb r0, [r4, #0xe]
b _0802F2FE
_0802F2AA:
ldrb r0, [r4, #0xf]
cmp r0, #0
beq _0802F2E4
adds r0, r4, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _0802F2FE
movs r0, #2
strb r0, [r4, #0xc]
movs r0, #0x10
strb r0, [r4, #0xe]
ldrb r0, [r4, #0xa]
strb r0, [r4, #0xf]
adds r0, r4, #0
adds r0, #0x82
ldrh r0, [r0]
lsls r0, r0, #4
str r0, [r4, #0x20]
adds r0, r4, #0
bl sub_0802F45C
adds r0, r4, #0
movs r1, #2
bl InitializeAnimation
b _0802F2FE
_0802F2E4:
adds r0, r4, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _0802F2FE
movs r0, #0x40
strb r0, [r4, #0xf]
adds r0, r4, #0
movs r1, #1
bl InitializeAnimation
_0802F2FE:
pop {r4, pc}
thumb_func_start sub_0802F300
sub_0802F300: @ 0x0802F300
push {r4, r5, r6, lr}
adds r4, r0, #0
bl GetNextFrame
adds r0, r4, #0
bl sub_080AEF88
movs r0, #0x36
ldrsh r6, [r4, r0]
bl Random
adds r5, r0, #0
movs r0, #0xf
ands r5, r0
adds r0, r4, #0
adds r0, #0x80
ldrh r1, [r0]
adds r0, r4, #0
bl sub_080044EC
cmp r0, #1
bne _0802F364
movs r0, #0
movs r2, #3
strb r2, [r4, #0xc]
strb r0, [r4, #0xd]
ldrb r0, [r4, #0xa]
cmp r0, #0
beq _0802F33C
movs r5, #0
_0802F33C:
cmp r5, #0
bne _0802F344
movs r0, #0xc0
b _0802F350
_0802F344:
ldr r0, _0802F360 @ =gUnk_080CDEF8
adds r1, r5, #0
ands r1, r2
adds r1, r1, r0
ldrb r0, [r1]
adds r0, r0, r5
_0802F350:
strb r0, [r4, #0xe]
movs r0, #0
strb r0, [r4, #0xf]
adds r0, r4, #0
movs r1, #3
bl InitializeAnimation
b _0802F3F0
.align 2, 0
_0802F360: .4byte gUnk_080CDEF8
_0802F364:
ldrh r0, [r4, #0x2a]
cmp r0, #0
beq _0802F374
adds r1, r0, #0
adds r0, r4, #0
bl sub_0800417E
b _0802F38C
_0802F374:
adds r0, r4, #0
bl sub_080002B8
movs r1, #0xf0
ands r1, r0
cmp r1, #0x50
bne _0802F38C
ldrb r0, [r4, #0x15]
adds r0, #0x10
movs r1, #0x1f
ands r0, r1
strb r0, [r4, #0x15]
_0802F38C:
ldrb r0, [r4, #0xe]
subs r0, #1
strb r0, [r4, #0xe]
lsls r0, r0, #0x18
cmp r0, #0
bne _0802F3AC
movs r0, #0x10
strb r0, [r4, #0xe]
ldrb r0, [r4, #0xf]
cmp r0, #0
beq _0802F3AC
subs r0, #1
strb r0, [r4, #0xf]
adds r0, r4, #0
bl sub_0802F45C
_0802F3AC:
ldrb r0, [r4, #0xd]
cmp r0, #0
bne _0802F3C6
movs r1, #0x36
ldrsh r0, [r4, r1]
cmp r6, r0
bge _0802F3C6
adds r0, r4, #0
movs r1, #4
bl InitializeAnimation
movs r0, #1
strb r0, [r4, #0xd]
_0802F3C6:
movs r0, #0xc
rsbs r0, r0, #0
cmp r6, r0
bge _0802F3DA
ldrb r2, [r4, #0x19]
movs r1, #0x3f
adds r0, r1, #0
ands r0, r2
movs r2, #0x40
b _0802F3E4
_0802F3DA:
ldrb r2, [r4, #0x19]
movs r1, #0x3f
adds r0, r1, #0
ands r0, r2
movs r2, #0x80
_0802F3E4:
orrs r0, r2
strb r0, [r4, #0x19]
ldrb r0, [r4, #0x1b]
ands r1, r0
orrs r1, r2
strb r1, [r4, #0x1b]
_0802F3F0:
pop {r4, r5, r6, pc}
.align 2, 0
thumb_func_start sub_0802F3F4
sub_0802F3F4: @ 0x0802F3F4
push {r4, lr}
adds r4, r0, #0
bl GetNextFrame
adds r0, r4, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _0802F45A
adds r0, r4, #0
adds r0, #0x7c
ldrb r1, [r0]
adds r2, r0, #0
cmp r1, #1
bhi _0802F44C
ldrb r0, [r4, #0xa]
movs r1, #1
ands r0, r1
cmp r0, #0
beq _0802F44C
movs r0, #2
strb r0, [r4, #0xc]
movs r0, #0x10
strb r0, [r4, #0xe]
ldrb r0, [r4, #0xa]
strb r0, [r4, #0xf]
adds r0, r4, #0
adds r0, #0x82
ldrh r0, [r0]
lsls r0, r0, #4
str r0, [r4, #0x20]
ldrb r0, [r2]
adds r0, #1
strb r0, [r2]
adds r0, r4, #0
bl sub_0802F45C
adds r0, r4, #0
movs r1, #2
bl InitializeAnimation
b _0802F45A
_0802F44C:
movs r1, #0
movs r0, #1
strb r0, [r4, #0xc]
strb r1, [r2]
adds r0, r4, #0
bl InitializeAnimation
_0802F45A:
pop {r4, pc}
thumb_func_start sub_0802F45C
sub_0802F45C: @ 0x0802F45C
push {r4, lr}
adds r4, r0, #0
bl sub_08049FA0
cmp r0, #0
bne _0802F472
adds r0, r4, #0
bl sub_08049EE4
strb r0, [r4, #0x15]
b _0802F49E
_0802F472:
adds r0, r4, #0
movs r1, #1
bl sub_08049FDC
cmp r0, #0
beq _0802F48A
adds r0, r4, #0
movs r1, #1
bl sub_08049F84
strb r0, [r4, #0x15]
b _0802F49E
_0802F48A:
bl Random
movs r1, #0xf
ands r1, r0
adds r1, #0x18
ldrb r0, [r4, #0x15]
adds r1, r1, r0
movs r0, #0x1f
ands r1, r0
strb r1, [r4, #0x15]
_0802F49E:
pop {r4, pc}

View File

@ -1,189 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_08038048
sub_08038048: @ 0x08038048
push {r4, r5, r6, lr}
adds r4, r0, #0
movs r1, #2
bl UpdateAnimationVariableFrames
adds r0, r4, #0
bl sub_080AEF88
movs r0, #0x36
ldrsh r6, [r4, r0]
bl Random
adds r5, r0, #0
movs r0, #0xf
ands r5, r0
movs r1, #0xc0
lsls r1, r1, #6
adds r0, r4, #0
bl sub_080044EC
cmp r0, #1
bne _08038088
movs r0, #0
movs r1, #3
strb r1, [r4, #0xc]
strb r0, [r4, #0xd]
movs r0, #0x14
strb r0, [r4, #0xe]
adds r0, r4, #0
bl InitializeAnimation
b _0803810C
_08038088:
ldrh r0, [r4, #0x2a]
cmp r0, #0
beq _08038098
adds r1, r0, #0
adds r0, r4, #0
bl sub_0800417E
b _080380B0
_08038098:
adds r0, r4, #0
bl sub_080002B8
movs r1, #0xf0
ands r1, r0
cmp r1, #0x50
bne _080380B0
ldrb r0, [r4, #0x15]
adds r0, #0x10
movs r1, #0x1f
ands r0, r1
strb r0, [r4, #0x15]
_080380B0:
ldrb r0, [r4, #0xe]
subs r0, #1
strb r0, [r4, #0xe]
lsls r0, r0, #0x18
cmp r0, #0
bne _080380C8
adds r0, r5, #0
adds r0, #0x10
strb r0, [r4, #0xe]
adds r0, r4, #0
bl sub_08038168
_080380C8:
ldrb r0, [r4, #0xd]
cmp r0, #0
bne _080380E2
movs r1, #0x36
ldrsh r0, [r4, r1]
cmp r6, r0
bge _080380E2
adds r0, r4, #0
movs r1, #4
bl InitializeAnimation
movs r0, #1
strb r0, [r4, #0xd]
_080380E2:
movs r0, #0xc
rsbs r0, r0, #0
cmp r6, r0
bge _080380F6
ldrb r2, [r4, #0x19]
movs r1, #0x3f
adds r0, r1, #0
ands r0, r2
movs r2, #0x40
b _08038100
_080380F6:
ldrb r2, [r4, #0x19]
movs r1, #0x3f
adds r0, r1, #0
ands r0, r2
movs r2, #0x80
_08038100:
orrs r0, r2
strb r0, [r4, #0x19]
ldrb r0, [r4, #0x1b]
ands r1, r0
orrs r1, r2
strb r1, [r4, #0x1b]
_0803810C:
pop {r4, r5, r6, pc}
.align 2, 0
thumb_func_start sub_08038110
sub_08038110: @ 0x08038110
push {r4, lr}
adds r4, r0, #0
movs r1, #2
bl UpdateAnimationVariableFrames
adds r0, r4, #0
adds r0, #0x5a
ldrb r1, [r0]
movs r0, #0x80
ands r0, r1
cmp r0, #0
beq _08038164
adds r2, r4, #0
adds r2, #0x80
ldrb r0, [r2]
cmp r0, #4
bhi _08038150
movs r0, #2
strb r0, [r4, #0xc]
movs r0, #8
strb r0, [r4, #0xe]
movs r0, #0xe0
lsls r0, r0, #0xa
str r0, [r4, #0x20]
adds r0, r4, #0
bl sub_08038168
adds r0, r4, #0
movs r1, #2
bl InitializeAnimation
b _08038164
_08038150:
movs r0, #0
movs r1, #1
strb r1, [r4, #0xc]
strb r0, [r2]
movs r0, #0xc0
strb r0, [r4, #0xe]
adds r0, r4, #0
movs r1, #0
bl InitializeAnimation
_08038164:
pop {r4, pc}
.align 2, 0
thumb_func_start sub_08038168
sub_08038168: @ 0x08038168
push {r4, lr}
adds r4, r0, #0
bl sub_08049FA0
cmp r0, #0
bne _0803817E
adds r0, r4, #0
bl sub_08049EE4
strb r0, [r4, #0x15]
b _080381AA
_0803817E:
adds r0, r4, #0
movs r1, #1
bl sub_08049FDC
cmp r0, #0
beq _08038196
adds r0, r4, #0
movs r1, #1
bl sub_08049F84
strb r0, [r4, #0x15]
b _080381AA
_08038196:
bl Random
movs r1, #0xf
ands r1, r0
adds r1, #0x18
ldrb r0, [r4, #0x15]
adds r1, r1, r0
movs r0, #0x1f
ands r1, r0
strb r1, [r4, #0x15]
_080381AA:
pop {r4, pc}

View File

@ -251,4 +251,8 @@ extern u32 sub_08079F8C(void);
extern void sub_080787CC(Entity*);
extern void sub_080526F8(s32);
extern int sub_0807CF28(u32, SaveFile*);
extern u32 sub_080044EC(Entity*, u32);
extern u32 sub_080002B8(Entity*);
extern u32 sub_08049F84(Entity*, u32);
extern void sub_0802F45C(Entity*);
#endif

View File

@ -366,7 +366,7 @@ SECTIONS {
asm/wallMaster2.o(.text);
asm/gleerok.o(.text);
asm/vaatiEyesMacro.o(.text);
asm/tektite.o(.text);
src/enemy/tektite.o(.text);
asm/wizzrobeWind.o(.text);
asm/wizzrobeFire.o(.text);
asm/wizzrobeIce.o(.text);
@ -391,7 +391,6 @@ SECTIONS {
asm/gibdo.o(.text);
asm/octorokGolden.o(.text);
src/enemy/tektiteGolden.o(.text);
asm/tektiteGolden.o(.text);
asm/ropeGolden.o(.text);
asm/cloudPiranha.o(.text);
asm/scissorsBeetle.o(.text);

195
src/enemy/tektite.c Normal file
View File

@ -0,0 +1,195 @@
#include "global.h"
#include "entity.h"
#include "enemy.h"
#include "functions.h"
extern void (*const gUnk_080CDED0[])(Entity*);
extern void (*const gUnk_080CDEE8[])(Entity*);
void Tektite(Entity* this) {
EnemyFunctionHandler(this, gUnk_080CDED0);
SetChildOffset(this, 0, 1, -0x10);
}
void sub_0802F138(Entity* this) {
gUnk_080CDEE8[this->action](this);
}
extern u8 gUnk_080CDEF8[];
void sub_0802F150(Entity* this) {
u32 bVar1;
u32 uVar2;
if (this->field_0x43 != 0) {
sub_0804A9FC(this, 0x1c);
}
sub_0804AA30(this, gUnk_080CDED0);
if ((this->bitfield & 0x80) != 0) {
switch (this->bitfield & 0x3f) {
case 0x14:
this->action = 1;
this->previousActionFlag = 0;
if ((this->entityType).form != 0) {
this->actionDelay = 0xc0;
} else {
this->actionDelay = gUnk_080CDEF8[Random() & 3];
}
this->field_0xf = 0;
*(u8*)&this->field_0x7c = 0;
if (this->height.HALF.HI != 0) {
this->field_0x20 >>= 2;
} else {
this->field_0x20 = 0;
}
InitializeAnimation(this, 0);
break;
case 0xe:
case 0x15:
this->currentHealth = 0;
break;
}
}
}
void nullsub_16(Entity* this) {
}
void sub_0802F1F0(Entity* this) {
sub_08001242();
if (this->height.HALF.HI != 0) {
sub_08003FC4(this, this->field_0x80.HWORD);
}
}
extern u8 gUnk_080CDEF8[];
void sub_0802F210(Entity* this) {
u32 temp;
u32 temp2;
sub_0804A720(this);
this->action = 1;
this->previousActionFlag = 0;
this->actionDelay = gUnk_080CDEF8[Random() & 3];
this->actionDelay = (Random() & 0x1f) + this->actionDelay;
this->field_0xf = 0;
*(u8*)&this->field_0x7c = 0;
this->field_0x80.HWORD = this->entityType.form == 0 ? 0x1800 : 0x2800;
this->field_0x82.HWORD = this->entityType.form == 0 ? 0x2800 : 0x3000;
InitializeAnimation(this, 0);
}
void sub_0802F284(Entity* this) {
if (this->actionDelay > 0x60) {
UpdateAnimationVariableFrames(this, 2);
} else {
GetNextFrame(this);
}
if (this->actionDelay != 0) {
this->actionDelay--;
} else if (this->field_0xf != 0) {
if ((this->frames.b.f3) != 0) {
this->action = 2;
this->actionDelay = 0x10;
this->field_0xf = this->entityType.form;
this->field_0x20 = this->field_0x82.HWORD << 4;
sub_0802F45C(this);
InitializeAnimation(this, 2);
}
} else if ((this->frames.b.f3) != 0) {
this->field_0xf = 0x40;
InitializeAnimation(this, 1);
}
}
extern u8 gUnk_080CDEF8[];
void sub_0802F300(Entity* this) {
s32 temp;
u32 rand;
GetNextFrame(this);
sub_080AEF88(this);
temp = this->height.HALF.HI;
rand = Random() & 0xf;
if (sub_080044EC(this, this->field_0x80.HWORD) == 1) {
this->action = 3;
this->previousActionFlag = 0;
if (this->entityType.form != 0) {
rand = 0;
}
if (rand == 0) {
this->actionDelay = 0xc0;
} else {
this->actionDelay = gUnk_080CDEF8[rand & 3] + rand;
}
this->field_0xf = 0;
InitializeAnimation(this, 3);
return;
} else if (this->collisions != 0) {
sub_0800417E(this, this->collisions);
} else if ((sub_080002B8(this) & 0xf0) == 0x50) {
this->direction = (this->direction + 0x10) & 0x1f;
}
if (--this->actionDelay == 0) {
this->actionDelay = 0x10;
if (this->field_0xf != 0) {
this->field_0xf--;
sub_0802F45C(this);
}
}
if ((this->previousActionFlag == 0) && (temp < this->height.HALF.HI)) {
InitializeAnimation(this, 4);
this->previousActionFlag = 1;
}
if (temp < -0xc) {
this->spriteRendering.b3 = 1;
this->spriteOrientation.flipY = 1;
} else {
this->spriteRendering.b3 = 2;
this->spriteOrientation.flipY = 2;
}
}
void sub_0802F3F4(Entity* this) {
GetNextFrame(this);
if ((this->frames.b.f3) != 0) {
if ((*(u8*)&this->field_0x7c.HALF.LO < 2) && ((this->entityType.form % 2) != 0)) {
this->action = 2;
this->actionDelay = 0x10;
this->field_0xf = this->entityType.form;
this->field_0x20 = this->field_0x82.HWORD << 4;
(*(u8*)&this->field_0x7c.HALF.LO)++;
sub_0802F45C(this);
InitializeAnimation(this, 2);
} else {
this->action = 1;
*(u8*)&this->field_0x7c.HALF.LO = 0;
InitializeAnimation(this, 0);
}
}
}
void sub_0802F45C(Entity* this) {
u32 temp;
if (sub_08049FA0(this) == 0) {
this->direction = sub_08049EE4(this);
} else if (sub_08049FDC(this, 1) != 0) {
this->direction = sub_08049F84(this, 1);
} else {
temp = (Random() & 0xf) + 0x18;
this->direction = (temp + this->direction) & 0x1f;
}
}

View File

@ -9,100 +9,159 @@ extern void sub_08038168(Entity*);
extern void (*const gUnk_080CF4A0)(Entity*);
extern void (*const gUnk_080CF4B8[])(Entity*);
void TektiteGolden(Entity *this)
{
EnemyFunctionHandler(this, &gUnk_080CF4A0);
SetChildOffset(this, 0, 1, -0x10);
void TektiteGolden(Entity* this) {
EnemyFunctionHandler(this, &gUnk_080CF4A0);
SetChildOffset(this, 0, 1, -0x10);
}
void sub_08037EE8(Entity* this)
{
gUnk_080CF4B8[this->action](this);
void sub_08037EE8(Entity* this) {
gUnk_080CF4B8[this->action](this);
}
void sub_08037F00(Entity *this)
{
u32 uVar1;
if (this->field_0x43 != 0) {
sub_0804A9FC(this,0x1c);
}
sub_0804AA30(this, &gUnk_080CF4A0);
if (this->bitfield == 0x94) {
void sub_08037F00(Entity* this) {
u32 uVar1;
if (this->field_0x43 != 0) {
sub_0804A9FC(this, 0x1c);
}
sub_0804AA30(this, &gUnk_080CF4A0);
if (this->bitfield == 0x94) {
this->action = 1;
this->previousActionFlag = 0;
this->actionDelay = 0x14;
this->field_0xf = 0;
this->field_0x80.HALF.LO = 0;
if (this->height.HALF.HI != 0) {
this->field_0x20 >>= 2;
} else {
this->field_0x20 = 0;
}
InitializeAnimation(this, 0);
}
}
void sub_08037F58(Entity* this) {
u32 uVar1;
if ((this->field_0x3a & 2) == 0) {
SetGlobalFlag(this->entityType.parameter);
}
if ((this->entityType).form != 0) {
uVar1 = 0x59;
} else {
uVar1 = 0x58;
}
CreateDeathFx(this, 0xff, uVar1);
}
void sub_08037F84(Entity* this) {
sub_08001242();
if (this->height.HALF.HI != 0) {
sub_08003FC4(this, 0x3000);
}
}
void sub_08037FA0(Entity* this) {
if (CheckGlobalFlag(this->entityType.parameter)) {
DeleteThisEntity();
}
sub_0804A720(this);
this->action = 1;
this->previousActionFlag = 0;
this->actionDelay = 0x14;
this->actionDelay = (Random() & 0x1f) + 0x20;
this->field_0xf = 0;
this->field_0x80.HALF.LO = 0;
uVar1 = this->height.HALF.HI;
if (uVar1 != 0) {
this->field_0x20 >>= 2;
}
else {
this->field_0x20 = uVar1;
}
InitializeAnimation(this,0);
}
InitializeAnimation(this, 0);
}
void sub_08037F58(Entity *this)
{
u32 uVar1;
if ((this->field_0x3a & 2) == 0) {
SetGlobalFlag(this->entityType.parameter);
}
if ((this->entityType).form != 0) {
uVar1 = 0x59;
}
else {
uVar1 = 0x58;
}
CreateDeathFx(this, 0xff, uVar1);
}
void sub_08037F84(Entity *this)
{
sub_08001242();
if (this->height.HALF.HI != 0) {
sub_08003FC4(this, 0x3000);
}
}
void sub_08037FA0(Entity *this)
{
if (CheckGlobalFlag(this->entityType.parameter)) {
DeleteThisEntity();
}
sub_0804A720(this);
this->action = 1;
this->previousActionFlag = 0;
this->actionDelay = (Random() & 0x1f) + 0x20;
this->field_0xf = 0;
this->field_0x80.HALF.LO = 0;
InitializeAnimation(this,0);
}
void sub_08037Fe0(Entity *this)
{
UpdateAnimationVariableFrames(this, 2);
if (this->actionDelay != 0) {
this->actionDelay--;
}
else if (this->field_0xf != 0) {
if ((this->frames.b.f3) != 0) {
this->action = 2;
this->actionDelay = 6;
this->field_0xf = 0;
this->field_0x20 = 0x38000;
sub_08038168(this);
InitializeAnimation(this, 2);
}
}
else if ((this->frames.b.f3) != 0) {
void sub_08037Fe0(Entity* this) {
UpdateAnimationVariableFrames(this, 2);
if (this->actionDelay != 0) {
this->actionDelay--;
} else if (this->field_0xf != 0) {
if ((this->frames.b.f3) != 0) {
this->action = 2;
this->actionDelay = 6;
this->field_0xf = 0;
this->field_0x20 = 0x38000;
sub_08038168(this);
InitializeAnimation(this, 2);
}
} else if ((this->frames.b.f3) != 0) {
this->field_0xf = 0x40;
InitializeAnimation(this, 1);
}
}
void sub_08038048(Entity* this) {
s32 temp;
u32 rand;
UpdateAnimationVariableFrames(this, 2);
sub_080AEF88(this);
temp = this->height.HALF.HI;
rand = Random() & 0xf;
if (sub_080044EC(this, 0x3000) == 1) {
this->action = 3;
this->previousActionFlag = 0;
this->actionDelay = 0x14;
InitializeAnimation(this, 3);
return;
} else if (this->collisions != 0) {
sub_0800417E(this, this->collisions);
} else if ((sub_080002B8(this) & 0xf0) == 0x50) {
this->direction = (this->direction + 0x10) & 0x1f;
}
if (--this->actionDelay == 0) {
this->actionDelay = rand + 0x10;
sub_08038168(this);
}
if ((this->previousActionFlag == 0) && (temp < this->height.HALF.HI)) {
InitializeAnimation(this, 4);
this->previousActionFlag = 1;
}
if (temp < -0xc) {
this->spriteRendering.b3 = 1;
this->spriteOrientation.flipY = 1;
} else {
this->spriteRendering.b3 = 2;
this->spriteOrientation.flipY = 2;
}
}
void sub_08038110(Entity* this) {
UpdateAnimationVariableFrames(this, 2);
if ((this->frames.b.f3) != 0) {
if (this->field_0x80.HALF.LO < 5) {
this->action = 2;
this->actionDelay = 8;
this->field_0x20 = 0x38000;
sub_08038168(this);
InitializeAnimation(this, 2);
} else {
this->action = 1;
this->field_0x80.HALF.LO = 0;
this->actionDelay = 0xc0;
InitializeAnimation(this, 0);
}
}
}
void sub_08038168(Entity* this) {
u32 temp;
if (sub_08049FA0(this) == 0) {
this->direction = sub_08049EE4(this);
} else if (sub_08049FDC(this, 1) != 0) {
this->direction = sub_08049F84(this, 1);
} else {
temp = (Random() & 0xf) + 0x18;
this->direction = (temp + this->direction) & 0x1f;
}
}