mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'improved-spindash-fucking-again' into 'master'
Improved spindash + ebrake Closes #1345 and #1344 See merge request KartKrew/Kart!2341
This commit is contained in:
commit
f3824b5ad9
6 changed files with 49 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
42
src/k_kart.c
42
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)
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue