mirror of
https://github.com/zeldaret/tmc
synced 2026-06-18 15:36:09 -04:00
Merge pull request #304 from octorock/lilypadLarge
Decompile LilypadLarge
This commit is contained in:
+2
-3
@@ -22,7 +22,6 @@ extern u8 gUnk_08114F38[];
|
||||
extern u8 gUnk_08114F58[];
|
||||
|
||||
void sub_080027EA(Entity*, u32, u32);
|
||||
void sub_0806F5BC(Entity*, u32, u32);
|
||||
u32 sub_0806F58C(Entity*, Entity*);
|
||||
u32 sub_0806FCA0(Entity*, Entity*);
|
||||
|
||||
@@ -214,8 +213,8 @@ u32 sub_0806F804(u32 x, u32 y) {
|
||||
return gUnk_02025EB0._4[idx];
|
||||
}
|
||||
|
||||
void sub_0806F824(Entity* a, Entity* b, s32 x, s32 y) {
|
||||
sub_080045D4(a->x.HALF.HI, a->y.HALF.HI, b->x.HALF.HI + x, b->y.HALF.HI + y);
|
||||
u32 sub_0806F824(Entity* a, Entity* b, s32 x, s32 y) {
|
||||
return sub_080045D4(a->x.HALF.HI, a->y.HALF.HI, b->x.HALF.HI + x, b->y.HALF.HI + y);
|
||||
}
|
||||
|
||||
u32 sub_0806F854(Entity* ent, s32 x, s32 y) {
|
||||
|
||||
@@ -8,16 +8,6 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern u32 sub_080002D4(s32, s32, u32);
|
||||
extern s32 sub_080012DC(Entity*);
|
||||
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 Entity* gUnk_020000B0;
|
||||
extern void (*const gUnk_080012C8[])(Entity*);
|
||||
extern void (*const gUnk_080CE56C[])(Entity*);
|
||||
|
||||
@@ -12,12 +12,6 @@
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void sub_08078954(Entity*);
|
||||
extern void sub_08078930(Entity*);
|
||||
extern s32 sub_080012DC(Entity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
extern void sub_08079BD8(Entity*);
|
||||
|
||||
void sub_0802AD1C(Entity*, u32);
|
||||
void sub_0802AD54(Entity*);
|
||||
void sub_0802B048(Entity*);
|
||||
|
||||
@@ -33,8 +33,6 @@ void sub_0803C714(BowMoblinEntity*);
|
||||
void sub_0803C634(BowMoblinEntity*);
|
||||
u32 sub_0803C6F8(BowMoblinEntity*);
|
||||
u32 sub_0803C568(BowMoblinEntity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
extern u32 sub_0806FC80(Entity*, Entity*, s32);
|
||||
void sub_0803C664(BowMoblinEntity*);
|
||||
|
||||
void (*const gUnk_080CFF78[])(Entity*);
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
#include "game.h"
|
||||
#include "item.h"
|
||||
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
extern bool32 sub_08056338(void);
|
||||
extern void UnloadOBJPalette(Entity*);
|
||||
|
||||
bool32 sub_0802915C(Entity*);
|
||||
bool32 sub_080291DC(Entity*);
|
||||
void sub_0802922C(Entity*);
|
||||
|
||||
@@ -20,8 +20,6 @@ void (*const gUnk_080CE990[])(CrowEntity*);
|
||||
void (*const gUnk_080CE9A4[])(CrowEntity*);
|
||||
extern Entity* gUnk_020000B0;
|
||||
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
|
||||
void sub_08032AF4(CrowEntity* this);
|
||||
void sub_08032AB0(CrowEntity* this);
|
||||
void sub_08032B38(CrowEntity* this);
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
|
||||
void sub_08022A88(Entity*);
|
||||
void sub_08022AA4(Entity*);
|
||||
void sub_08022B0C(Entity*);
|
||||
|
||||
@@ -27,9 +27,7 @@ void sub_08037B48(Entity*);
|
||||
void sub_08037A14(Entity*);
|
||||
|
||||
extern void sub_0804A4E4(Entity*, Entity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
u32 sub_0804A044(Entity*, Entity*, u32);
|
||||
extern void SoundReqClipped(Entity*, u32);
|
||||
|
||||
extern void (*const gGibdo[6])(Entity*);
|
||||
extern void (*const gUnk_080CF2AC[9])(Entity*);
|
||||
|
||||
@@ -106,7 +106,7 @@ void GyorgMale(GyorgMaleEntity* this) {
|
||||
}
|
||||
gUnk_080D1AFC[super->action](this);
|
||||
if (super->action != 7) {
|
||||
sub_0805EC9C(this, 0xaa, 0xaa, this->unk_78);
|
||||
sub_0805EC9C(super, 0xaa, 0xaa, this->unk_78);
|
||||
}
|
||||
super->animationState = -(this->unk_78 >> 8);
|
||||
sub_08048004(this);
|
||||
@@ -986,7 +986,7 @@ void sub_08047BF0(GyorgMaleEntity* this) {
|
||||
}
|
||||
}
|
||||
}
|
||||
sub_0805EC9C(this, 0xAA, 0xAA, this->unk_78);
|
||||
sub_0805EC9C(super, 0xAA, 0xAA, this->unk_78);
|
||||
}
|
||||
|
||||
void sub_08047D24(GyorgMaleEntity* this) {
|
||||
@@ -1005,7 +1005,7 @@ void sub_08047D24(GyorgMaleEntity* this) {
|
||||
} else {
|
||||
sub_08047E58(this);
|
||||
}
|
||||
sub_0805EC9C(this, this->unk_7e, this->unk_7e, this->unk_78);
|
||||
sub_0805EC9C(super, this->unk_7e, this->unk_7e, this->unk_78);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
|
||||
void Octorok_Pause(Entity*);
|
||||
bool32 Octorok_FacesPlayer(Entity*);
|
||||
void Octorok_Turn(Entity*);
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
extern void sub_08078AC0(u32, u32, u32);
|
||||
extern u32 GetRandomByWeight(const u8*);
|
||||
extern u32 sub_0806FC80(Entity*, Entity*, s32);
|
||||
extern void sub_080792BC(s32, u32, u32);
|
||||
|
||||
enum OctorokRotation { ROTATION_CW, ROTATION_CCW, NO_ROTATION = 0xff };
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
#include "functions.h"
|
||||
#include "save.h"
|
||||
|
||||
extern u32 sub_080002E0(u16, u32);
|
||||
extern void SoundReqClipped(Entity*, u32);
|
||||
extern u32 sub_08049F1C(Entity*, Entity*, u32);
|
||||
extern u32 PlayerInRange(Entity*, u32, u32);
|
||||
extern void sub_080AEFB4(Entity*);
|
||||
|
||||
void sub_080249F4(Entity*);
|
||||
void sub_08024940(Entity*);
|
||||
void sub_080249DC(Entity*);
|
||||
|
||||
@@ -9,12 +9,6 @@
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern u32 sub_080002E0(u32, u32);
|
||||
extern u32 sub_080002C8(u16, u8);
|
||||
extern u8 sub_080002D4(u32, u32, u32);
|
||||
extern void sub_0804AA1C(Entity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
|
||||
extern u8 gUnk_080B37A0[];
|
||||
extern u8 gUnk_080B3E80[];
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ void sub_08044FF8(Entity*);
|
||||
void sub_08045178(Entity*, Entity*, int, int);
|
||||
|
||||
extern void sub_0804A4E4(Entity*, Entity*);
|
||||
extern u32 sub_080002CC(Entity*, s32, s32);
|
||||
|
||||
extern void (*const gUnk_080D16BC[])(Entity*);
|
||||
extern void (*const gUnk_080D16A4[])(Entity*);
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern bool32 sub_0806FC80(Entity*, Entity*, u32);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
|
||||
void sub_08028604(Entity*);
|
||||
void sub_08028754(Entity*);
|
||||
void sub_08028784(Entity*);
|
||||
|
||||
@@ -20,8 +20,6 @@ typedef struct {
|
||||
|
||||
static_assert(sizeof(TakkuriEntity) == 0x88);
|
||||
|
||||
extern void sub_0803C0AC(Entity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
extern Entity* gUnk_020000B0;
|
||||
|
||||
void (*const gUnk_080CFF3C[])(Entity*);
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern u32 sub_080002E0(u32, u32);
|
||||
extern s16 gUnk_080B4488[];
|
||||
|
||||
void VaatiEyesMacroFunction0(Entity*);
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern bool32 PlayerInRange(Entity*, u32, u32);
|
||||
extern u32 sub_080002E0(u32, u32);
|
||||
extern Entity* gUnk_020000B0;
|
||||
extern const ScreenTransitionData gUnk_0813AB94;
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void sub_08001328(Entity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
extern ScreenTransitionData* gUnk_0813AB1C[];
|
||||
|
||||
void sub_0802A78C(Entity*);
|
||||
|
||||
@@ -40,8 +40,6 @@ extern u16 gUnk_08111104[];
|
||||
|
||||
extern u32 sub_0806FCA0(Entity*, Entity*);
|
||||
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
|
||||
void sub_08067790(Entity* this) {
|
||||
ShowNPCDialogue(this, &gUnk_08110EF8 + this->type * 10 + gSave.global_progress);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ extern struct {
|
||||
s8 unk_1;
|
||||
} gUnk_0810AC4C[];
|
||||
extern u8 gUnk_0810AC54[8];
|
||||
extern u32 sub_080002B4(Entity*, u32, u32);
|
||||
|
||||
extern u8 gUnk_0810AC5D;
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ extern void (*const gUnk_0810FDC8[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_0810FDA4[])(Entity*);
|
||||
|
||||
extern bool32 sub_08056338(void);
|
||||
|
||||
extern void sub_08078850(Entity*, u32, u8, u32*);
|
||||
extern u32 gUnk_0810FDA0;
|
||||
extern u16 script_Stockwell;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void SoundReqClipped(Entity*, u32);
|
||||
extern u32 sub_0806FC80(Entity*, Entity*, s32);
|
||||
extern void sub_0809CDF0(Entity*);
|
||||
|
||||
extern void (*const gUnk_08123E20[])(Entity*);
|
||||
|
||||
@@ -136,7 +136,6 @@ u32 sub_08081D28(Entity* this) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
extern u32 sub_080002E0(u32, u32);
|
||||
extern Entity* gPlayerClones[3];
|
||||
u32 sub_08081E0C(Entity*);
|
||||
|
||||
|
||||
@@ -0,0 +1,385 @@
|
||||
/**
|
||||
* @file lilypadLarge.c
|
||||
* @ingroup Objects
|
||||
*
|
||||
* @brief Large Lilypad object
|
||||
*/
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
#include "item.h"
|
||||
#include "object.h"
|
||||
|
||||
typedef struct {
|
||||
Entity base;
|
||||
u8 unk_68[4];
|
||||
s32 unk_6c;
|
||||
s32 unk_70;
|
||||
s16 unk_74;
|
||||
s16 unk_76;
|
||||
union SplitWord unk_78;
|
||||
union SplitWord unk_7c;
|
||||
u8 unk_80[2];
|
||||
u16 unk_82;
|
||||
u8 unk_84;
|
||||
u8 unk_85;
|
||||
} LilypadLargeEntity;
|
||||
|
||||
extern void (*const gUnk_08120608[])(LilypadLargeEntity*);
|
||||
extern Hitbox gUnk_08120640;
|
||||
extern void (*const gUnk_0812062C[])(LilypadLargeEntity*);
|
||||
extern u8 gUnk_08120638[];
|
||||
extern u8 gUnk_08126EE4[];
|
||||
extern u32 gUnk_08120620[];
|
||||
|
||||
void sub_080855E8(LilypadLargeEntity*);
|
||||
void sub_08085CDC(LilypadLargeEntity*);
|
||||
void sub_08085EFC(LilypadLargeEntity*);
|
||||
void sub_08085F1C(LilypadLargeEntity*);
|
||||
void sub_08085E74(LilypadLargeEntity*);
|
||||
void sub_08085F48(LilypadLargeEntity*);
|
||||
void sub_08085D28(LilypadLargeEntity*);
|
||||
void sub_08085D60(LilypadLargeEntity*);
|
||||
|
||||
void LilypadLarge(LilypadLargeEntity* this) {
|
||||
gUnk_08120608[super->action](this);
|
||||
}
|
||||
|
||||
void sub_08085504(LilypadLargeEntity* this) {
|
||||
if (super->type == 0xff) {
|
||||
if (GetInventoryValue(ITEM_FLIPPERS)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
super->type = 0;
|
||||
}
|
||||
if (super->type != 0) {
|
||||
if (gArea.locationIndex == 0x1b) {
|
||||
if (CheckLocalFlag(super->type2) == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
} else {
|
||||
if (CheckLocalFlag(super->type2) == 0) {
|
||||
super->action = 5;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (super->actionDelay != 0) {
|
||||
if (sub_080040A2(super) == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
super->actionDelay = 0;
|
||||
} else {
|
||||
if (EntityHasDuplicateID(super) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
super->action = 1;
|
||||
super->speed = 0x100;
|
||||
super->spritePriority.b0 = 6;
|
||||
super->hitbox = &gUnk_08120640;
|
||||
super->flags |= 0x80;
|
||||
super->field_0x3c = 7;
|
||||
super->hitType = 1;
|
||||
super->flags2 = 4;
|
||||
this->unk_78.WORD = 0x1000000;
|
||||
this->unk_7c.HALF_U.HI = 0x1000;
|
||||
this->unk_85 = 0;
|
||||
this->unk_84 = 0;
|
||||
InitializeAnimation(super, 9);
|
||||
sub_080855E8(this);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/lilypadLarge/sub_080855E8.inc", void sub_080855E8(LilypadLargeEntity* this));
|
||||
|
||||
void sub_08085A1C(LilypadLargeEntity* this) {
|
||||
gUnk_0812062C[super->subAction](this);
|
||||
gPlayerState.flags |= 2;
|
||||
sub_08078B48();
|
||||
}
|
||||
|
||||
void sub_08085A44(LilypadLargeEntity* this) {
|
||||
super->speed = 0x200;
|
||||
if (sub_080002B4(super, 0x10, 0x18) != 0x11) {
|
||||
super->direction = 0x18;
|
||||
} else {
|
||||
if (sub_080002B4(super, 0xfffffff0, 0x18) != 0x11) {
|
||||
super->direction = 8;
|
||||
} else {
|
||||
super->direction = 0x10;
|
||||
super->subAction = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
sub_08085EFC(this);
|
||||
sub_080AF134(super);
|
||||
sub_08085F1C(this);
|
||||
}
|
||||
|
||||
void sub_08085A98(LilypadLargeEntity* this) {
|
||||
sub_08085EFC(this);
|
||||
LinearMoveUpdate(super);
|
||||
sub_08085F1C(this);
|
||||
if (0x7fffff < (u32)this->unk_78.WORD) {
|
||||
this->unk_78.WORD -= 0x20000;
|
||||
sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
|
||||
}
|
||||
if (sub_080002B4(super, 0, 0x18) != 0x11) {
|
||||
super->subAction = 2;
|
||||
if (gArea.locationIndex == 0x1b) {
|
||||
super->y.HALF.HI += 0xd0;
|
||||
super->z.HALF.HI = 0xff30;
|
||||
this->unk_82 = 0x46;
|
||||
SetLocalFlag(0x73);
|
||||
} else {
|
||||
super->y.HALF.HI += 0x40;
|
||||
super->z.HALF.HI = 0xffc0;
|
||||
this->unk_82 = 0xf;
|
||||
}
|
||||
CreateObjectWithParent(super, OBJECT_2B, 0, 0);
|
||||
SoundReq(SFX_12D);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08085B40(LilypadLargeEntity* this) {
|
||||
if (super->z.WORD != 0) {
|
||||
if (GravityUpdate(super, 0x2000) != 0) {
|
||||
if ((u32)this->unk_78.WORD < 0x1200000) {
|
||||
this->unk_78.WORD += 0x100000;
|
||||
sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
|
||||
}
|
||||
gPlayerEntity.y.HALF.HI = (super->y.HALF.HI + super->z.HALF.HI) - this->unk_74;
|
||||
if (gArea.locationIndex == 0x1b) {
|
||||
gPlayerEntity.z.HALF.HI = super->y.HALF.HI - this->unk_74 - 0xd0 - gPlayerEntity.y.HALF.HI;
|
||||
} else {
|
||||
gPlayerEntity.z.HALF.HI = super->y.HALF.HI - this->unk_74 - 0x40 - gPlayerEntity.y.HALF.HI;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ResetCollisionLayer(super);
|
||||
if (sub_080002B8(super) == 0xd) {
|
||||
ResetCollisionLayer(&gPlayerEntity);
|
||||
sub_08085CDC(this);
|
||||
super->direction = GetFacingDirection(&gPlayerEntity, super);
|
||||
sub_0806F5BC(&gPlayerEntity, 0x100, super->direction);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->unk_82 == 0) {
|
||||
if (GravityUpdate(&gPlayerEntity, 0x2000) == 0) {
|
||||
ResetCollisionLayer(&gPlayerEntity);
|
||||
sub_08085F1C(this);
|
||||
super->action = 1;
|
||||
super->field_0xf = 4;
|
||||
while (super->field_0xf != 0) {
|
||||
sub_080A2AF4(super, 8, 10);
|
||||
super->field_0xf--;
|
||||
}
|
||||
super->field_0xf = 1;
|
||||
super->actionDelay |= 0x80;
|
||||
this->unk_70 = 0;
|
||||
this->unk_6c = 0;
|
||||
if (sub_080002B8(super) == 0xd) {
|
||||
super->action = 4;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->unk_82--;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08085C5C(LilypadLargeEntity* this) {
|
||||
if (sub_0806FC80(super, &gPlayerEntity, 0x18) != 0) {
|
||||
LinearMoveUpdate(super);
|
||||
gPlayerEntity.speed = super->speed;
|
||||
gPlayerEntity.direction = super->direction;
|
||||
LinearMoveUpdate(&gPlayerEntity);
|
||||
gPlayerState.flags |= 2;
|
||||
if (super->collisionLayer == 1) {
|
||||
ResetCollisionLayer(&gPlayerEntity);
|
||||
} else {
|
||||
sub_08004542(&gPlayerEntity);
|
||||
}
|
||||
}
|
||||
if (gRoomControls.reload_flags == 0) {
|
||||
super->flags &= 0xdf;
|
||||
super->action = 1;
|
||||
super->updatePriority = super->updatePriorityPrev;
|
||||
gRoomControls.camera_target = &gPlayerEntity;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08085CDC(LilypadLargeEntity* this) {
|
||||
this->unk_78.WORD += 0x100000;
|
||||
if (this->unk_78.WORD_U < 0x4000000) {
|
||||
sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
|
||||
} else {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08085D10(LilypadLargeEntity* this) {
|
||||
if (EntityHasDuplicateID(super) != 0) {
|
||||
SetLocalFlag(super->type2);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08085D28(LilypadLargeEntity* this) {
|
||||
if (((gPlayerState.framestate != 0x13) && ((gPlayerState.flags & 2) != 0)) &&
|
||||
(sub_080002B4(super, 0, 0x18) == 0x11)) {
|
||||
super->action = 2;
|
||||
super->subAction = 0;
|
||||
sub_08078B48();
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/lilypadLarge/sub_08085D60.inc", void sub_08085D60(LilypadLargeEntity* this)) {
|
||||
u32 r4; // horizontal direction?
|
||||
u32 r6; // vertical direction?
|
||||
if ((gPlayerState.flags & 2) != 0) {
|
||||
if (gPlayerState.framestate != 0x12) {
|
||||
if (gPlayerState.jump_status == 0) {
|
||||
if ((super->direction & 7) == 0) { // North or South
|
||||
r4 = super->direction;
|
||||
r6 = super->direction;
|
||||
} else {
|
||||
if ((super->direction & 0x10) != 0) { // South(already top) or West
|
||||
r4 = DirectionWest;
|
||||
} else {
|
||||
r4 = DirectionEast;
|
||||
}
|
||||
if (super->direction - 8 > 0x10) { // North(already top) or West(?)
|
||||
r6 = DirectionNorth;
|
||||
} else {
|
||||
r6 = DirectionSouth;
|
||||
}
|
||||
}
|
||||
if (r4 == DirectionWest || r4 == DirectionEast) { // Handle horizontal
|
||||
u32 tmp = r4 >> 2;
|
||||
s32 tmpX = gUnk_08120638[tmp];
|
||||
s32 tmpY = gUnk_08120638[tmp + 1];
|
||||
if (sub_080002CC(super, tmpX, tmpY) == 0xff) {
|
||||
|
||||
if (sub_080806BC((super->x.HALF.HI - gRoomControls.origin_x) + tmpX,
|
||||
(super->y.HALF.HI - gRoomControls.origin_y) + tmpY, r4, 5) == 0) {
|
||||
if (sub_0807BD14(&gPlayerEntity, r4 >> 3) != 0) {
|
||||
super->direction = r4;
|
||||
sub_08085E74(this);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
super->direction = r4;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (r6 == DirectionNorth || r6 == DirectionSouth) { // Handle vertical
|
||||
u32 tmp = r6 >> 2;
|
||||
s32 tmpX = (u8)gUnk_08120638[tmp];
|
||||
s32 tmpY = gUnk_08120638[tmp + 1];
|
||||
if (sub_080002CC(super, tmpX, tmpY) == 0xff) {
|
||||
if (sub_0807BD14(&gPlayerEntity, r6 >> 3) != 0) {
|
||||
super->direction = (u8)r6;
|
||||
sub_08085E74(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
super->flags &= 0xdf;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08085E74(LilypadLargeEntity* this) {
|
||||
super->flags |= 0x20;
|
||||
super->updatePriority = 6;
|
||||
super->action = 3;
|
||||
switch (super->direction) {
|
||||
case DirectionNorth:
|
||||
super->speed = 0x120;
|
||||
break;
|
||||
case DirectionSouth:
|
||||
super->speed = 0x138;
|
||||
break;
|
||||
case DirectionEast:
|
||||
case DirectionWest:
|
||||
super->speed = 0x100;
|
||||
break;
|
||||
}
|
||||
this->unk_70 = 0;
|
||||
this->unk_6c = 0;
|
||||
super->x.HALF.LO = 0;
|
||||
super->y.HALF.LO = 0;
|
||||
gPlayerEntity.x.HALF.LO = 0;
|
||||
gPlayerEntity.y.HALF.LO = 0;
|
||||
gPlayerEntity.direction = super->direction;
|
||||
gPlayerState.animation = 0x100;
|
||||
gRoomControls.camera_target = super;
|
||||
if (gPlayerState.item != NULL) {
|
||||
DeleteEntity(gPlayerState.item);
|
||||
}
|
||||
ResetPlayer();
|
||||
}
|
||||
|
||||
void sub_08085EFC(LilypadLargeEntity* this) {
|
||||
this->unk_76 = super->x.HALF.HI - gPlayerEntity.x.HALF.HI;
|
||||
this->unk_74 = super->y.HALF.HI - gPlayerEntity.y.HALF.HI;
|
||||
}
|
||||
|
||||
void sub_08085F1C(LilypadLargeEntity* this) {
|
||||
gPlayerEntity.x.HALF.HI = super->x.HALF.HI - this->unk_76;
|
||||
gPlayerEntity.y.HALF.HI = super->y.HALF.HI - this->unk_74;
|
||||
sub_0807A5B8(super->direction);
|
||||
}
|
||||
|
||||
void sub_08085F48(LilypadLargeEntity* this) {
|
||||
u32 tmp = super->actionDelay & 0x80;
|
||||
if (tmp != 0) {
|
||||
if (gPlayerState.floor_type == 0x17) {
|
||||
ResetPlayerVelocity();
|
||||
gPlayerState.floor_type = 0x19;
|
||||
}
|
||||
SoundReq(SFX_WATER_WALK);
|
||||
if (this->unk_78.WORD_U < 0x1280000) {
|
||||
this->unk_78.WORD_U += 0x80000;
|
||||
} else {
|
||||
super->actionDelay = 0;
|
||||
}
|
||||
} else {
|
||||
if ((gPlayerState.flags & 2) != 0) {
|
||||
if (super->actionDelay != 0) {
|
||||
if (this->unk_78.WORD_U < 0x1200000) {
|
||||
this->unk_78.WORD_U += 0x8000;
|
||||
} else {
|
||||
super->actionDelay = tmp;
|
||||
}
|
||||
} else {
|
||||
if (this->unk_78.WORD_U > 0x1100000) {
|
||||
this->unk_78.WORD_U -= 0x8000;
|
||||
} else {
|
||||
super->actionDelay = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (super->actionDelay != 0) {
|
||||
if (this->unk_78.WORD_U < 0x1100000) {
|
||||
this->unk_78.WORD_U += 0x4000;
|
||||
} else {
|
||||
super->actionDelay = 0;
|
||||
}
|
||||
} else {
|
||||
if (this->unk_78.WORD_U > 0x1060000) {
|
||||
this->unk_78.WORD_U -= 0x4000;
|
||||
} else {
|
||||
super->actionDelay = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
|
||||
}
|
||||
+1
-2
@@ -5,7 +5,6 @@ extern void (*MaskActionFuncs[])(Entity*);
|
||||
|
||||
extern void sub_08000148(u16, u16, u32);
|
||||
extern s16 sub_080001DA(u16, u32);
|
||||
extern u16 sub_080002E0(u16, u32);
|
||||
|
||||
extern void sub_0805457C(Entity*, s32);
|
||||
|
||||
@@ -52,7 +51,7 @@ void sub_080929A4(Entity* 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_0x7a.HWORD = sub_080002E0(this->field_0x7c.HALF.HI, 1);
|
||||
this->field_0x7a.HWORD = sub_080002E0((u16)this->field_0x7c.HALF.HI, 1);
|
||||
|
||||
SetTile(0x4022, this->field_0x7c.HALF_U.HI, 1);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include "functions.h"
|
||||
|
||||
extern u32 sub_08091DDC(Entity*);
|
||||
extern u32 sub_080002B4(Entity*, u32, u32);
|
||||
extern u32 sub_08007DD6(u32, u32);
|
||||
extern void sub_08017744(Entity*);
|
||||
extern void sub_08091C0C(Entity*);
|
||||
|
||||
@@ -40,8 +40,6 @@ enum OctorokBossObjectType {
|
||||
};
|
||||
#define GET_HELPER(this) (*(HelperStruct**)&(this)->cutsceneBeh)
|
||||
|
||||
extern u32 sub_0806FC80(Entity*, Entity*, s32);
|
||||
|
||||
void OctorokBossObject(Entity* this) {
|
||||
OctorokBossObject_Actions[this->action](this);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "player.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void sub_0806F5BC(Entity*, u32, u32);
|
||||
extern u32 sub_080041DC(Entity*, u32, u32);
|
||||
|
||||
extern void (*const GleerokProjectile_Functions[])(Entity*);
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
#include "functions.h"
|
||||
#include "game.h"
|
||||
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
extern u32 sub_08049F1C(Entity*, Entity*, u32);
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern u32 sub_0806F824(Entity*, Entity*, u32, u32);
|
||||
extern Hitbox gHitbox_0;
|
||||
|
||||
extern void (*const MandiblesProjectile_Functions[])(Entity*);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
void OctorokBossProjectile_Action2(Entity*);
|
||||
extern void sub_080AE58C(Entity*, u32, u32);
|
||||
extern u32 sub_0806FC80(Entity*, Entity*, s32);
|
||||
|
||||
extern void (*const OctorokBossProjectile_Functions[])(Entity*);
|
||||
extern void (*const OctorokBossProjectile_Actions[])(Entity*);
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include "player.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void sub_0806F5BC(Entity*, u32, u32);
|
||||
extern u32 sub_080041DC(Entity*, u32, u32);
|
||||
|
||||
extern void (*const V1FireProjectile_Functions[])(Entity*);
|
||||
|
||||
Reference in New Issue
Block a user