Merge branch 'my-son-is-still-useless' into 'master'

Stat rebalance nightmare vortex

See merge request KartKrew/Kart!2053
This commit is contained in:
AJ Martinez 2024-03-10 07:20:04 +00:00
commit bd2573cfa9
3 changed files with 41 additions and 14 deletions

View file

@ -690,8 +690,8 @@ struct player_t
SINT8 drift; // (-5 to 5) - Drifting Left or Right, plus a bigger counter = sharper turn SINT8 drift; // (-5 to 5) - Drifting Left or Right, plus a bigger counter = sharper turn
fixed_t driftcharge; // Charge your drift so you can release a burst of speed fixed_t driftcharge; // Charge your drift so you can release a burst of speed
UINT8 driftboost; // (0 to 125) - Boost you get from drifting UINT16 driftboost; // (0 to 125 baseline) - Boost you get from drifting
UINT8 strongdriftboost; // (0 to 125) - While active, boost from drifting gives a stronger speed increase UINT16 strongdriftboost; // (0 to 125) - While active, boost from drifting gives a stronger speed increase
UINT16 gateBoost; // Juicebox Manta Ring boosts UINT16 gateBoost; // Juicebox Manta Ring boosts
UINT8 gateSound; // Sound effect combo UINT8 gateSound; // Sound effect combo

View file

@ -1210,8 +1210,10 @@ static void K_UpdateOffroad(player_t *player)
// If you are in offroad, a timer starts. // If you are in offroad, a timer starts.
if (offroadstrength) if (offroadstrength)
{ {
UINT8 offramp = (gamespeed == KARTSPEED_HARD ? 2 : 1);
if (player->offroad < offroadstrength) if (player->offroad < offroadstrength)
player->offroad += offroadstrength / TICRATE; player->offroad += offroadstrength * offramp / TICRATE;
if (player->offroad > offroadstrength) if (player->offroad > offroadstrength)
player->offroad = offroadstrength; player->offroad = offroadstrength;
@ -2875,6 +2877,8 @@ boolean K_SlopeResistance(const player_t *player)
tripwirepass_t K_TripwirePassConditions(const player_t *player) tripwirepass_t K_TripwirePassConditions(const player_t *player)
{ {
UINT8 tripwirereq = player->offroad ? 3 : 2;
if ( if (
player->invincibilitytimer || player->invincibilitytimer ||
player->sneakertimer player->sneakertimer
@ -2883,7 +2887,7 @@ tripwirepass_t K_TripwirePassConditions(const player_t *player)
if ( if (
player->flamedash || player->flamedash ||
(player->speed > 2 * K_GetKartSpeed(player, false, false) && player->tripwireReboundDelay == 0) (player->speed > (tripwirereq * K_GetKartSpeed(player, false, false)) && player->tripwireReboundDelay == 0)
) )
return TRIPWIRE_BOOST; return TRIPWIRE_BOOST;
@ -3373,8 +3377,13 @@ static void K_GetKartBoostPower(player_t *player)
if (player->driftboost) // Drift Boost if (player->driftboost) // Drift Boost
{ {
// Rebuff Eggman's stat block corner // Rebuff Eggman's stat block corner
const INT32 heavyAccel = ((9 - player->kartspeed) * 2) + (player->kartweight - 1); // const INT32 heavyAccel = ((9 - player->kartspeed) * 2) + (player->kartweight - 1);
const fixed_t heavyAccelBonus = FRACUNIT + ((heavyAccel * maxmetabolismincrease * 2) / 24); // const fixed_t heavyAccelBonus = FRACUNIT + ((heavyAccel * maxmetabolismincrease * 2) / 24);
// hello commit from 18 months ago, The Situation Has Changed.
// We buffed rings so many times that weight needs a totally different class of change!
// I've left the old formulas in, in case I'm smoking dick, but this was sorely needed in TA especially.
const fixed_t herbalfolkmedicine = FRACUNIT + FRACUNIT*(player->kartweight-1)/12 + FRACUNIT*(8-player->kartspeed)/32;
fixed_t driftSpeed = FRACUNIT/4; // 25% base fixed_t driftSpeed = FRACUNIT/4; // 25% base
@ -3385,7 +3394,10 @@ static void K_GetKartBoostPower(player_t *player)
} }
// Bottom-left bonus // Bottom-left bonus
driftSpeed = FixedMul(driftSpeed, heavyAccelBonus); // driftSpeed = FixedMul(driftSpeed, heavyAccelBonus);
// Fucking bonus ever
driftSpeed = FixedMul(driftSpeed, herbalfolkmedicine);
ADDBOOST(driftSpeed, 4*FRACUNIT, 0); // + variable top speed, + 400% acceleration, +0% handling ADDBOOST(driftSpeed, 4*FRACUNIT, 0); // + variable top speed, + 400% acceleration, +0% handling
} }
@ -8643,10 +8655,15 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
} }
else if (player->ringboost) else if (player->ringboost)
{ {
// These values can get FUCKED ever since ring-stacking speed changes. // If a Ring Box or Super Ring isn't paying out, aggressively reduce
// If we're not actively being awarded rings, roll off extreme ringboost durations. // extreme ringboost duration. Less aggressive for accel types, so they
// retain more speed for small payouts.
UINT8 roller = TICRATE*2;
roller += 4*(8-player->kartspeed);
if (player->superring == 0) if (player->superring == 0)
player->ringboost -= max((player->ringboost / TICRATE / 2), 1); player->ringboost -= max((player->ringboost / roller), 1);
else else
player->ringboost--; player->ringboost--;
} }
@ -10439,6 +10456,9 @@ static void K_KartDrift(player_t *player, boolean onground)
S_StartSound(player->mo, sfx_s23c); S_StartSound(player->mo, sfx_s23c);
//K_SpawnDashDustRelease(player); //K_SpawnDashDustRelease(player);
// Used to detect useful driftboosts.
UINT8 oldDriftBoost = player->driftboost;
// Airtime means we're not gaining speed. Get grounded! // Airtime means we're not gaining speed. Get grounded!
if (!onground) if (!onground)
player->mo->momz -= player->speed/2; player->mo->momz -= player->speed/2;
@ -10515,6 +10535,13 @@ static void K_KartDrift(player_t *player, boolean onground)
player->trickcharge = 0; player->trickcharge = 0;
player->infinitether = TICRATE*2; player->infinitether = TICRATE*2;
} }
// If you actually used a useful driftboost, adjust the added boost, biasing towards bottom-right.
// Everyone else has speed-retention mechanics they can chain into themselves: Metal needs help!
if (player->driftboost > oldDriftBoost)
{
player->driftboost = (38 + player->kartweight + player->kartspeed) * player->driftboost / 40;
}
} }
// Remove charge // Remove charge

