diff --git a/src/d_player.h b/src/d_player.h index 5fa9c3906..543bd316c 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -806,6 +806,7 @@ struct player_t UINT8 flamelength; // Flame Shield dash meter, number of segments UINT16 counterdash; // Flame Shield boost without the flame, largely. Used in places where awarding thrust would affect player control. + UINT16 neutraldash; // Neutral drifting is marginally faster. UINT16 ballhogcharge; // Ballhog charge up -- the higher this value, the more projectiles boolean ballhogtap; // Ballhog released during charge: used to allow semirapid tapfire diff --git a/src/k_kart.c b/src/k_kart.c index 063024c3c..1ef687a53 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3648,6 +3648,17 @@ static void K_GetKartBoostPower(player_t *player) ADDBOOST(player->vortexBoost/6, FRACUNIT/10, 0); // + ???% top speed, + 10% acceleration, +0% handling } + if (player->neutraldash) // Neutral drifts are marginally faster + { + ADDBOOST( + FRACUNIT/5, // + 20% top speed + FRACUNIT/4, // + 25% acceleration + 0 // 0 handling + ); + numboosts--; // No afterimage! + } + + if (player->trickcharge) { // NB: This is an acceleration-only boost. @@ -9353,6 +9364,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->counterdash) player->counterdash--; + if (abs(player->drift)==5 && player->cmd.turning == 0) + player->neutraldash = min(player->neutraldash + 1, 1 + player->kartweight/2); + else if (player->neutraldash) + player->neutraldash--; + if ((player->sneakertimer || player->panelsneakertimer) && player->wipeoutslow > 0 && player->wipeoutslow < wipeoutslowtime+1) player->wipeoutslow = wipeoutslowtime+1; @@ -11162,6 +11178,14 @@ INT16 K_GetKartTurnValue(const player_t *player, INT16 turnvalue) } else { + if (player->driftcharge > 0 && (turnvalue > 0) == (player->drift > 0)) // If drifting and turning inward, then... + { + // Apply a progressive handling boost, stronger for higher weight, + // as you charge driftsparks. Reduces reliance on brakedrifting, especially G2! + fixed_t eggfactor = Easing_InCubic(player->kartweight * FRACUNIT / 9, 0, FRACUNIT/4); + turnfixed = FixedMul(turnfixed, FRACUNIT + (player->driftcharge * eggfactor / K_GetKartDriftSparkValue(player))); + } + // If we're drifting we have a completely different turning value fixed_t countersteer = FixedDiv(turnfixed, KART_FULLTURN * FRACUNIT); return K_GetKartDriftValue(player, countersteer); diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 56636fd19..d9fcf13ee 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -466,6 +466,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->flamedash); else if (fastcmp(field,"counterdash")) lua_pushinteger(L, plr->counterdash); + else if (fastcmp(field,"neutraldash")) + lua_pushinteger(L, plr->neutraldash); else if (fastcmp(field,"flamemeter")) lua_pushinteger(L, plr->flamemeter); else if (fastcmp(field,"flamelength")) @@ -1070,6 +1072,8 @@ static int player_set(lua_State *L) plr->flamedash = luaL_checkinteger(L, 3); else if (fastcmp(field,"counterdash")) plr->counterdash = luaL_checkinteger(L, 3); + else if (fastcmp(field,"neutraldash")) + plr->neutraldash = luaL_checkinteger(L, 3); else if (fastcmp(field,"flamemeter")) plr->flamemeter = luaL_checkinteger(L, 3); else if (fastcmp(field,"flamelength")) diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 51a1a94b9..030e3c1ab 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -530,6 +530,7 @@ static void P_NetArchivePlayers(savebuffer_t *save) WRITEUINT8(save->p, players[i].bubbleblowup); WRITEUINT16(save->p, players[i].flamedash); WRITEUINT16(save->p, players[i].counterdash); + WRITEUINT16(save->p, players[i].neutraldash); WRITEUINT16(save->p, players[i].flamemeter); WRITEUINT8(save->p, players[i].flamelength); @@ -1165,6 +1166,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save) players[i].bubbleblowup = READUINT8(save->p); players[i].flamedash = READUINT16(save->p); players[i].counterdash = READUINT16(save->p); + players[i].neutraldash = READUINT16(save->p); players[i].flamemeter = READUINT16(save->p); players[i].flamelength = READUINT8(save->p);