let angle be changed while spun out and boosting

This commit is contained in:
Latapostrophe 2019-05-25 13:08:38 +02:00
parent 2fb4dd73fc
commit 78c2c54a87
4 changed files with 17 additions and 7 deletions

View file

@ -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

View file

@ -1253,7 +1253,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
player = &players[consoleplayer];
else
player = &players[displayplayers[ssplayer-1]];
if (ssplayer == 2)
thiscam = (player->bot == 2 ? &camera[0] : &camera[ssplayer-1]);
else
@ -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);
@ -3274,7 +3273,7 @@ const char *Gametype_Names[NUMGAMETYPES] =
{
"Race", // GT_RACE
"Battle" // GT_MATCH
/*"Co-op", // GT_COOP
"Competition", // GT_COMPETITION
"Team Match", // GT_TEAMMATCH

View file

@ -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

View file

@ -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;
@ -7377,7 +7379,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
if (P_CameraThinker(player, thiscam, resetcalled))
return true;
if (thiscam == &camera[1]) // Camera 2
{
num = 1;
@ -8495,7 +8497,7 @@ void P_PlayerThink(player_t *player)
if (player->powers[pw_invulnerability] && player->powers[pw_invulnerability] < UINT16_MAX)
player->powers[pw_invulnerability]--;
if (player->powers[pw_flashing] && player->powers[pw_flashing] < UINT16_MAX &&
if (player->powers[pw_flashing] && player->powers[pw_flashing] < UINT16_MAX &&
(player->spectator || player->powers[pw_flashing] < K_GetKartFlashing(player)))
player->powers[pw_flashing]--;