From 9389ceb8c12c3e9d29b3e6428eb2ff07791d59ed Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Sun, 31 Jul 2022 21:09:30 -0500 Subject: [PATCH] Speed up lifting silver rocks and obelisks by 5x (#953) * Speed up lifting silver rocks and obelisks by 3x * Increase rock lifting speed to 5x * Fix bug that sped up picking up small rocks, grass, bombflowers * Add enhancement checkbox for faster block lifting and reduced speed to 3x --- libultraship/libultraship/ImGuiImpl.cpp | 2 ++ soh/src/code/z_onepointdemo.c | 19 +++++++++++++++++++ soh/src/code/z_onepointdemo_data.inc | 6 +++--- .../actors/ovl_player_actor/z_player.c | 6 +++++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index e01026b10..c3dc8e23f 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -990,6 +990,8 @@ namespace SohImGui { EnhancementSliderInt("Vine/Ladder Climb speed +%d", "##CLIMBSPEED", "gClimbSpeed", 0, 12, ""); EnhancementCheckbox("Faster Block Push", "gFasterBlockPush"); + EnhancementCheckbox("Faster Heavy Block Lift", "gFasterHeavyBlockLift"); + Tooltip("Speeds up lifting silver rocks and obelisks"); EnhancementCheckbox("No Forced Navi", "gNoForcedNavi"); Tooltip("Prevent forced Navi conversations"); EnhancementCheckbox("No Skulltula Freeze", "gSkulltulaFreeze"); diff --git a/soh/src/code/z_onepointdemo.c b/soh/src/code/z_onepointdemo.c index 5dcdeb2e4..2fd692da8 100644 --- a/soh/src/code/z_onepointdemo.c +++ b/soh/src/code/z_onepointdemo.c @@ -1041,18 +1041,37 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 camIdx, s16 csId, Act func_800C0808(globalCtx, camIdx, player, CAM_SET_CS_C); break; case 4020: + if (CVar_GetS32("gFasterHeavyBlockLift", 0)) { + D_8012368C[0].timerInit *= (1.0f / 3.0f); + D_8012368C[1].timerInit *= (1.0f / 3.0f); + D_8012368C[2].timerInit *= (1.0f / 3.0f); + D_8012368C[3].timerInit *= (1.0f / 3.0f); + } csInfo->keyFrames = D_8012368C; csInfo->keyFrameCnt = 4; func_800C0808(globalCtx, camIdx, player, CAM_SET_CS_C); break; case 4021: + if (CVar_GetS32("gFasterHeavyBlockLift", 0)) { + D_8012372C[0].timerInit *= (1.0f / 3.0f); + D_8012372C[1].timerInit *= (1.0f / 3.0f); + D_8012372C[2].timerInit *= (1.0f / 3.0f); + D_8012372C[3].timerInit *= (1.0f / 3.0f); + } csInfo->keyFrames = D_8012372C; csInfo->keyFrameCnt = 4; func_800C0808(globalCtx, camIdx, player, CAM_SET_CS_C); break; case 4022: + if (CVar_GetS32("gFasterHeavyBlockLift", 0)) { + D_801237CC[0].timerInit *= (1.0f / 3.0f); + D_801237CC[1].timerInit *= (1.0f / 3.0f); + D_801237CC[2].timerInit *= (1.0f / 3.0f); + D_801237CC[3].timerInit *= (1.0f / 3.0f); + D_801237CC[4].timerInit *= (1.0f / 3.0f); + } csCam->timer = D_801237CC[0].timerInit + D_801237CC[3].timerInit + D_801237CC[1].timerInit + D_801237CC[2].timerInit + D_801237CC[4].timerInit; diff --git a/soh/src/code/z_onepointdemo_data.inc b/soh/src/code/z_onepointdemo_data.inc index 2488be71b..216340f40 100644 --- a/soh/src/code/z_onepointdemo_data.inc +++ b/soh/src/code/z_onepointdemo_data.inc @@ -624,21 +624,21 @@ static OnePointCsFull D_801235C4[5] = { { 0x12, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_8012368C[4] = { +OnePointCsFull D_8012368C[4] = { { 0x0F, 0xFF, 0x0101, 10, 0, 60.0f, 1.0f, { -1110.0f, -180.0f, -840.0f }, { -985.0f, -220.0f, -840.0f } }, { 0x02, 0xFF, 0x0101, 70, -45, 75.0f, 1.0f, { -1060.0f, -160.0f, -840.0f }, { -1005.0f, -230.0f, -840.0f } }, { 0x0F, 0xFF, 0x0000, 10, -45, 75.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, { 0x0F, 0xFF, 0x0101, 180, 9, 80.0f, 1.0f, { -1205.0f, -175.0f, -840.0f }, { -1305.0f, -230.0f, -828.0f } }, }; -static OnePointCsFull D_8012372C[4] = { +OnePointCsFull D_8012372C[4] = { { 0x0F, 0xFF, 0x0142, 10, 0, 70.0f, 1.0f, { 0.0f, 80.0f, 0.0f }, { -1650.0f, 200.0f, -2920.0f } }, { 0x02, 0xFF, 0x0142, 110, -2, 50.0f, 0.5f, { 0.0f, 150.0f, 0.0f }, { -1320.0f, 170.0f, -2900.0f } }, { 0x0B, 0xFF, 0x4242, 100, 2, 70.0f, 0.1f, { 0.0f, 150.0f, 50.0f }, { -1.0f, -1.0f, -1.0f } }, { 0x03, 0xFF, 0x4242, 60, 2, 45.0f, 0.01f, { 0.0f, 150.0f, 50.0f }, { 0.0f, 200.0f, -80.0f } }, }; -static OnePointCsFull D_801237CC[5] = { +OnePointCsFull D_801237CC[5] = { { 0x8F, 0xFF, 0x4242, 20, 0, 50.0f, 1.0f, { 0.0f, 50.0f, -10.0f }, { 0.0f, 0.0f, 100.0f } }, { 0x0A, 0xFF, 0x0101, 80, 0, 75.0f, 1.0f, { 2900.0f, 1300.0f, 530.0f }, { 2800.0f, 1190.0f, 540.0f } }, { 0x0F, 0xFF, 0x0000, 10, 0, 75.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 306a460d3..844e301a9 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -4648,7 +4648,11 @@ void func_8083A0F4(GlobalContext* globalCtx, Player* this) { anim = D_80853914[PLAYER_ANIMGROUP_13][this->modelAnimType]; } - func_80832264(globalCtx, this, anim); + if (CVar_GetS32("gFasterHeavyBlockLift", 0) && interactActorId == ACTOR_BG_HEAVY_BLOCK) { + LinkAnimation_PlayOnceSetSpeed(globalCtx, &this->skelAnime, anim, 3.0f); + } else { + LinkAnimation_PlayOnce(globalCtx, &this->skelAnime, anim); + } } } else {