diff --git a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c index 94eec2c1d6..77bf925314 100644 --- a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c +++ b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c @@ -7,6 +7,7 @@ #include "z_bg_ikana_rotaryroom.h" #include "overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h" #include "overlays/actors/ovl_En_Torch2/z_en_torch2.h" +#include "overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h" #include "objects/object_ikana_obj/object_ikana_obj.h" #define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -679,7 +680,8 @@ void func_80B81570(BgIkanaRotaryroom* this, PlayState* play) { sp70.y += this->dyna.actor.world.pos.y; sp70.z += this->dyna.actor.world.pos.z; - Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, sp70.x, sp70.y, sp70.z, 0, 0, 0, 1); + Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, sp70.x, sp70.y, sp70.z, 0, 0, 0, + ENWATEREFFECT_TYPE_FALLING_ROCK_SPAWNER); } Matrix_Pop(); diff --git a/src/overlays/actors/ovl_Boss_03/z_boss_03.c b/src/overlays/actors/ovl_Boss_03/z_boss_03.c index 23aa023dac..380ef6f0b4 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -724,7 +724,7 @@ void Boss03_ChasePlayer(Boss03* this, PlayState* play) { if (sp43 != 0) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, player->actor.world.pos.x, this->waterHeight, - player->actor.world.pos.z, 0, 0, 0x78, ENWATEREFFECT_309); + player->actor.world.pos.z, 0, 0, 0x78, ENWATEREFFECT_TYPE_GYORG_RIPPLES); Boss03_PlayUnderwaterSfx(&this->actor.projectedPos, NA_SE_EN_KONB_SINK_OLD); } @@ -1055,7 +1055,7 @@ void Boss03_Charge(Boss03* this, PlayState* play) { play_sound(NA_SE_IT_BIG_BOMB_EXPLOSION); func_800BC848(&this->actor, play, 20, 15); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, 0.0f, this->waterHeight, 0.0f, 0, 0, 0x96, - ENWATEREFFECT_30C); + ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE); // Player is above water && Player is standing on ground if ((this->waterHeight < player->actor.world.pos.y) && (player->actor.bgCheckFlags & 1)) { @@ -1528,7 +1528,7 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) { if ((this->workTimer[WORK_TIMER_UNK0_C] == 0) && ((this->waterHeight - 100.0f) < this->actor.world.pos.y)) { this->workTimer[WORK_TIMER_UNK0_C] = Rand_ZeroFloat(15.0f) + 15.0f; Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, this->actor.world.pos.x, this->waterHeight, - this->actor.world.pos.z, 0, 0, 0x78, ENWATEREFFECT_309); + this->actor.world.pos.z, 0, 0, 0x78, ENWATEREFFECT_TYPE_GYORG_RIPPLES); if (this->actionFunc == Boss03_DeathCutscene) { if ((D_809E9840 % 2) != 0) { @@ -2012,7 +2012,7 @@ void Boss03_Update(Actor* thisx, PlayState* play2) { } Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, this->actor.world.pos.x, this->waterHeight, - this->actor.world.pos.z, 0, 0, 0x78, ENWATEREFFECT_309); + this->actor.world.pos.z, 0, 0, 0x78, ENWATEREFFECT_TYPE_GYORG_RIPPLES); this->unk_280 = 27; this->unk_284 = this->actor.world.pos.x; diff --git a/src/overlays/actors/ovl_Dm_An/z_dm_an.c b/src/overlays/actors/ovl_Dm_An/z_dm_an.c index 64b6a7a98a..4cd28f454c 100644 --- a/src/overlays/actors/ovl_Dm_An/z_dm_an.c +++ b/src/overlays/actors/ovl_Dm_An/z_dm_an.c @@ -160,7 +160,7 @@ Actor* func_80C1C8E8(PlayState* play) { } tempActor = foundActor->next; - if (tempActor == NULL || NULL) { + if (tempActor == NULL || false) { foundActor = NULL; break; } diff --git a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c index 2b9c62e190..b51f4df8dd 100644 --- a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c +++ b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c @@ -1,7 +1,7 @@ /* * File: z_dm_gm.c * Overlay: ovl_Dm_Gm - * Description: Anju (cutscene) (duplicate of Dm_An?) + * Description: Complete duplicate of Dm_An */ #include "z_dm_gm.h" diff --git a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c index 3e6ab858fe..a251dd1133 100644 --- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c +++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c @@ -1,7 +1,7 @@ /* * File: z_en_hs2.c * Overlay: ovl_En_Hs2 - * Description: Blue Target Spot (?) + * Description: Near-empty actor. Does nothing, but can be targeted. */ #include "z_en_hs2.h" diff --git a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c index db6a9d172d..0d39a0db2e 100644 --- a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c +++ b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c @@ -1,7 +1,7 @@ /* * File: z_en_tag_obj.c * Overlay: ovl_En_Tag_Obj - * Description: + * Description: Unused Seahorse Spawner */ #include "z_en_tag_obj.h" diff --git a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c index 45459e8b38..ceac1e116e 100644 --- a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c +++ b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c @@ -1,7 +1,7 @@ /* * File: z_en_tanron6.c * Overlay: ovl_En_Tanron6 - * Description: Swarm of Giant Bees + * Description: Unused invisible enemy. Only draws a circle shadow. */ #include "z_en_tanron6.h" diff --git a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c index 92bec240eb..fc1ad7279b 100644 --- a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c +++ b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c @@ -1,7 +1,15 @@ /* * File: z_en_water_effect.c * Overlay: ovl_En_Water_Effect - * Description: Water splashing effect (used for Gyorg) + * Description: Water/rock drop spawner and Gyorg water splashing effect + * + * This actor serves two purposes: + * - It can act as a "spawner" for either water drops or flaming rocks. This + * spawner can be placed in the ceiling to drop these repeatedly. + * - It is also used to control various water splashing effects for the Gyorg + * fight. Specifically, it handles the splashing that is caused when it + * enters or exits the water, and it handles the shockwave that is created + * when it rams the center platform. */ #include "z_en_water_effect.h" @@ -85,27 +93,30 @@ void EnWaterEffect_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_1; this->unk_DC4 = Rand_ZeroFloat(100.0f); - if (this->actor.params == ENWATEREFFECT_1) { + if (this->actor.params == ENWATEREFFECT_TYPE_FALLING_ROCK_SPAWNER) { this->actor.update = func_80A59C04; this->actor.draw = func_80A5A184; this->unk_DC6 = Rand_ZeroFloat(100.0f) + 60.0f; - } else if ((this->actor.params == ENWATEREFFECT_309) || (this->actor.params == ENWATEREFFECT_30A) || - (this->actor.params == ENWATEREFFECT_30B) || (this->actor.params == ENWATEREFFECT_30C)) { + } else if ((this->actor.params == ENWATEREFFECT_TYPE_GYORG_RIPPLES) || + (this->actor.params == ENWATEREFFECT_TYPE_GYORG_PRIMARY_SPRAY) || + (this->actor.params == ENWATEREFFECT_TYPE_GYORG_SECONDARY_SPRAY) || + (this->actor.params == ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE)) { this->actor.update = func_80A5A534; this->actor.draw = func_80A5A6B8; this->actor.shape.rot.y = Rand_ZeroFloat(0x10000); Actor_SetScale(&this->actor, this->actor.shape.rot.z * 0.0002f); - if (this->actor.params == ENWATEREFFECT_309) { + if (this->actor.params == ENWATEREFFECT_TYPE_GYORG_RIPPLES) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, this->actor.world.pos.x, this->actor.world.pos.y, - this->actor.world.pos.z, 0, 0, this->actor.shape.rot.z, 0x30A); + this->actor.world.pos.z, 0, 0, this->actor.shape.rot.z, ENWATEREFFECT_TYPE_GYORG_PRIMARY_SPRAY); Actor_Spawn(&play->actorCtx, play, ACTOR_EN_WATER_EFFECT, this->actor.world.pos.x, this->actor.world.pos.y, - this->actor.world.pos.z, 0, 0, this->actor.shape.rot.z, 0x30B); - } else if (this->actor.params == ENWATEREFFECT_30A) { + this->actor.world.pos.z, 0, 0, this->actor.shape.rot.z, + ENWATEREFFECT_TYPE_GYORG_SECONDARY_SPRAY); + } else if (this->actor.params == ENWATEREFFECT_TYPE_GYORG_PRIMARY_SPRAY) { this->unk_DC4 = -3; - } else if (this->actor.params == ENWATEREFFECT_30B) { + } else if (this->actor.params == ENWATEREFFECT_TYPE_GYORG_SECONDARY_SPRAY) { this->unk_DC4 = -6; - } else if (this->actor.params == ENWATEREFFECT_30C) { + } else if (this->actor.params == ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE) { this->unk_DC4 = 23; } @@ -620,7 +631,8 @@ void func_80A5A6B8(Actor* thisx, PlayState* play2) { Matrix_Push(); Matrix_Push(); - if ((this->actor.params == ENWATEREFFECT_309) || (this->actor.params == ENWATEREFFECT_30A)) { + if ((this->actor.params == ENWATEREFFECT_TYPE_GYORG_RIPPLES) || + (this->actor.params == ENWATEREFFECT_TYPE_GYORG_PRIMARY_SPRAY)) { if (this->unk_E2C > 1.0f) { func_8012C2DC(play->state.gfxCtx); AnimatedMat_Draw(play, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000DE0)); @@ -648,7 +660,7 @@ void func_80A5A6B8(Actor* thisx, PlayState* play2) { Matrix_Pop(); } - if ((this->unk_E34 > 1.0f) && (this->actor.params != ENWATEREFFECT_30C)) { + if ((this->unk_E34 > 1.0f) && (this->actor.params != ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE)) { func_8012C2DC(play->state.gfxCtx); AnimatedMat_Draw(play, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000E40)); Matrix_Scale(this->unk_DC8[3].y, this->unk_DC8[3].z, this->unk_DC8[3].y, MTXMODE_APPLY); @@ -660,7 +672,8 @@ void func_80A5A6B8(Actor* thisx, PlayState* play2) { Matrix_Pop(); - if ((this->actor.params == ENWATEREFFECT_309) || (this->actor.params == ENWATEREFFECT_30C)) { + if ((this->actor.params == ENWATEREFFECT_TYPE_GYORG_RIPPLES) || + (this->actor.params == ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE)) { func_8012C2DC(play->state.gfxCtx); AnimatedMat_Draw(play, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000E58)); Matrix_Scale(this->unk_DC8[4].y, this->unk_DC8[4].z, this->unk_DC8[4].y, MTXMODE_APPLY); @@ -670,7 +683,7 @@ void func_80A5A6B8(Actor* thisx, PlayState* play2) { gSPDisplayList(POLY_XLU_DISP++, object_water_effect_DL_000CD8); } - if (this->actor.params == ENWATEREFFECT_309) { + if (this->actor.params == ENWATEREFFECT_TYPE_GYORG_RIPPLES) { func_8012C2DC(play->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(this->unk_144) / 2; i++, ptr++) { diff --git a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h index 35aebd83e7..e4fb752dc2 100644 --- a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h +++ b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h @@ -18,13 +18,14 @@ typedef struct { /* 0x3C */ s16 unk_3C; } EnWaterEffectStruct; // size = 0x40 -enum { - /* 0x001 */ ENWATEREFFECT_1 = 1, - /* 0x309 */ ENWATEREFFECT_309 = 0x309, - /* 0x30A */ ENWATEREFFECT_30A, - /* 0x30B */ ENWATEREFFECT_30B, - /* 0x30C */ ENWATEREFFECT_30C, -}; +typedef enum { + /* 0x001 */ ENWATEREFFECT_TYPE_FALLING_ROCK_SPAWNER = 1, // Spawner for falling flaming rocks, + /* 0x0FF */ ENWATEREFFECT_TYPE_FALLING_WATER_SPAWNER = 0xFF, // Spawner for water dripping from the ceiling + /* 0x309 */ ENWATEREFFECT_TYPE_GYORG_RIPPLES = 0x309, // Ripples on the surface when Gyrog enters/leaves the water + /* 0x30A */ ENWATEREFFECT_TYPE_GYORG_PRIMARY_SPRAY, // Large "funnel" of water that forms when Gyorg enters/leaves the water + /* 0x30B */ ENWATEREFFECT_TYPE_GYORG_SECONDARY_SPRAY, // Secondary "funnel" in the middle of the larger "funnel" + /* 0x30C */ ENWATEREFFECT_TYPE_GYORG_SHOCKWAVE, // Shockwave on the surface when Gyorg rams into the central platform +} EnWaterEffectType; typedef struct EnWaterEffect { /* 0x000 */ Actor actor; diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index cdf0447e67..1f3fae3ac9 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -1,7 +1,7 @@ /* * File: z_item_inbox.c * Overlay: ovl_Item_Inbox - * Description: + * Description: Unused, can draw GetItem models. Perhaps intended to draw items inside chests. */ #include "z_item_inbox.h" diff --git a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c index cbbdf82ed0..0c0177d2f7 100644 --- a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c +++ b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c @@ -1,7 +1,7 @@ /* * File: z_obj_dowsing.c * Overlay: ovl_Obj_Dowsing - * Description: + * Description: Rumbles controller if switch or collectible/chest flag is unset */ #include "z_obj_dowsing.h"