mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 04:41:23 +00:00
Minimum speed to get drift sparks
This commit is contained in:
parent
50a6df7563
commit
eebdda0833
3 changed files with 16 additions and 5 deletions
|
@ -351,6 +351,7 @@ typedef enum
|
|||
// v1.0.2 vars
|
||||
k_itemblink, // Item flashing after roulette, prevents Hyudoro stealing AND serves as a mashing indicator
|
||||
k_itemblinkmode, // Type of flashing: 0 = white (normal), 1 = red (mashing), 2 = rainbow (enhanced items)
|
||||
k_getsparks, // Disable drift sparks at low speed, JUST enough to give acceleration the actual headstart above speed
|
||||
|
||||
NUMKARTSTUFF
|
||||
} kartstufftype_t;
|
||||
|
|
|
@ -8281,7 +8281,8 @@ static const char *const KARTSTUFF_LIST[] = {
|
|||
"YOUGOTEM",
|
||||
|
||||
"ITEMBLINK",
|
||||
"ITEMBLINKMODE"
|
||||
"ITEMBLINKMODE",
|
||||
"GETSPARKS"
|
||||
};
|
||||
|
||||
static const char *const HUDITEMS_LIST[] = {
|
||||
|
|
17
src/k_kart.c
17
src/k_kart.c
|
@ -4585,6 +4585,7 @@ INT32 K_GetKartDriftSparkValue(player_t *player)
|
|||
|
||||
static void K_KartDrift(player_t *player, boolean onground)
|
||||
{
|
||||
fixed_t minspeed = (10 * player->mo->scale);
|
||||
INT32 dsone = K_GetKartDriftSparkValue(player);
|
||||
INT32 dstwo = dsone*2;
|
||||
INT32 dsthree = dstwo*2;
|
||||
|
@ -4635,14 +4636,14 @@ static void K_KartDrift(player_t *player, boolean onground)
|
|||
}
|
||||
|
||||
// Drifting: left or right?
|
||||
if ((player->cmd.driftturn > 0) && player->speed > FixedMul(10<<16, player->mo->scale) && player->kartstuff[k_jmp] == 1
|
||||
if ((player->cmd.driftturn > 0) && player->speed > minspeed && player->kartstuff[k_jmp] == 1
|
||||
&& (player->kartstuff[k_drift] == 0 || player->kartstuff[k_driftend] == 1)) // && player->kartstuff[k_drift] != 1)
|
||||
{
|
||||
// Starting left drift
|
||||
player->kartstuff[k_drift] = 1;
|
||||
player->kartstuff[k_driftend] = player->kartstuff[k_driftcharge] = 0;
|
||||
}
|
||||
else if ((player->cmd.driftturn < 0) && player->speed > FixedMul(10<<16, player->mo->scale) && player->kartstuff[k_jmp] == 1
|
||||
else if ((player->cmd.driftturn < 0) && player->speed > minspeed && player->kartstuff[k_jmp] == 1
|
||||
&& (player->kartstuff[k_drift] == 0 || player->kartstuff[k_driftend] == 1)) // && player->kartstuff[k_drift] != -1)
|
||||
{
|
||||
// Starting right drift
|
||||
|
@ -4666,6 +4667,8 @@ static void K_KartDrift(player_t *player, boolean onground)
|
|||
player->kartstuff[k_driftend] = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Incease/decrease the drift value to continue drifting in that direction
|
||||
if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_jmp] == 1 && onground && player->kartstuff[k_drift] != 0)
|
||||
{
|
||||
|
@ -4694,6 +4697,12 @@ static void K_KartDrift(player_t *player, boolean onground)
|
|||
driftadditive -= abs(player->cmd.driftturn)/75;
|
||||
}
|
||||
|
||||
// Disable drift-sparks until you're going fast enough
|
||||
if (player->kartstuff[k_getsparks] == 0)
|
||||
driftadditive = 0;
|
||||
if (player->speed > minspeed*2)
|
||||
player->kartstuff[k_getsparks] = 1;
|
||||
|
||||
// This spawns the drift sparks
|
||||
if (player->kartstuff[k_driftcharge] + driftadditive >= dsone)
|
||||
K_SpawnDriftSparks(player);
|
||||
|
@ -4713,11 +4722,11 @@ static void K_KartDrift(player_t *player, boolean onground)
|
|||
}
|
||||
|
||||
// Stop drifting
|
||||
if (player->kartstuff[k_spinouttimer] > 0 // banana peel
|
||||
|| player->speed < FixedMul(10<<16, player->mo->scale)) // you're too slow!
|
||||
if (player->kartstuff[k_spinouttimer] > 0 || player->speed < minspeed)
|
||||
{
|
||||
player->kartstuff[k_drift] = player->kartstuff[k_driftcharge] = 0;
|
||||
player->kartstuff[k_aizdriftstrat] = player->kartstuff[k_brakedrift] = 0;
|
||||
player->kartstuff[k_getsparks] = 0;
|
||||
}
|
||||
|
||||
if ((!player->kartstuff[k_sneakertimer])
|
||||
|
|
Loading…
Reference in a new issue