diff --git a/src/d_player.h b/src/d_player.h index 8b5b3066b..304dcb7bb 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -932,6 +932,8 @@ struct player_t UINT8 wavedashdelay; // How long since the last sliptide? Only boost once you've been straightened out for a bit. UINT16 wavedashboost; // The actual boost granted from wavedash. + UINT16 speedpunt; + UINT16 trickcharge; // Landed normally from a trick panel? Get the benefits package! UINT16 infinitether; // Generic infinitether time, used for infinitether leniency. diff --git a/src/k_kart.c b/src/k_kart.c index 7e62940ef..3f0c7e48e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3784,16 +3784,27 @@ void K_DoInstashield(player_t *player) void K_DoPowerClash(mobj_t *t1, mobj_t *t2) { mobj_t *clash; + UINT8 lag1 = 5; + UINT8 lag2 = 5; // short-circuit instashield for vfx visibility if (t1->player) + { t1->player->instashield = 1; + t1->player->speedpunt += 20; + lag1 -= min(lag1, t1->player->speedpunt/10); + } + if (t2->player) + { t2->player->instashield = 1; + t2->player->speedpunt += 20; + lag2 -= min(lag1, t2->player->speedpunt/10); + } S_StartSound(t1, sfx_parry); - K_AddHitLag(t1, 6, false); - K_AddHitLag(t2, 6, false); + K_AddHitLag(t1, lag1+1, false); + K_AddHitLag(t2, lag2+1, false); clash = P_SpawnMobj((t1->x/2) + (t2->x/2), (t1->y/2) + (t2->y/2), (t1->z/2) + (t2->z/2), MT_POWERCLASH); @@ -8551,6 +8562,13 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->wavedashboost--; } + if (player->speedpunt) + player->speedpunt--; + + // This timer can get out of control fast, clamp to match player expectations about "new" hazards + if (player->speedpunt > TICRATE*4) + player->speedpunt = TICRATE*4; + if (player->trickcharge > 0 && onground == true) { player->trickcharge--; diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 2d39cc7c9..7283b91dc 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -335,6 +335,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->wavedashdelay); else if (fastcmp(field,"wavedashboost")) lua_pushinteger(L, plr->wavedashboost); + else if (fastcmp(field,"speedpunt")) + lua_pushinteger(L, plr->speedpunt); else if (fastcmp(field,"trickcharge")) lua_pushinteger(L, plr->trickcharge); else if (fastcmp(field,"infinitether")) @@ -831,6 +833,8 @@ static int player_set(lua_State *L) plr->wavedashdelay = luaL_checkinteger(L, 3); else if (fastcmp(field,"wavedashboost")) plr->wavedashboost = luaL_checkinteger(L, 3); + else if (fastcmp(field,"speedpunt")) + plr->speedpunt = luaL_checkinteger(L, 3); else if (fastcmp(field,"trickcharge")) plr->trickcharge = luaL_checkinteger(L, 3); else if (fastcmp(field,"infinitether")) diff --git a/src/p_saveg.c b/src/p_saveg.c index 85eafd60a..176b521f1 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -561,6 +561,7 @@ static void P_NetArchivePlayers(savebuffer_t *save) WRITEUINT16(save->p, players[i].wavedash); WRITEUINT8(save->p, players[i].wavedashdelay); WRITEUINT16(save->p, players[i].wavedashboost); + WRITEUINT16(save->p, players[i].speedpunt); WRITEUINT16(save->p, players[i].trickcharge); WRITEUINT16(save->p, players[i].infinitether); @@ -1114,6 +1115,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save) players[i].wavedash = READUINT16(save->p); players[i].wavedashdelay = READUINT8(save->p); players[i].wavedashboost = READUINT16(save->p); + players[i].speedpunt = READUINT16(save->p); players[i].trickcharge = READUINT16(save->p); players[i].infinitether = READUINT16(save->p);