mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'sticky-sliptides' into 'master'
Digital-friendly sliptide extensions See merge request KartKrew/Kart!2418
This commit is contained in:
commit
495d875631
6 changed files with 66 additions and 19 deletions
|
|
@ -991,6 +991,7 @@ struct player_t
|
|||
UINT8 ignoreAirtimeLeniency; // We bubblebounced or otherwise did an airtime thing with control, powerup timers should still count down
|
||||
|
||||
fixed_t topAccel; // Reduced on straight wall collisions to give players extra recovery time
|
||||
fixed_t vortexBoost;
|
||||
|
||||
mobj_t *stumbleIndicator;
|
||||
mobj_t *wavedashIndicator;
|
||||
|
|
|
|||
23
src/k_kart.c
23
src/k_kart.c
|
|
@ -3618,6 +3618,11 @@ static void K_GetKartBoostPower(player_t *player)
|
|||
ADDBOOST(6*FRACUNIT/20, FRACUNIT, 0); // + 30% top speed, + 100% acceleration, +0% handling
|
||||
}
|
||||
|
||||
if (player->vortexBoost) // Holding wavedash vortex (assigned in K_UpdateWavedashIndicator!)
|
||||
{
|
||||
ADDBOOST(player->vortexBoost/6, FRACUNIT/10, 0); // + ???% top speed, + 10% acceleration, +0% handling
|
||||
}
|
||||
|
||||
if (player->trickcharge)
|
||||
{
|
||||
// NB: This is an acceleration-only boost.
|
||||
|
|
@ -4749,8 +4754,6 @@ void K_UpdateStumbleIndicator(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
#define MIN_WAVEDASH_CHARGE ((11*TICRATE/16)*9)
|
||||
|
||||
static boolean K_IsLosingWavedash(player_t *player)
|
||||
{
|
||||
if (player->mo == NULL || P_MobjWasRemoved(player->mo) == true)
|
||||
|
|
@ -4781,6 +4784,7 @@ void K_UpdateWavedashIndicator(player_t *player)
|
|||
if (player->wavedashIndicator == NULL || P_MobjWasRemoved(player->wavedashIndicator) == true)
|
||||
{
|
||||
K_InitWavedashIndicator(player);
|
||||
player->vortexBoost = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -4810,6 +4814,15 @@ void K_UpdateWavedashIndicator(player_t *player)
|
|||
else if (max(chargeFrame, decayFrame) < mobj->frame)
|
||||
mobj->frame--;
|
||||
|
||||
if (K_Sliptiding(player))
|
||||
{
|
||||
player->vortexBoost = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->vortexBoost = Easing_InCubic(mobj->frame*FRACUNIT/7, FRACUNIT, 0);
|
||||
}
|
||||
|
||||
mobj->renderflags &= ~RF_TRANSMASK;
|
||||
mobj->renderflags |= RF_PAPERSPRITE;
|
||||
|
||||
|
|
@ -6008,7 +6021,11 @@ static void K_SpawnAIZDust(player_t *player)
|
|||
spark = P_SpawnMobj(newx, newy, player->mo->z, MT_AIZDRIFTSTRAT);
|
||||
|
||||
spark->angle = travelangle+(player->aizdriftstrat*ANGLE_90);
|
||||
P_SetScale(spark, (spark->destscale = (3*player->mo->scale)>>2));
|
||||
P_SetScale(spark, (spark->destscale = (4*player->mo->scale)>>2));
|
||||
|
||||
fixed_t tiltmod = FixedDiv(abs(player->aizdrifttilt), ANGLE_22h);
|
||||
spark->destscale = FixedMul(spark->destscale, tiltmod);
|
||||
spark->scale = FixedMul(spark->scale, tiltmod);
|
||||
|
||||
spark->momx = (6*player->mo->momx)/5;
|
||||
spark->momy = (6*player->mo->momy)/5;
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@ Make sure this matches the actual number of states
|
|||
#define RINGVOLUMEREGEN 1
|
||||
#define RINGTRANSPARENCYREGEN 3
|
||||
|
||||
#define MIN_WAVEDASH_CHARGE ((11*TICRATE/16)*9)
|
||||
|
||||
#define MAXTOPACCEL (12*FRACUNIT)
|
||||
#define TOPACCELREGEN (FRACUNIT/16)
|
||||
|
||||
|
|
|
|||
|
|
@ -388,6 +388,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->ignoreAirtimeLeniency);
|
||||
else if (fastcmp(field,"topaccel"))
|
||||
lua_pushinteger(L, plr->topAccel);
|
||||
else if (fastcmp(field,"vortexboost"))
|
||||
lua_pushinteger(L, plr->vortexBoost);
|
||||
else if (fastcmp(field,"instawhipcharge"))
|
||||
lua_pushinteger(L, plr->instaWhipCharge);
|
||||
else if (fastcmp(field,"pitblame"))
|
||||
|
|
@ -960,6 +962,8 @@ static int player_set(lua_State *L)
|
|||
plr->ignoreAirtimeLeniency = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"topaccel"))
|
||||
plr->topAccel = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"vortexboost"))
|
||||
plr->vortexBoost = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"instawhipcharge"))
|
||||
plr->instaWhipCharge = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"pitblame"))
|
||||
|
|
|
|||
|
|
@ -598,6 +598,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT8(save->p, players[i].ignoreAirtimeLeniency);
|
||||
|
||||
WRITEFIXED(save->p, players[i].topAccel);
|
||||
WRITEFIXED(save->p, players[i].vortexBoost);
|
||||
|
||||
WRITEMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
||||
|
||||
|
|
@ -1209,6 +1210,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].ignoreAirtimeLeniency = READUINT8(save->p);
|
||||
|
||||
players[i].topAccel = READFIXED(save->p);
|
||||
players[i].vortexBoost = READFIXED(save->p);
|
||||
|
||||
READMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
||||
|
||||
|
|
|
|||
53
src/p_user.c
53
src/p_user.c
|
|
@ -2363,7 +2363,43 @@ static void P_UpdatePlayerAngle(player_t *player)
|
|||
angle_t leniency = leniency_base * min(player->cmd.latency, 6);
|
||||
// Don't force another turning tic, just give them the desired angle!
|
||||
|
||||
if (targetDelta == angleChange || (maxTurnRight == 0 && maxTurnLeft == 0))
|
||||
#if 0 // Old sliptide preservation behavior
|
||||
if (K_Sliptiding(player) && P_IsObjectOnGround(player->mo) && (player->cmd.turning != 0) && ((player->cmd.turning > 0) == (player->aizdriftstrat > 0)))
|
||||
{
|
||||
// Don't change handling direction if someone's inputs are sliptiding, you'll break the sliptide!
|
||||
if (player->cmd.turning > 0)
|
||||
{
|
||||
steeringLeft = max(steeringLeft, 1);
|
||||
steeringRight = max(steeringRight, steeringLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
steeringRight = min(steeringRight, -1);
|
||||
steeringLeft = min(steeringLeft, steeringRight);
|
||||
}
|
||||
}
|
||||
#else // Digital-friendly sliptide preservation behavior
|
||||
if (K_Sliptiding(player) && P_IsObjectOnGround(player->mo))
|
||||
{
|
||||
// Unless someone explicitly inputs a turn that would break their sliptide, keep sliptiding.
|
||||
if (player->aizdriftstrat > 0 && player->cmd.turning >= 0)
|
||||
{
|
||||
steeringLeft = max(steeringLeft, 1);
|
||||
steeringRight = max(steeringRight, steeringLeft);
|
||||
}
|
||||
else if ((player->aizdriftstrat < 0 && player->cmd.turning <= 0))
|
||||
{
|
||||
steeringRight = min(steeringRight, -1);
|
||||
steeringLeft = min(steeringLeft, steeringRight);
|
||||
}
|
||||
else
|
||||
{
|
||||
// :V
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (maxTurnRight == 0 && maxTurnLeft == 0)
|
||||
{
|
||||
// Either we're dead on or we can't steer at all.
|
||||
player->steering = targetsteering;
|
||||
|
|
@ -2372,21 +2408,6 @@ static void P_UpdatePlayerAngle(player_t *player)
|
|||
{
|
||||
// We're off. Try to legally steer the player towards their camera.
|
||||
|
||||
if (K_Sliptiding(player) && P_IsObjectOnGround(player->mo) && (player->cmd.turning != 0) && ((player->cmd.turning > 0) == (player->aizdriftstrat > 0)))
|
||||
{
|
||||
// Don't change handling direction if someone's inputs are sliptiding, you'll break the sliptide!
|
||||
if (player->cmd.turning > 0)
|
||||
{
|
||||
steeringLeft = max(steeringLeft, 1);
|
||||
steeringRight = max(steeringRight, steeringLeft);
|
||||
}
|
||||
else
|
||||
{
|
||||
steeringRight = min(steeringRight, -1);
|
||||
steeringLeft = min(steeringLeft, steeringRight);
|
||||
}
|
||||
}
|
||||
|
||||
player->steering = P_FindClosestTurningForAngle(player, targetDelta, steeringLeft, steeringRight);
|
||||
angleChange = K_GetKartTurnValue(player, player->steering) << TICCMD_REDUCE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue