mirror of
https://github.com/zeldaret/tmc
synced 2026-07-10 07:06:52 -04:00
@@ -0,0 +1,200 @@
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "room.h"
|
||||
#include "asm.h"
|
||||
#include "functions.h"
|
||||
#include "enemy/gyorg.h"
|
||||
|
||||
void sub_08048684(GyorgChildEntity*);
|
||||
void sub_0804869C(GyorgChildEntity*);
|
||||
void sub_080486AC(GyorgChildEntity*);
|
||||
|
||||
void (*const gUnk_080D1E6C[])(GyorgChildEntity*) = {
|
||||
sub_08048684,
|
||||
sub_0804869C,
|
||||
(void (*)(GyorgChildEntity*))sub_08001324,
|
||||
(void (*)(GyorgChildEntity*))sub_0804A7D4,
|
||||
(void (*)(GyorgChildEntity*))sub_08001242,
|
||||
sub_080486AC,
|
||||
};
|
||||
|
||||
void GyorgChild(Entity* this) {
|
||||
if (gRoomTransition.field_0x39 == 0) {
|
||||
this->flags &= ~0x80;
|
||||
this->health = 0;
|
||||
this->collisionLayer = 2;
|
||||
}
|
||||
gUnk_080D1E6C[GetNextFunction(this)]((GyorgChildEntity*)this);
|
||||
}
|
||||
|
||||
void sub_080486F4(GyorgChildEntity*);
|
||||
void sub_0804877C(GyorgChildEntity*);
|
||||
void sub_0804882C(GyorgChildEntity*);
|
||||
void sub_08048904(GyorgChildEntity*);
|
||||
|
||||
void sub_08048684(GyorgChildEntity* this) {
|
||||
static void (*const gUnk_080D1E84[])(GyorgChildEntity*) = {
|
||||
sub_080486F4,
|
||||
sub_0804877C,
|
||||
sub_0804882C,
|
||||
sub_08048904,
|
||||
};
|
||||
gUnk_080D1E84[super->action](this);
|
||||
}
|
||||
|
||||
void sub_0804869C(GyorgChildEntity* this) {
|
||||
sub_0804AA30(super, gUnk_080D1E6C);
|
||||
}
|
||||
|
||||
void sub_080486D0(GyorgChildEntity*);
|
||||
void sub_080486D8(GyorgChildEntity*);
|
||||
void sub_080486E0(GyorgChildEntity*);
|
||||
|
||||
void sub_080486AC(GyorgChildEntity* this) {
|
||||
static void (*const gUnk_080D1E94[])(GyorgChildEntity*) = {
|
||||
sub_080486D0,
|
||||
sub_080486D8,
|
||||
sub_080486E0,
|
||||
};
|
||||
if (sub_0806F520()) {
|
||||
gUnk_080D1E94[super->subAction](this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080486D0(GyorgChildEntity* this) {
|
||||
super->subAction = 2;
|
||||
}
|
||||
|
||||
void sub_080486D8(GyorgChildEntity* this) {
|
||||
sub_0806F4E8(super);
|
||||
}
|
||||
|
||||
void sub_080486E0(GyorgChildEntity* this) {
|
||||
if (sub_0806F3E4(super)) {
|
||||
sub_0804A7D4(super);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080486F4(GyorgChildEntity* this) {
|
||||
static const s8 gUnk_080D1EA0[] = {
|
||||
0x50, 0x1, 0x40, 0x1, 0x30, 0x1, 0x20, 0x1, 0x10, 0x1, 0,
|
||||
0, 0x10, -0x1, 0x20, -0x1, 0x30, -0x1, 0x40, -0x1, 0x50, -0x1,
|
||||
};
|
||||
super->field_0x1c = 1;
|
||||
super->spriteOrientation.flipY = 3;
|
||||
super->spriteRendering.b3 = 3;
|
||||
super->spritePriority.b0 = 7;
|
||||
super->animationState = super->direction >> 2;
|
||||
if (super->type == 0) {
|
||||
s32 r;
|
||||
InitializeAnimation(super, super->animationState);
|
||||
super->action = 1;
|
||||
super->flags |= 0x80;
|
||||
r = (signed)Random() % 0xB;
|
||||
super->direction += r;
|
||||
super->direction -= 5;
|
||||
super->direction &= 0x1F;
|
||||
r *= 2;
|
||||
super->actionDelay = gUnk_080D1EA0[r];
|
||||
this->unk_7b = gUnk_080D1EA0[r + 1];
|
||||
super->speed = 0x200;
|
||||
} else {
|
||||
super->action = 2;
|
||||
super->actionDelay = 1;
|
||||
super->spriteSettings.draw = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0804877C(GyorgChildEntity* this) {
|
||||
LinearMoveUpdate(super);
|
||||
if (super->actionDelay != 0) {
|
||||
if ((--super->actionDelay & 0xF) == 0) {
|
||||
super->direction += this->unk_7b;
|
||||
super->direction &= 0x1F;
|
||||
}
|
||||
}
|
||||
switch (super->animationState >> 1) {
|
||||
case 0:
|
||||
if (super->y.HALF.HI > gRoomControls.scroll_y - 0x18) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (super->x.HALF.HI < gRoomControls.scroll_x + 0x108) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (super->y.HALF.HI < gRoomControls.scroll_y + 0xb8) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (super->x.HALF.HI > gRoomControls.scroll_x - 0x18) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
super->action = 2;
|
||||
super->actionDelay = 90;
|
||||
super->spriteSettings.draw = 0;
|
||||
}
|
||||
|
||||
void sub_0804882C(GyorgChildEntity* this) {
|
||||
if (--super->actionDelay == 0) {
|
||||
super->action = 3;
|
||||
super->flags |= 0x80;
|
||||
Random();
|
||||
super->spriteSettings.draw = 1;
|
||||
super->spritePriority.b0 = 4;
|
||||
super->speed = this->unk_78;
|
||||
super->collisionLayer = 2;
|
||||
UpdateSpriteForCollisionLayer(super);
|
||||
super->direction = this->unk_7a;
|
||||
super->animationState = super->direction >> 2;
|
||||
InitializeAnimation(super, super->animationState);
|
||||
switch (super->animationState >> 1) {
|
||||
case 0:
|
||||
case 2:
|
||||
super->x.HALF.HI = gPlayerEntity.x.HALF.HI + this->unk_74;
|
||||
super->y.HALF.HI = gRoomControls.scroll_y + this->unk_76;
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
super->x.HALF.HI = gRoomControls.scroll_x + this->unk_74;
|
||||
super->y.HALF.HI = gPlayerEntity.y.HALF.HI + this->unk_76;
|
||||
break;
|
||||
}
|
||||
if (super->type2 == 0) {
|
||||
SoundReq(SFX_198);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08048904(GyorgChildEntity* this) {
|
||||
LinearMoveUpdate(super);
|
||||
GetNextFrame(super);
|
||||
switch (super->animationState >> 1) {
|
||||
case 0:
|
||||
if (super->y.HALF.HI > gRoomControls.scroll_y - 0x28) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (super->x.HALF.HI < gRoomControls.scroll_x + 0x118) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (super->y.HALF.HI < gRoomControls.scroll_y + 0xc8) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (super->x.HALF.HI > gRoomControls.scroll_x - 0x28) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -0,0 +1,458 @@
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "sound.h"
|
||||
#include "asm.h"
|
||||
#include "functions.h"
|
||||
#include "enemy/gyorg.h"
|
||||
|
||||
extern u8 gEntCount;
|
||||
extern u8 gMapDataTopSpecial[];
|
||||
|
||||
extern u16 gUnk_02019EE0[];
|
||||
|
||||
extern void sub_080197D4(const void*);
|
||||
|
||||
extern u32 sub_08000E62(u32);
|
||||
extern void RegisterTransitionManager(void*, void (*)(), void (*)());
|
||||
|
||||
void sub_08046498();
|
||||
void sub_0804660C(GyorgFemaleEntity*, u32);
|
||||
void sub_080464C0(GyorgFemaleEntity*);
|
||||
void sub_08046634(GyorgFemaleEntity*, u32);
|
||||
void sub_080465C8(void);
|
||||
void sub_080466A8(GyorgFemaleEntity*);
|
||||
void sub_08046668(GyorgFemaleEntity*);
|
||||
void sub_08046518(void);
|
||||
void sub_080467DC(GyorgFemaleEntity*);
|
||||
|
||||
extern u8 gUpdateVisibleTiles;
|
||||
extern u8 gUnk_080B3E80[];
|
||||
extern u8 gUnk_080B37A0[];
|
||||
extern u16 gMetatileTypesTop[];
|
||||
|
||||
extern const u8 gUnk_080D1A94[];
|
||||
extern const u8 gUnk_080D1AAC[];
|
||||
extern const u8 gUnk_080D1AC4[];
|
||||
extern const u8 gUnk_080D1ADC[];
|
||||
|
||||
void sub_0804614C(GyorgFemaleEntity*);
|
||||
void sub_0804625C(GyorgFemaleEntity*);
|
||||
void sub_0804632C(GyorgFemaleEntity*);
|
||||
void sub_080463E4(GyorgFemaleEntity*);
|
||||
|
||||
void GyorgFemale(Entity* this) {
|
||||
static void (*const gUnk_080D1A64[])(GyorgFemaleEntity*) = {
|
||||
sub_0804614C,
|
||||
sub_0804625C,
|
||||
sub_0804632C,
|
||||
sub_080463E4,
|
||||
};
|
||||
gUnk_080D1A64[this->action]((GyorgFemaleEntity*)this);
|
||||
}
|
||||
|
||||
void sub_0804614C(GyorgFemaleEntity* this) {
|
||||
Entity* tmp;
|
||||
if (gEntCount > 0x3d)
|
||||
return;
|
||||
tmp = CreateProjectile(0x22);
|
||||
tmp->type = 0;
|
||||
tmp->parent = super;
|
||||
((GyorgHeap*)super->myHeap)->unk_14 = (GenericEntity*)tmp;
|
||||
tmp = CreateEnemy(GYORG_FEMALE_MOUTH, 0);
|
||||
tmp->parent = super;
|
||||
((GyorgHeap*)super->myHeap)->unk_10 = (GyorgFemaleMouthEntity*)tmp;
|
||||
tmp = CreateEnemy(GYORG_FEMALE_EYE, 0);
|
||||
tmp->parent = super;
|
||||
tmp = CreateEnemy(GYORG_FEMALE_EYE, 1);
|
||||
tmp->parent = super;
|
||||
tmp = CreateEnemy(GYORG_FEMALE_EYE, 2);
|
||||
tmp->parent = super;
|
||||
tmp = CreateEnemy(GYORG_FEMALE_EYE, 3);
|
||||
tmp->parent = super;
|
||||
tmp = CreateEnemy(GYORG_FEMALE_EYE, 4);
|
||||
tmp->parent = super;
|
||||
tmp = CreateEnemy(GYORG_FEMALE_EYE, 5);
|
||||
tmp->parent = super;
|
||||
tmp = CreateEnemy(GYORG_FEMALE_EYE, 6);
|
||||
tmp->parent = super;
|
||||
tmp = CreateEnemy(GYORG_FEMALE_EYE, 7);
|
||||
tmp->parent = super;
|
||||
super->action = 1;
|
||||
super->spriteOrientation.flipY = 2;
|
||||
super->spriteRendering.b3 = 2;
|
||||
super->collisionLayer = 2;
|
||||
this->unk_78 = 0;
|
||||
this->unk_79 = 0;
|
||||
this->unk_70 = 0x3C;
|
||||
MemClear(&gUnk_02019EE0, 0x8000);
|
||||
MemClear(&gMapDataTopSpecial, 0x8000);
|
||||
sub_0804660C(this, 0);
|
||||
sub_080464C0(this);
|
||||
gPlayerEntity.collisionLayer = 2;
|
||||
UpdateSpriteForCollisionLayer(&gPlayerEntity);
|
||||
#ifndef EU
|
||||
RegisterTransitionManager(this, sub_08046498, 0);
|
||||
#else
|
||||
RegisterTransitionManager(this, sub_080464C0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void sub_0804625C(GyorgFemaleEntity* this) {
|
||||
if (this->unk_79 & 0x80) {
|
||||
this->unk_79 &= ~0x80;
|
||||
this->unk_79 |= 0x40;
|
||||
sub_0804660C(this, (this->unk_79 & 3) << 6);
|
||||
} else {
|
||||
if (this->unk_79 & 0x40) {
|
||||
this->unk_79 &= ~0x40;
|
||||
sub_080464C0(this);
|
||||
}
|
||||
}
|
||||
sub_080465C8();
|
||||
if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x38) {
|
||||
super->action = 2;
|
||||
super->actionDelay = 0;
|
||||
this->unk_7a = 0;
|
||||
this->unk_7c = 0;
|
||||
this->unk_7d = 0;
|
||||
this->unk_70 = 0x3c;
|
||||
this->unk_80 = 0;
|
||||
return;
|
||||
}
|
||||
if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x40) {
|
||||
super->action = 3;
|
||||
this->unk_70 = 0x3c;
|
||||
super->actionDelay = 0;
|
||||
this->unk_7a = 0;
|
||||
this->unk_7c = 0;
|
||||
this->unk_7d = 0;
|
||||
this->unk_80 = 0;
|
||||
return;
|
||||
}
|
||||
if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x100) {
|
||||
if (--this->unk_70 == 0) {
|
||||
this->unk_70 = 0x168;
|
||||
sub_08046634(this, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0804632C(GyorgFemaleEntity* this) {
|
||||
sub_080465C8();
|
||||
sub_080466A8(this);
|
||||
if (++this->unk_7a > 0x59f) {
|
||||
this->unk_7a = 0;
|
||||
this->unk_7c = 0;
|
||||
this->unk_7d = 0;
|
||||
this->unk_80 = 0;
|
||||
} else {
|
||||
if (this->unk_7a == 0x78) {
|
||||
sub_08046668(this);
|
||||
} else {
|
||||
if (this->unk_7a == 0x528) {
|
||||
this->unk_78 = 0;
|
||||
#ifndef EU
|
||||
this->unk_7d = 0;
|
||||
this->unk_7f = 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x80 && --this->unk_70 == 0) {
|
||||
this->unk_70 = 0x168;
|
||||
sub_08046634(this, 0);
|
||||
}
|
||||
if ((((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x38) == 0) {
|
||||
super->action = 1;
|
||||
this->unk_70 = 0x3c;
|
||||
#ifndef EU
|
||||
this->unk_78 = 0;
|
||||
#endif
|
||||
this->unk_80 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080463E4(GyorgFemaleEntity* this) {
|
||||
sub_080465C8();
|
||||
if (--this->unk_70 == 0) {
|
||||
this->unk_70 = 0x168;
|
||||
sub_08046634(this, 1);
|
||||
}
|
||||
sub_080466A8(this);
|
||||
if (++this->unk_7a > 0x59f) {
|
||||
this->unk_7a = 0;
|
||||
this->unk_7c = 0;
|
||||
this->unk_7d = 0;
|
||||
this->unk_80 = 0;
|
||||
} else {
|
||||
if (this->unk_7a == 0x78) {
|
||||
sub_08046668(this);
|
||||
} else {
|
||||
if (this->unk_7a == 0x528) {
|
||||
this->unk_78 = 0;
|
||||
#ifndef EU
|
||||
this->unk_7d = 0;
|
||||
this->unk_7f = 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
if (super->health == 0) {
|
||||
super->action = 1;
|
||||
#ifdef EU
|
||||
this->unk_78 = 0;
|
||||
#endif
|
||||
this->unk_70 = 0x3c;
|
||||
#ifndef EU
|
||||
this->unk_78 = 0;
|
||||
#endif
|
||||
this->unk_80 = 0;
|
||||
SoundReq(SFX_BOSS_DIE);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef EU
|
||||
void sub_08046498(GyorgFemaleEntity* this) {
|
||||
MemClear(&gUnk_02019EE0, 0x8000);
|
||||
MemClear(&gMapDataTopSpecial, 0x8000);
|
||||
sub_080464C0(this);
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_080464C0(GyorgFemaleEntity* this) {
|
||||
static const void* const gUnk_080D1A74[] = {
|
||||
gUnk_080D1A94,
|
||||
gUnk_080D1AAC,
|
||||
gUnk_080D1AC4,
|
||||
gUnk_080D1ADC,
|
||||
};
|
||||
s32 i;
|
||||
u8* src;
|
||||
u8* dst;
|
||||
sub_080197D4(gUnk_080D1A74[super->animationState >> 6]);
|
||||
sub_08046518();
|
||||
for (i = 0x20, src = ((u8*)&gUnk_02019EE0), dst = ((u8*)&gUnk_02019EE0) + 0x3260; i != 0; i--) {
|
||||
MemCopy(src, dst, 0x40);
|
||||
dst += 0x100;
|
||||
src += 0x40;
|
||||
}
|
||||
MemClear(&gUnk_02019EE0, 0x800);
|
||||
gUpdateVisibleTiles = 1;
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/gyorg_female/sub_08046518.inc", void sub_08046518(void)) {
|
||||
u32 r5;
|
||||
u16* stack1;
|
||||
u8* stack2;
|
||||
u8* r6;
|
||||
u32 i;
|
||||
u16* sl;
|
||||
sl = &gMetatileTypesTop[0xFFFFBCB0];
|
||||
stack1 = &gMetatileTypesTop[0xFFFFECB0];
|
||||
stack2 = (u8*)&gMetatileTypesTop[0x00006658];
|
||||
r6 = (u8*)&gMetatileTypesTop[0xFFFFD658];
|
||||
for (i = 0; i < 0x10; i++) {
|
||||
sl += 0x40;
|
||||
stack1 += 0x40;
|
||||
for (r5 = 0; r5 < 0x10; r5++) {
|
||||
stack1[r5] = sl[r5];
|
||||
stack2[r5] = gUnk_080B37A0[gMetatileTypesTop[sl[r5]]];
|
||||
r6[r5] = gUnk_080B3E80[gMetatileTypesTop[sl[r5]]];
|
||||
}
|
||||
stack2 = stack2 + 0x40;
|
||||
r6 = r6 + 0x40;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_080465C8(void) {
|
||||
s32 x, y;
|
||||
x = (gPlayerEntity.x.HALF.HI - gRoomControls.origin_x) >> 3;
|
||||
y = (gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) >> 3;
|
||||
if (gUnk_02019EE0[(y << 7) + x]) {
|
||||
gPlayerState.field_0x14 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0804660C(GyorgFemaleEntity* this, u32 unk1) {
|
||||
static const u16 gUnk_080D1A84[] = {
|
||||
0x200, 0x258, 0x1B8, 0x210, 0x200, 0x1C8, 0x248, 0x210,
|
||||
};
|
||||
const u16* p;
|
||||
super->animationState = unk1;
|
||||
p = &gUnk_080D1A84[unk1 >> 5];
|
||||
super->x.HALF.HI = p[0] + gRoomControls.origin_x;
|
||||
super->y.HALF.HI = p[1] + gRoomControls.origin_y;
|
||||
}
|
||||
|
||||
// todo: correct type
|
||||
const u8 gUnk_080D1A94[] = {
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0x7C,
|
||||
#elif defined(EU)
|
||||
0x50,
|
||||
#else
|
||||
0x08,
|
||||
#endif
|
||||
0x41, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80,
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0x2C, 0xD3,
|
||||
#elif defined(EU)
|
||||
0x00, 0xD3,
|
||||
#else
|
||||
0xB8, 0xD2,
|
||||
#endif
|
||||
0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80,
|
||||
};
|
||||
|
||||
const u8 gUnk_080D1AAC[] = {
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0xFC,
|
||||
#elif defined(EU)
|
||||
0xD0,
|
||||
#else
|
||||
0x88,
|
||||
#endif
|
||||
0x3D, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80,
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0xF8,
|
||||
#elif defined(EU)
|
||||
0xCC,
|
||||
#else
|
||||
0x84,
|
||||
#endif
|
||||
0xD6, 0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80,
|
||||
};
|
||||
|
||||
const u8 gUnk_080D1AC4[] = {
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0xE4,
|
||||
#elif defined(EU)
|
||||
0xB8,
|
||||
#else
|
||||
0x70,
|
||||
#endif
|
||||
0x36, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80,
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0xC0,
|
||||
#elif defined(EU)
|
||||
0x94,
|
||||
#else
|
||||
0x4C,
|
||||
#endif
|
||||
0xDA, 0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80,
|
||||
};
|
||||
|
||||
const u8 gUnk_080D1ADC[] = {
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0x78,
|
||||
#elif defined(EU)
|
||||
0x4C,
|
||||
#else
|
||||
0x04,
|
||||
#endif
|
||||
0x3A, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80,
|
||||
#if defined(JP) || defined(DEMO_JP)
|
||||
0x88,
|
||||
#elif defined(EU)
|
||||
0x5C,
|
||||
#else
|
||||
0x14,
|
||||
#endif
|
||||
0xDE, 0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80,
|
||||
};
|
||||
|
||||
void sub_08046634(GyorgFemaleEntity* this, u32 unk1) {
|
||||
static const u8 gUnk_080D1AF4[] = { 2, 3, 6, 7 };
|
||||
u32 tmp;
|
||||
if (unk1 == 0) {
|
||||
tmp = gUnk_080D1AF4[Random() & 3];
|
||||
} else {
|
||||
tmp = Random() & 7;
|
||||
}
|
||||
sub_080A1ED0(tmp, 0, super->animationState >> 3);
|
||||
}
|
||||
|
||||
void sub_08046668(GyorgFemaleEntity* this) {
|
||||
static const u8 gUnk_080D1AF8[] = { 0x16, 0x92, 0x94, 0x86 };
|
||||
if (super->health == 0) {
|
||||
return;
|
||||
}
|
||||
#ifndef EU
|
||||
if (this->unk_78 == 0xFF) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
this->unk_78 = gUnk_080D1AF8[Random() & 3];
|
||||
this->unk_7f = 0;
|
||||
this->unk_82 = 0;
|
||||
sub_080467DC(this);
|
||||
}
|
||||
|
||||
void sub_080466A8(GyorgFemaleEntity* this) {
|
||||
if (this->unk_7c != 0) {
|
||||
this->unk_7d |= this->unk_7c;
|
||||
if (super->actionDelay == 0 && this->unk_78 != 0xFF) {
|
||||
#ifndef EU
|
||||
super->actionDelay = 4;
|
||||
#else
|
||||
super->actionDelay = 3;
|
||||
#endif
|
||||
}
|
||||
if (sub_08000E62(this->unk_7d) > 2) {
|
||||
super->actionDelay = 0;
|
||||
this->unk_7d = 0;
|
||||
this->unk_78 = 0xFF;
|
||||
SoundReq(SFX_BOSS_HIT);
|
||||
if (super->health != 0) {
|
||||
InitScreenShake(8, 0);
|
||||
if (++this->unk_82 <= 0xC) {
|
||||
super->health--;
|
||||
}
|
||||
if (super->health == 0) {
|
||||
this->unk_78 = 0;
|
||||
this->unk_7a = 0x528;
|
||||
} else {
|
||||
if (this->unk_7f == 0) {
|
||||
this->unk_7f = 1;
|
||||
this->unk_7a = 0x438;
|
||||
}
|
||||
}
|
||||
}
|
||||
sub_080467DC(this);
|
||||
}
|
||||
}
|
||||
if (super->actionDelay != 0 && this->unk_78 != 0xFF && --super->actionDelay == 0) {
|
||||
Entity* tmp;
|
||||
this->unk_80 |= this->unk_7d;
|
||||
this->unk_7d = 0;
|
||||
sub_080467DC(this);
|
||||
#ifndef EU
|
||||
if (((GyorgHeap*)super->myHeap)->unk_3c != 0xFF) {
|
||||
#endif
|
||||
tmp = &gPlayerEntity;
|
||||
tmp->knockbackDirection = ((GyorgHeap*)super->myHeap)->unk_3c;
|
||||
tmp->iframes = 0xF4;
|
||||
tmp->knockbackDuration = 0xA;
|
||||
tmp = CreateFx(super, 0x2C, 0);
|
||||
if (tmp) {
|
||||
tmp->x.HALF.HI = ((GyorgHeap*)super->myHeap)->unk_38;
|
||||
tmp->y.HALF.HI = ((GyorgHeap*)super->myHeap)->unk_3a;
|
||||
tmp->collisionLayer = 1;
|
||||
UpdateSpriteForCollisionLayer(tmp);
|
||||
}
|
||||
#ifndef EU
|
||||
}
|
||||
#endif
|
||||
}
|
||||
this->unk_7c = 0;
|
||||
}
|
||||
|
||||
void sub_080467DC(GyorgFemaleEntity* this) {
|
||||
u32 i;
|
||||
for (i = 0; i < 8; i++) {
|
||||
(*((GyorgHeap**)(&super->myHeap)))->unk_18[i] = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "player.h"
|
||||
#include "functions.h"
|
||||
#include "enemy/gyorg.h"
|
||||
|
||||
void sub_080489B4(GyorgFemaleEyeEntity*);
|
||||
void sub_080489CC(GyorgFemaleEyeEntity*);
|
||||
|
||||
void sub_08048AF0(GyorgFemaleEyeEntity*);
|
||||
void sub_08048B2C(GyorgFemaleEyeEntity*);
|
||||
void sub_08048B84(GyorgFemaleEyeEntity*);
|
||||
void sub_08048BB0(GyorgFemaleEyeEntity*);
|
||||
void sub_08048CEC(GyorgFemaleEyeEntity*);
|
||||
|
||||
void sub_08048D20(GyorgFemaleEyeEntity*);
|
||||
u32 sub_08048D70(GyorgFemaleEntity*);
|
||||
|
||||
void (*const gUnk_080D1F64[])(GyorgFemaleEyeEntity*) = {
|
||||
sub_080489B4,
|
||||
sub_080489CC,
|
||||
(void (*)(GyorgFemaleEyeEntity*))sub_08001324,
|
||||
(void (*)(GyorgFemaleEyeEntity*))sub_0804A7D4,
|
||||
(void (*)(GyorgFemaleEyeEntity*))sub_08001242,
|
||||
sub_080489B4,
|
||||
};
|
||||
|
||||
void GyorgFemaleEye(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
gUnk_080D1F64[GetNextFunction(this)]((GyorgFemaleEyeEntity*)this);
|
||||
}
|
||||
|
||||
void sub_080489B4(GyorgFemaleEyeEntity* this) {
|
||||
static void (*const gUnk_080D1F7C[])(GyorgFemaleEyeEntity*) = {
|
||||
sub_08048AF0, sub_08048B2C, sub_08048B84, sub_08048BB0, sub_08048CEC,
|
||||
};
|
||||
gUnk_080D1F7C[super->action](this);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
u16 x, y;
|
||||
} xy;
|
||||
|
||||
const xy gUnk_080D1F90[] = {
|
||||
{ 0x1e8, 0x1d8 }, { 0x1f8, 0x1d8 }, { 0x208, 0x1d8 }, { 0x218, 0x1d8 }, { 0x1e8, 0x1e8 }, { 0x1f8, 0x1e8 },
|
||||
{ 0x208, 0x1e8 }, { 0x218, 0x1e8 }, { 0x238, 0x1f8 }, { 0x238, 0x208 }, { 0x238, 0x218 }, { 0x238, 0x228 },
|
||||
{ 0x228, 0x1f8 }, { 0x228, 0x208 }, { 0x228, 0x218 }, { 0x228, 0x228 }, { 0x218, 0x248 }, { 0x208, 0x248 },
|
||||
{ 0x1f8, 0x248 }, { 0x1e8, 0x248 }, { 0x218, 0x238 }, { 0x208, 0x238 }, { 0x1f8, 0x238 }, { 0x1e8, 0x238 },
|
||||
{ 0x1c8, 0x228 }, { 0x1c8, 0x218 }, { 0x1c8, 0x208 }, { 0x1c8, 0x1f8 }, { 0x1d8, 0x228 }, { 0x1d8, 0x218 },
|
||||
{ 0x1d8, 0x208 }, { 0x1d8, 0x1f8 },
|
||||
};
|
||||
|
||||
const u8 gUnk_080D2010[] = {
|
||||
0, 0, 1, 1, 0, 0, 1, 1, 4, 4, 5, 5, 4, 4, 5, 5, 9, 9, 8, 8, 9, 9, 8, 8, 13, 13, 12, 12, 13, 13, 12, 12,
|
||||
};
|
||||
|
||||
const u8 gUnk_080D2030[] = {
|
||||
2, 2, 3, 3, 2, 2, 3, 3, 6, 6, 7, 7, 6, 6, 7, 7, 11, 11, 10, 10, 11, 11, 10, 10, 15, 15, 14, 14, 15, 15, 14, 14,
|
||||
};
|
||||
|
||||
void sub_080489CC(GyorgFemaleEyeEntity* this) {
|
||||
GyorgFemaleEntity* parent;
|
||||
if (super->health != 0xFF) {
|
||||
parent = (GyorgFemaleEntity*)super->parent;
|
||||
#ifndef EU
|
||||
if ((parent->unk_78 >> super->type) & 1) {
|
||||
#endif
|
||||
parent->unk_7c |= (1 << super->type);
|
||||
#ifndef EU
|
||||
switch (super->bitfield & 0x7F) {
|
||||
case 4 ... 6:
|
||||
case 8 ... 13:
|
||||
case 16 ... 18:
|
||||
case 24 ... 26:
|
||||
#endif
|
||||
(*(((GyorgHeap**)&parent->base.myHeap)))->unk_18[super->type] = super->field_0x4c;
|
||||
(*(((GyorgHeap**)&parent->base.myHeap)))->unk_38 = (gPlayerEntity.x.HALF.HI + super->x.HALF.HI) / 2;
|
||||
(*(((GyorgHeap**)&parent->base.myHeap)))->unk_3a = (gPlayerEntity.y.HALF.HI + super->y.HALF.HI) / 2;
|
||||
(*(((GyorgHeap**)&parent->base.myHeap)))->unk_3c = (super->knockbackDirection ^= 0x10);
|
||||
#ifndef EU
|
||||
break;
|
||||
default:
|
||||
((GyorgHeap*)parent->base.myHeap)->unk_3c = 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
super->health = 0xFF;
|
||||
sub_0804AA30(super, (void (*const*)(Entity*))gUnk_080D1F64);
|
||||
}
|
||||
|
||||
void sub_08048AF0(GyorgFemaleEyeEntity* this) {
|
||||
super->action = 1;
|
||||
super->animationState = 0xFF;
|
||||
super->spriteOrientation.flipY = 2;
|
||||
super->spriteRendering.b3 = 2;
|
||||
super->spritePriority.b0 = 7;
|
||||
super->collisionLayer = 2;
|
||||
sub_08048D20(this);
|
||||
}
|
||||
|
||||
void sub_08048B2C(GyorgFemaleEyeEntity* this) {
|
||||
GyorgFemaleEntity* parent;
|
||||
sub_08048D20(this);
|
||||
parent = (GyorgFemaleEntity*)super->parent;
|
||||
if (sub_08048D70(parent)) {
|
||||
if (!super->spriteSettings.draw) {
|
||||
CreateFx(super, 2, 0x40);
|
||||
}
|
||||
super->spriteSettings.draw = 1;
|
||||
} else {
|
||||
super->spriteSettings.draw = 0;
|
||||
}
|
||||
if ((parent->unk_78 >> super->type) & 1) {
|
||||
super->action = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08048B84(GyorgFemaleEyeEntity* this) {
|
||||
GetNextFrame(super);
|
||||
if (super->frame & 0x80) {
|
||||
super->action = 3;
|
||||
super->flags |= 0x80;
|
||||
super->hitType = 0x1E;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08048BB0(GyorgFemaleEyeEntity* this) {
|
||||
GyorgFemaleEntity* parent = (GyorgFemaleEntity*)super->parent;
|
||||
if (!((parent->unk_78 >> super->type) & 1)) {
|
||||
if (parent->base.health != 0) {
|
||||
super->action = 4;
|
||||
super->flags &= ~0x80;
|
||||
InitializeAnimation(super, gUnk_080D2030[(super->animationState << 3) + super->type]);
|
||||
} else {
|
||||
super->action = 1;
|
||||
super->flags &= ~0x80;
|
||||
super->spriteSettings.draw = 0;
|
||||
InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]);
|
||||
CreateFx(super, 2, 0x40);
|
||||
}
|
||||
} else {
|
||||
if ((parent->unk_80 >> super->type) & 1) {
|
||||
if (super->animIndex <= 0x13) {
|
||||
super->iframes = 0xF4;
|
||||
super->hitType = 0x89;
|
||||
InitializeAnimation(super, (parent->base.animationState >> 6) + 0x14);
|
||||
SoundReq(0x119);
|
||||
}
|
||||
GetNextFrame(super);
|
||||
if (super->frame & 0x80) {
|
||||
super->hitType = 0x1E;
|
||||
InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]);
|
||||
UpdateAnimationVariableFrames(super, 7);
|
||||
parent->unk_80 &= ~(1 << super->type);
|
||||
}
|
||||
} else {
|
||||
if (parent->unk_78 == 0xFF) {
|
||||
u32 tmp = super->animIndex;
|
||||
if (tmp < 0x10 || tmp > 0x13) {
|
||||
InitializeAnimation(super, super->animationState + 0x10);
|
||||
UpdateAnimationVariableFrames(super, Random() & 0x1C);
|
||||
}
|
||||
GetNextFrame(super);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08048CEC(GyorgFemaleEyeEntity* this) {
|
||||
GetNextFrame(super);
|
||||
if (super->frame & 0x80) {
|
||||
super->action = 1;
|
||||
InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]);
|
||||
}
|
||||
}
|
||||
void sub_08048D20(GyorgFemaleEyeEntity* this) {
|
||||
GyorgFemaleEntity* parent = (GyorgFemaleEntity*)super->parent;
|
||||
const xy* tmp;
|
||||
u32 tmp2 = (parent->base.animationState >> 6);
|
||||
if (tmp2 != super->animationState) {
|
||||
super->animationState = tmp2;
|
||||
tmp = &gUnk_080D1F90[super->type + (tmp2 << 3)];
|
||||
super->x.HALF.HI = tmp->x + gRoomControls.origin_x;
|
||||
super->y.HALF.HI = tmp->y + gRoomControls.origin_y;
|
||||
InitializeAnimation(super, gUnk_080D2010[super->type + (tmp2 << 3)]);
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_08048D70(GyorgFemaleEntity* parent) {
|
||||
GyorgMaleEntity* tmp;
|
||||
if (parent->base.health != 0) {
|
||||
return 1;
|
||||
}
|
||||
tmp = ((GyorgHeap*)parent->base.myHeap)->male1;
|
||||
if (!tmp) {
|
||||
tmp = ((GyorgHeap*)parent->base.myHeap)->male2;
|
||||
}
|
||||
if (tmp->base.health != 0) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "enemy/gyorg.h"
|
||||
|
||||
extern const Hitbox gUnk_080D28DC;
|
||||
extern const Hitbox gUnk_080D28E4;
|
||||
extern const Hitbox gUnk_080D28EC;
|
||||
extern const Hitbox gUnk_080D28F4;
|
||||
extern const Hitbox gUnk_080D28FC;
|
||||
extern const Hitbox gUnk_080D2904;
|
||||
extern const Hitbox gUnk_080D290C;
|
||||
extern const Hitbox gUnk_080D2914;
|
||||
|
||||
const Hitbox* const gUnk_080D28AC[] = {
|
||||
&gUnk_080D28DC, &gUnk_080D28E4, &gUnk_080D28EC, &gUnk_080D28F4,
|
||||
&gUnk_080D28FC, &gUnk_080D2904, &gUnk_080D290C, &gUnk_080D2914,
|
||||
};
|
||||
|
||||
const u16 gUnk_080D28CC[] = {
|
||||
0x200, 0x1C8, 0x248, 0x210, 0x200, 0x258, 0x1b8, 0x210,
|
||||
};
|
||||
|
||||
const Hitbox gUnk_080D28DC = { 0xE0, 0xF4, { 0, 0, 0, 0 }, 0x8, 0xA };
|
||||
const Hitbox gUnk_080D28E4 = { 0x20, 0xF4, { 0, 0, 0, 0 }, 0x8, 0xA };
|
||||
const Hitbox gUnk_080D28EC = { 0x0C, 0xE0, { 0, 0, 0, 0 }, 0xA, 0x8 };
|
||||
const Hitbox gUnk_080D28F4 = { 0x0C, 0x20, { 0, 0, 0, 0 }, 0xA, 0x8 };
|
||||
const Hitbox gUnk_080D28FC = { 0xE0, 0x0C, { 0, 0, 0, 0 }, 0x8, 0xA };
|
||||
const Hitbox gUnk_080D2904 = { 0x20, 0x0C, { 0, 0, 0, 0 }, 0x8, 0xA };
|
||||
const Hitbox gUnk_080D290C = { 0xF4, 0xE0, { 0, 0, 0, 0 }, 0xA, 0x8 };
|
||||
const Hitbox gUnk_080D2914 = { 0xF4, 0x20, { 0, 0, 0, 0 }, 0xA, 0x8 };
|
||||
|
||||
void GyorgFemaleMouth(Entity* this) {
|
||||
u32 tmp;
|
||||
if (this->parent->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->spriteOrientation.flipY = 2;
|
||||
this->spriteRendering.b3 = 2;
|
||||
this->spritePriority.b0 = 7;
|
||||
this->collisionLayer = 2;
|
||||
this->animationState = 0xFF;
|
||||
}
|
||||
tmp = this->parent->animationState >> 5;
|
||||
if (tmp != this->animationState) {
|
||||
this->animationState = tmp;
|
||||
this->x.HALF.HI = gUnk_080D28CC[tmp] + gRoomControls.origin_x;
|
||||
this->y.HALF.HI = gUnk_080D28CC[tmp + 1] + gRoomControls.origin_y;
|
||||
InitializeAnimation(this, tmp >> 1);
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
}
|
||||
if (tmp & 2) {
|
||||
if (this->y.HALF.HI < gPlayerEntity.y.HALF.HI) {
|
||||
tmp++;
|
||||
}
|
||||
} else {
|
||||
if (this->x.HALF.HI < gPlayerEntity.x.HALF.HI) {
|
||||
tmp++;
|
||||
}
|
||||
}
|
||||
this->hitbox = (Hitbox*)gUnk_080D28AC[tmp]; // discarding const qualifier with cast
|
||||
}
|
||||
+652
-645
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,443 @@
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "object.h"
|
||||
#include "area.h"
|
||||
#include "room.h"
|
||||
#include "screen.h"
|
||||
#include "functions.h"
|
||||
#include "enemy/gyorg.h"
|
||||
|
||||
extern const ScreenTransitionData gUnk_0813ABD0;
|
||||
|
||||
extern u32 sub_08079F8C(void);
|
||||
extern s16* const gUnk_08124FF0[];
|
||||
|
||||
extern void sub_080A1DCC(GyorgBossObjectEntity*);
|
||||
extern void sub_080A1C9C(GyorgBossObjectEntity*);
|
||||
void sub_080A1E54(GyorgBossObjectEntity*);
|
||||
|
||||
void sub_080A1D8C(GyorgBossObjectEntity*, s32);
|
||||
|
||||
void sub_080A1FF0(GyorgBossObjectEntity*);
|
||||
u32 sub_080A20B8(GyorgBossObjectEntity*, GyorgMaleEntity*);
|
||||
void sub_080A1D70(GyorgBossObjectEntity*, u32);
|
||||
|
||||
void sub_080A1704(GyorgBossObjectEntity*);
|
||||
void sub_080A184C(GyorgBossObjectEntity*);
|
||||
void sub_080A189C(GyorgBossObjectEntity*);
|
||||
void sub_080A190C(GyorgBossObjectEntity*);
|
||||
void sub_080A1990(GyorgBossObjectEntity*);
|
||||
void sub_080A19FC(GyorgBossObjectEntity*);
|
||||
void sub_080A1A80(GyorgBossObjectEntity*);
|
||||
void sub_080A1AE8(GyorgBossObjectEntity*);
|
||||
void sub_080A1B4C(GyorgBossObjectEntity*);
|
||||
void sub_080A1C04(GyorgBossObjectEntity*);
|
||||
|
||||
void GyorgBossObject(Entity* this) {
|
||||
static void (*const gUnk_08124ED0[])(GyorgBossObjectEntity*) = {
|
||||
sub_080A1704, sub_080A184C, sub_080A189C, sub_080A190C, sub_080A1990,
|
||||
sub_080A19FC, sub_080A1A80, sub_080A1AE8, sub_080A1B4C, sub_080A1C04,
|
||||
};
|
||||
gUnk_08124ED0[this->action]((GyorgBossObjectEntity*)this);
|
||||
sub_080A1DCC((GyorgBossObjectEntity*)this);
|
||||
sub_080A1C9C((GyorgBossObjectEntity*)this);
|
||||
}
|
||||
|
||||
void sub_080A1704(GyorgBossObjectEntity* this) {
|
||||
GyorgHeap* heap;
|
||||
Entity* tmp;
|
||||
if (CheckFlags(0x7B)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (gEntCount > 0x45)
|
||||
return;
|
||||
heap = zMalloc(sizeof(GyorgHeap));
|
||||
if (!heap)
|
||||
return;
|
||||
super->action = 1;
|
||||
super->myHeap = heap;
|
||||
this->unk_6e = 0x258;
|
||||
this->unk_6c = 0;
|
||||
heap->boss = this;
|
||||
tmp = CreateEnemy(GYORG_FEMALE, 0);
|
||||
tmp->myHeap = heap;
|
||||
heap->female = (GyorgFemaleEntity*)tmp;
|
||||
tmp = CreateEnemy(GYORG_MALE, 0);
|
||||
tmp->x.HALF.HI = gRoomControls.origin_x + 0x200;
|
||||
#ifdef EU
|
||||
tmp->y.HALF.HI = gRoomControls.origin_y + 0x380;
|
||||
#else
|
||||
tmp->y.HALF.HI = gRoomControls.origin_y + 0x330;
|
||||
#endif
|
||||
tmp->myHeap = heap;
|
||||
heap->male1 = (GyorgMaleEntity*)tmp;
|
||||
tmp = CreateEnemy(GYORG_MALE, 1);
|
||||
tmp->x.HALF.HI = gRoomControls.origin_x + 0x260;
|
||||
#ifdef EU
|
||||
tmp->y.HALF.HI = gRoomControls.origin_y + 0x360;
|
||||
#else
|
||||
tmp->y.HALF.HI = gRoomControls.origin_y + 0x310;
|
||||
#endif
|
||||
tmp->myHeap = heap;
|
||||
heap->male2 = (GyorgMaleEntity*)tmp;
|
||||
gScreen.bg3.control = 0x1E07;
|
||||
gScreen.lcd.displayControl |= 0x800;
|
||||
this->unk_70 = 0;
|
||||
this->unk_72 = 0;
|
||||
this->unk_74 = 0;
|
||||
this->unk_7a = 0;
|
||||
this->unk_76 = 0xc0;
|
||||
this->unk_78 = 0xc0;
|
||||
gRoomTransition.field_0x39 = 1;
|
||||
gPlayerState.flags |= 0x20000;
|
||||
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
|
||||
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
|
||||
#ifndef EU
|
||||
SoundReq(0x80100000);
|
||||
gArea.bgm = gArea.queued_bgm;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sub_080A184C(GyorgBossObjectEntity* this) {
|
||||
if (--this->unk_6e == 0) {
|
||||
super->action = 2;
|
||||
this->unk_6c = 8;
|
||||
((GyorgHeap*)super->myHeap)->female->base.health = 8;
|
||||
}
|
||||
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
|
||||
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
|
||||
}
|
||||
|
||||
void sub_080A189C(GyorgBossObjectEntity* this) {
|
||||
if (((GyorgHeap*)super->myHeap)->female->base.health == 0) {
|
||||
super->action = 3;
|
||||
super->actionDelay = 0x23;
|
||||
this->unk_6c = 1;
|
||||
this->unk_78 = 0x400;
|
||||
this->unk_7b = 1;
|
||||
((GyorgHeap*)super->myHeap)->male1->base.health = 0xC;
|
||||
SoundReq(0x128);
|
||||
InitScreenShake(0x96, 1);
|
||||
}
|
||||
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
|
||||
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
|
||||
}
|
||||
|
||||
void sub_080A190C(GyorgBossObjectEntity* this) {
|
||||
sub_080A1FF0(this);
|
||||
if (((GyorgHeap*)super->myHeap)->male1->base.health == 0) {
|
||||
if (sub_080A20B8(this, ((GyorgHeap*)super->myHeap)->male1)) {
|
||||
super->action = 4;
|
||||
this->unk_6c = 0x10;
|
||||
this->unk_78 = 0xC0;
|
||||
sub_080A1D70(this, ((GyorgHeap*)super->myHeap)->female->base.animationState);
|
||||
((GyorgHeap*)super->myHeap)->female->base.health = 0x18;
|
||||
}
|
||||
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
|
||||
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
|
||||
} else {
|
||||
gPlayerState.startPosX = ((GyorgHeap*)super->myHeap)->male1->base.x.HALF.HI;
|
||||
gPlayerState.startPosY = ((GyorgHeap*)super->myHeap)->male1->base.y.HALF.HI;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A1990(GyorgBossObjectEntity* this) {
|
||||
if (((GyorgHeap*)super->myHeap)->female->base.health == 0) {
|
||||
((GyorgHeap*)super->myHeap)->male1->base.health = 0xC;
|
||||
super->action = 5;
|
||||
super->actionDelay = 0x23;
|
||||
this->unk_6c = 2;
|
||||
this->unk_78 = 0x400;
|
||||
this->unk_7b = 1;
|
||||
SoundReq(0x128);
|
||||
InitScreenShake(0x96, 1);
|
||||
}
|
||||
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
|
||||
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
|
||||
}
|
||||
|
||||
void sub_080A19FC(GyorgBossObjectEntity* this) {
|
||||
sub_080A1FF0(this);
|
||||
if (((GyorgHeap*)super->myHeap)->male2->base.health == 0) {
|
||||
if (sub_080A20B8(this, ((GyorgHeap*)super->myHeap)->male2)) {
|
||||
super->action = 6;
|
||||
this->unk_6c = 0x20;
|
||||
this->unk_78 = 0xc0;
|
||||
sub_080A1D70(this, ((GyorgHeap*)super->myHeap)->female->base.animationState);
|
||||
((GyorgHeap*)super->myHeap)->female->base.health = 0x18;
|
||||
}
|
||||
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
|
||||
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
|
||||
} else {
|
||||
gPlayerState.startPosX = ((GyorgHeap*)super->myHeap)->male2->base.x.HALF.HI;
|
||||
gPlayerState.startPosY = ((GyorgHeap*)super->myHeap)->male2->base.y.HALF.HI;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A1A80(GyorgBossObjectEntity* this) {
|
||||
if (((GyorgHeap*)super->myHeap)->female->base.health == 0) {
|
||||
((GyorgHeap*)super->myHeap)->male2->base.health = 0xC;
|
||||
super->action = 7;
|
||||
super->actionDelay = 0x23;
|
||||
this->unk_6c = 0x104;
|
||||
this->unk_78 = 0x400;
|
||||
SoundReq(SFX_BOSS_DIE);
|
||||
InitScreenShake(0x96, 1);
|
||||
}
|
||||
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
|
||||
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
|
||||
}
|
||||
|
||||
void sub_080A1AE8(GyorgBossObjectEntity* this) {
|
||||
sub_080A1FF0(this);
|
||||
if (((GyorgHeap*)super->myHeap)->male2->base.health == 0) {
|
||||
if (sub_080A20B8(this, ((GyorgHeap*)super->myHeap)->male2)) {
|
||||
super->action = 8;
|
||||
this->unk_6c = 0x40;
|
||||
this->unk_78 = 0xC0;
|
||||
((GyorgHeap*)super->myHeap)->female->base.health = 0xC;
|
||||
}
|
||||
}
|
||||
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
|
||||
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
|
||||
}
|
||||
|
||||
void sub_080A1B4C(GyorgBossObjectEntity* this) {
|
||||
if (((GyorgHeap*)super->myHeap)->female->base.health == 0) {
|
||||
if (this->unk_6c != 0) {
|
||||
InitScreenShake(0x2d, 1);
|
||||
SoundReq(SFX_BOSS_DIE);
|
||||
this->unk_78 = 0x600;
|
||||
}
|
||||
this->unk_6c = 0;
|
||||
gRoomTransition.field_0x39 = 0;
|
||||
if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) {
|
||||
super->action = 9;
|
||||
super->actionDelay = 0;
|
||||
super->field_0xf = 0xF0;
|
||||
this->unk_6e = 0x1a4;
|
||||
super->direction = 0;
|
||||
super->speed = 0x60;
|
||||
gPlayerState.flags &= ~0x20000;
|
||||
CopyPosition(&gPlayerEntity, super);
|
||||
gRoomControls.camera_target = super;
|
||||
SetPlayerControl(2);
|
||||
}
|
||||
}
|
||||
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
|
||||
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
|
||||
}
|
||||
|
||||
void sub_080A1C04(GyorgBossObjectEntity* this) {
|
||||
if (this->unk_6e == 0) {
|
||||
LinearMoveUpdate(super);
|
||||
sub_080A1E54(this);
|
||||
if (--super->field_0xf == 0) {
|
||||
SetFlag(0x7B);
|
||||
sub_0808091C(&gUnk_0813ABD0, 8);
|
||||
return;
|
||||
}
|
||||
if (super->field_0xf == 0x3C) {
|
||||
SetFade(7, 4);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (--this->unk_6e < 0xb4) {
|
||||
sub_080A1E54(this);
|
||||
return;
|
||||
}
|
||||
switch (this->unk_6e) {
|
||||
case 0xb4:
|
||||
SoundReq(SFX_BOSS_DIE);
|
||||
InitScreenShake(0x2d0, 2);
|
||||
break;
|
||||
case 0x12C:
|
||||
SoundReq(SFX_BOSS_DIE);
|
||||
InitScreenShake(0x4b, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A1C9C(GyorgBossObjectEntity* this) {
|
||||
if (this->unk_7a) {
|
||||
if (this->unk_74 != this->unk_75) {
|
||||
this->unk_78 = 0;
|
||||
sub_080A1D8C(this, 0xC);
|
||||
if (this->unk_76 == 0) {
|
||||
this->unk_74 = this->unk_75;
|
||||
this->unk_78 = this->unk_7c;
|
||||
}
|
||||
} else {
|
||||
sub_080A1D8C(this, 0xC);
|
||||
if (this->unk_78 == this->unk_76) {
|
||||
this->unk_7a = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sub_080A1D8C(this, 8);
|
||||
}
|
||||
this->unk_70 += gSineTable[this->unk_74] * this->unk_76 / 0x100;
|
||||
this->unk_72 -= gSineTable[this->unk_74 + 0x40] * this->unk_76 / 0x100;
|
||||
gScreen.bg3.xOffset = this->unk_70 >> 0x8;
|
||||
gScreen.bg3.yOffset = this->unk_72 >> 0x8;
|
||||
}
|
||||
|
||||
void sub_080A1D70(GyorgBossObjectEntity* this, u32 unk1) {
|
||||
this->unk_75 = unk1;
|
||||
this->unk_7a = 1;
|
||||
this->unk_7c = this->unk_78;
|
||||
}
|
||||
|
||||
void sub_080A1D8C(GyorgBossObjectEntity* this, s32 unk1) {
|
||||
if (this->unk_78 != this->unk_76) {
|
||||
if (this->unk_78 > this->unk_76) {
|
||||
if (unk1 < this->unk_78 - this->unk_76) {
|
||||
this->unk_76 += unk1;
|
||||
} else {
|
||||
this->unk_76 = this->unk_78;
|
||||
}
|
||||
} else {
|
||||
if (unk1 < this->unk_76 - this->unk_78) {
|
||||
this->unk_76 -= unk1;
|
||||
} else {
|
||||
this->unk_76 = this->unk_78;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A1DCC(GyorgBossObjectEntity* this) {
|
||||
GenericEntity* tmp;
|
||||
if ((tmp = (GenericEntity*)((GyorgHeap*)super->myHeap)->male1) != NULL ||
|
||||
(tmp = (GenericEntity*)((GyorgHeap*)super->myHeap)->male2) != NULL) {
|
||||
if (tmp->field_0x7c.BYTES.byte0 && tmp->base.spriteRendering.b3 == 2) {
|
||||
((GyorgHeap*)super->myHeap)->unk_10->base.flags &= ~0x80;
|
||||
tmp = ((GyorgHeap*)super->myHeap)->unk_14;
|
||||
tmp->base.flags &= ~0x80;
|
||||
tmp = (GenericEntity*)tmp->base.child;
|
||||
tmp->base.flags &= ~0x80;
|
||||
tmp = (GenericEntity*)tmp->base.child;
|
||||
tmp->base.flags &= ~0x80;
|
||||
tmp = (GenericEntity*)tmp->base.child;
|
||||
tmp->base.flags &= ~0x80;
|
||||
return;
|
||||
}
|
||||
}
|
||||
((GyorgHeap*)super->myHeap)->unk_10->base.flags |= 0x80;
|
||||
tmp = ((GyorgHeap*)super->myHeap)->unk_14;
|
||||
tmp->base.flags |= 0x80;
|
||||
tmp = (GenericEntity*)tmp->base.child;
|
||||
tmp->base.flags |= 0x80;
|
||||
tmp = (GenericEntity*)tmp->base.child;
|
||||
tmp->base.flags |= 0x80;
|
||||
tmp = (GenericEntity*)tmp->base.child;
|
||||
tmp->base.flags |= 0x80;
|
||||
}
|
||||
|
||||
void sub_080A1E54(GyorgBossObjectEntity* this) {
|
||||
Entity* fx;
|
||||
if ((++super->actionDelay & 0x1F) == 0) {
|
||||
fx = CreateFx(super, 0x51, 0);
|
||||
if (fx) {
|
||||
u32 r = Random();
|
||||
fx->x.HALF.HI = gRoomControls.origin_x + 0x200 + (r & 0xf0) - 0x78;
|
||||
fx->y.HALF.HI = gRoomControls.origin_y + 0x210 + ((r >> 8) & 0x70) - 0x38;
|
||||
fx->spritePriority.b0 = 5;
|
||||
fx->collisionLayer = 2;
|
||||
UpdateSpriteForCollisionLayer(fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A1ED0(u32 unk0, u32 unk1, u32 unk2) {
|
||||
static const u16 gUnk_08124EF8[] = { 0x200, 0x1C0, 0x250, 0x210, 0x200, 0x260, 0x1B0, 0x210 };
|
||||
u32 i = 0;
|
||||
s16* p;
|
||||
u32 x, y;
|
||||
x = gUnk_08124EF8[unk2 * 2] + gRoomControls.origin_x;
|
||||
y = gUnk_08124EF8[unk2 * 2 + 1] + gRoomControls.origin_y;
|
||||
p = gUnk_08124FF0[unk0];
|
||||
while (*p != 1) {
|
||||
GyorgChildEntity* tmp = (GyorgChildEntity*)CreateEnemy(GYORG_CHILD, unk1);
|
||||
if (tmp) {
|
||||
tmp->base.type2 = i++;
|
||||
tmp->base.x.HALF.HI = x;
|
||||
tmp->base.y.HALF.HI = y;
|
||||
tmp->base.direction = DirectionFromAnimationState(unk2);
|
||||
tmp->unk_7a = DirectionTurnAround(DirectionFromAnimationState(unk2));
|
||||
tmp->unk_78 = p[2];
|
||||
switch (unk2) {
|
||||
case 0:
|
||||
tmp->unk_74 = p[0];
|
||||
tmp->unk_76 = -p[1];
|
||||
break;
|
||||
case 1:
|
||||
tmp->unk_74 = p[1] + 0xF0;
|
||||
tmp->unk_76 = p[0];
|
||||
break;
|
||||
case 2:
|
||||
tmp->unk_74 = p[0];
|
||||
tmp->unk_76 = p[1] + 0xA0;
|
||||
break;
|
||||
case 3:
|
||||
tmp->unk_74 = -p[1];
|
||||
tmp->unk_76 = p[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
p += 3;
|
||||
}
|
||||
if (unk1 == 0) {
|
||||
Entity* tmp;
|
||||
tmp = CreateObject(SPECIAL_FX, 2, 0);
|
||||
if (tmp) {
|
||||
tmp->x.HALF.HI = x;
|
||||
tmp->y.HALF.HI = y;
|
||||
tmp->spriteOrientation.flipY = 3;
|
||||
tmp->spriteRendering.b3 = 3;
|
||||
tmp->collisionLayer = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A1FF0(GyorgBossObjectEntity* this) {
|
||||
if (super->actionDelay != 0) {
|
||||
super->actionDelay--;
|
||||
if (super->actionDelay <= 0x20 && (super->actionDelay & 0xF) == 0) {
|
||||
Entity* fx;
|
||||
fx = CreateFx(super, 0x51, 0);
|
||||
if (fx) {
|
||||
u32 r = Random();
|
||||
fx->x.HALF.HI = gRoomControls.origin_x + 0x200 + (r & 0x78) - 0x3C;
|
||||
fx->y.HALF.HI = gRoomControls.origin_y + 0x210 + (r & 0x78) - 0x3C;
|
||||
fx->spritePriority.b0 = 6;
|
||||
fx->collisionLayer = 1;
|
||||
UpdateSpriteForCollisionLayer(fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this->unk_7b) {
|
||||
if (sub_0806FCB8(&gPlayerEntity, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, 0x100)) {
|
||||
if (super->actionDelay == 0) {
|
||||
super->actionDelay = 0x78;
|
||||
} else {
|
||||
if (super->actionDelay == 0x23) {
|
||||
InitScreenShake(0x1e, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->unk_7b = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_080A20B8(GyorgBossObjectEntity* this, GyorgMaleEntity* other) {
|
||||
if (other == NULL) {
|
||||
return 1;
|
||||
}
|
||||
if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) {
|
||||
return other->unk_7c == 0 && gPlayerState.field_0x14 != 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ void sub_080A0624(Entity* this) {
|
||||
|
||||
void sub_080A0640(Entity* this) {
|
||||
if (this->type == 0) {
|
||||
PositionRelative(*(Entity**)(this->parent->myHeap + 0x4), this, 0, 0x80000);
|
||||
PositionRelative(*(((Entity**)this->parent->myHeap) + 4), this, 0, 0x80000);
|
||||
} else {
|
||||
CopyPosition(this->parent, this);
|
||||
}
|
||||
|
||||
@@ -77,25 +77,25 @@ void V3TennisBallProjectile_Action2(Entity* this) {
|
||||
bool32 sub_080ACB40(Entity* this) {
|
||||
Entity* r1_grandparent = this->parent->parent;
|
||||
Entity* child = this->child;
|
||||
Entity* tmp = ((Entity*)(r1_grandparent->myHeap[7]))->child;
|
||||
Entity* tmp = ((Entity**)(r1_grandparent->myHeap))[7]->child;
|
||||
|
||||
if (tmp != this && child == tmp->child) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
tmp = ((Entity*)(r1_grandparent->myHeap[8]))->child;
|
||||
tmp = ((Entity**)(r1_grandparent->myHeap))[8]->child;
|
||||
|
||||
if (tmp != this && child == tmp->child) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
tmp = ((Entity*)(r1_grandparent->myHeap[9]))->child;
|
||||
tmp = ((Entity**)(r1_grandparent->myHeap))[9]->child;
|
||||
|
||||
if (tmp != this && child == tmp->child) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
tmp = ((Entity*)(r1_grandparent->myHeap[10]))->child;
|
||||
tmp = ((Entity**)(r1_grandparent->myHeap))[10]->child;
|
||||
|
||||
if (tmp != this && child == tmp->child) {
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ void sub_08080910(void) {
|
||||
gRoomTransition.type = TRANSITION_CUT;
|
||||
}
|
||||
|
||||
void sub_0808091C(ScreenTransitionData* param_1, u32 param_2) {
|
||||
void sub_0808091C(const ScreenTransitionData* param_1, u32 param_2) {
|
||||
DoExitTransition(param_1);
|
||||
gRoomTransition.type = param_2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user