[cc0 oot] EnFish (#2792)

* [cc0 oot] EnFish

* bring changes to external files

* EnFish actionFunc typedef

* EnFish move variable assigns into decls

* format
This commit is contained in:
Dragorn421
2026-08-31 18:22:17 +02:00
committed by GitHub
parent 1e2bd9e46a
commit 7dbd31ab0b
4 changed files with 316 additions and 377 deletions
File diff suppressed because it is too large Load Diff
+19 -19
View File
@@ -4,29 +4,29 @@
#include "ultra64.h"
#include "actor.h"
typedef enum EnFishType {
EN_FISH_TYPE_NORMAL = -1, // Typically ObjMure-handled (also used in some Zora's fountain cutscene layers)
EN_FISH_TYPE_DROPPED, // Dropped by the player
EN_FISH_TYPE_TINY_POND // Used in grottos, the fish doesn't reappear
} EnFishType;
struct EnFish;
typedef void (*EnFishActionFunc)(struct EnFish*, struct PlayState*);
typedef struct EnFish {
/* 0x0000 */ Actor actor;
/* 0x014C */ ColliderJntSph collider;
/* 0x016C */ ColliderJntSphElement colliderElements[1];
/* 0x01AC */ SkelAnime skelAnime;
/* 0x01F0 */ Vec3s jointTable[7];
/* 0x021A */ Vec3s morphTable[7];
/* 0x0244 */ EnFishActionFunc actionFunc;
/* 0x0248 */ s16 timer;
/* 0x024A */ s16 respawnTimer;
/* 0x024C */ s16 slowPhase;
/* 0x024E */ s16 fastPhase;
/* 0x0250 */ s32 unk_250; // Set to 0 or 5, arg5 of Actor_UpdateBgCheckInfo
} EnFish; // size = 0x0254
typedef enum EnFishType {
/* -1 */ FISH_SWIMMING_RESPAWNING = -1, // Used in Zora's Domain; code only uses not 0 or 1, runs away from Player
/* 0 */ FISH_DROPPED,
/* 1 */ FISH_SWIMMING_UNIQUE // Used in grottos
} EnFishType;
/* 0x000 */ Actor actor;
/* 0x14C */ ColliderJntSph collider;
/* 0x16C */ ColliderJntSphElement colliderElements[1];
/* 0x1AC */ SkelAnime skelAnime;
/* 0x1F0 */ Vec3s jointTable[7];
/* 0x21A */ Vec3s morphTable[7];
/* 0x244 */ EnFishActionFunc actionFunc;
/* 0x248 */ s16 timer;
/* 0x24A */ s16 reappearTimer;
/* 0x24C */ s16 phase1;
/* 0x24E */ s16 phase2;
/* 0x250 */ s32 updBgCheckInfoFlags;
} EnFish; // size = 0x254
#endif
@@ -5,6 +5,7 @@
*/
#include "z_obj_mure.h"
#include "overlays/actors/ovl_En_Fish/z_en_fish.h"
#include "overlays/actors/ovl_En_Insect/z_en_insect.h"
#include "libc64/qrand.h"
@@ -57,7 +58,7 @@ static s32 sMaxChildSpawns[] = { 12, 9, 8, 0 };
static s16 sSpawnActorIds[] = { ACTOR_EN_KUSA, 0, ACTOR_EN_FISH, ACTOR_EN_INSECT, ACTOR_EN_BUTTE };
static s16 sSpawnParams[] = { 0, 2, -1, INSECT_TYPE_PERMANENT, -1 };
static s16 sSpawnParams[] = { 0, 2, EN_FISH_TYPE_NORMAL, INSECT_TYPE_PERMANENT, -1 };
static InitChainEntry sInitChain[] = {
ICHAIN_F32(cullingVolumeDistance, 1200, ICHAIN_CONTINUE),
@@ -14147,7 +14147,7 @@ void Player_Action_8084EED8(Player* this, PlayState* play) {
}
static BottleDropInfo D_80854A28[] = {
{ ACTOR_EN_FISH, FISH_DROPPED },
{ ACTOR_EN_FISH, EN_FISH_TYPE_DROPPED },
{ ACTOR_EN_ICE_HONO, 0 },
{ ACTOR_EN_INSECT, INSECT_TYPE_FIRST_DROPPED },
};