diff --git a/src/d_player.h b/src/d_player.h index 98dee8e9a..c2ad5050b 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -675,6 +675,10 @@ struct player_t UINT8 tripwireReboundDelay; // When failing Tripwire, brieftly lock out speed-based tripwire pass (anti-cheese) + UINT16 sliptideZip; // How long is our chained sliptide? Grant a proportional boost when it's over. + UINT8 sliptideZipDelay; // How long since the last sliptide? Only boost once you've been straightened out for a bit. + UINT16 sliptideZipBoost; // The actual boost granted from sliptideZip. + mobj_t *stumbleIndicator; #ifdef HWRENDER diff --git a/src/k_kart.c b/src/k_kart.c index 5e9982648..eb8962fbc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1809,6 +1809,11 @@ static void K_SpawnGenericSpeedLines(player_t *player, boolean top) fast->colorized = true; fast->renderflags |= RF_ADD; } + else if (player->sliptideZipBoost) + { + fast->color = SKINCOLOR_WHITE; + fast->colorized = true; + } } void K_SpawnNormalSpeedLines(player_t *player) @@ -3046,7 +3051,7 @@ static void K_GetKartBoostPower(player_t *player) speedboost += FixedDiv(s, FRACUNIT + (metabolism * (numboosts-1))); \ accelboost += FixedDiv(a, FRACUNIT + (metabolism * (numboosts-1))); \ if (player->aizdriftstrat) \ - handleboost += FixedDiv(h, FRACUNIT + (metabolism * (numboosts-1))); \ + handleboost += FixedDiv(3*h/2, FRACUNIT + (metabolism * (numboosts-1))/4); \ else \ handleboost = max(h, handleboost); \ } @@ -3080,6 +3085,11 @@ static void K_GetKartBoostPower(player_t *player) ); } + if (player->sliptideZipBoost) + { + ADDBOOST(3*FRACUNIT/4, 4*FRACUNIT, sliptidehandling/2); + } + if (player->spindashboost) // Spindash boost { const fixed_t MAXCHARGESPEED = K_GetSpindashChargeSpeed(player); @@ -7483,7 +7493,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->sneakertimer || player->ringboost || player->driftboost || player->startboost || player->eggmanexplode || player->trickboost - || player->gateBoost) + || player->gateBoost || player->sliptideZipBoost) { #if 0 if (player->invincibilitytimer) @@ -7745,6 +7755,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->startboost--; } + if (player->sliptideZipBoost > 0 && onground == true) + { + player->sliptideZipBoost--; + } + if (player->spindashboost) { player->spindashboost--; @@ -9205,6 +9220,8 @@ static void K_KartDrift(player_t *player, boolean onground) { K_SpawnAIZDust(player); + player->sliptideZip++; + if (abs(player->aizdrifttilt) < ANGLE_22h) { player->aizdrifttilt = @@ -9222,6 +9239,18 @@ static void K_KartDrift(player_t *player, boolean onground) if (!K_Sliptiding(player)) { + if (player->sliptideZip > 0) + { + player->sliptideZipDelay++; + if (player->sliptideZipDelay > TICRATE && player->drift == 0) + { + S_StartSound(player->mo, sfx_s3kb6); + player->sliptideZipBoost += player->sliptideZip; + player->sliptideZip = 0; + player->sliptideZipDelay = 0; + } + } + player->aizdrifttilt -= player->aizdrifttilt / 4; player->aizdriftturn -= player->aizdriftturn / 4; @@ -9230,6 +9259,10 @@ static void K_KartDrift(player_t *player, boolean onground) if (abs(player->aizdriftturn) < ANGLE_11hh) player->aizdriftturn = 0; } + else + { + player->sliptideZipDelay = 0; + } if (player->drift && ((buttons & BT_BRAKE) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 211f83867..caa44ce58 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -308,6 +308,12 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->tripwireLeniency); else if (fastcmp(field,"tripwireReboundDelay")) lua_pushinteger(L, plr->tripwireReboundDelay); + else if (fastcmp(field,"sliptideZip")) + lua_pushinteger(L, plr->sliptideZip); + else if (fastcmp(field,"sliptideZipDelay")) + lua_pushinteger(L, plr->sliptideZipDelay); + else if (fastcmp(field,"sliptideZipBoost")) + lua_pushinteger(L, plr->sliptideZipDelay); /* else if (fastcmp(field,"itemroulette")) lua_pushinteger(L, plr->itemroulette); @@ -688,6 +694,12 @@ static int player_set(lua_State *L) plr->tripwireLeniency = luaL_checkinteger(L, 3); else if (fastcmp(field,"tripwireReboundDelay")) plr->tripwireReboundDelay = luaL_checkinteger(L, 3); + else if (fastcmp(field,"sliptideZip")) + plr->sliptideZip = luaL_checkinteger(L, 3); + else if (fastcmp(field,"sliptideZipDelay")) + plr->sliptideZipDelay = luaL_checkinteger(L, 3); + else if (fastcmp(field,"sliptideZipBoost")) + plr->sliptideZipDelay = luaL_checkinteger(L, 3); /* else if (fastcmp(field,"itemroulette")) plr->itemroulette = luaL_checkinteger(L, 3); diff --git a/src/p_saveg.c b/src/p_saveg.c index fc9d7daf4..49d31a230 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -397,6 +397,10 @@ static void P_NetArchivePlayers(savebuffer_t *save) WRITEUINT8(save->p, players[i].tripwireReboundDelay); + WRITEUINT16(save->p, players[i].sliptideZip); + WRITEUINT8(save->p, players[i].sliptideZipDelay); + WRITEUINT16(save->p, players[i].sliptideZipBoost); + // respawnvars_t WRITEUINT8(save->p, players[i].respawn.state); WRITEUINT32(save->p, K_GetWaypointHeapIndex(players[i].respawn.wp)); @@ -767,6 +771,10 @@ static void P_NetUnArchivePlayers(savebuffer_t *save) players[i].tripwireReboundDelay = READUINT8(save->p); + players[i].sliptideZip = READUINT16(save->p); + players[i].sliptideZipDelay = READUINT8(save->p); + players[i].sliptideZipBoost = READUINT16(save->p); + // respawnvars_t players[i].respawn.state = READUINT8(save->p); players[i].respawn.wp = (waypoint_t *)(size_t)READUINT32(save->p);