diff --git a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c index 4387b92846..8f6eb2e9fb 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c @@ -58,10 +58,7 @@ void EffectSsBubble_Draw(PlayState* play, u32 index, EffectSs* this) { void EffectSsBubble_Update(PlayState* play, u32 index, EffectSs* this) { WaterBox* waterBox; - f32 waterSurfaceY; - Vec3f ripplePos; - - waterSurfaceY = this->pos.y; + f32 waterSurfaceY = this->pos.y; // kill bubble if it's out of range of a water box if (!WaterBox_GetSurface1(play, &play->colCtx, this->pos.x, this->pos.z, &waterSurfaceY, &waterBox)) { @@ -70,6 +67,8 @@ void EffectSsBubble_Update(PlayState* play, u32 index, EffectSs* this) { } if (waterSurfaceY < this->pos.y) { + Vec3f ripplePos; + ripplePos.x = this->pos.x; ripplePos.y = waterSurfaceY; ripplePos.z = this->pos.z; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c index a0cfd80c39..dff7cea06f 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dead_Dd/z_eff_ss_dead_dd.c @@ -29,7 +29,6 @@ EffectSsInit Effect_Ss_Dead_Dd_InitVars = { }; u32 EffectSsDeadDd_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { - s32 i; EffectSsDeadDdInitParams* initParams = (EffectSsDeadDdInitParams*)initParamsx; if (initParams->type == 0) { @@ -58,6 +57,8 @@ u32 EffectSsDeadDd_Init(PlayState* play, u32 index, EffectSs* this, void* initPa this->rEnvColorB = initParams->envColor.b; } else if (initParams->type == 1) { + s32 i; + this->life = initParams->life; this->rScaleStep = initParams->scaleStep; this->rAlphaMode = 0; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c index 1910c5914b..62dfc4472d 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c @@ -37,7 +37,6 @@ static EffectSsUpdateFunc sUpdateFuncs[] = { }; u32 EffectSsDust_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { - s32 randColorOffset; EffectSsDustInitParams* initParams = (EffectSsDustInitParams*)initParamsx; Math_Vec3f_Copy(&this->pos, &initParams->pos); @@ -49,7 +48,8 @@ u32 EffectSsDust_Init(PlayState* play, u32 index, EffectSs* this, void* initPara this->draw = EffectSsDust_Draw; if (initParams->drawFlags & 4) { - randColorOffset = Rand_ZeroOne() * 20.0f - 10.0f; + s32 randColorOffset = Rand_ZeroOne() * 20.0f - 10.0f; + this->rPrimColorR = initParams->primColor.r + randColorOffset; this->rPrimColorG = initParams->primColor.g + randColorOffset; this->rPrimColorB = initParams->primColor.b + randColorOffset; diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c index 618759146e..471bed5f7b 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c +++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c @@ -26,13 +26,11 @@ EffectSsInit Effect_Ss_Extra_InitVars = { u32 EffectSsExtra_Init(PlayState* play, u32 index, EffectSs* this, void* initParamsx) { EffectSsExtraInitParams* initParams = (EffectSsExtraInitParams*)initParamsx; s32 pad; - s32 objectSlot; - uintptr_t oldSeg6; - - objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_YABUSAME_POINT); + s32 objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_YABUSAME_POINT); if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { - oldSeg6 = gSegments[6]; + uintptr_t oldSeg6 = gSegments[6]; + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment); this->pos = initParams->pos; this->velocity = initParams->velocity; diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c index 186ed88766..c427ddca6b 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c +++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c @@ -172,21 +172,20 @@ void EffectSsFhgFlash_UpdateLightBall(PlayState* play, u32 index, EffectSs* this void EffectSsFhgFlash_UpdateShock(PlayState* play, u32 index, EffectSs* this) { s16 randBodyPart; - Player* player; - BossGanondrof* phantomGanon; - s16 rotStep; + s16 rotStep = Rand_ZeroOne() * 20000.0f; - rotStep = Rand_ZeroOne() * 20000.0f; this->rXZRot += rotStep + 0x4000; if (this->rParam == FHGFLASH_SHOCK_PLAYER) { - player = GET_PLAYER(play); + Player* player = GET_PLAYER(play); + randBodyPart = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f); this->pos.x = player->bodyPartsPos[randBodyPart].x + Rand_CenteredFloat(10.0f); this->pos.y = player->bodyPartsPos[randBodyPart].y + Rand_CenteredFloat(15.0f); this->pos.z = player->bodyPartsPos[randBodyPart].z + Rand_CenteredFloat(10.0f); } else if (this->rParam == FHGFLASH_SHOCK_PG) { - phantomGanon = (BossGanondrof*)this->actor; + BossGanondrof* phantomGanon = (BossGanondrof*)this->actor; + randBodyPart = Rand_ZeroFloat(23.9f); this->pos.x = phantomGanon->bodyPartsPos[randBodyPart].x + Rand_CenteredFloat(15.0f); this->pos.y = phantomGanon->bodyPartsPos[randBodyPart].y + Rand_CenteredFloat(20.0f); @@ -194,6 +193,8 @@ void EffectSsFhgFlash_UpdateShock(PlayState* play, u32 index, EffectSs* this) { } if (this->life < 100) { + s32 pad; + this->rAlpha -= 50; if (this->rAlpha < 0) { diff --git a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c index 89bd579292..790d157a71 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c +++ b/src/overlays/effects/ovl_Effect_Ss_Ice_Smoke/z_eff_ss_ice_smoke.c @@ -24,12 +24,12 @@ u32 EffectSsIceSmoke_Init(PlayState* play, u32 index, EffectSs* this, void* init EffectSsIceSmokeInitParams* initParams = (EffectSsIceSmokeInitParams*)initParamsx; s32 pad; s32 objectSlot; - uintptr_t prevSeg6; objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FZ); if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { - prevSeg6 = gSegments[6]; + uintptr_t prevSeg6 = gSegments[6]; + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment); Math_Vec3f_Copy(&this->pos, &initParams->pos); Math_Vec3f_Copy(&this->velocity, &initParams->velocity); @@ -61,6 +61,10 @@ void EffectSsIceSmoke_Draw(PlayState* play, u32 index, EffectSs* this) { OPEN_DISPS(play->state.gfxCtx, "../z_eff_ss_ice_smoke.c", 155); +#if !OOT_DEBUG + if (1) {} +#endif + objectSlot = Object_GetSlot(&play->objectCtx, OBJECT_FZ); if ((objectSlot >= 0) && Object_IsLoaded(&play->objectCtx, objectSlot)) { diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index b466818adc..29c243f689 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -78,9 +78,11 @@ u32 EffectSsKakera_Init(PlayState* play, u32 index, EffectSs* this, void* initPa f32 func_809A9818(f32 arg0, f32 arg1) { f32 temp_f2; +#if OOT_DEBUG if (arg1 < 0.0f) { PRINTF("範囲がマイナス!!(randomD_sectionUniformity)\n"); } +#endif temp_f2 = Rand_ZeroOne() * arg1; return ((temp_f2 * 2.0f) - arg1) + arg0; diff --git a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c index 7aaa867f84..5ee3a70cb8 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c +++ b/src/overlays/effects/ovl_Effect_Ss_Sibuki/z_eff_ss_sibuki.c @@ -79,10 +79,9 @@ void EffectSsSibuki_Draw(PlayState* play, u32 index, EffectSs* this) { } void EffectSsSibuki_Update(PlayState* play, u32 index, EffectSs* this) { - s32 pad[3]; - f32 xzVelScale; - s16 yaw; Player* player = GET_PLAYER(play); + s32 pad[2]; + f32 xzVelScale; if (this->pos.y <= player->actor.floorHeight) { this->life = 0; @@ -92,7 +91,8 @@ void EffectSsSibuki_Update(PlayState* play, u32 index, EffectSs* this) { this->rMoveDelay--; if (this->rMoveDelay == 0) { - yaw = Camera_GetInputDirYaw(Play_GetCamera(play, CAM_ID_MAIN)); + s16 yaw = Camera_GetInputDirYaw(Play_GetCamera(play, CAM_ID_MAIN)); + xzVelScale = ((200.0f + KREG(20)) * 0.01f) + ((0.1f * Rand_ZeroOne()) * (KREG(23) + 20.0f)); if (this->rDirection != 0) {