diff --git a/src/d_player.h b/src/d_player.h index 6a06c7493..6a9dbb2fa 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -287,7 +287,7 @@ typedef enum k_jmp, // In Mario Kart, letting go of the jump button stops the drift k_offroad, // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed k_pogospring, // Pogo spring bounce effect - k_brakestop, // Wait until you've made a complete stop for a few tics before letting brake go in reverse. + k_spindash, // Spindash charge k_waterskip, // Water skipping counter k_dashpadcooldown, // Separate the vanilla SA-style dash pads from using pw_flashing k_numboosts, // Count of how many boosts are being stacked, for after image spawning diff --git a/src/d_ticcmd.h b/src/d_ticcmd.h index c73c161b5..1a37d1b1e 100644 --- a/src/d_ticcmd.h +++ b/src/d_ticcmd.h @@ -42,6 +42,8 @@ typedef enum BT_CUSTOM3 = 1<<15, } buttoncode_t; +#define BT_SPINDASHMASK (BT_ACCELERATE|BT_BRAKE) + // The data sampled per tick (single player) // and transmitted to other peers (multiplayer). // Mainly movements/button commands per game tick, diff --git a/src/dehacked.c b/src/dehacked.c index a0efc5cb2..59c00721a 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8504,7 +8504,7 @@ static const char *const KARTSTUFF_LIST[] = { "JMP", "OFFROAD", "POGOSPRING", - "BRAKESTOP", + "SPINDASH", "WATERSKIP", "DASHPADCOOLDOWN", "NUMBOOSTS", diff --git a/src/k_kart.c b/src/k_kart.c index d3ff34d69..92aaa6b7e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7404,7 +7404,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->mo->friction += 4608; } - if ((cmd->buttons & (BT_BRAKE|BT_ACCELERATE)) == (BT_BRAKE|BT_ACCELERATE) && !(player->kartstuff[k_drift])) + if ((cmd->buttons & BT_SPINDASHMASK) == BT_SPINDASHMASK + && !player->kartstuff[k_drift]) player->mo->friction -= 3072; else if (player->speed > 0 && cmd->forwardmove < 0) // change friction while braking no matter what, otherwise it's not any more effective than just letting go off accel player->mo->friction -= 2048; @@ -7454,13 +7455,20 @@ void K_MoveKartPlayer(player_t *player, boolean onground) K_KartDrift(player, P_IsObjectOnGround(player->mo)); // Not using onground, since we don't want this affected by spring pads - // Quick Turning - // You can't turn your kart when you're not moving. - // So now it's time to burn some rubber! - if (player->speed < 2 && leveltime > starttime && cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE && cmd->driftturn != 0) + // Spindash + if ((cmd->buttons & BT_SPINDASHMASK) == BT_SPINDASHMASK + && !player->kartstuff[k_drift] + && !player->kartstuff[k_spinouttimer] + && leveltime > starttime) { - if (leveltime % 8 == 0) - S_StartSound(player->mo, sfx_s224); + if (player->speed < 6*mapobjectscale) + { + if (cmd->driftturn != 0 && leveltime % 8 == 0) + S_StartSound(player->mo, sfx_ruburn); + } + else + if (leveltime % 4 == 0) + S_StartSound(player->mo, sfx_s3k36); } // Squishing diff --git a/src/p_mobj.c b/src/p_mobj.c index cfd14efe5..3f37d1d72 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2796,7 +2796,6 @@ static void P_PlayerZMovement(mobj_t *mo) // Check if we're on a polyobject // that triggers a linedef executor. msecnode_t *node; - boolean stopmovecut = false; for (node = mo->touching_sectorlist; node; node = node->m_sectorlist_next) { @@ -2828,8 +2827,8 @@ static void P_PlayerZMovement(mobj_t *mo) polysec = po->lines[0]->backsector; // Moving polyobjects should act like conveyors if the player lands on one. (I.E. none of the momentum cut thing below) -Red - if ((mo->z == polysec->ceilingheight || mo->z+mo->height == polysec->floorheight) && po->thinker) - stopmovecut = true; + /*if ((mo->z == polysec->ceilingheight || mo->z+mo->height == polysec->floorheight) && po->thinker) + stopmovecut = true;*/ if (!(po->flags & POF_LDEXEC)) { @@ -2850,24 +2849,7 @@ static void P_PlayerZMovement(mobj_t *mo) } } } - - if (!stopmovecut) #endif - - // Cut momentum in half when you hit the ground and - // aren't pressing any controls. - if (!(mo->player->cmd.forwardmove || mo->player->cmd.sidemove) && !mo->player->cmomx && !mo->player->cmomy - && !(mo->player->kartstuff[k_spinouttimer])) - { - mo->momx = mo->momx/2; - mo->momy = mo->momy/2; - - if (mo->player->cmd.buttons & BT_BRAKE && !(mo->player->cmd.forwardmove)) // FURTHER slowdown if you're braking. - { - mo->momx = mo->momx/2; - mo->momy = mo->momy/2; - } - } } if (mo->health) diff --git a/src/p_slopes.c b/src/p_slopes.c index ffb50f407..d3faa5e4a 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -884,7 +884,9 @@ void P_ButteredSlope(mobj_t *mo) if (mo->player) { // SRB2Kart - spindash negates slopes - if (((mo->player->cmd.buttons & (BT_BRAKE|BT_ACCELERATE)) == (BT_BRAKE|BT_ACCELERATE)) && !mo->player->kartstuff[k_drift]) + if (((mo->player->cmd.buttons & BT_SPINDASHMASK) == BT_SPINDASHMASK) + && !mo->player->kartstuff[k_drift] + && !mo->player->kartstuff[k_spinouttimer]) return; // Changed in kart to only not apply physics on very slight slopes (I think about 4 degree angles) diff --git a/src/p_user.c b/src/p_user.c index 9fba3b2d6..3cbe533cb 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -5785,7 +5785,7 @@ static void P_MovePlayer(player_t *player) // Kart: store the current turn range for later use if ((player->mo && player->speed > 0) // Moving - || (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn + || (leveltime > starttime && (cmd->buttons & BT_SPINDASHMASK) == BT_SPINDASHMASK) // Rubber-burn turn || (player->respawn.state != RESPAWNST_NONE) // Respawning || (player->spectator || objectplacing)) // Not a physical player {