mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-15 01:01:43 +00:00
let angle be changed while spun out and boosting
This commit is contained in:
parent
2fb4dd73fc
commit
78c2c54a87
4 changed files with 17 additions and 7 deletions
|
@ -273,6 +273,7 @@ typedef enum
|
|||
k_boostpower, // Base boost value, for offroad
|
||||
k_speedboost, // Boost value smoothing for max speed
|
||||
k_accelboost, // Boost value smoothing for acceleration
|
||||
k_boostangle, // angle set when not spun out OR boosted to determine what direction you should keep going at if you're spun out and boosted.
|
||||
k_boostcam, // Camera push forward on boost
|
||||
k_destboostcam, // Ditto
|
||||
k_timeovercam, // Camera timer for leaving behind or not
|
||||
|
|
|
@ -1558,8 +1558,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
if (((player->mo && player->speed > 0) // Moving
|
||||
|| (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|
||||
|| (player->kartstuff[k_respawn]) // Respawning
|
||||
|| (player->spectator || objectplacing)) // Not a physical player
|
||||
&& !(player->kartstuff[k_spinouttimer] && player->kartstuff[k_sneakertimer])) // Spinning and boosting cancels out turning
|
||||
|| (player->spectator || objectplacing))) // Not a physical player
|
||||
lang += (cmd->angleturn<<16);
|
||||
|
||||
cmd->angleturn = (INT16)(lang >> 16);
|
||||
|
|
|
@ -3541,6 +3541,9 @@ void K_DoSneaker(player_t *player, INT32 type)
|
|||
|
||||
player->kartstuff[k_sneakertimer] = sneakertime;
|
||||
|
||||
// set angle for spun out players:
|
||||
player->kartstuff[k_boostangle] = (INT32)player->mo->angle;
|
||||
|
||||
if (type != 0)
|
||||
{
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
|
@ -4469,6 +4472,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
{
|
||||
K_UpdateOffroad(player);
|
||||
K_UpdateEngineSounds(player, cmd); // Thanks, VAda!
|
||||
|
||||
// update boost angle if not spun out
|
||||
if (!player->kartstuff[k_spinouttimer] && !player->kartstuff[k_wipeoutslow])
|
||||
player->kartstuff[k_boostangle] = (INT32)player->mo->angle;
|
||||
|
||||
K_GetKartBoostPower(player);
|
||||
|
||||
// Speed lines
|
||||
|
|
|
@ -4054,6 +4054,8 @@ static void P_3dMovement(player_t *player)
|
|||
{
|
||||
if (player->kartstuff[k_drift] != 0)
|
||||
movepushangle = player->mo->angle-(ANGLE_45/5)*player->kartstuff[k_drift];
|
||||
else if (player->kartstuff[k_spinouttimer] || player->kartstuff[k_wipeoutslow]) // if spun out, use the boost angle
|
||||
movepushangle = (angle_t)player->kartstuff[k_boostangle];
|
||||
else
|
||||
movepushangle = player->mo->angle;
|
||||
}
|
||||
|
@ -5780,7 +5782,7 @@ static void P_MovePlayer(player_t *player)
|
|||
|| (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|
||||
|| (player->kartstuff[k_respawn]) // Respawning
|
||||
|| (player->spectator || objectplacing)) // Not a physical player
|
||||
&& !(player->kartstuff[k_spinouttimer] && player->kartstuff[k_sneakertimer])) // Spinning and boosting cancels out turning
|
||||
) // ~~Spinning and boosting cancels out turning~~ Not anymore given spinout is more slippery and more prone to get you killed because of boosters.
|
||||
{
|
||||
player->lturn_max[leveltime%MAXPREDICTTICS] = K_GetKartTurnValue(player, KART_FULLTURN)+1;
|
||||
player->rturn_max[leveltime%MAXPREDICTTICS] = K_GetKartTurnValue(player, -KART_FULLTURN)-1;
|
||||
|
|
Loading…
Reference in a new issue