diff --git a/src/d_player.h b/src/d_player.h index c62494b51..0d412e9c3 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -698,6 +698,7 @@ struct player_t INT32 nullHitlag; // Numbers of tics of hitlag that will ultimately be ignored by subtracting from hitlag UINT8 wipeoutslow; // Timer before you slowdown when getting wiped out UINT8 justbumped; // Prevent players from endlessly bumping into each other + UINT8 noEbrakeMagnet; // Briefly disable 2.2 responsive ebrake if you're bumped by another player. UINT8 tumbleBounces; UINT16 tumbleHeight; // In *mobjscaled* fracunits, or mfu, not raw fu UINT8 justDI; // Turn-lockout timer to briefly prevent unintended turning after DI, resets when actionable or no input diff --git a/src/doomstat.h b/src/doomstat.h index 38902b1d1..a94d0de82 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -797,6 +797,7 @@ extern INT32 itemtime; extern INT32 bubbletime; extern INT32 comebacktime; extern INT32 bumptime; +extern INT32 ebraketime; extern INT32 greasetics; extern INT32 wipeoutslowtime; extern INT32 wantedreduce; diff --git a/src/g_game.c b/src/g_game.c index 079b7bbab..c946f3eb0 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -265,6 +265,7 @@ INT32 itemtime = 8*TICRATE; INT32 bubbletime = TICRATE/2; INT32 comebacktime = 3*TICRATE; INT32 bumptime = 6; +INT32 ebraketime = TICRATE; INT32 greasetics = 3*TICRATE; INT32 wipeoutslowtime = 20; INT32 wantedreduce = 5*TICRATE; diff --git a/src/k_kart.c b/src/k_kart.c index d14da36f3..f7d7eef9f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -840,6 +840,7 @@ static void K_PlayerJustBumped(player_t *player) } player->justbumped = bumptime; + player->noEbrakeMagnet = ebraketime; player->spindash = 0; // If spinouttimer is not set yet but could be set later, @@ -983,12 +984,14 @@ boolean K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2) if (mobj1->player && mobj1->player->justbumped && !K_JustBumpedException(mobj2)) { mobj1->player->justbumped = bumptime; + mobj1->player->noEbrakeMagnet = ebraketime; return false; } if (mobj2->player && mobj2->player->justbumped && !K_JustBumpedException(mobj1)) { mobj2->player->justbumped = bumptime; + mobj2->player->noEbrakeMagnet = ebraketime; return false; } @@ -3369,7 +3372,17 @@ fixed_t K_GetSpindashChargeSpeed(const player_t *player) // more speed for higher weight & speed // Tails = +16.94%, Fang = +34.94%, Mighty = +34.94%, Metal = +43.61% // (can be higher than this value when overcharged) - const fixed_t val = (10*FRACUNIT/277) + (((player->kartspeed + player->kartweight) + 2) * FRACUNIT) / 45; + + // The above comment is now strictly incorrect and I can't be assed to do the math properly. + // 2.2 introduces a power fudge to compensate for the removal of spindash overcharge. -Tyron + fixed_t val = (10*FRACUNIT/277) + (((player->kartspeed + player->kartweight) + 2) * FRACUNIT) / 45; + + // 2.2 - Improved Spindash + if (!G_CompatLevel(0x000A)) + { + if (gametyperules & GTR_CIRCUIT) + val = 5 * val / 4; + } // Old behavior before desperation spindash // return (gametyperules & GTR_CLOSERPLAYERS) ? (4 * val) : val; @@ -9146,6 +9159,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->justbumped > 0) player->justbumped--; + if (player->noEbrakeMagnet > 0) + player->noEbrakeMagnet--; + if (player->defenseLockout) { player->instaWhipCharge = 0; @@ -11788,6 +11804,18 @@ static void K_KartSpindash(player_t *player) player->pflags &= ~PF_NOFASTFALL; return; } + else + { + // 2.2 - More responsive ebrake + if (!G_CompatLevel(0x000A)) + { + if (player->noEbrakeMagnet == 0 && (FixedHypot(player->mo->momx, player->mo->momy) < 20*player->mo->scale)) + { + P_Thrust(player->mo, K_MomentumAngleReal(player->mo) + ANGLE_180, FixedHypot(player->mo->momx, player->mo->momy)/8); + } + } + + } // Handle fast falling behaviors first. if (player->respawn.state != RESPAWNST_NONE) @@ -11861,7 +11889,17 @@ static void K_KartSpindash(player_t *player) // Intentionally a lop-sided trade-off, so the game doesn't become // Funky Kong's Ring Racers. - P_PlayerRingBurst(player, 1); + // 2.2 - No extended ring debt for recovery spindash + if (G_CompatLevel(0x000A)) + { + P_PlayerRingBurst(player, 1); + } + else + { + if (player->rings > 0) + P_PlayerRingBurst(player, 1); + } + } if (chargetime > 0) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index e3ecb502a..d7d1773c7 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -250,6 +250,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->wipeoutslow); else if (fastcmp(field,"justbumped")) lua_pushinteger(L, plr->justbumped); + else if (fastcmp(field,"noebrakemagnet")) + lua_pushinteger(L, plr->noEbrakeMagnet); else if (fastcmp(field,"tumblebounces")) lua_pushinteger(L, plr->tumbleBounces); else if (fastcmp(field,"tumbleheight")) @@ -802,6 +804,8 @@ static int player_set(lua_State *L) plr->wipeoutslow = luaL_checkinteger(L, 3); else if (fastcmp(field,"justbumped")) plr->justbumped = luaL_checkinteger(L, 3); + else if (fastcmp(field,"noebrakemagnet")) + plr->noEbrakeMagnet = luaL_checkinteger(L, 3); else if (fastcmp(field,"tumblebounces")) plr->tumbleBounces = luaL_checkinteger(L, 3); else if (fastcmp(field,"tumbleheight")) diff --git a/src/p_saveg.c b/src/p_saveg.c index 4dab0507b..1861bf40c 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -434,6 +434,7 @@ static void P_NetArchivePlayers(savebuffer_t *save) WRITEINT32(save->p, players[i].nullHitlag); WRITEUINT8(save->p, players[i].wipeoutslow); WRITEUINT8(save->p, players[i].justbumped); + WRITEUINT8(save->p, players[i].noEbrakeMagnet); WRITEUINT8(save->p, players[i].tumbleBounces); WRITEUINT16(save->p, players[i].tumbleHeight); @@ -1032,6 +1033,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save) players[i].nullHitlag = READINT32(save->p); players[i].wipeoutslow = READUINT8(save->p); players[i].justbumped = READUINT8(save->p); + players[i].noEbrakeMagnet = READUINT8(save->p); players[i].tumbleBounces = READUINT8(save->p); players[i].tumbleHeight = READUINT16(save->p);