mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-27 03:30:50 +00:00
Merge branch 'spinout-angle' into 'v1'
Spinout angle change when boosting See merge request KartKrew/Kart!153
This commit is contained in:
commit
65763b8745
5 changed files with 18 additions and 7 deletions
|
@ -273,6 +273,7 @@ typedef enum
|
||||||
k_boostpower, // Base boost value, for offroad
|
k_boostpower, // Base boost value, for offroad
|
||||||
k_speedboost, // Boost value smoothing for max speed
|
k_speedboost, // Boost value smoothing for max speed
|
||||||
k_accelboost, // Boost value smoothing for acceleration
|
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_boostcam, // Camera push forward on boost
|
||||||
k_destboostcam, // Ditto
|
k_destboostcam, // Ditto
|
||||||
k_timeovercam, // Camera timer for leaving behind or not
|
k_timeovercam, // Camera timer for leaving behind or not
|
||||||
|
|
|
@ -8391,6 +8391,7 @@ static const char *const KARTSTUFF_LIST[] = {
|
||||||
"BOOSTPOWER",
|
"BOOSTPOWER",
|
||||||
"SPEEDBOOST",
|
"SPEEDBOOST",
|
||||||
"ACCELBOOST",
|
"ACCELBOOST",
|
||||||
|
"BOOSTANGLE",
|
||||||
"BOOSTCAM",
|
"BOOSTCAM",
|
||||||
"DESTBOOSTCAM",
|
"DESTBOOSTCAM",
|
||||||
"TIMEOVERCAM",
|
"TIMEOVERCAM",
|
||||||
|
|
|
@ -1253,7 +1253,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||||
player = &players[consoleplayer];
|
player = &players[consoleplayer];
|
||||||
else
|
else
|
||||||
player = &players[displayplayers[ssplayer-1]];
|
player = &players[displayplayers[ssplayer-1]];
|
||||||
|
|
||||||
if (ssplayer == 2)
|
if (ssplayer == 2)
|
||||||
thiscam = (player->bot == 2 ? &camera[0] : &camera[ssplayer-1]);
|
thiscam = (player->bot == 2 ? &camera[0] : &camera[ssplayer-1]);
|
||||||
else
|
else
|
||||||
|
@ -1558,8 +1558,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||||
if (((player->mo && player->speed > 0) // Moving
|
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_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|
||||||
|| (player->kartstuff[k_respawn]) // Respawning
|
|| (player->kartstuff[k_respawn]) // Respawning
|
||||||
|| (player->spectator || objectplacing)) // Not a physical player
|
|| (player->spectator || objectplacing))) // Not a physical player
|
||||||
&& !(player->kartstuff[k_spinouttimer] && player->kartstuff[k_sneakertimer])) // Spinning and boosting cancels out turning
|
|
||||||
lang += (cmd->angleturn<<16);
|
lang += (cmd->angleturn<<16);
|
||||||
|
|
||||||
cmd->angleturn = (INT16)(lang >> 16);
|
cmd->angleturn = (INT16)(lang >> 16);
|
||||||
|
@ -3274,7 +3273,7 @@ const char *Gametype_Names[NUMGAMETYPES] =
|
||||||
{
|
{
|
||||||
"Race", // GT_RACE
|
"Race", // GT_RACE
|
||||||
"Battle" // GT_MATCH
|
"Battle" // GT_MATCH
|
||||||
|
|
||||||
/*"Co-op", // GT_COOP
|
/*"Co-op", // GT_COOP
|
||||||
"Competition", // GT_COMPETITION
|
"Competition", // GT_COMPETITION
|
||||||
"Team Match", // GT_TEAMMATCH
|
"Team Match", // GT_TEAMMATCH
|
||||||
|
|
|
@ -3541,6 +3541,9 @@ void K_DoSneaker(player_t *player, INT32 type)
|
||||||
|
|
||||||
player->kartstuff[k_sneakertimer] = sneakertime;
|
player->kartstuff[k_sneakertimer] = sneakertime;
|
||||||
|
|
||||||
|
// set angle for spun out players:
|
||||||
|
player->kartstuff[k_boostangle] = (INT32)player->mo->angle;
|
||||||
|
|
||||||
if (type != 0)
|
if (type != 0)
|
||||||
{
|
{
|
||||||
player->pflags |= PF_ATTACKDOWN;
|
player->pflags |= PF_ATTACKDOWN;
|
||||||
|
@ -4469,6 +4472,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
{
|
{
|
||||||
K_UpdateOffroad(player);
|
K_UpdateOffroad(player);
|
||||||
K_UpdateEngineSounds(player, cmd); // Thanks, VAda!
|
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);
|
K_GetKartBoostPower(player);
|
||||||
|
|
||||||
// Speed lines
|
// Speed lines
|
||||||
|
|
|
@ -4054,6 +4054,8 @@ static void P_3dMovement(player_t *player)
|
||||||
{
|
{
|
||||||
if (player->kartstuff[k_drift] != 0)
|
if (player->kartstuff[k_drift] != 0)
|
||||||
movepushangle = player->mo->angle-(ANGLE_45/5)*player->kartstuff[k_drift];
|
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
|
else
|
||||||
movepushangle = player->mo->angle;
|
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
|
|| (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn
|
||||||
|| (player->kartstuff[k_respawn]) // Respawning
|
|| (player->kartstuff[k_respawn]) // Respawning
|
||||||
|| (player->spectator || objectplacing)) // Not a physical player
|
|| (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->lturn_max[leveltime%MAXPREDICTTICS] = K_GetKartTurnValue(player, KART_FULLTURN)+1;
|
||||||
player->rturn_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))
|
if (P_CameraThinker(player, thiscam, resetcalled))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
if (thiscam == &camera[1]) // Camera 2
|
if (thiscam == &camera[1]) // Camera 2
|
||||||
{
|
{
|
||||||
num = 1;
|
num = 1;
|
||||||
|
@ -8495,7 +8497,7 @@ void P_PlayerThink(player_t *player)
|
||||||
if (player->powers[pw_invulnerability] && player->powers[pw_invulnerability] < UINT16_MAX)
|
if (player->powers[pw_invulnerability] && player->powers[pw_invulnerability] < UINT16_MAX)
|
||||||
player->powers[pw_invulnerability]--;
|
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->spectator || player->powers[pw_flashing] < K_GetKartFlashing(player)))
|
||||||
player->powers[pw_flashing]--;
|
player->powers[pw_flashing]--;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue