From 1be9b16f3a4fd697dfc6ed12ec815f7bdaa3036e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 31 Aug 2018 00:05:46 -0400 Subject: [PATCH] Scale the speed of SA dash pads with higher scales Also, added a define for GROWNEVERMISSES, which fixes every single jump with Grow but with feels terrible. --- src/p_slopes.c | 14 ++++++++++++++ src/p_spec.c | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/src/p_slopes.c b/src/p_slopes.c index dd737204c..a9706eb9e 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -778,6 +778,10 @@ void P_ReverseQuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope) slope->zangle = InvAngle(slope->zangle); } +// SRB2Kart: This fixes all slope-based jumps for different scales in Kart automatically without map tweaking. +// However, they will always feel off every single time... see for yourself: https://cdn.discordapp.com/attachments/270211093761097728/484924392128774165/kart0181.gif +//#define GROWNEVERMISSES + // // P_SlopeLaunch // @@ -786,6 +790,10 @@ void P_SlopeLaunch(mobj_t *mo) { if (!(mo->standingslope->flags & SL_NOPHYSICS)) // If there's physics, time for launching. { +#ifdef GROWNEVERMISSES + const fixed_t xyscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - mo->scale); + const fixed_t zscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - mo->scale); +#endif // Double the pre-rotation Z, then halve the post-rotation Z. This reduces the // vertical launch given from slopes while increasing the horizontal launch // given. Good for SRB2's gravity and horizontal speeds. @@ -795,9 +803,15 @@ void P_SlopeLaunch(mobj_t *mo) slopemom.z = mo->momz; P_QuantizeMomentumToSlope(&slopemom, mo->standingslope); +#ifdef GROWNEVERMISSES + mo->momx = FixedMul(slopemom.x, xyscale); + mo->momy = FixedMul(slopemom.y, xyscale); + mo->momz = FixedMul(slopemom.z, zscale); +#else mo->momx = slopemom.x; mo->momy = slopemom.y; mo->momz = slopemom.z; +#endif } //CONS_Printf("Launched off of slope.\n"); diff --git a/src/p_spec.c b/src/p_spec.c index 57f5659a6..3ad529c41 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3813,6 +3813,11 @@ DoneSection2: player->mo->angle = lineangle; + // SRB2Kart: Scale the speed you get from them! + // This is scaled differently from other horizontal speed boosts from stuff like springs, because of how this is used for some ramp jumps. + if (player->mo->scale > mapheaderinfo[gamemap-1]->mobj_scale) + linespeed = FixedMul(linespeed, mapheaderinfo[gamemap-1]->mobj_scale + (player->mo->scale - mapheaderinfo[gamemap-1]->mobj_scale)); + if (!demoplayback || P_AnalogMove(player)) { if (player == &players[consoleplayer])