diff --git a/assets/xml/objects/object_dnt.xml b/assets/xml/objects/object_dnt.xml index 9f3fcf9963..6587202581 100644 --- a/assets/xml/objects/object_dnt.xml +++ b/assets/xml/objects/object_dnt.xml @@ -1,91 +1,106 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/functions.h b/include/functions.h index 9a4decc25d..66265e454c 100644 --- a/include/functions.h +++ b/include/functions.h @@ -499,9 +499,9 @@ void TitleCard_InitBossName(GameState* gameState, TitleCardContext* titleCtx, Te s32 Actor_SetPlayerImpact(PlayState* play, PlayerImpactType type, s32 timer, f32 dist, Vec3f* pos); f32 Actor_GetPlayerImpact(PlayState* play, f32 range, Vec3f* pos, PlayerImpactType* type); -void* func_800B6584(PlayState* play, s16 id, void* arg2, size_t size); -void* func_800B6608(PlayState* play, s16 id); -void* func_800B6680(PlayState* play, s16 id); +void* Actor_AddSharedMemoryEntry(PlayState* play, s16 id, void* ptr, size_t size); +void* Actor_FreeSharedMemoryEntry(PlayState* play, s16 id); +void* Actor_FindSharedMemoryEntry(PlayState* play, s16 id); void Actor_Kill(Actor* actor); void Actor_SetWorldToHome(Actor* actor); void Actor_SetFocus(Actor* actor, f32 height); diff --git a/include/z64actor.h b/include/z64actor.h index c25033e4a3..4dfc4ead09 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -348,11 +348,11 @@ typedef struct PlayerImpact { /* 0x08 */ Vec3f pos; } PlayerImpact; // size = 0x14 -typedef struct ActorContext_unk_20C { +typedef struct ActorSharedMemoryEntry { /* 0x0 */ s16 id; /* 0x2 */ s8 isDynamicallyInitialised; /* 0x4 */ void* ptr; -} ActorContext_unk_20C; // size = 0x8 +} ActorSharedMemoryEntry; // size = 0x8 typedef struct ActorContextSceneFlags { /* 0x00 */ u32 switches[4]; // First 0x40 are permanent, second 0x40 are temporary @@ -412,7 +412,7 @@ typedef struct ActorContext { /* 0x1E4 */ TitleCardContext titleCtxt; /* 0x1F4 */ PlayerImpact playerImpact; /* 0x208 */ UNK_TYPE1 unk_208[0x4]; - /* 0x20C */ ActorContext_unk_20C unk_20C[8]; + /* 0x20C */ ActorSharedMemoryEntry actorSharedMemory[8]; /* 0x24C */ UNK_TYPE1 unk_24C[0x4]; /* 0x250 */ void* absoluteSpace; // Space used to allocate actor overlays of alloc type ALLOCTYPE_ABSOLUTE /* 0x254 */ struct EnTorch2* elegyShells[5]; // PLAYER_FORM_MAX diff --git a/include/z64save.h b/include/z64save.h index ca0625ad27..fa44ebfe10 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -674,10 +674,10 @@ typedef enum { #define WEEKEVENTREG_14_02 PACK_WEEKEVENTREG_FLAG(14, 0x02) #define WEEKEVENTREG_14_04 PACK_WEEKEVENTREG_FLAG(14, 0x04) #define WEEKEVENTREG_DRANK_CHATEAU_ROMANI PACK_WEEKEVENTREG_FLAG(14, 0x08) -#define WEEKEVENTREG_14_10 PACK_WEEKEVENTREG_FLAG(14, 0x10) -#define WEEKEVENTREG_14_20 PACK_WEEKEVENTREG_FLAG(14, 0x20) -#define WEEKEVENTREG_14_40 PACK_WEEKEVENTREG_FLAG(14, 0x40) -#define WEEKEVENTREG_14_80 PACK_WEEKEVENTREG_FLAG(14, 0x80) +#define WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1 PACK_WEEKEVENTREG_FLAG(14, 0x10) +#define WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2 PACK_WEEKEVENTREG_FLAG(14, 0x20) +#define WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_3 PACK_WEEKEVENTREG_FLAG(14, 0x40) +#define WEEKEVENTREG_RECEIVED_DEKU_PLAYGROUND_HEART_PIECE PACK_WEEKEVENTREG_FLAG(14, 0x80) #define WEEKEVENTREG_15_01 PACK_WEEKEVENTREG_FLAG(15, 0x01) #define WEEKEVENTREG_15_02 PACK_WEEKEVENTREG_FLAG(15, 0x02) #define WEEKEVENTREG_15_04 PACK_WEEKEVENTREG_FLAG(15, 0x04) diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 843b0eafd9..0d72410ad1 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -956,33 +956,37 @@ f32 Actor_GetPlayerImpact(PlayState* play, f32 range, Vec3f* pos, PlayerImpactTy } /** - * Initializes an element of the `play->actorCtx.unk_20C` array to the `arg2` pointer, or allocates one using the - * `size` argument in case `arg2` is NULL. This element is associated to an `id` + * Initializes an element of the `play->actorCtx.actorSharedMemory` array to the `ptr` pointer, or allocates one using + * the `size` argument in case `ptr` is NULL. This element is associated to an `id`. * - * In success returns the allocated pointer if `arg2` was NULL or the `arg2` pointer otherwise - * In failure (There's no space left in `play->actorCtx.unk_20C` or an allocation error happened) returns NULL + * This allows allows different actors the ability to access the varible, and thus communicate with each other by + * reading/setting the value. + * + * In success: returns the allocated pointer if `ptr` was NULL or the `ptr` pointer otherwise. + * In failure (There's no space left in `play->actorCtx.actorSharedMemory` or an allocation error happened): returns + * NULL. * * Note there are no duplicated id checks. * * Used only by EnLiftNuts. */ -void* func_800B6584(PlayState* play, s16 id, void* arg2, size_t size) { - ActorContext_unk_20C* entry = play->actorCtx.unk_20C; +void* Actor_AddSharedMemoryEntry(PlayState* play, s16 id, void* ptr, size_t size) { + ActorSharedMemoryEntry* entry = play->actorCtx.actorSharedMemory; s32 i; - for (i = 0; i < ARRAY_COUNT(play->actorCtx.unk_20C); i++) { + for (i = 0; i < ARRAY_COUNT(play->actorCtx.actorSharedMemory); i++) { if (entry->id == 0) { - if (arg2 == NULL) { - arg2 = ZeldaArena_Malloc(size); - if (arg2 == NULL) { + if (ptr == NULL) { + ptr = ZeldaArena_Malloc(size); + if (ptr == NULL) { return NULL; } entry->isDynamicallyInitialised = true; } entry->id = id; - entry->ptr = arg2; - return arg2; + entry->ptr = ptr; + return ptr; } entry++; @@ -992,18 +996,18 @@ void* func_800B6584(PlayState* play, s16 id, void* arg2, size_t size) { } /** - * Frees the first element of `play->actorCtx.unk_20C` with id `id`. + * Frees the first element of `play->actorCtx.actorSharedMemory` with id `id`. * * If success, the free'd pointer is returned. * If failure, NULL is returned. * * Used only by EnLiftNuts. */ -void* func_800B6608(PlayState* play, s16 id) { - ActorContext_unk_20C* entry = play->actorCtx.unk_20C; +void* Actor_FreeSharedMemoryEntry(PlayState* play, s16 id) { + ActorSharedMemoryEntry* entry = play->actorCtx.actorSharedMemory; s32 i; - for (i = 0; i < ARRAY_COUNT(play->actorCtx.unk_20C); i++) { + for (i = 0; i < ARRAY_COUNT(play->actorCtx.actorSharedMemory); i++) { if (id == entry->id) { entry->id = 0; if (entry->isDynamicallyInitialised) { @@ -1020,16 +1024,16 @@ void* func_800B6608(PlayState* play, s16 id) { } /** - * Retrieves the first pointer stored with the id `id`. + * Retrieves the first pointer stored with the id `id` from `play->actorCtx.actorSharedMemory`. * If there's no pointer stored with that id, NULL is returned. * * Used only by EnGamelupy. */ -void* func_800B6680(PlayState* play, s16 id) { - ActorContext_unk_20C* entry = play->actorCtx.unk_20C; +void* Actor_FindSharedMemoryEntry(PlayState* play, s16 id) { + ActorSharedMemoryEntry* entry = play->actorCtx.actorSharedMemory; s32 i; - for (i = 0; i < ARRAY_COUNT(play->actorCtx.unk_20C); i++) { + for (i = 0; i < ARRAY_COUNT(play->actorCtx.actorSharedMemory); i++) { if (id == entry->id) { return entry->ptr; } diff --git a/src/code/z_sram_NES.c b/src/code/z_sram_NES.c index 7e0caa640c..41c9fa9daf 100644 --- a/src/code/z_sram_NES.c +++ b/src/code/z_sram_NES.c @@ -88,7 +88,7 @@ u16 sPersistentCycleWeekEventRegs[ARRAY_COUNT(gSaveContext.save.saveInfo.weekEve /* 11 */ 0, /* 12 */ PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_12_10), /* 13 */ PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_OCEANSIDE_WALLET_UPGRADE), - /* 14 */ PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_14_80), + /* 14 */ PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_DEKU_PLAYGROUND_HEART_PIECE), /* 15 */ PERSISTENT_WEEKEVENTREG(WEEKEVENTREG_15_20), /* 16 */ 0, /* 17 */ 0, diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c index a5900670d5..4b1114c59a 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -63,29 +63,29 @@ static ColliderCylinderInitType1 sCylinderInit = { }; static AnimationInfoS sAnimationInfo[] = { - { &object_dnt_Anim_005488, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_004AA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_004E38, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_005CA8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_0038CC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_003CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_0012F4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_004700, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_003438, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_001E2C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_000994, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_002268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_002F08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_00577C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnt_Anim_0029E8, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, - { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_0012F4, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_002670, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubStandingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubRiseUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubJumpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubExcitedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubExcitedLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubExcitedEndAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubTakeOffHatAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubShockedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubShockedShakeHeadAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubShockedPoundAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubShockedEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubThinkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubBobAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gBusinessScrubBurrowAnim, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubBurrowAnim, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, + { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubTakeOffHatAnim, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; static u16 D_80BF048C[] = { @@ -1598,7 +1598,7 @@ void EnAkindonuts_Init(Actor* thisx, PlayState* play) { EnAkindonuts* this = THIS; Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_InitFlex(play, &this->skelAnime, &object_dnt_Skel_00AC70, &object_dnt_Anim_005488, this->jointTable, + SkelAnime_InitFlex(play, &this->skelAnime, &gBusinessScrubSkel, &gBusinessScrubStandingAnim, this->jointTable, this->morphTable, 28); Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); @@ -1679,9 +1679,9 @@ s32 EnAkindonuts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V if (limbIndex == 26) { if ((this->unk_338 == 6) || (this->unk_338 == 5) || (this->unk_338 == 7)) { - *dList = object_dnt_DL_001350; + *dList = gBusinessScrubEyesWideDL; } else { - *dList = object_dnt_DL_008290; + *dList = gBusinessScrubEyesDL; } } return false; diff --git a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c index b9936c53c8..97567e5f4e 100644 --- a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c +++ b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c @@ -16,12 +16,12 @@ void EnGamelupy_Destroy(Actor* thisx, PlayState* play); void EnGamelupy_Update(Actor* thisx, PlayState* play); void EnGamelupy_Draw(Actor* thisx, PlayState* play); -void func_80AF6958(EnGamelupy* this, PlayState* play); -void func_80AF69A8(EnGamelupy* this, PlayState* play); -void func_80AF6A78(EnGamelupy* this, PlayState* play); -void func_80AF6944(EnGamelupy* this); -void func_80AF6994(EnGamelupy* this); -void func_80AF6A38(EnGamelupy* this); +void EnGamelupy_FindSharedMemory(EnGamelupy* this, PlayState* play); +void EnGamelupy_Idle(EnGamelupy* this, PlayState* play); +void EnGamelupy_Collected(EnGamelupy* this, PlayState* play); +void EnGamelupy_SetupFindSharedMemory(EnGamelupy* this); +void EnGamelupy_SetupIdle(EnGamelupy* this); +void EnGamelupy_SetupCollected(EnGamelupy* this); ActorInit En_Gamelupy_InitVars = { ACTOR_EN_GAMELUPY, @@ -74,15 +74,15 @@ void EnGamelupy_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actor.gravity = -0.5f; this->actor.shape.rot.y = Rand_Next(); - this->unk_19C = 0; - this->unk_19E = 0; - this->unk_1A0 = 0x7D0; - if (this->actor.params == 1) { - this->rupeeIndex = 1; + this->collectedTimer = 0; + this->sparklesAngle = 0; + this->sparklesAngleStep = 0x7D0; + if (EN_GAMELUPY_GET_TYPE(&this->actor) == ENGAMELUPY_TYPE_BLUE) { + this->type = ENGAMELUPY_TYPE_BLUE; } else { - this->rupeeIndex = 0; + this->type = ENGAMELUPY_TYPE_GREEN; } - func_80AF6944(this); + EnGamelupy_SetupFindSharedMemory(this); } void EnGamelupy_Destroy(Actor* thisx, PlayState* play) { @@ -91,77 +91,77 @@ void EnGamelupy_Destroy(Actor* thisx, PlayState* play) { Collider_DestroyCylinder(play, &this->collider); } -void func_80AF6854(EnGamelupy* this, PlayState* play) { - Vec3f sp4C; - Vec3f sp40; - Vec3f sp30; +void EnGamelupy_SpawnSparkles(EnGamelupy* this, PlayState* play) { + Vec3f pos; + Vec3f accel; + Vec3f velocity; - sp4C = this->actor.world.pos; - sp30.x = Math_SinS(this->unk_19E) * 3.0f; - sp30.y = 5.5f; - sp30.z = Math_CosS(this->unk_19E) * 3.0f; - sp40.x = -0.05f * sp30.x; - sp40.y = -0.4f; - sp40.z = -0.05f * sp30.z; - EffectSsKirakira_SpawnDispersed(play, &sp4C, &sp30, &sp40, &sPrimColor, &sEnvColor, 3000, 40); - this->unk_19E += this->unk_1A0; + pos = this->actor.world.pos; + velocity.x = Math_SinS(this->sparklesAngle) * 3.0f; + velocity.y = 5.5f; + velocity.z = Math_CosS(this->sparklesAngle) * 3.0f; + accel.x = -0.05f * velocity.x; + accel.y = -0.4f; + accel.z = -0.05f * velocity.z; + EffectSsKirakira_SpawnDispersed(play, &pos, &velocity, &accel, &sPrimColor, &sEnvColor, 3000, 40); + this->sparklesAngle += this->sparklesAngleStep; } -void func_80AF6944(EnGamelupy* this) { - this->actionFunc = func_80AF6958; +void EnGamelupy_SetupFindSharedMemory(EnGamelupy* this) { + this->actionFunc = EnGamelupy_FindSharedMemory; } -void func_80AF6958(EnGamelupy* this, PlayState* play) { - s16* unk_198 = func_800B6680(play, ACTOR_EN_GAMELUPY); +void EnGamelupy_FindSharedMemory(EnGamelupy* this, PlayState* play) { + s16* minigameScore = Actor_FindSharedMemoryEntry(play, ACTOR_EN_GAMELUPY); - if (unk_198 != NULL) { - this->unk_198 = unk_198; - func_80AF6994(this); + if (minigameScore != NULL) { + this->minigameScore = minigameScore; + EnGamelupy_SetupIdle(this); } } -void func_80AF6994(EnGamelupy* this) { - this->actionFunc = func_80AF69A8; +void EnGamelupy_SetupIdle(EnGamelupy* this) { + this->actionFunc = EnGamelupy_Idle; } -void func_80AF69A8(EnGamelupy* this, PlayState* play) { +void EnGamelupy_Idle(EnGamelupy* this, PlayState* play) { if (this->collider.base.ocFlags1 & OC1_HIT) { - *this->unk_198 += 50; - if (this->rupeeIndex == 1) { + *this->minigameScore += ENGAMELUPY_POINTS; + if (this->type == ENGAMELUPY_TYPE_BLUE) { Rupees_ChangeBy(5); } else { Rupees_ChangeBy(1); } - func_80AF6A38(this); + EnGamelupy_SetupCollected(this); } this->actor.shape.rot.y += 0x1F4; } -void func_80AF6A38(EnGamelupy* this) { - this->unk_19C = 0; +void EnGamelupy_SetupCollected(EnGamelupy* this) { + this->collectedTimer = 0; this->actor.gravity = 0.0f; Actor_PlaySfx(&this->actor, NA_SE_SY_GET_RUPY); - this->actionFunc = func_80AF6A78; + this->actionFunc = EnGamelupy_Collected; } -void func_80AF6A78(EnGamelupy* this, PlayState* play) { +void EnGamelupy_Collected(EnGamelupy* this, PlayState* play) { f32 scale; Player* player = GET_PLAYER(play); - if (this->unk_19C > 30) { + if (this->collectedTimer > 30) { Actor_Kill(&this->actor); } else { - this->unk_19C++; + this->collectedTimer++; this->actor.world.pos = player->actor.world.pos; this->actor.world.pos.y += 40.0f; - scale = (30.0f - this->unk_19C) * 0.001f; + scale = (30.0f - this->collectedTimer) * 0.001f; Actor_SetScale(&this->actor, scale); - func_80AF6854(this, play); + EnGamelupy_SpawnSparkles(this, play); } this->actor.shape.rot.y += 0x3E8; } -void func_80AF6B40(EnGamelupy* this, PlayState* play) { +void EnGamelupy_UpdateCollision(EnGamelupy* this, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } @@ -172,7 +172,7 @@ void EnGamelupy_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); Actor_MoveWithGravity(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 32.0f, 30.0f, 0.0f, UPDBGCHECKINFO_FLAG_4 | UPDBGCHECKINFO_FLAG_8); - func_80AF6B40(this, play); + EnGamelupy_UpdateCollision(this, play); } void EnGamelupy_Draw(Actor* thisx, PlayState* play) { @@ -184,7 +184,7 @@ void EnGamelupy_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Opa(play->state.gfxCtx); func_800B8050(&this->actor, play, 0); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sRupeeTextures[this->rupeeIndex])); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sRupeeTextures[this->type])); gSPDisplayList(POLY_OPA_DISP++, gRupeeDL); CLOSE_DISPS(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.h b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.h index 5d45f31681..d9e5d2b7d0 100644 --- a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.h +++ b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.h @@ -5,17 +5,27 @@ struct EnGamelupy; +#define ENGAMELUPY_POINTS 50 + typedef void (*EnGamelupyActionFunc)(struct EnGamelupy*, PlayState*); +#define EN_GAMELUPY_GET_TYPE(thisx) ((thisx)->params) + +typedef enum { + /* 0 */ ENGAMELUPY_TYPE_GREEN, + /* 1 */ ENGAMELUPY_TYPE_BLUE, + /* 2 */ ENGAMELUPY_TYPE_MAX +} EnGamelupyType; + typedef struct EnGamelupy { /* 0x000 */ Actor actor; /* 0x144 */ ColliderCylinder collider; /* 0x190 */ EnGamelupyActionFunc actionFunc; - /* 0x194 */ s32 rupeeIndex; - /* 0x198 */ s16* unk_198; - /* 0x19C */ s16 unk_19C; - /* 0x19E */ s16 unk_19E; - /* 0x1A0 */ s16 unk_1A0; + /* 0x194 */ s32 type; + /* 0x198 */ s16* minigameScore; // Pointer to shared memory location with actor EnLiftNuts + /* 0x19C */ s16 collectedTimer; + /* 0x19E */ s16 sparklesAngle; + /* 0x1A0 */ s16 sparklesAngleStep; } EnGamelupy; // size = 0x1A4 #endif // Z_EN_GAMELUPY_H diff --git a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c index cae3ae6e1d..5755d9f9b7 100644 --- a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c +++ b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c @@ -5,6 +5,7 @@ */ #include "z_en_lift_nuts.h" +#include "overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.h" #define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000) @@ -15,39 +16,38 @@ void EnLiftNuts_Destroy(Actor* thisx, PlayState* play); void EnLiftNuts_Update(Actor* thisx, PlayState* play); void EnLiftNuts_Draw(Actor* thisx, PlayState* play); -void func_80AEA910(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_HandleConversation5(EnLiftNuts* this, PlayState* play); -s32 func_80AE9B8C(void); -void func_80AE9F28(EnLiftNuts* this); -void func_80AE9F70(EnLiftNuts* this, PlayState* play); -void func_80AEA044(EnLiftNuts* this, PlayState* play); -void func_80AEA0B4(EnLiftNuts* this); -void func_80AEA128(EnLiftNuts* this, PlayState* play); -void func_80AEA1A0(EnLiftNuts* this, PlayState* play); -void func_80AEABF0(EnLiftNuts* this); -void func_80AEAC64(EnLiftNuts* this, PlayState* play); -void func_80AEACF8(EnLiftNuts* this, PlayState* play); -void func_80AEAEAC(EnLiftNuts* this); -void func_80AEAF14(EnLiftNuts* this, PlayState* play); -void func_80AEAF8C(EnLiftNuts* this); -void func_80AEAFA0(EnLiftNuts* this, PlayState* play); -void func_80AEB114(EnLiftNuts* this); -void func_80AEB148(EnLiftNuts* this, PlayState* play); -void func_80AEB1C8(EnLiftNuts* this); -void func_80AEB230(EnLiftNuts* this, PlayState* play); -void func_80AEB280(EnLiftNuts* this); -void func_80AEB294(EnLiftNuts* this, PlayState* play); -void func_80AEB3E0(EnLiftNuts* this, PlayState* play); -void func_80AEB428(EnLiftNuts* this, PlayState* play); -void func_80AEB584(EnLiftNuts* this); -void func_80AEB598(EnLiftNuts* this, PlayState* play); -void func_80AEB684(EnLiftNuts* this); -void func_80AEB698(EnLiftNuts* this, PlayState* play); -void func_80AEB828(EnLiftNuts* this); -void func_80AEB8A4(EnLiftNuts* this, PlayState* play); -void func_80AEB934(EnLiftNuts* this, PlayState* play); -void func_80AEB974(EnLiftNuts* this); -void func_80AEB9E0(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupIdleHidden(EnLiftNuts* this); +void EnLiftNuts_IdleHidden(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_Burrow(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupIdle(EnLiftNuts* this); +void EnLiftNuts_RiseUp(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_Idle(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupStartConversation(EnLiftNuts* this); +void EnLiftNuts_StartConversation(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_HandleConversation(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupMove(EnLiftNuts* this); +void EnLiftNuts_Move(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupMovePlayer(EnLiftNuts* this); +void EnLiftNuts_MovePlayer(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupStartGame(EnLiftNuts* this); +void EnLiftNuts_StartGame(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupStartGameImmediately(EnLiftNuts* this); +void EnLiftNuts_StartGameImmediately(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupRunGame(EnLiftNuts* this); +void EnLiftNuts_RunGame(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupEndGame(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_EndGame(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupGiveReward(EnLiftNuts* this); +void EnLiftNuts_GiveReward(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupResumeConversation(EnLiftNuts* this); +void EnLiftNuts_ResumeConversation(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_SetupStartHiding(EnLiftNuts* this); +void EnLiftNuts_StartHiding(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_Hide(EnLiftNuts* this, PlayState* play); +void EnLiftNuts_UpdateEyes(EnLiftNuts* this); +void EnLiftNuts_SpawnDust(EnLiftNuts* this, PlayState* play); ActorInit En_Lift_Nuts_InitVars = { ACTOR_EN_LIFT_NUTS, @@ -61,34 +61,54 @@ ActorInit En_Lift_Nuts_InitVars = { (ActorFunc)EnLiftNuts_Draw, }; -static AnimationInfo sAnimations[] = { - { &object_dnt_Anim_005488, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_dnt_Anim_00B0B4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_dnt_Anim_004AA0, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, - { &object_dnt_Anim_0029E8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, - { &object_dnt_Anim_005CA8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, - { &object_dnt_Anim_0038CC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_dnt_Anim_003CC0, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, - { &object_dnt_Anim_0012F4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, - { &object_dnt_Anim_004700, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, - { &object_dnt_Anim_001BC8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_dnt_Anim_003438, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -2.0f }, - { &object_dnt_Anim_001E2C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_dnt_Anim_000994, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, - { &object_dnt_Anim_002268, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, - { &object_dnt_Anim_002F08, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_dnt_Anim_00577C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, - { &object_dnt_Anim_004E38, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, - { &object_dnt_Anim_0029E8, 1.0f, 4.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, - { &object_dnt_Anim_0029E8, 1.0f, 8.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, +typedef enum { + /* 0 */ ENLIFTNUTS_ANIM_STANDING, + /* 1 */ ENLIFTNUTS_ANIM_WALK, + /* 2 */ ENLIFTNUTS_ANIM_RISE_UP, + /* 3 */ ENLIFTNUTS_ANIM_BURROW_LONG, + /* 4 */ ENLIFTNUTS_ANIM_EXCITED_START, + /* 5 */ ENLIFTNUTS_ANIM_EXCITED_LOOP, + /* 6 */ ENLIFTNUTS_ANIM_EXCITED_END, + /* 7 */ ENLIFTNUTS_ANIM_TAKE_OFF_HAT, + /* 8 */ ENLIFTNUTS_ANIM_FLY_START, + /* 9 */ ENLIFTNUTS_ANIM_FLY_LOOP, + /* 10 */ ENLIFTNUTS_ANIM_SHOCKED_START, + /* 11 */ ENLIFTNUTS_ANIM_SHOCKED_SHAKE_HEAD, + /* 12 */ ENLIFTNUTS_ANIM_SHOCKED_POUND, + /* 13 */ ENLIFTNUTS_ANIM_SHOCKED_END, + /* 14 */ ENLIFTNUTS_ANIM_THINK, + /* 15 */ ENLIFTNUTS_ANIM_BOB, + /* 16 */ ENLIFTNUTS_ANIM_JUMP, + /* 17 */ ENLIFTNUTS_ANIM_BURROW_HALF, + /* 18 */ ENLIFTNUTS_ANIM_BURROW_SHORT, + /* 19 */ ENLIFTNUTS_ANIM_MAX +} EnLiftNutsAnimation; + +static AnimationInfo sAnimations[ENLIFTNUTS_ANIM_MAX] = { + { &gBusinessScrubStandingAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gBusinessScrubWalkAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gBusinessScrubRiseUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &gBusinessScrubBurrowAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &gBusinessScrubExcitedStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, + { &gBusinessScrubExcitedLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gBusinessScrubExcitedEndAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, + { &gBusinessScrubTakeOffHatAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &gBusinessScrubFlyStartAnim, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &gBusinessScrubFlyLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gBusinessScrubShockedStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -2.0f }, + { &gBusinessScrubShockedShakeHeadAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gBusinessScrubShockedPoundAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &gBusinessScrubShockedEndAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f }, + { &gBusinessScrubThinkAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gBusinessScrubBobAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, + { &gBusinessScrubJumpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &gBusinessScrubBurrowAnim, 1.0f, 4.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, + { &gBusinessScrubBurrowAnim, 1.0f, 8.0f, 0.0f, ANIMMODE_ONCE, 0.0f }, }; -Gfx* D_80AEBF18[] = { - object_dnt_DL_008290, - object_dnt_DL_001350, - object_dnt_DL_001420, - NULL, -}; +Gfx* sEyeTextures[] = { gBusinessScrubEyesDL, gBusinessScrubEyesWideDL, gBusinessScrubEyesSquintDL }; + +static s32 sPad = 0; static ColliderCylinderInit sCylinderInit = { { @@ -112,48 +132,54 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -void func_80AE9A20(EnLiftNuts* this, PlayState* play) { - static s16 D_80AEBF60 = 0; - static s32 D_80AEBF64 = false; +void EnLiftNuts_AddSharedMemoryEntry(EnLiftNuts* this, PlayState* play) { + static s16 sMinigameScore = 0; + static s32 sAddedSharedMemory = false; - if (!D_80AEBF64) { - func_800B6584(play, ACTOR_EN_GAMELUPY, &D_80AEBF60, sizeof(s16)); - D_80AEBF64 = true; + if (!sAddedSharedMemory) { + Actor_AddSharedMemoryEntry(play, ACTOR_EN_GAMELUPY, &sMinigameScore, sizeof(s16)); + sAddedSharedMemory = true; } - this->ptr_1EC = &D_80AEBF60; + this->minigameScore = &sMinigameScore; } -void func_80AE9A80(EnLiftNuts* this, PlayState* play) { - static s16 D_80AEBF68 = false; +void EnLiftNuts_FreeSharedMemoryEntry(EnLiftNuts* this, PlayState* play) { + static s16 sFreedSharedMemory = false; - if (!D_80AEBF68) { - func_800B6608(play, ACTOR_EN_GAMELUPY); - D_80AEBF68 = true; + if (!sFreedSharedMemory) { + Actor_FreeSharedMemoryEntry(play, ACTOR_EN_GAMELUPY); + sFreedSharedMemory = true; } } -s32 func_80AE9AC4(EnLiftNuts* this, s32 arg1) { - static s32 D_80AEBF6C = 0; +typedef enum { + /* 0 */ ENLIFTNUTS_AUTOTALK_MODE_CHECK_OFF, + /* 1 */ ENLIFTNUTS_AUTOTALK_MODE_SET_ON, + /* 2 */ ENLIFTNUTS_AUTOTALK_MODE_SET_OFF +} EnLiftNutsAutotalkMode; - switch (arg1) { - case 0: - if (D_80AEBF6C == 0) { +s32 EnLiftNuts_Autotalk(EnLiftNuts* this, EnLiftNutsAutotalkMode mode) { + static s32 sIsAutotalkOn = false; + + switch (mode) { + case ENLIFTNUTS_AUTOTALK_MODE_CHECK_OFF: + if (!sIsAutotalkOn) { return true; } break; - case 1: - if (D_80AEBF6C == 0) { - this->unk_34E = 1; - D_80AEBF6C = 1; + case ENLIFTNUTS_AUTOTALK_MODE_SET_ON: + if (!sIsAutotalkOn) { + this->autotalk = true; + sIsAutotalkOn = true; return true; } break; - case 2: - if (D_80AEBF6C == 1) { - this->unk_34E = 0; - D_80AEBF6C = 0; + case ENLIFTNUTS_AUTOTALK_MODE_SET_OFF: + if (sIsAutotalkOn == true) { + this->autotalk = false; + sIsAutotalkOn = false; return true; } break; @@ -161,60 +187,93 @@ s32 func_80AE9AC4(EnLiftNuts* this, s32 arg1) { default: break; } + return false; } -s32 func_80AE9B4C(s32 arg0, s32 arg1) { - static s32 D_80AEBF70 = 0; +typedef enum { + /* 0 */ ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, + /* 1 */ ENLIFTNUTS_MINIGAME_STATE_MODE_SET +} EnLiftNutsMiniGameStateMode; - if (arg0 == 0) { - if (D_80AEBF70 == arg1) { +typedef enum { + /* 0 */ ENLIFTNUTS_MINIGAME_STATE_NONE, + /* 1 */ ENLIFTNUTS_MINIGAME_STATE_STARTING, + /* 2 */ ENLIFTNUTS_MINIGAME_STATE_RUNNING, + /* 3 */ ENLIFTNUTS_MINIGAME_STATE_AFTER, + /* 4 */ ENLIFTNUTS_MINIGAME_STATE_HIDING +} EnLiftNutsMiniGameState; + +/** + * Will either check or set the current minigame state based on the given mode + * + * @return boolean, based on the mode + * ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK: true if the current minigame state equals the provided state, false otherwise + * ENLIFTNUTS_MINIGAME_STATE_MODE_SET: true if the minigame state was set succesfully to the provided state, false + * otherwise + */ +s32 EnLiftNuts_MinigameState(EnLiftNutsMiniGameStateMode mode, EnLiftNutsMiniGameState state) { + static EnLiftNutsMiniGameState sMinigameState = ENLIFTNUTS_MINIGAME_STATE_NONE; + + if (mode == ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK) { + if (sMinigameState == state) { return true; } - } else if (arg0 == 1) { - D_80AEBF70 = arg1; + } else if (mode == ENLIFTNUTS_MINIGAME_STATE_MODE_SET) { + sMinigameState = state; return true; } return false; } -s32 func_80AE9B8C() { - s32 ret = 0; +s32 EnLiftNuts_GetNumDaysWon(void) { + s32 numDays = 0; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_10)) { - ret = 1; + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1)) { + numDays++; } - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_20)) { - ret++; + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2)) { + numDays++; } - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_40)) { - ret++; + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_3)) { + numDays++; } - return ret; + return numDays; } -void func_80AE9BCC(EnLiftNuts* this, PlayState* play) { - if ((this->actionFunc != func_80AEB934) && (this->actionFunc != func_80AEB8A4) && - (this->actionFunc != func_80AEACF8) && (this->actionFunc != func_80AEAC64) && - (this->actionFunc != func_80AEA044) && (this->actionFunc != func_80AEB598) && - (this->actionFunc != func_80AEB698) && !func_80AE9B4C(0, 3) && (func_80AE9B8C() == 3) && - (GET_PLAYER_FORM == PLAYER_FORM_DEKU) && (this->actor.xzDistToPlayer < 150.0f)) { - func_80AEB828(this); +/** + * Will check if the actor should hide, and if so starts hiding. + */ +void EnLiftNuts_TryHide(EnLiftNuts* this, PlayState* play) { + if (((this->actionFunc == EnLiftNuts_Hide) || (this->actionFunc == EnLiftNuts_StartHiding) || + (this->actionFunc == EnLiftNuts_HandleConversation) || (this->actionFunc == EnLiftNuts_StartConversation) || + (this->actionFunc == EnLiftNuts_Burrow) || (this->actionFunc == EnLiftNuts_GiveReward) || + (this->actionFunc == EnLiftNuts_ResumeConversation))) { + return; + } + + if (EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, ENLIFTNUTS_MINIGAME_STATE_AFTER)) { + return; + } + + if ((EnLiftNuts_GetNumDaysWon() == 3) && (GET_PLAYER_FORM == PLAYER_FORM_DEKU) && + (this->actor.xzDistToPlayer < 150.0f)) { + EnLiftNuts_SetupStartHiding(this); } } void EnLiftNuts_Init(Actor* thisx, PlayState* play) { + s32 pad; EnLiftNuts* this = THIS; Path* path; - Vec3s* pathPos; - s32 pad; + Vec3s* points; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_dnt_Skel_00AC70, &object_dnt_Anim_0029E8, this->jointTable, - this->morphTable, OBJECT_DNT_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gBusinessScrubSkel, &gBusinessScrubBurrowAnim, this->jointTable, + this->morphTable, BUSINESS_SCRUB_LIMB_MAX); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit); @@ -228,31 +287,31 @@ void EnLiftNuts_Init(Actor* thisx, PlayState* play) { } } this->actor.targetMode = 0; - this->unk_354 = 0; - this->unk_34E = 0; - this->unk_356 = 0; - this->unk_1E4 = 0; - this->unk_1E8 = 0; + this->timer = 0; + this->autotalk = false; + this->isFirstTimeHiding = false; + this->eyeTexIndex = 0; + this->unk1E8 = 0; this->actor.gravity = -2.0f; - path = &play->setupPathList[ENLIFTNUTS_GET_FF00(&this->actor)]; - pathPos = Lib_SegmentedToVirtual(path->points); - this->vec_1D8.x = pathPos->x; - this->vec_1D8.y = pathPos->y; - this->vec_1D8.z = pathPos->z; - func_80AE9A20(this, play); + path = &play->setupPathList[ENLIFTNUTS_GET_PATH_INDEX(&this->actor)]; + points = Lib_SegmentedToVirtual(path->points); + this->waypointPos.x = points[0].x; + this->waypointPos.y = points[0].y; + this->waypointPos.z = points[0].z; + EnLiftNuts_AddSharedMemoryEntry(this, play); if (!Flags_GetSwitch(play, 0x41)) { - func_80AE9B4C(1, 0); - func_80AE9F28(this); - } else if (func_80AE9AC4(this, 0)) { + EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_SET, ENLIFTNUTS_MINIGAME_STATE_NONE); + EnLiftNuts_SetupIdleHidden(this); + } else if (EnLiftNuts_Autotalk(this, ENLIFTNUTS_AUTOTALK_MODE_CHECK_OFF)) { Player* player = GET_PLAYER(play); player->stateFlags1 |= PLAYER_STATE1_20; - func_80AE9AC4(this, 1); - func_80AE9B4C(1, 3); - func_80AEA0B4(this); + EnLiftNuts_Autotalk(this, ENLIFTNUTS_AUTOTALK_MODE_SET_ON); + EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_SET, ENLIFTNUTS_MINIGAME_STATE_AFTER); + EnLiftNuts_SetupIdle(this); } else { - func_80AE9F28(this); + EnLiftNuts_SetupIdleHidden(this); } } @@ -260,77 +319,79 @@ void EnLiftNuts_Destroy(Actor* thisx, PlayState* play) { EnLiftNuts* this = THIS; Collider_DestroyCylinder(play, &this->collider); - func_80AE9A80(this, play); + EnLiftNuts_FreeSharedMemoryEntry(this, play); } -void func_80AE9F28(EnLiftNuts* this) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 18); - this->actionFunc = func_80AE9F70; - this->unk_354 = 0; +void EnLiftNuts_SetupIdleHidden(EnLiftNuts* this) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_BURROW_SHORT); + this->actionFunc = EnLiftNuts_IdleHidden; + this->timer = 0; } -void func_80AE9F70(EnLiftNuts* this, PlayState* play) { - if (this->unk_354 < 40) { - this->unk_354++; +void EnLiftNuts_IdleHidden(EnLiftNuts* this, PlayState* play) { + if (this->timer < 40) { + this->timer++; } else if (this->actor.xzDistToPlayer < 100.0f) { - func_80AEA0B4(this); + EnLiftNuts_SetupIdle(this); } } -void func_80AE9FC8(EnLiftNuts* this) { - if (this->actionFunc == func_80AEA1A0) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 17); +void EnLiftNuts_SetupBurrow(EnLiftNuts* this) { + if (this->actionFunc == EnLiftNuts_Idle) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_BURROW_HALF); } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_BURROW_LONG); } Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); - this->actionFunc = func_80AEA044; + this->actionFunc = EnLiftNuts_Burrow; } -void func_80AEA044(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_Burrow(EnLiftNuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - func_80AE9F28(this); + EnLiftNuts_SetupIdleHidden(this); } else if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - func_80AEB9E0(this, play); + EnLiftNuts_SpawnDust(this, play); } } -void func_80AEA0B4(EnLiftNuts* this) { - if (func_80AE9B4C(0, 1)) { - this->actionFunc = func_80AEA1A0; +void EnLiftNuts_SetupIdle(EnLiftNuts* this) { + if (EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, ENLIFTNUTS_MINIGAME_STATE_STARTING)) { + this->actionFunc = EnLiftNuts_Idle; } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_RISE_UP); Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); - this->actionFunc = func_80AEA128; + this->actionFunc = EnLiftNuts_RiseUp; } } -void func_80AEA128(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_RiseUp(EnLiftNuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 15); - this->actionFunc = func_80AEA1A0; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_BOB); + this->actionFunc = EnLiftNuts_Idle; } else if (Animation_OnFrame(&this->skelAnime, 8.0f)) { - func_80AEB9E0(this, play); + EnLiftNuts_SpawnDust(this, play); } } -void func_80AEA1A0(EnLiftNuts* this, PlayState* play) { - if ((func_80AE9B4C(0, 3) || func_80AE9B4C(0, 1)) && (this->unk_34E == 1)) { +void EnLiftNuts_Idle(EnLiftNuts* this, PlayState* play) { + if ((EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, ENLIFTNUTS_MINIGAME_STATE_AFTER) || + EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, ENLIFTNUTS_MINIGAME_STATE_STARTING)) && + (this->autotalk == true)) { this->actor.flags |= ACTOR_FLAG_10000; } else if (this->actor.xzDistToPlayer > 120.0f) { - func_80AE9FC8(this); + EnLiftNuts_SetupBurrow(this); } if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { if (GET_PLAYER_FORM == PLAYER_FORM_DEKU) { - if (func_80AE9B4C(0, 0)) { + if (EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, ENLIFTNUTS_MINIGAME_STATE_NONE)) { switch (CURRENT_DAY) { case 1: if ((gSaveContext.save.time > CLOCK_TIME(23, 30)) || (gSaveContext.save.time <= CLOCK_TIME(6, 0))) { Message_StartTextbox(play, 0x27F7, &this->actor); this->textId = 0x27F7; - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_10)) { + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1)) { Message_StartTextbox(play, 0x27D9, &this->actor); this->textId = 0x27D9; } else { @@ -345,13 +406,13 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) { Message_StartTextbox(play, 0x27F7, &this->actor); this->textId = 0x27F7; } else { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_20)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2)) { Message_StartTextbox(play, 0x27DB, &this->actor); this->textId = 0x27DB; break; } - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_10)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1)) { Message_StartTextbox(play, 0x27DC, &this->actor); this->textId = 0x27DC; } else { @@ -366,13 +427,13 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) { (gSaveContext.save.time <= CLOCK_TIME(6, 0))) { Message_StartTextbox(play, 0x27F7, &this->actor); this->textId = 0x27F7; - } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_40)) { + } else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_3)) { Message_StartTextbox(play, 0x27DE, &this->actor); this->textId = 0x27DE; - } else if (func_80AE9B8C() == 2) { + } else if (EnLiftNuts_GetNumDaysWon() == 2) { Message_StartTextbox(play, 0x27DF, &this->actor); this->textId = 0x27DF; - } else if (func_80AE9B8C() == 1) { + } else if (EnLiftNuts_GetNumDaysWon() == 1) { Message_StartTextbox(play, 0x27E0, &this->actor); this->textId = 0x27E0; } else { @@ -381,13 +442,14 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) { } break; } - } else if (func_80AE9B4C(0, 3)) { + } else if (EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, + ENLIFTNUTS_MINIGAME_STATE_AFTER)) { if (Flags_GetSwitch(play, 0x40)) { Flags_UnsetSwitch(play, 0x40); Inventory_SaveDekuPlaygroundHighScore(4); - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_10) && CHECK_WEEKEVENTREG(WEEKEVENTREG_14_20) && - (CURRENT_DAY == 3)) { - this->unk_354 = 0; + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1) && + CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2) && (CURRENT_DAY == 3)) { + this->timer = 0; Message_StartTextbox(play, 0x27F4, &this->actor); this->textId = 0x27F4; } else { @@ -411,7 +473,7 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) { } Flags_UnsetSwitch(play, 0x41); this->actor.flags &= ~ACTOR_FLAG_10000; - } else if (!Flags_GetSwitch(play, 0x42)) { + } else if (!Flags_GetSwitch(play, 0x42)) { // Explain Rules Flags_SetSwitch(play, 0x42); Message_StartTextbox(play, 0x27E6, &this->actor); this->textId = 0x27E6; @@ -440,9 +502,9 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) { Message_StartTextbox(play, 0x27D8, &this->actor); this->textId = 0x27D8; } - func_80AEABF0(this); - } else if (func_80AE9AC4(this, 0) || (this->unk_34E == 1)) { - if (this->unk_34E == 1) { + EnLiftNuts_SetupStartConversation(this); + } else if (EnLiftNuts_Autotalk(this, ENLIFTNUTS_AUTOTALK_MODE_CHECK_OFF) || (this->autotalk == true)) { + if (this->autotalk == true) { func_800B8614(&this->actor, play, 200.0f); } else if (this->actor.playerHeightRel >= -13.0f) { func_800B8614(&this->actor, play, 100.0f); @@ -451,7 +513,7 @@ void func_80AEA1A0(EnLiftNuts* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x1000, 0x500); } -void func_80AEA7A4(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_HandleConversationChoice(EnLiftNuts* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Message_ShouldAdvance(play)) { @@ -465,13 +527,13 @@ void func_80AEA7A4(EnLiftNuts* this, PlayState* play) { Rupees_ChangeBy(-10); } else { Audio_PlaySfx(NA_SE_SY_ERROR); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_WALK); Message_StartTextbox(play, 0x27E4, &this->actor); this->textId = 0x27E4; } } else { Audio_PlaySfx_MessageCancel(); - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_WALK); Message_StartTextbox(play, 0x27E3, &this->actor); this->textId = 0x27E3; } @@ -480,20 +542,21 @@ void func_80AEA7A4(EnLiftNuts* this, PlayState* play) { case 0x238D: if (play->msgCtx.choiceIndex == 0) { // Yes player->stateFlags1 |= PLAYER_STATE1_20; - func_80AEB1C8(this); + EnLiftNuts_SetupStartGameImmediately(this); } else { - func_80AE9FC8(this); + EnLiftNuts_SetupBurrow(this); } break; default: - func_80AE9FC8(this); + EnLiftNuts_SetupBurrow(this); break; } } } -void func_80AEA910(EnLiftNuts* this, PlayState* play) { +// TODO: name based on TEXT_STATE_5 +void EnLiftNuts_HandleConversation5(EnLiftNuts* this, PlayState* play) { Player* player = GET_PLAYER(play); if (Message_ShouldAdvance(play)) { @@ -513,17 +576,17 @@ void func_80AEA910(EnLiftNuts* this, PlayState* play) { case 0x27E3: case 0x27E4: - func_80AE9FC8(this); + EnLiftNuts_SetupBurrow(this); break; case 0x27E5: Message_CloseTextbox(play); player->stateFlags1 |= PLAYER_STATE1_20; - func_80AEAEAC(this); + EnLiftNuts_SetupMove(this); break; case 0x27E6: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_WALK); switch (CURRENT_DAY) { case 1: Message_StartTextbox(play, 0x27E7, &this->actor); @@ -555,19 +618,19 @@ void func_80AEA910(EnLiftNuts* this, PlayState* play) { case 0x27FA: Message_CloseTextbox(play); player->stateFlags1 &= ~PLAYER_STATE1_20; - func_80AEB114(this); + EnLiftNuts_SetupStartGame(this); break; case 0x27EE: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0x10); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_JUMP); Message_StartTextbox(play, 0x27EF, &this->actor); this->textId = 0x27EF; break; case 0x27EF: Message_CloseTextbox(play); - func_80AEB584(this); - func_80AEB598(this, play); + EnLiftNuts_SetupGiveReward(this); + EnLiftNuts_GiveReward(this, play); break; case 0x27F1: @@ -576,22 +639,22 @@ void func_80AEA910(EnLiftNuts* this, PlayState* play) { break; case 0x27F2: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_WALK); Message_StartTextbox(play, 0x27F3, &this->actor); this->textId = 0x27F3; break; case 0x27F4: Message_CloseTextbox(play); - func_80AEB584(this); - func_80AEB598(this, play); + EnLiftNuts_SetupGiveReward(this); + EnLiftNuts_GiveReward(this, play); break; case 0x27F5: Message_CloseTextbox(play); - func_80AE9B4C(1, 0); + EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_SET, ENLIFTNUTS_MINIGAME_STATE_NONE); player->stateFlags1 &= ~PLAYER_STATE1_20; - func_80AE9FC8(this); + EnLiftNuts_SetupBurrow(this); break; case 0x27F9: @@ -605,54 +668,54 @@ void func_80AEA910(EnLiftNuts* this, PlayState* play) { } } -void func_80AEABF0(EnLiftNuts* this) { - this->unk_354 = 0; +void EnLiftNuts_SetupStartConversation(EnLiftNuts* this) { + this->timer = 0; - if (this->actionFunc != func_80AEB698) { - if (func_80AE9B4C(0, 0)) { + if (this->actionFunc != EnLiftNuts_ResumeConversation) { + if (EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, ENLIFTNUTS_MINIGAME_STATE_NONE)) { Actor_PlaySfx(&this->actor, NA_SE_EN_AKINDONUTS_HIDE); } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 16); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_JUMP); } - this->actionFunc = func_80AEAC64; + this->actionFunc = EnLiftNuts_StartConversation; } -void func_80AEAC64(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_StartConversation(EnLiftNuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { if ((this->textId == 0x27EE) || (this->textId == 0x27F4) || (this->textId == 0x27F5)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_SHOCKED_START); } else { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_STANDING); } - this->actionFunc = func_80AEACF8; + this->actionFunc = EnLiftNuts_HandleConversation; } } -void func_80AEACF8(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_HandleConversation(EnLiftNuts* this, PlayState* play) { Player* player = GET_PLAYER(play); switch (Message_GetState(&play->msgCtx)) { - case 0: - case 1: - case 2: - case 3: + case TEXT_STATE_NONE: + case TEXT_STATE_1: + case TEXT_STATE_CLOSING: + case TEXT_STATE_3: break; - case 4: - func_80AEA7A4(this, play); + case TEXT_STATE_CHOICE: + EnLiftNuts_HandleConversationChoice(this, play); break; - case 5: - func_80AEA910(this, play); + case TEXT_STATE_5: + EnLiftNuts_HandleConversation5(this, play); break; - case 6: + case TEXT_STATE_DONE: if (Message_ShouldAdvance(play)) { player->stateFlags1 &= ~PLAYER_STATE1_20; - func_80AE9FC8(this); - func_80AE9AC4(this, 2); - if (func_80AE9B4C(0, 3)) { - func_80AE9B4C(1, 0); + EnLiftNuts_SetupBurrow(this); + EnLiftNuts_Autotalk(this, ENLIFTNUTS_AUTOTALK_MODE_SET_OFF); + if (EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, ENLIFTNUTS_MINIGAME_STATE_AFTER)) { + EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_SET, ENLIFTNUTS_MINIGAME_STATE_NONE); } } break; @@ -665,22 +728,22 @@ void func_80AEACF8(EnLiftNuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { switch (this->textId) { case 0x27EE: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_SHOCKED_SHAKE_HEAD); break; case 0x27EF: - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_WALK); break; case 0x27F4: - if (this->unk_354 == 0) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11); - this->unk_354++; - } else if (this->unk_354 == 4) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12); - this->unk_354 = 0; + if (this->timer == 0) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_SHOCKED_SHAKE_HEAD); + this->timer++; + } else if (this->timer == 4) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_SHOCKED_POUND); + this->timer = 0; } else { - this->unk_354++; + this->timer++; } break; @@ -688,106 +751,111 @@ void func_80AEACF8(EnLiftNuts* this, PlayState* play) { break; } } - func_80AEB974(this); + EnLiftNuts_UpdateEyes(this); } -void func_80AEAEAC(EnLiftNuts* this) { +void EnLiftNuts_SetupMove(EnLiftNuts* this) { this->actor.speed = 2.0f; - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); - func_80AE9AC4(this, 1); - func_80AE9B4C(1, 1); - this->actionFunc = func_80AEAF14; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_WALK); + EnLiftNuts_Autotalk(this, ENLIFTNUTS_AUTOTALK_MODE_SET_ON); + EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_SET, ENLIFTNUTS_MINIGAME_STATE_STARTING); + this->actionFunc = EnLiftNuts_Move; } -void func_80AEAF14(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_Move(EnLiftNuts* this, PlayState* play) { f32 dist; Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 10, 0x1000, 0x500); - dist = Math_Vec3f_StepTo(&this->actor.world.pos, &this->vec_1D8, this->actor.speed); + dist = Math_Vec3f_StepTo(&this->actor.world.pos, &this->waypointPos, this->actor.speed); this->actor.world.pos.y += this->actor.gravity; if (dist == 0.0f) { - func_80AEAF8C(this); + EnLiftNuts_SetupMovePlayer(this); } } -void func_80AEAF8C(EnLiftNuts* this) { - this->actionFunc = func_80AEAFA0; +void EnLiftNuts_SetupMovePlayer(EnLiftNuts* this) { + this->actionFunc = EnLiftNuts_MovePlayer; } -void func_80AEAFA0(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_MovePlayer(EnLiftNuts* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 dist; - f32 temp_fv0; + f32 magnitude; + s16 playerYaw; s16 yaw; - s16 sp28; s16 yawDiff; - sp28 = this->actor.yawTowardsPlayer - 0x8000; - yaw = Math_Vec3f_Yaw(&player->actor.world.pos, &this->actor.home.pos); - yawDiff = yaw - sp28; + yaw = this->actor.yawTowardsPlayer - 0x8000; + playerYaw = Math_Vec3f_Yaw(&player->actor.world.pos, &this->actor.home.pos); + yawDiff = playerYaw - yaw; dist = Math_Vec3f_DistXZ(&player->actor.world.pos, &this->actor.home.pos); if (this->actor.xzDistToPlayer < dist) { if (ABS_ALT(yawDiff) < 0x2000) { - yaw = (yawDiff > 0) ? (yaw + 0x2000) : (yaw - 0x2000); + playerYaw = (yawDiff > 0) ? (playerYaw + 0x2000) : (playerYaw - 0x2000); } } + if (dist < 5.0f) { - temp_fv0 = 10.0f; + magnitude = 10.0f; } else if (dist < 30.0f) { - temp_fv0 = 40.0f; + magnitude = 40.0f; } else { - temp_fv0 = 80.0f; + magnitude = 80.0f; } - play->actorCtx.unk268 = 1; - func_800B6F20(play, &play->actorCtx.unk_26C, temp_fv0, yaw); + play->actorCtx.unk268 = true; + func_800B6F20(play, &play->actorCtx.unk_26C, magnitude, playerYaw); + if (dist < 5.0f) { - func_80AEA0B4(this); + EnLiftNuts_SetupIdle(this); } } -void func_80AEB114(EnLiftNuts* this) { +void EnLiftNuts_SetupStartGame(EnLiftNuts* this) { Audio_PlaySubBgm(NA_BGM_TIMED_MINI_GAME); - this->actionFunc = func_80AEB148; + this->actionFunc = EnLiftNuts_StartGame; } -void func_80AEB148(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_StartGame(EnLiftNuts* this, PlayState* play) { Player* player = GET_PLAYER(play); if (player->stateFlags3 & PLAYER_STATE3_200) { this->actor.speed = 2.0f; SET_EVENTINF(EVENTINF_34); - Interface_StartTimer(4, 0); - func_80AE9B4C(1, 2); + Interface_StartTimer(TIMER_ID_MINIGAME_2, 0); + EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_SET, ENLIFTNUTS_MINIGAME_STATE_RUNNING); Actor_PlaySfx(&this->actor, NA_SE_SY_FOUND); - func_80AEB280(this); + EnLiftNuts_SetupRunGame(this); } } -void func_80AEB1C8(EnLiftNuts* this) { +/** + * Does not wait for the player to pop out of the flower to start the minigame. + */ +void EnLiftNuts_SetupStartGameImmediately(EnLiftNuts* this) { this->actor.speed = 2.0f; SET_EVENTINF(EVENTINF_34); - Interface_StartTimer(4, 0); - func_80AE9B4C(1, 2); - this->actionFunc = func_80AEB230; + Interface_StartTimer(TIMER_ID_MINIGAME_2, 0); + EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_SET, ENLIFTNUTS_MINIGAME_STATE_RUNNING); + this->actionFunc = EnLiftNuts_StartGameImmediately; } -void func_80AEB230(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_StartGameImmediately(EnLiftNuts* this, PlayState* play) { Player* player = GET_PLAYER(play); if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] > SECONDS_TO_TIMER(0)) { player->stateFlags1 &= ~PLAYER_STATE1_20; - func_80AEB280(this); + EnLiftNuts_SetupRunGame(this); } } -void func_80AEB280(EnLiftNuts* this) { - this->actionFunc = func_80AEB294; +void EnLiftNuts_SetupRunGame(EnLiftNuts* this) { + this->actionFunc = EnLiftNuts_RunGame; } -void func_80AEB294(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_RunGame(EnLiftNuts* this, PlayState* play) { Player* player = GET_PLAYER(play); if (((player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (player->actor.floorBgId == BG_ACTOR_MAX) && @@ -795,10 +863,10 @@ void func_80AEB294(EnLiftNuts* this, PlayState* play) { (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] >= SECONDS_TO_TIMER(120))) { player->stateFlags1 |= PLAYER_STATE1_20; Flags_SetSwitch(play, 0x41); - func_80AEB3E0(this, play); + EnLiftNuts_SetupEndGame(this, play); } - if (*this->ptr_1EC == 300) { + if (*this->minigameScore == (ENGAMELUPY_POINTS * 6)) { player->stateFlags1 |= PLAYER_STATE1_20; if (((void)0, gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2]) < @@ -806,33 +874,33 @@ void func_80AEB294(EnLiftNuts* this, PlayState* play) { Flags_SetSwitch(play, 0x40); } Flags_SetSwitch(play, 0x41); - func_80AEB3E0(this, play); + EnLiftNuts_SetupEndGame(this, play); } } -void func_80AEB3E0(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_SetupEndGame(EnLiftNuts* this, PlayState* play) { Audio_PlaySfx(NA_SE_SY_FOUND); - this->unk_354 = 0; + this->timer = 0; gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_6; - this->actionFunc = func_80AEB428; + this->actionFunc = EnLiftNuts_EndGame; } -void func_80AEB428(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_EndGame(EnLiftNuts* this, PlayState* play) { s32 pad; - if (this->unk_354 == 10) { + if (this->timer == 10) { if (((void)0, gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2]) > gSaveContext.save.saveInfo.dekuPlaygroundHighScores[CURRENT_DAY - 1]) { Message_StartTextbox(play, 0x27EA, &this->actor); this->textId = 0x27EA; - } else if (*this->ptr_1EC == 300) { + } else if (*this->minigameScore == (ENGAMELUPY_POINTS * 6)) { Message_StartTextbox(play, 0x27F8, &this->actor); this->textId = 0x27F8; } else { Message_StartTextbox(play, 0x27EC, &this->actor); this->textId = 0x27EC; } - } else if (this->unk_354 == 30) { + } else if (this->timer == 30) { CLEAR_EVENTINF(EVENTINF_34); gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = ENTRANCE(DEKU_SCRUB_PLAYGROUND, 1); gSaveContext.nextCutsceneIndex = 0; @@ -841,40 +909,45 @@ void func_80AEB428(EnLiftNuts* this, PlayState* play) { play->transitionType = TRANS_TYPE_64; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK; } - this->unk_354++; + this->timer++; } -void func_80AEB584(EnLiftNuts* this) { - this->actionFunc = func_80AEB598; +void EnLiftNuts_SetupGiveReward(EnLiftNuts* this) { + this->actionFunc = EnLiftNuts_GiveReward; } -void func_80AEB598(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_GiveReward(EnLiftNuts* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_10) && CHECK_WEEKEVENTREG(WEEKEVENTREG_14_20) && (CURRENT_DAY == 3) && - !CHECK_WEEKEVENTREG(WEEKEVENTREG_14_80)) { - SET_WEEKEVENTREG(WEEKEVENTREG_14_80); + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1) && + CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2) && (CURRENT_DAY == 3) && + !CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_DEKU_PLAYGROUND_HEART_PIECE)) { + SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_DEKU_PLAYGROUND_HEART_PIECE); } - func_80AEB684(this); - } else if ((this->textId == 0x27F4) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_14_80)) { + EnLiftNuts_SetupResumeConversation(this); + } else if ((this->textId == 0x27F4) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_DEKU_PLAYGROUND_HEART_PIECE)) { Actor_OfferGetItem(&this->actor, play, GI_HEART_PIECE, 500.0f, 100.0f); } else { Actor_OfferGetItem(&this->actor, play, GI_RUPEE_PURPLE, 500.0f, 100.0f); } } -void func_80AEB684(EnLiftNuts* this) { - this->actionFunc = func_80AEB698; +void EnLiftNuts_SetupResumeConversation(EnLiftNuts* this) { + this->actionFunc = EnLiftNuts_ResumeConversation; } -void func_80AEB698(EnLiftNuts* this, PlayState* play) { +/** + * Resumes the current conversation after giving player the reward for winning the minigame. + */ +void EnLiftNuts_ResumeConversation(EnLiftNuts* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->actor, &play->state)) { - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_10) && CHECK_WEEKEVENTREG(WEEKEVENTREG_14_20) && (CURRENT_DAY == 3)) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 13); + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1) && + CHECK_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2) && (CURRENT_DAY == 3)) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_SHOCKED_END); Message_StartTextbox(play, 0x27F5, &this->actor); this->textId = 0x27F5; - } else if (func_80AE9B8C() > 0) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1); + } else if (EnLiftNuts_GetNumDaysWon() > 0) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_WALK); Message_StartTextbox(play, 0x27F0, &this->actor); this->textId = 0x27F0; } else { @@ -882,18 +955,18 @@ void func_80AEB698(EnLiftNuts* this, PlayState* play) { this->textId = 0x27F1; } this->actor.flags &= ~ACTOR_FLAG_10000; - func_80AEABF0(this); + EnLiftNuts_SetupStartConversation(this); switch (CURRENT_DAY) { case 1: - SET_WEEKEVENTREG(WEEKEVENTREG_14_10); + SET_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1); break; case 2: - SET_WEEKEVENTREG(WEEKEVENTREG_14_20); + SET_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2); break; case 3: - SET_WEEKEVENTREG(WEEKEVENTREG_14_40); + SET_WEEKEVENTREG(WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_3); break; default: @@ -904,64 +977,63 @@ void func_80AEB698(EnLiftNuts* this, PlayState* play) { } } -void func_80AEB828(EnLiftNuts* this) { - if (!func_80AE9B4C(0, 4)) { - func_80AE9B4C(1, 4); - this->unk_356 = 1; +void EnLiftNuts_SetupStartHiding(EnLiftNuts* this) { + if (!EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, ENLIFTNUTS_MINIGAME_STATE_HIDING)) { + EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_SET, ENLIFTNUTS_MINIGAME_STATE_HIDING); + this->isFirstTimeHiding = true; } - if (this->actionFunc == func_80AE9F70) { - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 15); + if (this->actionFunc == EnLiftNuts_IdleHidden) { + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_BOB); } - this->unk_354 = 0; - this->actionFunc = func_80AEB8A4; + this->timer = 0; + this->actionFunc = EnLiftNuts_StartHiding; } -void func_80AEB8A4(EnLiftNuts* this, PlayState* play) { - if (this->unk_354 == 22) { - if (this->unk_356 == 1) { +void EnLiftNuts_StartHiding(EnLiftNuts* this, PlayState* play) { + if (this->timer == 22) { + if (this->isFirstTimeHiding == true) { Message_StartTextbox(play, 0x27F6, &this->actor); this->textId = 0x27F6; } - Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 17); - this->actionFunc = func_80AEB934; + Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, ENLIFTNUTS_ANIM_BURROW_HALF); + this->actionFunc = EnLiftNuts_Hide; } - this->unk_354++; + this->timer++; } -void func_80AEB934(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_Hide(EnLiftNuts* this, PlayState* play) { if (Animation_OnFrame(&this->skelAnime, 5.0f)) { - func_80AEB9E0(this, play); + EnLiftNuts_SpawnDust(this, play); } } -void func_80AEB974(EnLiftNuts* this) { - s16 textId = this->textId; - - switch (textId) { - default: - this->unk_1E4 = 0; - break; - +void EnLiftNuts_UpdateEyes(EnLiftNuts* this) { + switch (this->textId) { case 0x27EE: case 0x27EF: - this->unk_1E4 = 1; + this->eyeTexIndex = 1; break; case 0x27F5: - this->unk_1E4 = 2; + this->eyeTexIndex = 2; break; case 0x27F4: - if (this->unk_354 == 0) { - this->unk_1E4 = 2; - break; + if (this->timer == 0) { + this->eyeTexIndex = 2; + } else { + this->eyeTexIndex = 1; } - this->unk_1E4 = 1; + break; + + default: + this->eyeTexIndex = 0; + break; } } -void func_80AEB9E0(EnLiftNuts* this, PlayState* play) { - Vec3f worldPos = this->actor.world.pos; +void EnLiftNuts_SpawnDust(EnLiftNuts* this, PlayState* play) { + Vec3f pos = this->actor.world.pos; Vec3f velocity; Vec3f accel; Color_RGBA8 primColor = { 170, 130, 90, 255 }; @@ -978,11 +1050,11 @@ void func_80AEB9E0(EnLiftNuts* this, PlayState* play) { accel.x = -0.2f * velocity.x; accel.z = -0.2f * velocity.z; - func_800B0EB0(play, &worldPos, &velocity, &accel, &primColor, &envColor, 80, 25, 10); + func_800B0EB0(play, &pos, &velocity, &accel, &primColor, &envColor, 80, 25, 10); } } -void func_80AEBB30(EnLiftNuts* this, PlayState* play) { +void EnLiftNuts_UpdateCollision(EnLiftNuts* this, PlayState* play) { Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } @@ -992,35 +1064,37 @@ void EnLiftNuts_Update(Actor* thisx, PlayState* play) { SkelAnime_Update(&this->skelAnime); this->actionFunc(this, play); - func_80AEBB30(this, play); - Actor_UpdateBgCheckInfo(play, thisx, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_4); - func_80AE9BCC(this, play); + EnLiftNuts_UpdateCollision(this, play); + Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_4); + EnLiftNuts_TryHide(this, play); - if (func_80AE9B4C(0, 2)) { - thisx->flags &= ~ACTOR_FLAG_1; + if (EnLiftNuts_MinigameState(ENLIFTNUTS_MINIGAME_STATE_MODE_CHECK, ENLIFTNUTS_MINIGAME_STATE_RUNNING)) { + this->actor.flags &= ~ACTOR_FLAG_1; } } s32 EnLiftNuts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) { EnLiftNuts* this = THIS; - if ((limbIndex == OBJECT_DNT_LIMB_0F) || (limbIndex == OBJECT_DNT_LIMB_10) || (limbIndex == OBJECT_DNT_LIMB_15) || - (limbIndex == OBJECT_DNT_LIMB_17) || (limbIndex == OBJECT_DNT_LIMB_18) || (limbIndex == OBJECT_DNT_LIMB_15) || - (limbIndex == OBJECT_DNT_LIMB_1B)) { + if ((limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_HAT) || (limbIndex == BUSINESS_SCRUB_LIMB_RIGHT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_HAND_BAG) || (limbIndex == BUSINESS_SCRUB_LIMB_SCALP) || + (limbIndex == BUSINESS_SCRUB_LIMB_HAIR) || (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_HAND_BAG) || + (limbIndex == BUSINESS_SCRUB_LIMB_LEFT_ARM_BAG)) { *dList = NULL; } - if (limbIndex == OBJECT_DNT_LIMB_1A) { - *dList = D_80AEBF18[this->unk_1E4]; + if (limbIndex == BUSINESS_SCRUB_LIMB_EYES) { + *dList = sEyeTextures[this->eyeTexIndex]; } return false; } void EnLiftNuts_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { static Vec3f sFocusOffset = { 0.0f, 0.0f, 0.0f }; + EnLiftNuts* this = THIS; - if (limbIndex == OBJECT_DNT_LIMB_19) { - Matrix_MultVec3f(&sFocusOffset, &thisx->focus.pos); + if (limbIndex == BUSINESS_SCRUB_LIMB_HAT) { + Matrix_MultVec3f(&sFocusOffset, &this->actor.focus.pos); } } diff --git a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.h b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.h index 9a54132a46..2ee5897bdd 100644 --- a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.h +++ b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.h @@ -8,25 +8,25 @@ struct EnLiftNuts; typedef void (*EnLiftNutsActionFunc)(struct EnLiftNuts*, PlayState*); -#define ENLIFTNUTS_GET_FF00(thisx) (((thisx)->params & 0xFF00) >> 8) +#define ENLIFTNUTS_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFF00) >> 8) typedef struct EnLiftNuts { /* 0x000 */ Actor actor; /* 0x144 */ ColliderCylinder collider; /* 0x190 */ SkelAnime skelAnime; /* 0x1D4 */ EnLiftNutsActionFunc actionFunc; - /* 0x1D8 */ Vec3f vec_1D8; - /* 0x1E4 */ s32 unk_1E4; - /* 0x1E8 */ s32 unk_1E8; - /* 0x1EC */ s16* ptr_1EC; - /* 0x1F0 */ Vec3s jointTable[OBJECT_DNT_LIMB_MAX]; - /* 0x298 */ Vec3s morphTable[OBJECT_DNT_LIMB_MAX]; + /* 0x1D8 */ Vec3f waypointPos; + /* 0x1E4 */ s32 eyeTexIndex; + /* 0x1E8 */ s32 unk1E8; // Set but never used + /* 0x1EC */ s16* minigameScore; // Pointer to shared memory location with actor EnGamelupy + /* 0x1F0 */ Vec3s jointTable[BUSINESS_SCRUB_LIMB_MAX]; + /* 0x298 */ Vec3s morphTable[BUSINESS_SCRUB_LIMB_MAX]; /* 0x340 */ UNK_TYPE1 unk_340[0xC]; /* 0x34C */ s16 textId; - /* 0x34E */ s16 unk_34E; + /* 0x34E */ s16 autotalk; /* 0x350 */ UNK_TYPE1 unk_350[0x4]; - /* 0x354 */ s16 unk_354; - /* 0x356 */ s16 unk_356; + /* 0x354 */ s16 timer; // Frame counter used for various different things + /* 0x356 */ s16 isFirstTimeHiding; } EnLiftNuts; // size = 0x358 #endif // Z_EN_LIFT_NUTS_H diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c index 0a3eee7989..085610542d 100644 --- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c +++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c @@ -65,29 +65,29 @@ static ColliderCylinderInitType1 sCylinderInit = { }; static AnimationInfoS sAnimationInfo[] = { - { &object_dnt_Anim_005488, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_004AA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_004E38, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_005CA8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_0038CC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_003CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_0012F4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_004700, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_003438, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_001E2C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_000994, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_002268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_002F08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_00577C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnt_Anim_0029E8, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, - { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_0012F4, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_002670, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubStandingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubRiseUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubJumpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubExcitedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubExcitedLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubExcitedEndAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubTakeOffHatAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubShockedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubShockedShakeHeadAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubShockedPoundAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubShockedEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubThinkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubBobAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gBusinessScrubBurrowAnim, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubBurrowAnim, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, + { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubTakeOffHatAnim, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; Gfx* D_80BCCCDC[] = { gKakeraLeafMiddle, gKakeraLeafTip }; @@ -691,7 +691,7 @@ void EnScopenuts_Init(Actor* thisx, PlayState* play) { } Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_InitFlex(play, &this->skelAnime, &object_dnt_Skel_00AC70, &object_dnt_Anim_005488, this->jointTable, + SkelAnime_InitFlex(play, &this->skelAnime, &gBusinessScrubSkel, &gBusinessScrubStandingAnim, this->jointTable, this->morphTable, 28); Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); @@ -794,9 +794,9 @@ s32 EnScopenuts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve if (limbIndex == 26) { if ((this->unk_33C == 0x162F) || (this->unk_33C == 0x1630)) { - *dList = object_dnt_DL_001420; + *dList = gBusinessScrubEyesSquintDL; } else { - *dList = object_dnt_DL_008290; + *dList = gBusinessScrubEyesDL; } } diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c index 21359a0a6c..6e54b9be67 100644 --- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c +++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c @@ -81,29 +81,29 @@ static ColliderCylinderInitType1 sCylinderInit = { }; static AnimationInfoS sAnimationInfo[] = { - { &object_dnt_Anim_005488, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_004AA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_004E38, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_005CA8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_0038CC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_003CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_0012F4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_004700, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_003438, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_001E2C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_000994, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_002268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_002F08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_00577C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, - { &object_dnt_Anim_0029E8, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_0029E8, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, - { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, - { &object_dnt_Anim_0012F4, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, - { &object_dnt_Anim_002670, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubStandingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubRiseUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubJumpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubExcitedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubExcitedLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubExcitedEndAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubTakeOffHatAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubShockedStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubShockedShakeHeadAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubShockedPoundAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubShockedEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubThinkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubBobAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, + { &gBusinessScrubBurrowAnim, 1.0f, 8, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubBurrowAnim, 1.0f, 4, -1, ANIMMODE_ONCE, -4 }, + { &gBusinessScrubBurrowAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, + { &gBusinessScrubTakeOffHatAnim, -1.0f, 0, -1, ANIMMODE_ONCE, 0 }, + { &gBusinessScrubFlyEndAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, }; static InitChainEntry sInitChain[] = { @@ -953,7 +953,7 @@ void EnSellnuts_Init(Actor* thisx, PlayState* play) { } Actor_ProcessInitChain(&this->actor, sInitChain); - SkelAnime_InitFlex(play, &this->skelAnime, &object_dnt_Skel_00AC70, &object_dnt_Anim_005488, this->jointTable, + SkelAnime_InitFlex(play, &this->skelAnime, &gBusinessScrubSkel, &gBusinessScrubStandingAnim, this->jointTable, this->morphTable, 28); Collider_InitCylinder(play, &this->collider); Collider_SetCylinderType1(play, &this->collider, &this->actor, &sCylinderInit); @@ -1106,9 +1106,9 @@ s32 EnSellnuts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec if (limbIndex == 26) { if ((this->unk_34C == 6) || (this->unk_34C == 5) || (this->unk_34C == 7)) { - *dList = object_dnt_DL_001350; + *dList = gBusinessScrubEyesWideDL; } else { - *dList = object_dnt_DL_008290; + *dList = gBusinessScrubEyesDL; } } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 220695b001..9ef37a3e4e 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -700,9 +700,9 @@ 0x800B6474:("Actor_UpdatePlayerImpact",), 0x800B648C:("Actor_SetPlayerImpact",), 0x800B64FC:("Actor_GetPlayerImpact",), - 0x800B6584:("func_800B6584",), - 0x800B6608:("func_800B6608",), - 0x800B6680:("func_800B6680",), + 0x800B6584:("Actor_AddSharedMemoryEntry",), + 0x800B6608:("Actor_FreeSharedMemoryEntry",), + 0x800B6680:("Actor_FindSharedMemoryEntry",), 0x800B670C:("Actor_Kill",), 0x800B672C:("Actor_SetWorldToHome",), 0x800B675C:("Actor_SetFocus",), @@ -12504,48 +12504,48 @@ 0x80AE939C:("func_80AE939C",), 0x80AE9574:("ObjBigicicle_Update",), 0x80AE9780:("ObjBigicicle_Draw",), - 0x80AE9A20:("func_80AE9A20",), - 0x80AE9A80:("func_80AE9A80",), - 0x80AE9AC4:("func_80AE9AC4",), - 0x80AE9B4C:("func_80AE9B4C",), - 0x80AE9B8C:("func_80AE9B8C",), - 0x80AE9BCC:("func_80AE9BCC",), + 0x80AE9A20:("EnLiftNuts_AddSharedMemoryEntry",), + 0x80AE9A80:("EnLiftNuts_FreeSharedMemoryEntry",), + 0x80AE9AC4:("EnLiftNuts_Autotalk",), + 0x80AE9B4C:("EnLiftNuts_GameState",), + 0x80AE9B8C:("EnLiftNuts_GetNumDaysWon",), + 0x80AE9BCC:("EnLiftNuts_TryHide",), 0x80AE9CA8:("EnLiftNuts_Init",), 0x80AE9EEC:("EnLiftNuts_Destroy",), - 0x80AE9F28:("func_80AE9F28",), - 0x80AE9F70:("func_80AE9F70",), - 0x80AE9FC8:("func_80AE9FC8",), - 0x80AEA044:("func_80AEA044",), - 0x80AEA0B4:("func_80AEA0B4",), - 0x80AEA128:("func_80AEA128",), - 0x80AEA1A0:("func_80AEA1A0",), - 0x80AEA7A4:("func_80AEA7A4",), - 0x80AEA910:("func_80AEA910",), - 0x80AEABF0:("func_80AEABF0",), - 0x80AEAC64:("func_80AEAC64",), - 0x80AEACF8:("func_80AEACF8",), - 0x80AEAEAC:("func_80AEAEAC",), - 0x80AEAF14:("func_80AEAF14",), - 0x80AEAF8C:("func_80AEAF8C",), - 0x80AEAFA0:("func_80AEAFA0",), - 0x80AEB114:("func_80AEB114",), - 0x80AEB148:("func_80AEB148",), - 0x80AEB1C8:("func_80AEB1C8",), - 0x80AEB230:("func_80AEB230",), - 0x80AEB280:("func_80AEB280",), - 0x80AEB294:("func_80AEB294",), - 0x80AEB3E0:("func_80AEB3E0",), - 0x80AEB428:("func_80AEB428",), - 0x80AEB584:("func_80AEB584",), - 0x80AEB598:("func_80AEB598",), - 0x80AEB684:("func_80AEB684",), - 0x80AEB698:("func_80AEB698",), - 0x80AEB828:("func_80AEB828",), - 0x80AEB8A4:("func_80AEB8A4",), - 0x80AEB934:("func_80AEB934",), - 0x80AEB974:("func_80AEB974",), - 0x80AEB9E0:("func_80AEB9E0",), - 0x80AEBB30:("func_80AEBB30",), + 0x80AE9F28:("EnLiftNuts_SetupIdleHidden",), + 0x80AE9F70:("EnLiftNuts_IdleHidden",), + 0x80AE9FC8:("EnLiftNuts_SetupBurrow",), + 0x80AEA044:("EnLiftNuts_Burrow",), + 0x80AEA0B4:("EnLiftNuts_SetupIdle",), + 0x80AEA128:("EnLiftNuts_RiseUp",), + 0x80AEA1A0:("EnLiftNuts_Idle",), + 0x80AEA7A4:("EnLiftNuts_HandleConversationChoice",), + 0x80AEA910:("EnLiftNuts_HandleConversation5",), + 0x80AEABF0:("EnLiftNuts_SetupStartConversation",), + 0x80AEAC64:("EnLiftNuts_StartConversation",), + 0x80AEACF8:("EnLiftNuts_HandleConversation",), + 0x80AEAEAC:("EnLiftNuts_SetupMove",), + 0x80AEAF14:("EnLiftNuts_Move",), + 0x80AEAF8C:("EnLiftNuts_SetupMovePlayer",), + 0x80AEAFA0:("EnLiftNuts_MovePlayer",), + 0x80AEB114:("EnLiftNuts_SetupStartGame",), + 0x80AEB148:("EnLiftNuts_StartGame",), + 0x80AEB1C8:("EnLiftNuts_SetupStartGameImmediately",), + 0x80AEB230:("EnLiftNuts_StartGameImmediately",), + 0x80AEB280:("EnLiftNuts_SetupRunGame",), + 0x80AEB294:("EnLiftNuts_RunGame",), + 0x80AEB3E0:("EnLiftNuts_SetupEndGame",), + 0x80AEB428:("EnLiftNuts_EndGame",), + 0x80AEB584:("EnLiftNuts_SetupGiveReward",), + 0x80AEB598:("EnLiftNuts_GiveReward",), + 0x80AEB684:("EnLiftNuts_SetupResumeConversation",), + 0x80AEB698:("EnLiftNuts_ResumeConversation",), + 0x80AEB828:("EnLiftNuts_SetupStartHiding",), + 0x80AEB8A4:("EnLiftNuts_StartHiding",), + 0x80AEB934:("EnLiftNuts_Hide",), + 0x80AEB974:("EnLiftNuts_UpdateEyes",), + 0x80AEB9E0:("EnLiftNuts_SpawnDust",), + 0x80AEBB30:("EnLiftNuts_UpdateCollision",), 0x80AEBB74:("EnLiftNuts_Update",), 0x80AEBC18:("func_80AEBC18",), 0x80AEBC90:("func_80AEBC90",), @@ -12699,14 +12699,14 @@ 0x80AF6094:("EnWdhand_Draw",), 0x80AF6760:("EnGamelupy_Init",), 0x80AF6828:("EnGamelupy_Destroy",), - 0x80AF6854:("func_80AF6854",), - 0x80AF6944:("func_80AF6944",), - 0x80AF6958:("func_80AF6958",), - 0x80AF6994:("func_80AF6994",), - 0x80AF69A8:("func_80AF69A8",), - 0x80AF6A38:("func_80AF6A38",), - 0x80AF6A78:("func_80AF6A78",), - 0x80AF6B40:("func_80AF6B40",), + 0x80AF6854:("EnGamelupy_SpawnSparkles",), + 0x80AF6944:("EnGamelupy_SetupFindSharedMemory",), + 0x80AF6958:("EnGamelupy_FindSharedMemory",), + 0x80AF6994:("EnGamelupy_SetupIdle",), + 0x80AF69A8:("EnGamelupy_Idle",), + 0x80AF6A38:("EnGamelupy_SetupCollected",), + 0x80AF6A78:("EnGamelupy_Collected",), + 0x80AF6B40:("EnGamelupy_UpdateCollision",), 0x80AF6B84:("EnGamelupy_Update",), 0x80AF6BF8:("EnGamelupy_Draw",), 0x80AF6DE0:("func_80AF6DE0",), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index fb3d052079..25d7f3b61a 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -214,9 +214,9 @@ asm/non_matchings/code/z_actor/Actor_InitPlayerImpact.s,Actor_InitPlayerImpact,0 asm/non_matchings/code/z_actor/Actor_UpdatePlayerImpact.s,Actor_UpdatePlayerImpact,0x800B6474,0x6 asm/non_matchings/code/z_actor/Actor_SetPlayerImpact.s,Actor_SetPlayerImpact,0x800B648C,0x1C asm/non_matchings/code/z_actor/Actor_GetPlayerImpact.s,Actor_GetPlayerImpact,0x800B64FC,0x22 -asm/non_matchings/code/z_actor/func_800B6584.s,func_800B6584,0x800B6584,0x21 -asm/non_matchings/code/z_actor/func_800B6608.s,func_800B6608,0x800B6608,0x1E -asm/non_matchings/code/z_actor/func_800B6680.s,func_800B6680,0x800B6680,0x23 +asm/non_matchings/code/z_actor/Actor_AddSharedMemoryEntry.s,func_800B6584,0x800B6584,0x21 +asm/non_matchings/code/z_actor/Actor_FreeSharedMemoryEntry.s,func_800B6608,0x800B6608,0x1E +asm/non_matchings/code/z_actor/Actor_FindSharedMemoryEntry.s,func_800B6680,0x800B6680,0x23 asm/non_matchings/code/z_actor/Actor_Kill.s,Actor_Kill,0x800B670C,0x8 asm/non_matchings/code/z_actor/Actor_SetWorldToHome.s,Actor_SetWorldToHome,0x800B672C,0xC asm/non_matchings/code/z_actor/Actor_SetFocus.s,Actor_SetFocus,0x800B675C,0x11 diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py index 45faf5f0eb..b724b1f21a 100755 --- a/tools/weekeventregconvert.py +++ b/tools/weekeventregconvert.py @@ -120,10 +120,10 @@ weekEventReg = { (14 << 8) | 0x02: "WEEKEVENTREG_14_02", (14 << 8) | 0x04: "WEEKEVENTREG_14_04", (14 << 8) | 0x08: "WEEKEVENTREG_DRANK_CHATEAU_ROMANI", - (14 << 8) | 0x10: "WEEKEVENTREG_14_10", - (14 << 8) | 0x20: "WEEKEVENTREG_14_20", - (14 << 8) | 0x40: "WEEKEVENTREG_14_40", - (14 << 8) | 0x80: "WEEKEVENTREG_14_80", + (14 << 8) | 0x10: "WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_1", + (14 << 8) | 0x20: "WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_2", + (14 << 8) | 0x40: "WEEKEVENTREG_WON_DEKU_PLAYGROUND_DAY_3", + (14 << 8) | 0x80: "WEEKEVENTREG_RECEIVED_DEKU_PLAYGROUND_HEART_PIECE", (15 << 8) | 0x01: "WEEKEVENTREG_15_01", (15 << 8) | 0x02: "WEEKEVENTREG_15_02", (15 << 8) | 0x04: "WEEKEVENTREG_15_04",