From 92d07dd680dee45d532c9dbfcbb3d0c0968ecb22 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 5 Jul 2026 21:35:52 +0200 Subject: [PATCH] changes to some saturn specific visual effects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit most of those were added cause they´re cool to look at, but without much thought about potentially giving players that enable such features an "unfair" advantage over others. - eggboxes wont be rotated while stationary and on the ground anymore (they are meant to deceive players, being rotated makes them stand out alot!) - players that are about to explode due to eggboxes wont spawn extra red speedlines anymore - option to show driftlevel per speedlines has been removed --- src/k_kart.c | 78 ++++++++++++---------------------------------------- src/p_mobj.c | 8 +++++- 2 files changed, 24 insertions(+), 62 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 6a9ab79ea..9539f1b29 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -77,7 +77,7 @@ static inline angle_t K_MomentumAngle(const mobj_t *mo, const fixed_t threshold) } // extra colourisation stuff -static CV_PossibleValue_t colorspeedlines_cons_t[] = {{0, "Off"}, {1, "Normal"}, {2, "+Driftcharge"}, {3, "Drift only"}, {0, NULL}}; +static CV_PossibleValue_t colorspeedlines_cons_t[] = {{0, "Off"}, {1, "On"}, {0, NULL}}; consvar_t cv_coloredspeedlines = {"colorizedspeedlines", "Off", CV_SAVE, colorspeedlines_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_coloredsneakertrail = {"sneakertrailcolor", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -3572,13 +3572,14 @@ static INT32 K_StairJankFlip(INT32 value) // if not cv_bananthrowroll option "+Onground" static void K_ResetBananaRollangle(mobj_t* mo) { - if (cv_bananthrowroll.value != 1) - return; - if (!mo->rollangle) return; - if (mo->type != MT_BANANA && mo->type != MT_EGGMANITEM) + if (mo->type != MT_BANANA && mo->type != MT_EGGMANITEM) // always reset eggboxes + return; + + // keep banans "rotated" if we want them to + if (mo->type == MT_BANANA && cv_bananthrowroll.value == 2) return; // only reset if on ground @@ -5567,59 +5568,15 @@ boolean K_PlayerEffectsShouldBlend(player_t *player) return false; } -static UINT8 K_GetSpeedLineColor(player_t *player, boolean colorSpeed) +FUNCINLINE static ATTRINLINE void K_SpawnNormalSpeedLines(player_t *player) { - UINT8 speedcolor = SKINCOLOR_NONE; - const UINT8 playercolor = player->mo->color; - - if (colorSpeed) - { - if (cv_coloredspeedlines.value != 3) - speedcolor = playercolor; - - if (cv_coloredspeedlines.value >= 2 && player->kartstuff[k_driftboost]) - { - if (player->kartstuff[k_driftboost] <= 20) - speedcolor = SKINCOLOR_SAPPHIRE; - else if (player->kartstuff[k_driftboost] <= 50) - speedcolor = SKINCOLOR_RASPBERRY; - else if (player->kartstuff[k_driftboost] <= 125) - speedcolor = K_RainbowColor(); - - if (cv_coloredspeedlines.value == 2) - speedcolor = (leveltime & 1) ? playercolor : speedcolor; - } - } - - if (cv_coloredspeedlines.value != 3) - { - if (player->kartstuff[k_eggmanexplode]) - { - // Make it red when you have the eggman speed boost - speedcolor = SKINCOLOR_RED; - } - else if (player->kartstuff[k_invincibilitytimer]) - { - speedcolor = playercolor; - } - } - - return speedcolor; -} - -typedef INT32 (*randomFunc)(INT32 min, INT32 max); - -FUNCINLINE static ATTRINLINE void K_SpawnNormalSpeedLines(player_t *player, boolean synched) -{ - const randomFunc randomfunc = synched ? P_RandomRange : M_RandomRange; - fixed_t rand_x; fixed_t rand_y; fixed_t rand_z; - rand_z = player->mo->z + (player->mo->height/2) + (randomfunc(-20,20) * player->mo->scale); - rand_y = player->mo->y + (randomfunc(-36,36) * player->mo->scale); - rand_x = player->mo->x + (randomfunc(-36,36) * player->mo->scale); + rand_z = player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale); + rand_y = player->mo->y + (P_RandomRange(-36,36) * player->mo->scale); + rand_x = player->mo->x + (P_RandomRange(-36,36) * player->mo->scale); mobj_t *fast = P_SpawnMobj(rand_x, rand_y, rand_z, MT_FASTLINE); @@ -5627,7 +5584,7 @@ FUNCINLINE static ATTRINLINE void K_SpawnNormalSpeedLines(player_t *player, bool fast->momx = 3*player->mo->momx/4; fast->momy = 3*player->mo->momy/4; fast->momz = 3*player->mo->momz/4; - fast->islocal = !synched; + //fast->islocal = false; P_SetTarget(&fast->target, player->mo); // easier lua access K_MatchGenericExtraFlags(fast, player->mo); @@ -5638,8 +5595,11 @@ FUNCINLINE static ATTRINLINE void K_SpawnNormalSpeedLines(player_t *player, bool if (cv_coloredspeedlines.value) { - fast->color = K_GetSpeedLineColor(player, colorSpeed); - fast->colorized = true; + if (colorSpeed || player->kartstuff[k_invincibilitytimer]) // let invul color them even when players go rather slow + { + fast->color = player->mo->color; + fast->colorized = true; + } } if (colorSpeed && K_PlayerEffectsShouldBlend(player)) @@ -5668,11 +5628,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) // Speed lines if ((player->kartstuff[k_sneakertimer] || player->kartstuff[k_driftboost] || player->kartstuff[k_startboost]) && player->speed > 0) { - K_SpawnNormalSpeedLines(player, true); - } - else if ((cv_coloredspeedlines.value == 1 || cv_coloredspeedlines.value == 2) && player->kartstuff[k_eggmanexplode]) // gotta love the speedlines calling synched rng :chaosleep: - { - K_SpawnNormalSpeedLines(player, false); + K_SpawnNormalSpeedLines(player); } if (player->playerstate == PST_DEAD || player->kartstuff[k_respawn] > 1) // Ensure these are set correctly here diff --git a/src/p_mobj.c b/src/p_mobj.c index 66e673245..684f9d05a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7319,6 +7319,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) boolean grounded = P_IsObjectOnGround(mobj); //P_MobjCheckWaterVisual(mobj); + // rotate thrown eggboxes and bananas mid air! if (cv_bananthrowroll.value && !grounded) { // tilt n tumble @@ -7341,7 +7342,12 @@ static boolean P_MobjRegularThink(mobj_t *mobj) //P_SpawnItemLandDust(mobj); } - P_RollPitchMobj(mobj); + // do not rotate eggman items on slopes + // they are meant to deceive the player + // having them rotated makes them stand out a lot more + // since random items do not roll´n pitch on slopes! + if (mobj->type == MT_BANANA) + P_RollPitchMobj(mobj); if (mobj->threshold > 0) mobj->threshold--;