From 569013535e2bce6a573e67553a1115a50eaec629 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Thu, 26 Jan 2023 00:58:26 -0500 Subject: [PATCH] Improves the Block Pushing Speed Enhancement (#2396) * Increases the actual block pushing speed. Previously this enhancement only decreased the delay between pushes in any noticeable way because the top speed of the blocks was clamped. The enhancement now increases the top speed of the blocks according to the slider's value. * Applies previous changes to milk crates. * Applies same fix to fire temple stone blocks (I believe these are the ones with the faces on them) * Applies fixes to Poe painting blocks (forest temple) --- soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c | 3 ++- soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c | 2 +- .../overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 2 +- soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index 83154fd5d..e1e181cc5 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -138,7 +138,8 @@ void func_8088B268(BgHidanRock* this, PlayState* play) { } this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVarGetInteger("gFasterBlockPush", 0) * 0.3) + 0.5f; - this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f); + this->dyna.actor.speedXZ = + CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f + (CVarGetInteger("gFasterBlockPush", 0) * 0.5)); if (D_8088BFC0 > 0.0f) { temp_v1 = Math_StepToF(&D_8088BFC0, 20.0f, this->dyna.actor.speedXZ); diff --git a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index ae6b789ac..2895b7c6c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -388,7 +388,7 @@ void BgPoEvent_BlockPush(BgPoEvent* this, PlayState* play) { Player* player = GET_PLAYER(play); this->dyna.actor.speedXZ = this->dyna.actor.speedXZ + (CVarGetInteger("gFasterBlockPush", 0) * 0.3) + 0.5f; - this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f); + this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f + (CVarGetInteger("gFasterBlockPush", 0) * 0.5)); blockStop = Math_StepToF(&sBgPoEventblockPushDist, 20.0f, this->dyna.actor.speedXZ); displacement = this->direction * sBgPoEventblockPushDist; this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index efb9350c3..66b37d5c3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -262,7 +262,7 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) { this->unk_174 = this->unk_174 + ((CVarGetInteger("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f; - this->unk_174 = CLAMP_MAX(this->unk_174, 2.0f); + this->unk_174 = CLAMP_MAX(this->unk_174, 2.0f + (CVarGetInteger("gFasterBlockPush", 0) * 0.5)); approxFResult = Math_StepToF(&this->unk_178, 20.0f, this->unk_174); diff --git a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 67eb867a8..bfc944ca1 100644 --- a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -567,9 +567,9 @@ void ObjOshihiki_Push(ObjOshihiki* this, PlayState* play) { f32 pushDistSigned; s32 stopFlag; - this->pushSpeed = this->pushSpeed + ((CVarGetInteger("gFasterBlockPush", 0) / 2) * 0.5) + 0.5f; + this->pushSpeed = this->pushSpeed + (CVarGetInteger("gFasterBlockPush", 0) * 0.25) + 0.5f; this->stateFlags |= PUSHBLOCK_PUSH; - this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f); + this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f + (CVarGetInteger("gFasterBlockPush", 0) * 0.5)); stopFlag = Math_StepToF(&this->pushDist, 20.0f, this->pushSpeed); pushDistSigned = ((this->direction >= 0.0f) ? 1.0f : -1.0f) * this->pushDist; thisx->world.pos.x = thisx->home.pos.x + (pushDistSigned * this->yawSin);