mirror of
https://github.com/zeldaret/tmc
synced 2026-06-14 14:28:16 -04:00
Decompile Whirlwind
This commit is contained in:
@@ -20,7 +20,6 @@ typedef struct {
|
||||
/*0x86*/ u16 unk_86;
|
||||
} BigIceBlockEntity;
|
||||
|
||||
|
||||
extern void (*const BigIceBlock_Actions[])(BigIceBlockEntity*);
|
||||
extern const u16 gUnk_081237B0[];
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ typedef struct {
|
||||
/*0x86*/ u16 unk_86;
|
||||
} BossDoorEntity;
|
||||
|
||||
|
||||
extern bool32 gUnk_02036BB8;
|
||||
extern const u8 gUnk_0811F740[];
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ typedef struct {
|
||||
/*0x87*/ u8 unk_87;
|
||||
} FairyEntity;
|
||||
|
||||
|
||||
|
||||
void sub_0808D76C(FairyEntity*);
|
||||
void sub_0808DAD0(FairyEntity*);
|
||||
void sub_0808DB2C(FairyEntity*);
|
||||
|
||||
@@ -11,7 +11,6 @@ extern void (*const gUnk_081243B4[])(Entity*);
|
||||
extern void (*const gUnk_081243BC[])(Entity*);
|
||||
extern void (*const gUnk_081243C4[])(Entity*);
|
||||
|
||||
|
||||
void LightableSwitch(Entity* this) {
|
||||
gUnk_081243B4[this->type](this);
|
||||
sub_0809EB30(this);
|
||||
|
||||
@@ -9,7 +9,6 @@ extern void sub_08091C0C(Entity*);
|
||||
|
||||
extern void (*const gUnk_081223A8[])(Entity*);
|
||||
|
||||
|
||||
extern const s8 gUnk_081223C8[];
|
||||
extern const u32 gUnk_081223D8[];
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ typedef struct {
|
||||
/*0x87*/ u8 unk_87;
|
||||
} ObjectA8Entity;
|
||||
|
||||
|
||||
void sub_0809FECC(ObjectA8Entity*);
|
||||
bool32 sub_0809FE9C(ObjectA8Entity*);
|
||||
void ObjectA8_Init(ObjectA8Entity*);
|
||||
|
||||
@@ -16,7 +16,6 @@ extern void (*const gUnk_0811F090[])(Entity*);
|
||||
extern void (*const gUnk_0811F0A8[])(Entity*);
|
||||
extern void (*const gUnk_0811F0C4[])(Entity*);
|
||||
|
||||
|
||||
extern void sub_08078930(Entity*);
|
||||
extern void sub_08016A6C(Entity*);
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@ typedef struct {
|
||||
/*0x86*/ u16 pushedFlag;
|
||||
} PushableGraveEntity;
|
||||
|
||||
|
||||
|
||||
extern void (*const gUnk_081232AC[])(PushableGraveEntity*);
|
||||
extern const u8 gUnk_081232C0[];
|
||||
extern const u16 PushableGrave_Tiles[];
|
||||
|
||||
@@ -21,7 +21,6 @@ typedef struct {
|
||||
/*0x86*/ u16 unk_86;
|
||||
} PushableStatueEntity;
|
||||
|
||||
|
||||
extern const s16 gUnk_080B4488[];
|
||||
extern const s16 gUnk_080B4468[];
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ void sub_08086A6C(Entity*);
|
||||
|
||||
void (*const gUnk_081206C4[])(Entity*);
|
||||
|
||||
|
||||
// Main
|
||||
void Rupee(Entity* ent) {
|
||||
gUnk_081206C4[ent->action](ent);
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* @file whirlwind.c
|
||||
* @ingroup Objects
|
||||
*
|
||||
* @brief Whirlwind object
|
||||
*/
|
||||
|
||||
#define NENT_DEPRECATED
|
||||
#include "global.h"
|
||||
#include "object.h"
|
||||
#include "functions.h"
|
||||
#include "area.h"
|
||||
#include "hitbox.h"
|
||||
|
||||
void Whirlwind_Init(Entity*);
|
||||
void Whirlwind_Action1(Entity*);
|
||||
void Whirlwind_Action2(Entity*);
|
||||
|
||||
void Whirlwind(Entity* this) {
|
||||
static void (*const Whirlwind_Actions[])(Entity*) = {
|
||||
Whirlwind_Init,
|
||||
Whirlwind_Action1,
|
||||
Whirlwind_Action2,
|
||||
};
|
||||
u32 tmp = this->health;
|
||||
if (((tmp & 0x7f) != 0) && (ReadBit(gArea.filler5, tmp - 1) == 0)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
Whirlwind_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void Whirlwind_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->hitbox = (Hitbox*)&gUnk_080FD320;
|
||||
this->flags |= ENT_COLLIDE;
|
||||
this->hitType = 1;
|
||||
this->field_0x3c = 0x47;
|
||||
this->hurtType = 0x44;
|
||||
this->flags2 = 0x80;
|
||||
this->spriteOrientation.flipY = 1;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->animationState = this->type;
|
||||
this->direction = this->type << 3;
|
||||
this->speed = 0x700;
|
||||
if (this->type2 == 1) {
|
||||
ChangeObjPalette(this, 0x161);
|
||||
InitializeAnimation(this, 1);
|
||||
} else {
|
||||
this->z.HALF.HI = 0xffe8;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
sub_0807DD64(this);
|
||||
ExecuteScriptForEntity(this, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void Whirlwind_Action1(Entity* this) {
|
||||
if ((this->flags & ENT_SCRIPTED) != 0) {
|
||||
ExecuteScriptForEntity(this, NULL);
|
||||
}
|
||||
if (this->spriteSettings.draw != 0) {
|
||||
GetNextFrame(this);
|
||||
if ((((((gPlayerState.flags & PL_MINISH) == 0)) && (gPlayerState.field_0x3c[0] == 0)) &&
|
||||
((gPlayerEntity.action == 4 || ((gPlayerEntity.flags & ENT_COLLIDE) != 0)))) &&
|
||||
((gPlayerEntity.action != 6 && (sub_0800419C(this, &gPlayerEntity, 0xc, 0xc) != 0)))) {
|
||||
if (((gPlayerState.flags & PL_PARACHUTE) == 0) && (gPlayerEntity.action != 4)) {
|
||||
if ((this->type2 != 1) && (-0x10 < gPlayerEntity.z.HALF.HI)) {
|
||||
return;
|
||||
}
|
||||
} else if (gPlayerEntity.z.HALF.HI == 0) {
|
||||
return;
|
||||
}
|
||||
CopyPosition(this, &gPlayerEntity);
|
||||
sub_08004542(this);
|
||||
sub_08004542(&gPlayerEntity);
|
||||
gPlayerEntity.collisionLayer = 1;
|
||||
gPlayerEntity.flags |= ENT_COLLIDE;
|
||||
gPlayerState.queued_action = 0x1f;
|
||||
gPlayerState.field_0x38 = this->type2;
|
||||
gPlayerState.field_0x39 = 0xff;
|
||||
this->spritePriority.b0 = gPlayerEntity.spritePriority.b0 - 1;
|
||||
this->action++;
|
||||
sub_08077B20();
|
||||
SoundReq(SFX_153);
|
||||
SoundReq(SFX_PLY_VO5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Whirlwind_Action2(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (sub_0800419C(this, &gPlayerEntity, 0xc, 0xc) == 0) {
|
||||
ResetCollisionLayer(this);
|
||||
this->spriteOrientation.flipY = 1;
|
||||
this->spriteRendering.b3 = 1;
|
||||
this->action--;
|
||||
}
|
||||
}
|
||||
@@ -107,17 +107,17 @@ void WindTribeTeleporter_Action2(WindTribeTeleporterEntity* this) {
|
||||
break;
|
||||
default:
|
||||
if (--super->actionDelay == 0) {
|
||||
#if defined(DEMO_JP) || defined(JP) || defined(EU)
|
||||
#ifdef DEMO_JP
|
||||
SetLocalFlag(0xfc);
|
||||
#endif
|
||||
DoExitTransition(&gUnk_0813ADEC[super->type2]);
|
||||
#else
|
||||
#if defined(DEMO_JP) || defined(JP) || defined(EU)
|
||||
#ifdef DEMO_JP
|
||||
SetLocalFlag(0xfc);
|
||||
#endif
|
||||
DoExitTransition(&gUnk_0813ADEC[super->type2]);
|
||||
#else
|
||||
if (gRoomControls.area == 3) {
|
||||
SetLocalFlag(0xf9);
|
||||
}
|
||||
DoExitTransition(&gUnk_0813ADEC[super->type2]);
|
||||
#endif
|
||||
#endif
|
||||
} else {
|
||||
if ((gRoomTransition.frameCount & 1) == 0) {
|
||||
gPlayerEntity.animationState = (gPlayerEntity.animationState + 2) & 6;
|
||||
|
||||
Reference in New Issue
Block a user