View file

@ -437,8 +437,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITESINT8(save->p, players[i].drift); WRITESINT8(save->p, players[i].drift);
WRITEFIXED(save->p, players[i].driftcharge); WRITEFIXED(save->p, players[i].driftcharge);
WRITEUINT8(save->p, players[i].driftboost); WRITEUINT16(save->p, players[i].driftboost);
WRITEUINT8(save->p, players[i].strongdriftboost); WRITEUINT16(save->p, players[i].strongdriftboost);
WRITEUINT16(save->p, players[i].gateBoost); WRITEUINT16(save->p, players[i].gateBoost);
WRITEUINT8(save->p, players[i].gateSound); WRITEUINT8(save->p, players[i].gateSound);
@ -1025,8 +1025,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].drift = READSINT8(save->p); players[i].drift = READSINT8(save->p);
players[i].driftcharge = READFIXED(save->p); players[i].driftcharge = READFIXED(save->p);
players[i].driftboost = READUINT8(save->p); players[i].driftboost = READUINT16(save->p);
players[i].strongdriftboost = READUINT8(save->p); players[i].strongdriftboost = READUINT16(save->p);
players[i].gateBoost = READUINT16(save->p); players[i].gateBoost = READUINT16(save->p);
players[i].gateSound = READUINT8(save->p); players[i].gateSound = READUINT8(save->p);