Merge pull request #272 from Ibot02/gyorg

Gyorg
This commit is contained in:
notyourav
2022-01-09 23:46:09 -08:00
committed by GitHub
27 changed files with 2247 additions and 4846 deletions
+200
View File
@@ -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();
}
+458
View File
@@ -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;
}
}
+208
View File
@@ -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;
}
+66
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff