From a74ffb0b5b5d994f002ae39a1f5a44d3bc8ebccf Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 29 Jun 2026 18:13:17 +0200 Subject: [PATCH] toggable sound effect for stair jank not the biggest fan of it but idk how to make this better on stairs with lots of steps so this will do for now --- src/g_game.h | 1 + src/k_kart.c | 3 ++- src/m_menudefs.c | 35 ++++++++++++++++++++++++----------- src/p_map.c | 8 ++++++-- src/r_main.cpp | 1 + 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/g_game.h b/src/g_game.h index 4f46ef89d..6b2fae46d 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -119,6 +119,7 @@ extern consvar_t cv_gravstretch; extern consvar_t cv_sloperoll; extern consvar_t cv_sliptideroll; extern consvar_t cv_stairjank; +extern consvar_t cv_stairjanksfx; extern consvar_t cv_slamsound; extern consvar_t cv_sloperolldist; extern consvar_t cv_sparkroll; diff --git a/src/k_kart.c b/src/k_kart.c index 6cbb7bdf7..e1e8f9f41 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -110,7 +110,8 @@ static CV_PossibleValue_t sloperoll_cons_t[] = {{0, "Off"}, {1, "Players"}, {2, consvar_t cv_sloperoll = {"sloperoll", "Off", CV_SAVE|CV_CALL, sloperoll_cons_t, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_sparkroll = {"sparkroll", "Off", CV_SAVE|CV_CALL, CV_OnOff, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_sliptideroll = {"sliptideroll", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_stairjank = {"stairjank", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_stairjank = {"stairjank", "Off", CV_SAVE|CV_CALL, CV_OnOff, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_stairjanksfx = {"stairjanksfx", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; //hardcode saltyhop mhhm static void saltyhop_onchange(void); diff --git a/src/m_menudefs.c b/src/m_menudefs.c index 7eecdb0f6..72d3ab2f5 100644 --- a/src/m_menudefs.c +++ b/src/m_menudefs.c @@ -1791,20 +1791,22 @@ static menuitem_t OP_PlayerDistortMenu[] = {IT_STRING | IT_CVAR, NULL, "Rotate Players when Sliptiding", &cv_sliptideroll, 25}, {IT_STRING | IT_CVAR, NULL, "Stair Janking Effect", &cv_stairjank, 30}, - {IT_STRING | IT_CVAR, NULL, "Rotate Sparks and Boost Trails", &cv_sparkroll, 35}, - {IT_STRING | IT_CVAR, NULL, "Rotate Bananas on Throw", &cv_bananthrowroll, 40}, + {IT_STRING | IT_CVAR, NULL, "Stair Janking Sound Effect", &cv_stairjanksfx, 35}, // idk if that should be here but i dont care atm - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Player Stretch Factor", &cv_gravstretch, 50}, - {IT_STRING | IT_CVAR, NULL, "Squish Sound Effect", &cv_slamsound, 55}, + {IT_STRING | IT_CVAR, NULL, "Rotate Sparks and Boost Trails", &cv_sparkroll, 40}, + {IT_STRING | IT_CVAR, NULL, "Rotate Bananas on Throw", &cv_bananthrowroll, 45}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop", &cv_saltyhop, 65}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saltyhop Height", &cv_saltyheight, 70}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop Sound Effect", &cv_saltyhopsfx, 75}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop Squish", &cv_saltysquish, 80}, - {IT_STRING | IT_CVAR, NULL, "Saltyhop Roll", &cv_saltyroll, 85}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Player Stretch Factor", &cv_gravstretch, 55}, + {IT_STRING | IT_CVAR, NULL, "Squish Sound Effect", &cv_slamsound, 60}, - {IT_STRING | IT_CVAR, NULL, "Squishdance", &cv_squishdance, 95}, - {IT_STRING | IT_CVAR, NULL, "Squishdance Speed", &cv_squishdancespeed, 101}, // why is this offset by 6? idk cant remember lulul + {IT_STRING | IT_CVAR, NULL, "Saltyhop", &cv_saltyhop, 70}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Saltyhop Height", &cv_saltyheight, 75}, + {IT_STRING | IT_CVAR, NULL, "Saltyhop Sound Effect", &cv_saltyhopsfx, 80}, + {IT_STRING | IT_CVAR, NULL, "Saltyhop Squish", &cv_saltysquish, 85}, + {IT_STRING | IT_CVAR, NULL, "Saltyhop Roll", &cv_saltyroll, 90}, + + {IT_STRING | IT_CVAR, NULL, "Squishdance", &cv_squishdance, 100}, + {IT_STRING | IT_CVAR, NULL, "Squishdance Speed", &cv_squishdancespeed, 106}, // why is this offset by 6? idk cant remember lulul }; static const char* OP_PlayerDistortTooltips[] = @@ -1814,6 +1816,7 @@ static const char* OP_PlayerDistortTooltips[] = "Distance object rotation should be visable.", "Player rotation when sliptiding.", "Slightly tilt the player when driving over stairs or small bumps.", + "Sound effect when driving over stairs or small bumps.", "Rotation of a player's boost trails and drift sparks.", "Should banans rotate when thrown?\nAnd should they stay rotated when on the ground?", "Player squash and stretch.", @@ -1834,6 +1837,7 @@ enum slrotatedist, sliptide, stairjank, + stairjanksfx, sparkrotate, bananrotat, stretchyplayer, @@ -2742,6 +2746,15 @@ void PDistort_menu_Onchange(void) OP_PlayerDistortMenu[slrotatedist].status = IT_GRAYEDOUT; OP_PlayerDistortMenu[saltroll].status = IT_GRAYEDOUT; } + + if (cv_stairjank.value) + { + OP_PlayerDistortMenu[stairjanksfx].status = IT_STRING | IT_CVAR; + } + else + { + OP_PlayerDistortMenu[stairjanksfx].status = IT_GRAYEDOUT; + } } void Bird_menu_Onchange(void) diff --git a/src/p_map.c b/src/p_map.c index 77af3287b..02b2a3c7a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2594,10 +2594,14 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) { /* use a shorter sound if not two tics have passed * since the last step */ - //S_ReducedVFXSound(thing, (thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268), NULL); - //S_StartSound(thing, (thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268)); + //S_ReducedVFXSound(thing, (thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268), NULL); + //S_StartSound(thing, (thing->player->stairjank >= 16 ? sfx_s23b : sfx_s268)); // sound does not work out all that well for kart maps + // best i can do... + if (cv_stairjanksfx.value) + S_StartSoundAtVolume(thing, (thing->player->stairjank >= 8 ? sfx_s23b : sfx_s268), 192); // dont blast this at full volume lul + // TODO: maybe spawn smol dust effect similar to RR? /*if (!thing->player->stairjank) { diff --git a/src/r_main.cpp b/src/r_main.cpp index c4719e2e5..038fa8a6a 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -1601,6 +1601,7 @@ void R_RegisterEngineStuff(void) CV_RegisterVar(&cv_sloperolldist); CV_RegisterVar(&cv_sparkroll); CV_RegisterVar(&cv_stairjank); + CV_RegisterVar(&cv_stairjanksfx); CV_RegisterVar(&cv_showhud); CV_RegisterVar(&cv_translucenthud);