mirror of https://github.com/zeldaret/tmc.git
Decompile Acro-Bandits
This commit is contained in:
parent
79cb86022e
commit
debf6b2095
1482
asm/acroBandits.s
1482
asm/acroBandits.s
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,136 @@
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
|
||||||
|
.text
|
||||||
|
|
||||||
|
push {r4, r5, r6, r7, lr}
|
||||||
|
mov r7, sb
|
||||||
|
mov r6, r8
|
||||||
|
push {r6, r7}
|
||||||
|
adds r7, r0, #0
|
||||||
|
bl GetNextFrame
|
||||||
|
adds r3, r7, #0
|
||||||
|
adds r3, #0x5a
|
||||||
|
ldrb r1, [r3]
|
||||||
|
movs r0, #0x80
|
||||||
|
ands r0, r1
|
||||||
|
lsls r0, r0, #0x18
|
||||||
|
lsrs r2, r0, #0x18
|
||||||
|
cmp r2, #0
|
||||||
|
beq _08031D54
|
||||||
|
ldr r0, _08031D50 @ =gUnk_03003DBC
|
||||||
|
ldrb r0, [r0]
|
||||||
|
cmp r0, #0x42
|
||||||
|
bhi _08031D66
|
||||||
|
bl Random
|
||||||
|
adds r6, r0, #0
|
||||||
|
movs r0, #3
|
||||||
|
mov sb, r0
|
||||||
|
ands r6, r0
|
||||||
|
movs r0, #0x2e
|
||||||
|
movs r1, #1
|
||||||
|
bl CreateEnemy
|
||||||
|
adds r4, r0, #0
|
||||||
|
movs r0, #0
|
||||||
|
mov r8, r0
|
||||||
|
mov r0, r8
|
||||||
|
strb r0, [r4, #0xb]
|
||||||
|
mov r0, r8
|
||||||
|
str r0, [r4, #0x50]
|
||||||
|
adds r0, r4, #0
|
||||||
|
adds r0, #0x74
|
||||||
|
strb r6, [r0]
|
||||||
|
adds r0, r7, #0
|
||||||
|
adds r1, r4, #0
|
||||||
|
bl sub_08031E48
|
||||||
|
movs r0, #0x2e
|
||||||
|
movs r1, #1
|
||||||
|
bl CreateEnemy
|
||||||
|
adds r5, r0, #0
|
||||||
|
str r5, [r4, #0x54]
|
||||||
|
movs r0, #1
|
||||||
|
strb r0, [r5, #0xb]
|
||||||
|
str r4, [r5, #0x50]
|
||||||
|
adds r0, r5, #0
|
||||||
|
adds r0, #0x74
|
||||||
|
strb r6, [r0]
|
||||||
|
adds r0, r7, #0
|
||||||
|
adds r1, r5, #0
|
||||||
|
bl sub_08031E48
|
||||||
|
movs r0, #0x2e
|
||||||
|
movs r1, #1
|
||||||
|
bl CreateEnemy
|
||||||
|
adds r4, r0, #0
|
||||||
|
str r4, [r5, #0x54]
|
||||||
|
movs r0, #2
|
||||||
|
strb r0, [r4, #0xb]
|
||||||
|
str r5, [r4, #0x50]
|
||||||
|
adds r0, r4, #0
|
||||||
|
adds r0, #0x74
|
||||||
|
strb r6, [r0]
|
||||||
|
adds r0, r7, #0
|
||||||
|
adds r1, r4, #0
|
||||||
|
bl sub_08031E48
|
||||||
|
movs r0, #0x2e
|
||||||
|
movs r1, #1
|
||||||
|
bl CreateEnemy
|
||||||
|
adds r5, r0, #0
|
||||||
|
str r5, [r4, #0x54]
|
||||||
|
mov r0, sb
|
||||||
|
strb r0, [r5, #0xb]
|
||||||
|
str r4, [r5, #0x50]
|
||||||
|
adds r0, r5, #0
|
||||||
|
adds r0, #0x74
|
||||||
|
strb r6, [r0]
|
||||||
|
adds r0, r7, #0
|
||||||
|
adds r1, r5, #0
|
||||||
|
bl sub_08031E48
|
||||||
|
movs r0, #0x2e
|
||||||
|
movs r1, #1
|
||||||
|
bl CreateEnemy
|
||||||
|
adds r1, r0, #0
|
||||||
|
str r1, [r5, #0x54]
|
||||||
|
movs r0, #4
|
||||||
|
strb r0, [r1, #0xb]
|
||||||
|
str r5, [r1, #0x50]
|
||||||
|
mov r0, r8
|
||||||
|
str r0, [r1, #0x54]
|
||||||
|
adds r0, r1, #0
|
||||||
|
adds r0, #0x74
|
||||||
|
strb r6, [r0]
|
||||||
|
adds r0, r7, #0
|
||||||
|
bl sub_08031E48
|
||||||
|
movs r0, #6
|
||||||
|
strb r0, [r7, #0xc]
|
||||||
|
movs r0, #0x14
|
||||||
|
strb r0, [r7, #0xe]
|
||||||
|
adds r2, r7, #0
|
||||||
|
adds r2, #0x29
|
||||||
|
ldrb r0, [r2]
|
||||||
|
movs r1, #7
|
||||||
|
orrs r0, r1
|
||||||
|
strb r0, [r2]
|
||||||
|
adds r0, r7, #0
|
||||||
|
movs r1, #7
|
||||||
|
bl InitializeAnimation
|
||||||
|
b _08031D66
|
||||||
|
.align 2, 0
|
||||||
|
_08031D50: .4byte gUnk_03003DBC
|
||||||
|
_08031D54:
|
||||||
|
movs r0, #1
|
||||||
|
ands r0, r1
|
||||||
|
cmp r0, #0
|
||||||
|
beq _08031D66
|
||||||
|
strb r2, [r3]
|
||||||
|
ldrb r1, [r7, #0x10]
|
||||||
|
movs r0, #0x7f
|
||||||
|
ands r0, r1
|
||||||
|
strb r0, [r7, #0x10]
|
||||||
|
_08031D66:
|
||||||
|
pop {r3, r4}
|
||||||
|
mov r8, r3
|
||||||
|
mov sb, r4
|
||||||
|
pop {r4, r5, r6, r7, pc}
|
||||||
|
.align 2, 0
|
||||||
|
.syntax divided
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
|
||||||
|
.text
|
||||||
|
|
||||||
|
push {r4, lr}
|
||||||
|
adds r4, r0, #0
|
||||||
|
movs r0, #1
|
||||||
|
bl sub_08049DF4
|
||||||
|
adds r2, r0, #0
|
||||||
|
cmp r2, #0
|
||||||
|
beq _08031E44
|
||||||
|
adds r0, r4, #0
|
||||||
|
adds r0, #0x5a
|
||||||
|
ldrb r0, [r0]
|
||||||
|
movs r3, #6
|
||||||
|
ands r3, r0
|
||||||
|
ldr r0, _08031E40 @ =gUnk_080CE5C0
|
||||||
|
adds r3, r3, r0
|
||||||
|
movs r0, #0x2e
|
||||||
|
ldrsh r1, [r2, r0]
|
||||||
|
movs r0, #0
|
||||||
|
ldrsb r0, [r3, r0]
|
||||||
|
adds r1, r1, r0
|
||||||
|
movs r0, #0x32
|
||||||
|
ldrsh r2, [r2, r0]
|
||||||
|
movs r0, #1
|
||||||
|
ldrsb r0, [r3, r0]
|
||||||
|
adds r2, r2, r0
|
||||||
|
adds r0, r4, #0
|
||||||
|
movs r3, #0x50
|
||||||
|
bl sub_0806FCB8
|
||||||
|
b _08031E46
|
||||||
|
.align 2, 0
|
||||||
|
_08031E40: .4byte gUnk_080CE5C0
|
||||||
|
_08031E44:
|
||||||
|
movs r0, #0
|
||||||
|
_08031E46:
|
||||||
|
pop {r4, pc}
|
||||||
|
.syntax divided
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
|
||||||
|
.text
|
||||||
|
|
||||||
|
push {lr}
|
||||||
|
adds r3, r0, #0
|
||||||
|
adds r2, r3, #0
|
||||||
|
adds r2, #0x78
|
||||||
|
ldrb r0, [r2]
|
||||||
|
cmp r0, #0
|
||||||
|
beq _08032316
|
||||||
|
subs r0, #1
|
||||||
|
strb r0, [r2]
|
||||||
|
lsls r0, r0, #0x18
|
||||||
|
cmp r0, #0
|
||||||
|
bne _08032334
|
||||||
|
ldrb r2, [r3, #0x18]
|
||||||
|
lsls r1, r2, #0x19
|
||||||
|
lsrs r1, r1, #0x1f
|
||||||
|
movs r0, #1
|
||||||
|
eors r1, r0
|
||||||
|
lsls r1, r1, #6
|
||||||
|
subs r0, #0x42
|
||||||
|
ands r0, r2
|
||||||
|
orrs r0, r1
|
||||||
|
strb r0, [r3, #0x18]
|
||||||
|
b _08032334
|
||||||
|
_08032316:
|
||||||
|
ldrb r1, [r3, #0x15]
|
||||||
|
movs r0, #0xf
|
||||||
|
ands r0, r1
|
||||||
|
cmp r0, #0
|
||||||
|
beq _08032334
|
||||||
|
lsrs r1, r1, #4
|
||||||
|
movs r0, #1
|
||||||
|
eors r1, r0
|
||||||
|
ldrb r0, [r3, #0x18]
|
||||||
|
lsls r0, r0, #0x19
|
||||||
|
lsrs r0, r0, #0x1f
|
||||||
|
cmp r1, r0
|
||||||
|
beq _08032334
|
||||||
|
movs r0, #6
|
||||||
|
strb r0, [r2]
|
||||||
|
_08032334:
|
||||||
|
pop {pc}
|
||||||
|
.align 2, 0
|
||||||
|
.syntax divided
|
|
@ -91,7 +91,7 @@ typedef struct Entity {
|
||||||
/*0x3a*/ u8 field_0x3a;
|
/*0x3a*/ u8 field_0x3a;
|
||||||
/*0x3b*/ u8 flags2;
|
/*0x3b*/ u8 flags2;
|
||||||
/*0x3c*/ u8 field_0x3c;
|
/*0x3c*/ u8 field_0x3c;
|
||||||
/*0x3d*/ u8 hurtBlinkTime;
|
/*0x3d*/ s8 hurtBlinkTime;
|
||||||
/*0x3e*/ u8 field_0x3e;
|
/*0x3e*/ u8 field_0x3e;
|
||||||
/*0x3f*/ u8 damageType;
|
/*0x3f*/ u8 damageType;
|
||||||
/*0x40*/ u8 field_0x40;
|
/*0x40*/ u8 field_0x40;
|
||||||
|
@ -130,10 +130,10 @@ typedef struct Entity {
|
||||||
/*0x6c*/ union SplitHWord field_0x6c;
|
/*0x6c*/ union SplitHWord field_0x6c;
|
||||||
/*0x6e*/ u8 filler4[2];
|
/*0x6e*/ u8 filler4[2];
|
||||||
/*0x70*/ union SplitWord field_0x70;
|
/*0x70*/ union SplitWord field_0x70;
|
||||||
/*0x74*/ u16 field_0x74;
|
/*0x74*/ union SplitHWord field_0x74;
|
||||||
/*0x76*/ u16 field_0x76;
|
/*0x76*/ union SplitHWord field_0x76;
|
||||||
/*0x78*/ union SplitHWord field_0x78;
|
/*0x78*/ union SplitHWord field_0x78;
|
||||||
/*0x7a*/ u16 field_0x7a;
|
/*0x7a*/ union SplitHWord field_0x7a;
|
||||||
/*0x7c*/ union SplitWord field_0x7c;
|
/*0x7c*/ union SplitWord field_0x7c;
|
||||||
/*0x80*/ union SplitHWord field_0x80;
|
/*0x80*/ union SplitHWord field_0x80;
|
||||||
/*0x82*/ union SplitHWord field_0x82;
|
/*0x82*/ union SplitHWord field_0x82;
|
||||||
|
|
|
@ -60,7 +60,7 @@ extern void sub_0805EC9C();
|
||||||
extern void sub_0805EC60();
|
extern void sub_0805EC60();
|
||||||
extern void sub_080873D0();
|
extern void sub_080873D0();
|
||||||
extern u8 sub_080045D4(s16, s16, u16, u16);
|
extern u8 sub_080045D4(s16, s16, u16, u16);
|
||||||
extern void sub_0806F69C();
|
extern void sub_0806F69C(Entity*);
|
||||||
extern void sub_0805E3A0(Entity*, u32);
|
extern void sub_0805E3A0(Entity*, u32);
|
||||||
extern void sub_0806D0B0(Entity*);
|
extern void sub_0806D0B0(Entity*);
|
||||||
extern void sub_0807DD64(Entity*);
|
extern void sub_0807DD64(Entity*);
|
||||||
|
|
|
@ -374,7 +374,7 @@ SECTIONS {
|
||||||
asm/rope.o(.text);
|
asm/rope.o(.text);
|
||||||
src/enemy/smallPesto.o(.text);
|
src/enemy/smallPesto.o(.text);
|
||||||
asm/smallPesto.o(.text);
|
asm/smallPesto.o(.text);
|
||||||
asm/acroBandits.o(.text);
|
src/enemy/acroBandits.o(.text);
|
||||||
src/enemy/bladeTrap.o(.text);
|
src/enemy/bladeTrap.o(.text);
|
||||||
src/enemy/keaton.o(.text);
|
src/enemy/keaton.o(.text);
|
||||||
asm/crow.o(.text);
|
asm/crow.o(.text);
|
||||||
|
|
|
@ -0,0 +1,572 @@
|
||||||
|
#include "global.h"
|
||||||
|
#include "entity.h"
|
||||||
|
#include "functions.h"
|
||||||
|
|
||||||
|
extern u32 sub_080002D4(s32, s32, u32);
|
||||||
|
extern s32 sub_080012DC(Entity*);
|
||||||
|
extern void sub_08001324(Entity*);
|
||||||
|
extern u32 sub_080044EC(Entity*, u32);
|
||||||
|
extern u32 sub_08031E04(Entity*);
|
||||||
|
extern void sub_08031E48(Entity*, Entity*);
|
||||||
|
extern void sub_08032290(Entity*);
|
||||||
|
extern u32 sub_080322A4(Entity*);
|
||||||
|
void sub_080322E8(Entity*);
|
||||||
|
extern void sub_08032338(Entity*);
|
||||||
|
extern Entity* sub_08049DF4(u32);
|
||||||
|
extern u8 sub_08049F84(Entity*, u32);
|
||||||
|
extern void sub_0804A9FC(Entity*, u32);
|
||||||
|
extern void sub_0804AA30(Entity*, void (*const funcs[])(Entity*));
|
||||||
|
extern u32 sub_0806FCB8(Entity*, u32, u32, u32);
|
||||||
|
extern u32 GetNextFunction(Entity*);
|
||||||
|
extern void SetChildOffset(Entity*, s32, s32, s32);
|
||||||
|
extern u32 Random(void);
|
||||||
|
|
||||||
|
extern Entity* gUnk_020000B0;
|
||||||
|
extern u8 gUnk_03003DBC;
|
||||||
|
extern void (*const gUnk_080012C8[])(Entity*);
|
||||||
|
extern void (*const gUnk_080CE56C[])(Entity*);
|
||||||
|
extern void (*const gUnk_080CE584[])(Entity*);
|
||||||
|
extern void (*const gUnk_080CE58C[])(Entity*);
|
||||||
|
extern void (*const gUnk_080CE5C8[])(Entity*);
|
||||||
|
extern u8 gUnk_080CE5B0[8];
|
||||||
|
extern u8 gUnk_080CE5B8[8];
|
||||||
|
extern union SplitHWord gUnk_080CE5C0[4];
|
||||||
|
extern u16 gUnk_080CE5F0[5];
|
||||||
|
extern u8 gUnk_080CE5FA[20]; // Directions
|
||||||
|
|
||||||
|
void AcroBandit(Entity* this) {
|
||||||
|
s32 index;
|
||||||
|
|
||||||
|
index = sub_080012DC(this);
|
||||||
|
|
||||||
|
if (index) {
|
||||||
|
if ((this->field_0x3a & 1) == 0)
|
||||||
|
sub_08032338(this);
|
||||||
|
|
||||||
|
gUnk_080012C8[index](this);
|
||||||
|
} else {
|
||||||
|
gUnk_080CE56C[GetNextFunction(this)](this);
|
||||||
|
SetChildOffset(this, 0, 1, -0x10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080318C4(Entity* this) {
|
||||||
|
gUnk_080CE584[this->entityType.form](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080318DC(Entity* this) {
|
||||||
|
Entity* brother;
|
||||||
|
|
||||||
|
if (this->bitfield != 0x80 && this->bitfield != 0x81) {
|
||||||
|
if (this->entityType.form == 1) {
|
||||||
|
if (this->action < 7 && this->field_0x42) {
|
||||||
|
brother = this->attachedEntity;
|
||||||
|
if (brother) {
|
||||||
|
brother->parent = this->parent;
|
||||||
|
do {
|
||||||
|
brother->action = 5;
|
||||||
|
brother->spritePriority.b1 = 1;
|
||||||
|
if (brother->hurtBlinkTime == 0)
|
||||||
|
brother->hurtBlinkTime = -12;
|
||||||
|
} while (brother = brother->attachedEntity, brother != NULL);
|
||||||
|
}
|
||||||
|
if (this->parent) {
|
||||||
|
this->parent->attachedEntity = this->attachedEntity;
|
||||||
|
} else {
|
||||||
|
if (this->attachedEntity)
|
||||||
|
this->parent = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->action = 9;
|
||||||
|
this->spritePriority.b1 = 1;
|
||||||
|
if (this->field_0x3e < 0x10) {
|
||||||
|
this->spriteSettings.b.flipX = 0;
|
||||||
|
} else {
|
||||||
|
this->spriteSettings.b.flipX = 1;
|
||||||
|
}
|
||||||
|
InitializeAnimation(this, 14);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->currentHealth == 0) {
|
||||||
|
this->field_0x3e = ((this->field_0x3e + (7 & Random())) - 4) & 0x1f;
|
||||||
|
this->field_0x42 += this->entityType.parameter * 3;
|
||||||
|
sub_08032338(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->field_0x42 && this->frames.all & 0x10) {
|
||||||
|
if (this->entityType.form == 0) {
|
||||||
|
this->action = 8;
|
||||||
|
} else {
|
||||||
|
this->action = 9;
|
||||||
|
}
|
||||||
|
if (this->field_0x3e < 0x10) {
|
||||||
|
this->spriteSettings.b.flipX = 0;
|
||||||
|
} else {
|
||||||
|
this->spriteSettings.b.flipX = 1;
|
||||||
|
}
|
||||||
|
this->spritePriority.b1 = 1;
|
||||||
|
InitializeAnimation(this, 14);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->field_0x43)
|
||||||
|
sub_0804A9FC(this, 0x1c);
|
||||||
|
|
||||||
|
sub_0804AA30(this, gUnk_080CE56C);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031A60(Entity* this) {
|
||||||
|
if (this->hurtBlinkTime > 0)
|
||||||
|
sub_08003FC4(this, 0x1800);
|
||||||
|
|
||||||
|
sub_08001324(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nullsub_154(void) {
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031A88(Entity* this) {
|
||||||
|
gUnk_080CE58C[this->action](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031AA0(Entity* this) {
|
||||||
|
sub_0804A720(this);
|
||||||
|
this->action = '\x01';
|
||||||
|
this->field_0x74.HWORD = this->x.HALF.HI;
|
||||||
|
this->field_0x76.HWORD = this->y.HALF.HI;
|
||||||
|
this->field_0x78.HALF.HI = Random();
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031AC8(Entity* this)
|
||||||
|
|
||||||
|
{
|
||||||
|
u32 rand;
|
||||||
|
s32 x, y;
|
||||||
|
|
||||||
|
if (this->actionDelay) {
|
||||||
|
this->actionDelay--;
|
||||||
|
} else {
|
||||||
|
if (sub_08049FDC(this, 1)) {
|
||||||
|
rand = Random();
|
||||||
|
x = this->field_0x74.HWORD + ((s32)rand % 5) * 0x10 - 0x20;
|
||||||
|
y = this->field_0x76.HWORD + ((s32)(rand >> 4) % 5) * 0x10 - 0x20;
|
||||||
|
if (sub_080002D4(x, y, this->collisionLayer) == 0) {
|
||||||
|
this->action = 2;
|
||||||
|
this->spriteSettings.b.draw = 1;
|
||||||
|
this->x.HALF.HI = x;
|
||||||
|
this->y.HALF.HI = y;
|
||||||
|
InitializeAnimation(this, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031B48(Entity* this) {
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->frames.b.f0) {
|
||||||
|
this->frames.all = 0;
|
||||||
|
this->flags |= 0x80;
|
||||||
|
} else {
|
||||||
|
if (this->frames.b.f3) {
|
||||||
|
this->action = 0x3;
|
||||||
|
this->actionDelay = gUnk_080CE5B0[Random() & 7];
|
||||||
|
InitializeAnimation(this, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031B98(Entity* this) {
|
||||||
|
if (sub_08031E04(this)) {
|
||||||
|
this->action = 5;
|
||||||
|
if (this->x.HALF.HI > gUnk_020000B0->x.HALF.HI) {
|
||||||
|
this->spriteSettings.b.flipX = 0;
|
||||||
|
} else {
|
||||||
|
this->spriteSettings.b.flipX = 1;
|
||||||
|
}
|
||||||
|
InitializeAnimation(this, 3);
|
||||||
|
} else {
|
||||||
|
if (this->frames.b.f0 && this->actionDelay) {
|
||||||
|
// this->frames.b.f0 = 0;
|
||||||
|
this->frames.all &= 0xfe;
|
||||||
|
this->actionDelay--;
|
||||||
|
}
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->actionDelay == 0) {
|
||||||
|
this->action = 4;
|
||||||
|
this->flags &= 0x7f;
|
||||||
|
InitializeAnimation(this, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031C1C(Entity* this) {
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->frames.b.f3) {
|
||||||
|
this->action = '\x01';
|
||||||
|
this->actionDelay = gUnk_080CE5B8[Random() & 7];
|
||||||
|
this->spriteSettings.b.draw = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if NON_MATCHING
|
||||||
|
void sub_08031C58(Entity* this) {
|
||||||
|
u8 tmp;
|
||||||
|
Entity *a, *b;
|
||||||
|
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->frames.b.f3) {
|
||||||
|
if (gUnk_03003DBC < 0x43) {
|
||||||
|
tmp = Random();
|
||||||
|
tmp &= 3;
|
||||||
|
|
||||||
|
a = CreateEnemy(0x2e, 1);
|
||||||
|
a->entityType.parameter = 0;
|
||||||
|
a->parent = NULL;
|
||||||
|
a->field_0x74.HALF.LO = tmp;
|
||||||
|
sub_08031E48(this, a);
|
||||||
|
|
||||||
|
b = CreateEnemy(0x2e, 1);
|
||||||
|
a->attachedEntity = b;
|
||||||
|
b->entityType.parameter = 1;
|
||||||
|
b->parent = a;
|
||||||
|
b->field_0x74.HALF.LO = tmp;
|
||||||
|
sub_08031E48(this, b);
|
||||||
|
|
||||||
|
a = CreateEnemy(0x2e, 1);
|
||||||
|
b->attachedEntity = a;
|
||||||
|
a->entityType.parameter = 2;
|
||||||
|
a->parent = b;
|
||||||
|
a->field_0x74.HALF.LO = tmp;
|
||||||
|
sub_08031E48(this, a);
|
||||||
|
|
||||||
|
b = CreateEnemy(0x2e, 1);
|
||||||
|
a->attachedEntity = b;
|
||||||
|
b->entityType.parameter = 3;
|
||||||
|
b->parent = a;
|
||||||
|
b->field_0x74.HALF.LO = tmp;
|
||||||
|
sub_08031E48(this, b);
|
||||||
|
|
||||||
|
a = CreateEnemy(0x2e, 1);
|
||||||
|
b->attachedEntity = a;
|
||||||
|
a->entityType.parameter = 4;
|
||||||
|
a->parent = b;
|
||||||
|
a->attachedEntity = NULL;
|
||||||
|
a->field_0x74.HALF.LO = tmp;
|
||||||
|
sub_08031E48(this, a);
|
||||||
|
|
||||||
|
this->action = 6;
|
||||||
|
this->actionDelay = 20;
|
||||||
|
this->spritePriority.b0 = 7;
|
||||||
|
InitializeAnimation(this, 7);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this->frames.b.f0) {
|
||||||
|
this->frames.all = 0;
|
||||||
|
this->flags &= 0x7f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
NAKED
|
||||||
|
void sub_08031C58(Entity* this) {
|
||||||
|
asm(".include \"asm/non_matching/acroBandits/sub_08031C58.inc\"");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void sub_08031D70(Entity* this) {
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (--this->actionDelay == '\0') {
|
||||||
|
this->action = 7;
|
||||||
|
this->flags &= 0x7f;
|
||||||
|
this->actionDelay = 5;
|
||||||
|
this->spriteSettings.b.draw = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031DA0(Entity* this) {
|
||||||
|
if ((this->actionDelay & 0xf) == 0) {
|
||||||
|
if (this->actionDelay == 0x50) {
|
||||||
|
DeleteEntity(this);
|
||||||
|
} else {
|
||||||
|
this->action = 1;
|
||||||
|
this->actionDelay = 0xb4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031DC4(Entity* this) {
|
||||||
|
if (this->frames.b.f3) {
|
||||||
|
this->action = 1;
|
||||||
|
this->actionDelay = 0xb4;
|
||||||
|
this->spriteSettings.b.draw = 0;
|
||||||
|
} else {
|
||||||
|
GetNextFrame(this);
|
||||||
|
if ((this->frames.all & 0xf) == 2) {
|
||||||
|
this->flags &= 0x7f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if NON_MATCHING
|
||||||
|
u32 sub_08031E04(Entity* this) {
|
||||||
|
Entity* ent;
|
||||||
|
union SplitHWord* tmp;
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
ent = sub_08049DF4(1);
|
||||||
|
if (ent == NULL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
tmp = &gUnk_080CE5C0[this->frames.all & 6];
|
||||||
|
x = ent->x.HALF.HI + tmp->HALF.LO;
|
||||||
|
y = ent->y.HALF.HI + tmp->HALF.HI;
|
||||||
|
return sub_0806FCB8(this, x, y, 0x50);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
NAKED
|
||||||
|
u32 sub_08031E04(Entity* this) {
|
||||||
|
asm(".include \"asm/non_matching/acroBandits/sub_08031E04.inc\"");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void sub_08031E48(Entity* this, Entity* child) {
|
||||||
|
CopyPosition(this, child);
|
||||||
|
child->field_0x6c.HALF.LO = this->field_0x6c.HALF.LO;
|
||||||
|
child->field_0x70.HALF.LO = this->field_0x70.HALF.LO;
|
||||||
|
child->field_0x70.HALF.HI = this->field_0x70.HALF.HI;
|
||||||
|
child->filler4[0] = this->filler4[0];
|
||||||
|
child->filler4[1] = this->filler4[1];
|
||||||
|
child->field_0x7c.WORD = (s32)this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031E90(Entity* this) {
|
||||||
|
gUnk_080CE5C8[this->action](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031EA8(Entity* this) {
|
||||||
|
this->action = 1;
|
||||||
|
this->spritePriority.b1 = 1;
|
||||||
|
this->field_0x20 = 0x40000;
|
||||||
|
this->height.HALF.HI = (4 - this->entityType.parameter) * 0xe;
|
||||||
|
this->field_0x78.HALF.HI = Random();
|
||||||
|
InitializeAnimation(this, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031EE8(Entity* this) {
|
||||||
|
int draw;
|
||||||
|
|
||||||
|
this->height.WORD -= this->field_0x20;
|
||||||
|
this->field_0x20 -= 0x1800;
|
||||||
|
|
||||||
|
if (this->height.HALF.HI < 1) {
|
||||||
|
draw = this->spriteSettings.b.draw;
|
||||||
|
if (!draw)
|
||||||
|
sub_08004488(299);
|
||||||
|
|
||||||
|
this->spriteSettings.b.draw = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
draw = this->spriteSettings.b.draw;
|
||||||
|
if (draw == 1)
|
||||||
|
GetNextFrame(this);
|
||||||
|
|
||||||
|
if (this->field_0x20 < 1) {
|
||||||
|
this->action = 2;
|
||||||
|
this->flags |= 0x80;
|
||||||
|
InitializeAnimation(this, 5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031F54(Entity* this) {
|
||||||
|
sub_08003FC4(this, gUnk_080CE5F0[this->entityType.parameter]);
|
||||||
|
if (this->entityType.parameter * -0xe <= this->height.HALF.HI) {
|
||||||
|
this->action = 3;
|
||||||
|
this->actionDelay = 20;
|
||||||
|
this->height.HALF.HI = this->entityType.parameter * -0xe;
|
||||||
|
if (this->parent != NULL)
|
||||||
|
this->spritePriority.b1 = 0;
|
||||||
|
InitializeAnimation(this, 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08031FB0(Entity* this) {
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->frames.b.f3 && (this->parent || --this->actionDelay == 0)) {
|
||||||
|
this->action = 4;
|
||||||
|
this->direction = sub_08049F84(this, 1);
|
||||||
|
*(u8*)&this->field_0x76 = 0;
|
||||||
|
if (this->attachedEntity) {
|
||||||
|
InitializeAnimation(this, 9);
|
||||||
|
} else {
|
||||||
|
InitializeAnimation(this, 8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08032008(Entity* this) {
|
||||||
|
Entity* parent;
|
||||||
|
|
||||||
|
if (sub_080322A4(this) == 0) {
|
||||||
|
parent = this->parent;
|
||||||
|
if (parent == 0) {
|
||||||
|
if (sub_08049FDC(this, 1)) {
|
||||||
|
if ((++this->field_0x78.HALF.HI & 7) == 0) {
|
||||||
|
sub_08004596(this, GetFacingDirection(this, gUnk_020000B0));
|
||||||
|
}
|
||||||
|
this->field_0x76.HALF.LO = 0;
|
||||||
|
} else {
|
||||||
|
if (this->field_0x76.HALF.LO) {
|
||||||
|
(this->field_0x76.HALF.LO)--;
|
||||||
|
sub_08004596(this, this->field_0x7a.HALF.LO);
|
||||||
|
} else {
|
||||||
|
this->field_0x76.HALF.LO = 0x10;
|
||||||
|
if (sub_08049FA0(this) == 0 && (Random() & 1)) {
|
||||||
|
this->field_0x7a.HALF.LO = sub_08049EE4(this);
|
||||||
|
} else {
|
||||||
|
this->field_0x7a.HALF.LO = Random() & 30;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->direction & 0xf) {
|
||||||
|
this->spriteSettings.b.flipX = !(!(this->direction & 0x10) ^ 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub_080AEF88(this);
|
||||||
|
} else {
|
||||||
|
if (this->field_0x76.HALF.HI == 0) {
|
||||||
|
if (sub_0806FCB8(this, parent->x.HALF.HI, parent->y.HALF.HI, 1) == 0) {
|
||||||
|
this->field_0x76.HALF.HI = 1;
|
||||||
|
this->direction = GetFacingDirection(this, parent);
|
||||||
|
sub_080322E8(this);
|
||||||
|
sub_0806F69C(this);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this->direction = GetFacingDirection(this, parent);
|
||||||
|
sub_080322E8(this);
|
||||||
|
sub_0806F69C(this);
|
||||||
|
if (this->x.HALF.HI == parent->x.HALF.HI && this->y.HALF.HI == parent->y.HALF.HI)
|
||||||
|
this->field_0x76.HALF.HI = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GetNextFrame(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08032148(Entity* this) {
|
||||||
|
if (sub_08003FC4(this, 0x2000))
|
||||||
|
return;
|
||||||
|
|
||||||
|
sub_08032290(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08032160(Entity* this) {
|
||||||
|
Entity* tmp;
|
||||||
|
u32 dir;
|
||||||
|
|
||||||
|
if (this->actionDelay == 0) {
|
||||||
|
this->action = 7;
|
||||||
|
dir = gUnk_080CE5FA[this->field_0x74.HALF.LO * 5 + this->entityType.parameter];
|
||||||
|
this->direction = dir;
|
||||||
|
if (dir >= 0x10) {
|
||||||
|
this->spriteSettings.b.flipX = 1;
|
||||||
|
} else {
|
||||||
|
this->spriteSettings.b.flipX = 0;
|
||||||
|
}
|
||||||
|
this->nonPlanarMovement = 0xf0;
|
||||||
|
this->field_0x20 = 0x12000;
|
||||||
|
this->spritePriority.b1 = 1;
|
||||||
|
InitializeAnimation(this, 12);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->attachedEntity == NULL) {
|
||||||
|
for (tmp = this->parent; tmp != NULL; tmp = tmp->parent) {
|
||||||
|
if (tmp->currentHealth != 0)
|
||||||
|
tmp->actionDelay = 0;
|
||||||
|
}
|
||||||
|
this->actionDelay = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080321E8(Entity* this) {
|
||||||
|
sub_080AEFE0(this);
|
||||||
|
|
||||||
|
if (sub_080044EC(this, 0x2000) == 0)
|
||||||
|
this->action = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08032204(Entity* this) {
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->frames.all & 1) {
|
||||||
|
this->frames.all = 0;
|
||||||
|
this->frameDuration = (Random() & 0x30) + 30;
|
||||||
|
} else {
|
||||||
|
if (this->frames.all & 0x80) {
|
||||||
|
this->action = 9;
|
||||||
|
InitializeAnimation(this, 13);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08032248(Entity* this) {
|
||||||
|
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||||
|
if (this->frames.all & 0x80) {
|
||||||
|
((Entity*)this->field_0x7c.WORD)->actionDelay--;
|
||||||
|
|
||||||
|
DeleteEntity(this);
|
||||||
|
} else {
|
||||||
|
GetNextFrame(this);
|
||||||
|
|
||||||
|
if ((this->frames.all & 0xf) == 2)
|
||||||
|
this->flags &= 0x7f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08032290(Entity* this) {
|
||||||
|
this->action = 6;
|
||||||
|
this->actionDelay = 12;
|
||||||
|
InitializeAnimation(this, 11);
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 sub_080322A4(Entity* this) {
|
||||||
|
if (this->attachedEntity != NULL && (this->attachedEntity->height.HALF.HI + 8) >= this->height.HALF.HI) {
|
||||||
|
if (this->height.HALF.HI) {
|
||||||
|
this->action = 5;
|
||||||
|
this->height.HALF.HI = this->attachedEntity->height.HALF.HI + 8;
|
||||||
|
InitializeAnimation(this, 11);
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
sub_08032290(this);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if NON_MATCHING
|
||||||
|
void sub_080322E8(Entity* this) {
|
||||||
|
if (this->field_0x78.HALF.LO) {
|
||||||
|
if (--this->field_0x78.HALF.LO == 0) {
|
||||||
|
this->spriteSettings.b.flipX = this->spriteOrientation.flipX;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((this->direction & 0xf) &&
|
||||||
|
((this->direction >> 4 ^ 1) != -((int)((u32)this->spriteSettings.raw << 0x19) >> 0x1f))) {
|
||||||
|
this->field_0x78.HALF.LO = 6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
NAKED
|
||||||
|
void sub_080322E8(Entity* this) {
|
||||||
|
asm(".include \"asm/non_matching/acroBandits/sub_080322E8.inc\"");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void sub_08032338(Entity *this) {
|
||||||
|
if ((((Entity*)this->field_0x7c.WORD)->actionDelay += 15) != 80)
|
||||||
|
this->field_0x6c.HALF.LO = 0;
|
||||||
|
}
|
|
@ -22,7 +22,7 @@ void BladeTrap(Entity* ent) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
puVar3 = &(ent->field_0x74);
|
puVar3 = &(ent->field_0x74.HWORD);
|
||||||
uVar1 = *puVar3;
|
uVar1 = *puVar3;
|
||||||
*puVar3 = uVar1 - 1;
|
*puVar3 = uVar1 - 1;
|
||||||
if ((*puVar3) == 0) {
|
if ((*puVar3) == 0) {
|
||||||
|
|
|
@ -104,7 +104,7 @@ void sub_080324FC(Entity* this) {
|
||||||
if (this->field_0xf == 0) {
|
if (this->field_0xf == 0) {
|
||||||
this->action = 4;
|
this->action = 4;
|
||||||
this->nonPlanarMovement = 0x1E0;
|
this->nonPlanarMovement = 0x1E0;
|
||||||
this->field_0x76 = 0x46;
|
this->field_0x76.HWORD = 0x46;
|
||||||
this->field_0x78.HWORD = 0;
|
this->field_0x78.HWORD = 0;
|
||||||
*(((u8*)&this->field_0x7a) + 1) = 0;
|
*(((u8*)&this->field_0x7a) + 1) = 0;
|
||||||
sub_080327C8(this);
|
sub_080327C8(this);
|
||||||
|
@ -121,13 +121,13 @@ void sub_08032574(Entity* this) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (--this->field_0x76 == 0 || !sub_080AEFE0(this)) {
|
if (--this->field_0x76.HWORD == 0 || !sub_080AEFE0(this)) {
|
||||||
sub_0803275C(this);
|
sub_0803275C(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateAnimationSingleFrame(this);
|
UpdateAnimationSingleFrame(this);
|
||||||
if ((this->field_0x76 & 0x7) == 0) {
|
if ((this->field_0x76.HWORD & 0x7) == 0) {
|
||||||
sub_08032794(this);
|
sub_08032794(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,12 +184,12 @@ void sub_0803269C(Entity* this, u32 param_2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080326FC(Entity* this) {
|
void sub_080326FC(Entity* this) {
|
||||||
this->field_0x74 = gUnk_080CE7F0[Random() & 0xF];
|
this->field_0x74.HWORD = gUnk_080CE7F0[Random() & 0xF];
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 sub_0803271C(Entity* this) {
|
u32 sub_0803271C(Entity* this) {
|
||||||
this->field_0x74--;
|
this->field_0x74.HWORD--;
|
||||||
if (this->field_0x74 == 0) {
|
if (this->field_0x74.HWORD == 0) {
|
||||||
sub_08032784(this);
|
sub_08032784(this);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,8 +85,8 @@ void sub_08021E4C(Entity *this)
|
||||||
if (this->field_0x78.HWORD != 0) {
|
if (this->field_0x78.HWORD != 0) {
|
||||||
this->field_0x78.HWORD--;
|
this->field_0x78.HWORD--;
|
||||||
}
|
}
|
||||||
if (this->field_0x7a != 0) {
|
if (this->field_0x7a.HWORD != 0) {
|
||||||
(this->field_0x7a)--;
|
(this->field_0x7a.HWORD)--;
|
||||||
}
|
}
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
if ((this->frames.b.f3) != 0) {
|
if ((this->frames.b.f3) != 0) {
|
||||||
|
@ -126,7 +126,7 @@ void sub_08021EF0(Entity *this)
|
||||||
|
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->field_0x78.HWORD = gUnk_080CB6D6[Random() & 0xf];
|
this->field_0x78.HWORD = gUnk_080CB6D6[Random() & 0xf];
|
||||||
this->field_0x7a = 0x3c;
|
this->field_0x7a.HWORD = 0x3c;
|
||||||
InitializeAnimation(this, 0);
|
InitializeAnimation(this, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ void sub_08021F24(Entity *this)
|
||||||
this->actionDelay = gUnk_080CB6F6[Random() & 0xf];
|
this->actionDelay = gUnk_080CB6F6[Random() & 0xf];
|
||||||
InitializeAnimation(this, 1);
|
InitializeAnimation(this, 1);
|
||||||
}
|
}
|
||||||
else if (!this->field_0x7a && !(sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) {
|
else if (!this->field_0x7a.HWORD && !(sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
this->actionDelay = 0x1e;
|
this->actionDelay = 0x1e;
|
||||||
InitializeAnimation(this, 1);
|
InitializeAnimation(this, 1);
|
||||||
|
|
|
@ -161,8 +161,8 @@ void sub_0803C87C(Entity *this) {
|
||||||
|
|
||||||
this->spriteOffsetY = 0xff;
|
this->spriteOffsetY = 0xff;
|
||||||
|
|
||||||
this->field_0x74 = this->x.HALF.HI;
|
this->field_0x74.HWORD = this->x.HALF.HI;
|
||||||
this->field_0x76 = this->y.HALF.HI;
|
this->field_0x76.HWORD = this->y.HALF.HI;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0803C8BC(Entity *this) {
|
void sub_0803C8BC(Entity *this) {
|
||||||
|
@ -294,8 +294,8 @@ void sub_0803CA84(Entity *this, u32 unkParameter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_0803CAD0(Entity *this) {
|
void sub_0803CAD0(Entity *this) {
|
||||||
if (sub_0806FCB8(this, this->field_0x74, this->field_0x76, 1) == 0) {
|
if (sub_0806FCB8(this, this->field_0x74.HWORD, this->field_0x76.HWORD, 1) == 0) {
|
||||||
this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, this->field_0x74, this->field_0x76);
|
this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, this->field_0x74.HWORD, this->field_0x76.HWORD);
|
||||||
|
|
||||||
sub_080AEFE0(this);
|
sub_080AEFE0(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ void sub_0803CD6C(Entity *this) {
|
||||||
this->parent = lakitu;
|
this->parent = lakitu;
|
||||||
|
|
||||||
this->field_0x78.HWORD = this->x.HALF.HI;
|
this->field_0x78.HWORD = this->x.HALF.HI;
|
||||||
this->field_0x7a = this->y.HALF.HI;
|
this->field_0x7a.HWORD = this->y.HALF.HI;
|
||||||
|
|
||||||
InitAnimationForceUpdate(this, 4);
|
InitAnimationForceUpdate(this, 4);
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ void sub_0803CDA8(Entity *this) {
|
||||||
sub_0806F69C(this);
|
sub_0806F69C(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (--this->field_0x74 << 0x10 == 0) {
|
if (--this->field_0x74.HWORD << 0x10 == 0) {
|
||||||
sub_0803CE14(this);
|
sub_0803CE14(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ void sub_0803CDD8(Entity *this) {
|
||||||
void sub_0803CE14(Entity *this) {
|
void sub_0803CE14(Entity *this) {
|
||||||
u8 direction;
|
u8 direction;
|
||||||
|
|
||||||
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74);
|
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD);
|
||||||
|
|
||||||
direction = this->direction;
|
direction = this->direction;
|
||||||
if (direction & 0x80) {
|
if (direction & 0x80) {
|
||||||
|
@ -142,7 +142,7 @@ void sub_0803CE3C(Entity *this) {
|
||||||
this->field_0x3a &= 0xfb;
|
this->field_0x3a &= 0xfb;
|
||||||
|
|
||||||
this->x.HALF.HI = this->field_0x78.HWORD;
|
this->x.HALF.HI = this->field_0x78.HWORD;
|
||||||
this->y.HALF.HI = this->field_0x7a;
|
this->y.HALF.HI = this->field_0x7a.HWORD;
|
||||||
|
|
||||||
this->attachedEntity = this->parent;
|
this->attachedEntity = this->parent;
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ void sub_0801FC28(Entity* this) {
|
||||||
void sub_0801FC40(Entity* this) {
|
void sub_0801FC40(Entity* this) {
|
||||||
if (this->bitfield == 0x80) {
|
if (this->bitfield == 0x80) {
|
||||||
if (this->action == 3) {
|
if (this->action == 3) {
|
||||||
this->field_0x74 = 1;
|
this->field_0x74.HWORD = 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this->field_0x43 != 0) {
|
if (this->field_0x43 != 0) {
|
||||||
|
@ -79,9 +79,9 @@ void sub_0801FD2C(Entity* this) {
|
||||||
if (this->frames.b.f3 != 0) {
|
if (this->frames.b.f3 != 0) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
if (this->entityType.form == 0) {
|
if (this->entityType.form == 0) {
|
||||||
this->field_0x74 = 0xb4;
|
this->field_0x74.HWORD = 0xb4;
|
||||||
} else {
|
} else {
|
||||||
this->field_0x74 = 0x6e;
|
this->field_0x74.HWORD = 0x6e;
|
||||||
}
|
}
|
||||||
InitializeAnimation(this, 2);
|
InitializeAnimation(this, 2);
|
||||||
} else if (this->frames.b.f0 != 0) {
|
} else if (this->frames.b.f0 != 0) {
|
||||||
|
@ -95,7 +95,7 @@ void sub_0801FD80(Entity* this) {
|
||||||
sub_0801FED4(this);
|
sub_0801FED4(this);
|
||||||
GetNextFrame(this);
|
GetNextFrame(this);
|
||||||
|
|
||||||
if (--this->field_0x74 == 0) {
|
if (--this->field_0x74.HWORD == 0) {
|
||||||
this->action = 4;
|
this->action = 4;
|
||||||
this->flags &= 0x7f;
|
this->flags &= 0x7f;
|
||||||
InitializeAnimation(this, 1);
|
InitializeAnimation(this, 1);
|
||||||
|
@ -161,7 +161,7 @@ void sub_0801FED4(Entity* this) {
|
||||||
s16 sVar2;
|
s16 sVar2;
|
||||||
|
|
||||||
if (sub_08049FDC(this, 1) == 0) {
|
if (sub_08049FDC(this, 1) == 0) {
|
||||||
this->field_0x74 = 1;
|
this->field_0x74.HWORD = 1;
|
||||||
}
|
}
|
||||||
sVar2 = (this->frames.all & 0xf) * 0x20;
|
sVar2 = (this->frames.all & 0xf) * 0x20;
|
||||||
this->nonPlanarMovement = sVar2;
|
this->nonPlanarMovement = sVar2;
|
||||||
|
|
|
@ -90,7 +90,7 @@ void sub_08066D94(Entity* ent) {
|
||||||
npc->flags |= 0x20;
|
npc->flags |= 0x20;
|
||||||
npc->animationState = GetAnimationState(ent);
|
npc->animationState = GetAnimationState(ent);
|
||||||
roomID = gRoomControls.roomID;
|
roomID = gRoomControls.roomID;
|
||||||
npc->field_0x74 = roomID;
|
npc->field_0x74.HWORD = roomID;
|
||||||
CopyPosition(ent, npc);
|
CopyPosition(ent, npc);
|
||||||
}
|
}
|
||||||
DeleteThisEntity();
|
DeleteThisEntity();
|
||||||
|
|
|
@ -31,7 +31,7 @@ void sub_0809ED54(Entity *this)
|
||||||
|
|
||||||
if (((this->cutsceneBeh.HWORD == 0) || CheckFlags(this->cutsceneBeh.HWORD)) &&
|
if (((this->cutsceneBeh.HWORD == 0) || CheckFlags(this->cutsceneBeh.HWORD)) &&
|
||||||
((this->entityType.parameter != 1 ||
|
((this->entityType.parameter != 1 ||
|
||||||
(--this->field_0x74 == 0)))) {
|
(--this->field_0x74.HWORD == 0)))) {
|
||||||
sub_0809EE08(this);
|
sub_0809EE08(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ void sub_0809ED88(Entity *this)
|
||||||
sub_0809EE24(this);
|
sub_0809EE24(this);
|
||||||
}
|
}
|
||||||
else if (((this->entityType).parameter == 1) &&
|
else if (((this->entityType).parameter == 1) &&
|
||||||
(--this->field_0x74 == 0)) {
|
(--this->field_0x74.HWORD == 0)) {
|
||||||
sub_0809EE24(this);
|
sub_0809EE24(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ void sub_0809EDE4(Entity *this)
|
||||||
void sub_0809EE08(Entity *this)
|
void sub_0809EE08(Entity *this)
|
||||||
{
|
{
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
this->field_0x74 = *((u8 *)&this->field_0x7c + 3) << 2;
|
this->field_0x74.HWORD = *((u8 *)&this->field_0x7c + 3) << 2;
|
||||||
InitializeAnimation(this, this->entityType.form);
|
InitializeAnimation(this, this->entityType.form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,5 +82,5 @@ void sub_0809EE24(Entity *this)
|
||||||
void sub_0809EE34(Entity *this)
|
void sub_0809EE34(Entity *this)
|
||||||
{
|
{
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->field_0x74 = this->actionDelay << 2;
|
this->field_0x74.HWORD = this->actionDelay << 2;
|
||||||
}
|
}
|
|
@ -73,7 +73,7 @@ void sub_0809EAD8(Entity* this) {
|
||||||
if (this->entityType.parameter != 0) {
|
if (this->entityType.parameter != 0) {
|
||||||
|
|
||||||
this->attachedEntity = GetCurrentRoomProperty(this->entityType.parameter);
|
this->attachedEntity = GetCurrentRoomProperty(this->entityType.parameter);
|
||||||
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74);
|
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
SetTile(0x4050, COORD_TO_TILE(this), this->collisionLayer);
|
SetTile(0x4050, COORD_TO_TILE(this), this->collisionLayer);
|
||||||
|
@ -88,7 +88,7 @@ void sub_0809EB30(Entity* this) {
|
||||||
if ((this->direction & 0x80) == 0) {
|
if ((this->direction & 0x80) == 0) {
|
||||||
sub_0806F69C(this);
|
sub_0806F69C(this);
|
||||||
}
|
}
|
||||||
puVar2 = &this->field_0x74;
|
puVar2 = &this->field_0x74.HWORD;
|
||||||
if (!--*puVar2) {
|
if (!--*puVar2) {
|
||||||
sub_080A2CC0(this, &this->attachedEntity, puVar2);
|
sub_080A2CC0(this, &this->attachedEntity, puVar2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ void sub_080929A4(Entity *this) {
|
||||||
this->field_0x7c.HALF.HI = COORD_TO_TILE(this);
|
this->field_0x7c.HALF.HI = COORD_TO_TILE(this);
|
||||||
this->field_0x7c.HALF.LO = sub_080001DA(this->field_0x7c.HALF.HI, 1);
|
this->field_0x7c.HALF.LO = sub_080001DA(this->field_0x7c.HALF.HI, 1);
|
||||||
|
|
||||||
this->field_0x7a = sub_080002E0(this->field_0x7c.HALF.HI, 1);
|
this->field_0x7a.HWORD = sub_080002E0(this->field_0x7c.HALF.HI, 1);
|
||||||
|
|
||||||
SetTile(0x4022, this->field_0x7c.HALF.HI, 1);
|
SetTile(0x4022, this->field_0x7c.HALF.HI, 1);
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ void sub_08092A94(Entity *this) {
|
||||||
// Presumably, make the mask fall
|
// Presumably, make the mask fall
|
||||||
SetTile((u16)this->field_0x7c.HALF.LO, this->field_0x7c.HALF.HI, 1);
|
SetTile((u16)this->field_0x7c.HALF.LO, this->field_0x7c.HALF.HI, 1);
|
||||||
|
|
||||||
sub_08000148(this->field_0x7a, this->field_0x7c.HALF.HI, 1);
|
sub_08000148(this->field_0x7a.HWORD, this->field_0x7c.HALF.HI, 1);
|
||||||
|
|
||||||
this->action = 2;
|
this->action = 2;
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ void sub_080A0684(Entity *this)
|
||||||
this->spritePriority.b0 = 5;
|
this->spritePriority.b0 = 5;
|
||||||
this->field_0x70.HALF.LO = this->x.HALF.HI;
|
this->field_0x70.HALF.LO = this->x.HALF.HI;
|
||||||
this->field_0x70.HALF.HI = this->y.HALF.HI;
|
this->field_0x70.HALF.HI = this->y.HALF.HI;
|
||||||
this->field_0x74 = COORD_TO_TILE(this);
|
this->field_0x74.HWORD = COORD_TO_TILE(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080A0718(Entity *this)
|
void sub_080A0718(Entity *this)
|
||||||
|
@ -99,17 +99,17 @@ void sub_080A07F0(Entity *this)
|
||||||
|
|
||||||
void sub_080A080C(Entity *this)
|
void sub_080A080C(Entity *this)
|
||||||
{
|
{
|
||||||
this->field_0x76 = sub_080001DA(this->field_0x74 - 1, this->collisionLayer);
|
this->field_0x76.HWORD = sub_080001DA(this->field_0x74.HWORD - 1, this->collisionLayer);
|
||||||
this->field_0x78.HWORD = sub_080001DA(this->field_0x74, this->collisionLayer);
|
this->field_0x78.HWORD = sub_080001DA(this->field_0x74.HWORD, this->collisionLayer);
|
||||||
this->field_0x7a = sub_080001DA(this->field_0x74 + 1, this->collisionLayer);
|
this->field_0x7a.HWORD = sub_080001DA(this->field_0x74.HWORD + 1, this->collisionLayer);
|
||||||
SetTile(0x4022, this->field_0x74 - 1, this->collisionLayer);
|
SetTile(0x4022, this->field_0x74.HWORD - 1, this->collisionLayer);
|
||||||
SetTile(0x4022, this->field_0x74, this->collisionLayer);
|
SetTile(0x4022, this->field_0x74.HWORD, this->collisionLayer);
|
||||||
SetTile(0x4022, this->field_0x74 + 1, this->collisionLayer);
|
SetTile(0x4022, this->field_0x74.HWORD + 1, this->collisionLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_080A0870(Entity *this)
|
void sub_080A0870(Entity *this)
|
||||||
{
|
{
|
||||||
SetTile(this->field_0x76, this->field_0x74 - 1, this->collisionLayer);
|
SetTile(this->field_0x76.HWORD, this->field_0x74.HWORD - 1, this->collisionLayer);
|
||||||
SetTile(this->field_0x78.HWORD, this->field_0x74, this->collisionLayer);
|
SetTile(this->field_0x78.HWORD, this->field_0x74.HWORD, this->collisionLayer);
|
||||||
SetTile(this->field_0x7a, this->field_0x74 + 1, this->collisionLayer);
|
SetTile(this->field_0x7a.HWORD, this->field_0x74.HWORD + 1, this->collisionLayer);
|
||||||
}
|
}
|
|
@ -33,7 +33,7 @@ void sub_080851AC(Entity* this) {
|
||||||
this->animationState = this->entityType.parameter & 2;
|
this->animationState = this->entityType.parameter & 2;
|
||||||
if ((this->entityType).form == 3) {
|
if ((this->entityType).form == 3) {
|
||||||
uVar1 = CheckFlags(this->field_0x86);
|
uVar1 = CheckFlags(this->field_0x86);
|
||||||
this->field_0x7a = uVar1;
|
this->field_0x7a.HWORD = uVar1;
|
||||||
if ((u16)(uVar1 & -1) != 0) {
|
if ((u16)(uVar1 & -1) != 0) {
|
||||||
this->animationState = (this->animationState + 2) & 3;
|
this->animationState = (this->animationState + 2) & 3;
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
|
@ -62,7 +62,7 @@ void sub_080852B4(Entity* this) {
|
||||||
if (--this->field_0xf == 0) {
|
if (--this->field_0xf == 0) {
|
||||||
this->action = 3;
|
this->action = 3;
|
||||||
this->field_0xf = this->actionDelay;
|
this->field_0xf = this->actionDelay;
|
||||||
this->field_0x7a = CheckFlags(this->field_0x86);
|
this->field_0x7a.HWORD = CheckFlags(this->field_0x86);
|
||||||
this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3;
|
this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3;
|
||||||
InitializeAnimation(this, this->animationState);
|
InitializeAnimation(this, this->animationState);
|
||||||
sub_08085394(this);
|
sub_08085394(this);
|
||||||
|
@ -114,7 +114,7 @@ void sub_08085394(Entity *this)
|
||||||
iVar3 = this->animationState / 2;
|
iVar3 = this->animationState / 2;
|
||||||
layerData = *(u16 **)&this->field_0x70;
|
layerData = *(u16 **)&this->field_0x70;
|
||||||
uVar4 = COORD_TO_TILE(this);
|
uVar4 = COORD_TO_TILE(this);
|
||||||
this->field_0x74 = layerData[gUnk_080B4488[iVar3]];
|
this->field_0x74.HWORD = layerData[gUnk_080B4488[iVar3]];
|
||||||
pbVar5 = &this->collisionLayer;
|
pbVar5 = &this->collisionLayer;
|
||||||
SetTile(uVar1, uVar4 - iVar3, *pbVar5);
|
SetTile(uVar1, uVar4 - iVar3, *pbVar5);
|
||||||
this->field_0x76 = layerData[0];
|
this->field_0x76 = layerData[0];
|
||||||
|
@ -137,8 +137,8 @@ void sub_0808543C(Entity *this)
|
||||||
|
|
||||||
temp = gUnk_080B4488[this->animationState / 2][0];
|
temp = gUnk_080B4488[this->animationState / 2][0];
|
||||||
uVar2 = COORD_TO_TILE(this);
|
uVar2 = COORD_TO_TILE(this);
|
||||||
SetTile(this->field_0x74, uVar2 - temp, this->collisionLayer);
|
SetTile(this->field_0x74.HWORD, uVar2 - temp, this->collisionLayer);
|
||||||
SetTile(this->field_0x76, uVar2, this->collisionLayer);
|
SetTile(this->field_0x76.HWORD, uVar2, this->collisionLayer);
|
||||||
SetTile(this->field_0x78.HWORD, uVar2 + temp, this->collisionLayer);
|
SetTile(this->field_0x78.HWORD, uVar2 + temp, this->collisionLayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue