diff --git a/include/dusk/settings.h b/include/dusk/settings.h index b822a2ffbb..582c5a1872 100644 --- a/include/dusk/settings.h +++ b/include/dusk/settings.h @@ -35,6 +35,7 @@ struct UserSettings { int damageMultiplier; bool instantDeath; bool fastClimbing; + bool fastTears; // Preferences bool enableMirrorMode; diff --git a/src/d/actor/d_a_e_ym.cpp b/src/d/actor/d_a_e_ym.cpp index a5544b4041..758bec6269 100644 --- a/src/d/actor/d_a_e_ym.cpp +++ b/src/d/actor/d_a_e_ym.cpp @@ -16,6 +16,8 @@ #include "f_op/f_op_camera_mng.h" #include +#include "dusk/settings.h" + class daE_YM_HIO_c: public JORReflexible { public: daE_YM_HIO_c(); @@ -1066,7 +1068,11 @@ void daE_YM_c::executeDown() { } if (mAcch.ChkGroundHit()) { if (mFlyType != 1) { + #if TARGET_PC + bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 2.0f : 1.0f); + #else bckSet(6, 0, 0.0f, 1.0f); + #endif } if (mMode == 1) { mSound.startCreatureSound(Z2SE_EN_YM_LAND, 0, -1); @@ -1086,7 +1092,11 @@ void daE_YM_c::executeDown() { if (current.pos.y < gnd_cross) { mSound.startCreatureSound(Z2SE_CM_BODYFALL_WATER_M, 0, -1); mSound.startCreatureSound(Z2SE_EN_YM_MOGAKU, 0, -1); + #if TARGET_PC + bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 2.0f : 1.0f); + #else bckSet(6, 0, 0.0f, 1.0f); + #endif speedF = 0.0f; speed.y = gravity = 0.0f; current.pos.y = gnd_cross; @@ -1102,8 +1112,13 @@ void daE_YM_c::executeDown() { f32 gnd_cross_2 = dComIfG_Bgsp().GroundCross(&gnd_chk); if (gnd_cross_2 == -G_CM3D_F_INF || std::abs(gnd_cross_2 - current.pos.y) > 1000.0f || dComIfG_Bgsp().GetGroundCode(gnd_chk) == 4 || dComIfG_Bgsp().GetGroundCode(gnd_chk) == 10 - || dComIfG_Bgsp().GetGroundCode(gnd_chk) == 5) { + || dComIfG_Bgsp().GetGroundCode(gnd_chk) == 5) + { + #if TARGET_PC + bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 2.0f : 1.0f); + #else bckSet(6, 0, 0.0f, 1.0f); + #endif mMode = 3; speedF = 0.0f; shape_angle.x = -0x8000; diff --git a/src/d/actor/d_a_obj_drop.cpp b/src/d/actor/d_a_obj_drop.cpp index 64fc1f537d..275a3d6e12 100644 --- a/src/d/actor/d_a_obj_drop.cpp +++ b/src/d/actor/d_a_obj_drop.cpp @@ -20,6 +20,8 @@ #include "d/actor/d_a_e_ymb.h" #include "f_op/f_op_camera_mng.h" +#include "dusk/settings.h" + #if DEBUG daObjDrop_HIO_c l_HIO; #endif @@ -261,8 +263,18 @@ int daObjDrop_c::modeParentWait() { } mModeAction = 1; + +#if TARGET_PC + mModeTimer = dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 20 : 40; + if (dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0) { + current.pos.y += 100.0f; + } else { + current.pos.y += 300.0f; + } +#else mModeTimer = 40; current.pos.y += 300.0f; +#endif mSound.startSound(Z2SE_OBJ_LIGHTDROP_APPEAR, 0, -1); break; case 1: @@ -272,7 +284,11 @@ int daObjDrop_c::modeParentWait() { break; case 2: createBodyEffect(); +#if TARGET_PC + mModeTimer = dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 5 : 45; +#else mModeTimer = 45; +#endif mModeAction = 0; setMode(MODE_WAIT_e); break; @@ -281,6 +297,18 @@ int daObjDrop_c::modeParentWait() { return 1; } +#if TARGET_PC +static inline BOOL checkGetCargoRide() { + if ((daPy_getPlayerActorClass()->checkCargoCarry() && strcmp(dComIfGp_getStartStageName(), "F_SP112") == 0) || + dComIfGs_isLightDropGetFlag(dComIfGp_getStartStageDarkArea())) + { + return true; + } + + return false; +} +#endif + int daObjDrop_c::modeWait() { daPy_py_c* pplayer = daPy_getPlayerActorClass(); @@ -302,7 +330,32 @@ int daObjDrop_c::modeWait() { case 1: case 2: case 50: + #if TARGET_PC + if (dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0) { + f32 player_dist = current.pos.abs(daPy_getPlayerActorClass()->current.pos); + f32 home_dist = current.pos.abs(home.pos); + + if (checkGetCargoRide() && player_dist < 1000.0f) { + mTargetPos = pplayer->current.pos; + mTargetPos.y += 100.0f; + + f32 temp = 3000.0f - home_dist; + if (temp < 0.0f) { + temp = 0.0f; + } + + cLib_chaseF(&speedF, (temp / 3000.0f) * 10.0f * (temp / 3000.0f), 1.0f); + } else { + mTargetPos = home.pos; + cLib_chaseF(&speedF, 2.0f, 0.5f); + } + } else { + cLib_chaseF(&speedF, 7.5f, 0.4f); + } + #else cLib_chaseF(&speedF, 7.5f, 0.4f); + #endif + if (mModeAction == 1) { cLib_chasePos(¤t.pos, mTargetPos, speedF); } diff --git a/src/dusk/imgui/ImGuiMenuEnhancements.cpp b/src/dusk/imgui/ImGuiMenuEnhancements.cpp index 1ccb06e202..cf7fcc41d7 100644 --- a/src/dusk/imgui/ImGuiMenuEnhancements.cpp +++ b/src/dusk/imgui/ImGuiMenuEnhancements.cpp @@ -37,6 +37,11 @@ namespace dusk { ImGui::SetTooltip("Quicker climbing on ladders and vines like the HD version"); } + ImGui::Checkbox("Faster Tears of Light", &getSettings().game.fastTears); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Tears of Light dropped by Shadow Insects pop out faster like the HD version"); + } + ImGui::Checkbox("Hide TV Settings Screen", &getSettings().game.hideTvSettingsScreen); if (ImGui::IsItemHovered()) { ImGui::SetTooltip("Hides the TV calibration screen shown when loading a save"); diff --git a/src/dusk/imgui/ImGuiSaveEditor.cpp b/src/dusk/imgui/ImGuiSaveEditor.cpp index ff04b1f1a2..a9cca636f8 100644 --- a/src/dusk/imgui/ImGuiSaveEditor.cpp +++ b/src/dusk/imgui/ImGuiSaveEditor.cpp @@ -823,7 +823,7 @@ namespace dusk { for (int e = 0; e < 255; e++) { ImGui::Text("%03d ", e); ImGui::SameLine(); - for (int i = 8; i >= 0; i--) { + for (int i = 7; i >= 0; i--) { bool flag = event.mEvent[e] & (1 << i); if (ImGui::Checkbox(fmt::format("##event{0}{1}", e, i).c_str(), &flag)) { if (flag) diff --git a/src/dusk/settings.cpp b/src/dusk/settings.cpp index a8a4d219a9..ea17eef374 100644 --- a/src/dusk/settings.cpp +++ b/src/dusk/settings.cpp @@ -31,6 +31,7 @@ UserSettings g_userSettings = { .damageMultiplier = 1, .instantDeath = false, .fastClimbing = false, + .fastTears = false, // Preferences .enableMirrorMode = false,