From 4875311ac934f4ded2101ecb64c613edeb9e3009 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sat, 27 May 2023 21:55:26 -0700 Subject: [PATCH] Slower Drop Dash boost type --- src/d_player.h | 3 ++- src/k_kart.c | 9 ++++++++- src/k_respawn.c | 2 +- src/p_saveg.c | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index e37a563e1..e66bf1255 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -530,7 +530,8 @@ struct player_t respawnvars_t respawn; // Respawn info mobj_t *ringShooter; // DEZ respawner object tic_t airtime; // Used to track just air time, but has evolved over time into a general "karted" timer. Rename this variable? - UINT8 startboost; // (0 to 125) - Boost you get from start of race or respawn drop dash + UINT8 startboost; // (0 to 125) - Boost you get from start of race + UINT8 dropdashboost; // Boost you get when holding A while respawning UINT16 flashing; UINT16 spinouttimer; // Spin-out from a banana peel or oil slick (was "pw_bananacam") diff --git a/src/k_kart.c b/src/k_kart.c index 539b8e3f2..3bdbb924d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1564,7 +1564,7 @@ void K_SpawnDashDustRelease(player_t *player) if (!P_IsObjectOnGround(player->mo)) return; - if (!player->speed && !player->startboost && !player->spindash) + if (!player->speed && !player->startboost && !player->spindash && !player->dropdashboost) return; travelangle = player->mo->angle; @@ -3107,6 +3107,11 @@ static void K_GetKartBoostPower(player_t *player) ADDBOOST(FRACUNIT, 4*FRACUNIT, SLIPTIDEHANDLING); // + 100% top speed, + 400% acceleration, +50% handling } + if (player->dropdashboost) // Drop dash + { + ADDBOOST(FRACUNIT/3, 4*FRACUNIT, SLIPTIDEHANDLING); // + 33% top speed, + 400% acceleration, +50% handling + } + if (player->driftboost) // Drift Boost { // Rebuff Eggman's stat block corner @@ -7881,6 +7886,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) { player->startboost--; } + if (player->dropdashboost) + player->dropdashboost--; if (player->sliptideZipBoost > 0 && onground == true) { diff --git a/src/k_respawn.c b/src/k_respawn.c index 46851a02f..ff6ef657a 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -799,7 +799,7 @@ static void K_HandleDropDash(player_t *player) if ((buttons & BT_ACCELERATE) && (player->respawn.dropdash >= TICRATE/4)) { S_StartSound(player->mo, sfx_s23c); - player->startboost = 50; + player->dropdashboost = 50; K_SpawnDashDustRelease(player); } diff --git a/src/p_saveg.c b/src/p_saveg.c index 16073ac06..3a7594e9e 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -281,6 +281,7 @@ static void P_NetArchivePlayers(savebuffer_t *save) WRITEUINT32(save->p, K_GetWaypointHeapIndex(players[i].nextwaypoint)); WRITEUINT32(save->p, players[i].airtime); WRITEUINT8(save->p, players[i].startboost); + WRITEUINT8(save->p, players[i].dropdashboost); WRITEUINT16(save->p, players[i].flashing); WRITEUINT16(save->p, players[i].spinouttimer); @@ -666,6 +667,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save) players[i].nextwaypoint = (waypoint_t *)(size_t)READUINT32(save->p); players[i].airtime = READUINT32(save->p); players[i].startboost = READUINT8(save->p); + players[i].dropdashboost = READUINT8(save->p); players[i].flashing = READUINT16(save->p); players[i].spinouttimer = READUINT16(save->p);