mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-15 09:11:59 +00:00
Merge branch 'spinout-speedup' into 'master'
Spinout speedup See merge request KartKrew/Kart!63
This commit is contained in:
commit
666f57d11b
2 changed files with 34 additions and 13 deletions
25
src/k_kart.c
25
src/k_kart.c
|
@ -1847,19 +1847,15 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
|
|||
|
||||
player->kartstuff[k_spinouttype] = type;
|
||||
|
||||
if (player->kartstuff[k_spinouttype] <= 0)
|
||||
if (player->kartstuff[k_spinouttype] <= 0) // type 0 is spinout, type 1 is wipeout
|
||||
{
|
||||
player->kartstuff[k_spinouttimer] = 3*TICRATE/2; // Banana Spinout
|
||||
|
||||
// At spinout, player speed is increased to 1/4 their regular speed, moving them forward
|
||||
if (player->speed < K_GetKartSpeed(player, true)/4)
|
||||
P_InstaThrust(player->mo, player->mo->angle, FixedMul(K_GetKartSpeed(player, true)/4, player->mo->scale));
|
||||
|
||||
S_StartSound(player->mo, sfx_slip);
|
||||
}
|
||||
else
|
||||
player->kartstuff[k_spinouttimer] = TICRATE+20; // Wipeout
|
||||
|
||||
player->kartstuff[k_spinouttimer] = (3*TICRATE/2)+2;
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||
|
||||
if (player->mo->state != &states[S_KART_SPIN])
|
||||
|
@ -2032,7 +2028,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
|
|||
|
||||
if (inflictor && inflictor->type == MT_SPBEXPLOSION && inflictor->extravalue1)
|
||||
{
|
||||
player->kartstuff[k_spinouttimer] = (3*player->kartstuff[k_spinouttimer])/2;
|
||||
player->kartstuff[k_spinouttimer] = ((3*player->kartstuff[k_spinouttimer])/2)+1;
|
||||
player->mo->momz *= 2;
|
||||
}
|
||||
|
||||
|
@ -3956,6 +3952,18 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
|
||||
player->kartstuff[k_timeovercam] = 0;
|
||||
|
||||
// Make ABSOLUTELY SURE that your flashing tics don't get set WHILE you're still in hit animations.
|
||||
if (player->kartstuff[k_spinouttimer] != 0
|
||||
|| player->kartstuff[k_wipeoutslow] != 0
|
||||
|| player->kartstuff[k_squishedtimer] != 0)
|
||||
{
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||
}
|
||||
else if (player->powers[pw_flashing] == K_GetKartFlashing(player))
|
||||
{
|
||||
player->powers[pw_flashing]--;
|
||||
}
|
||||
|
||||
if (player->kartstuff[k_spinouttimer])
|
||||
{
|
||||
if ((P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype] == 1)
|
||||
|
@ -3983,9 +3991,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
if (player->kartstuff[k_spinouttimer] == 0 && player->powers[pw_flashing] == K_GetKartFlashing(player))
|
||||
player->powers[pw_flashing]--;
|
||||
|
||||
/*if (player->kartstuff[k_thunderanim])
|
||||
player->kartstuff[k_thunderanim]--;*/
|
||||
|
||||
|
|
22
src/p_user.c
22
src/p_user.c
|
@ -6652,13 +6652,24 @@ static void P_MovePlayer(player_t *player)
|
|||
if (player->mo->state != &states[S_KART_SQUISH])
|
||||
P_SetPlayerMobjState(player->mo, S_KART_SQUISH);
|
||||
}
|
||||
else if (player->kartstuff[k_spinouttimer] > 0 || player->pflags & PF_SLIDING)
|
||||
else if (player->pflags & PF_SLIDING)
|
||||
{
|
||||
if (player->mo->state != &states[S_KART_SPIN])
|
||||
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
|
||||
|
||||
player->frameangle -= ANGLE_22h;
|
||||
}
|
||||
else if (player->kartstuff[k_spinouttimer] > 0)
|
||||
{
|
||||
INT32 speed = max(1, min(8, player->kartstuff[k_spinouttimer]/8));
|
||||
|
||||
if (player->mo->state != &states[S_KART_SPIN])
|
||||
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
|
||||
|
||||
if (speed == 1 && abs(player->mo->angle - player->frameangle) < ANGLE_22h)
|
||||
player->frameangle = player->mo->angle; // Face forward at the end of the animation
|
||||
else
|
||||
player->frameangle -= (ANGLE_11hh * speed);
|
||||
}
|
||||
else if (player->powers[pw_nocontrol] && player->pflags & PF_SKIDDOWN)
|
||||
{
|
||||
if (player->mo->state != &states[S_KART_SPIN])
|
||||
|
@ -7335,7 +7346,7 @@ static void P_DoZoomTube(player_t *player)
|
|||
fixed_t dist;
|
||||
boolean reverse;
|
||||
|
||||
player->mo->height = P_GetPlayerSpinHeight(player);
|
||||
//player->mo->height = P_GetPlayerSpinHeight(player);
|
||||
|
||||
if (player->speed > 0)
|
||||
reverse = false;
|
||||
|
@ -7440,6 +7451,11 @@ static void P_DoZoomTube(player_t *player)
|
|||
else if (player == &players[fourthdisplayplayer])
|
||||
localangle4 = player->mo->angle;
|
||||
}
|
||||
#if 0
|
||||
if (player->mo->state != &states[S_KART_SPIN])
|
||||
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
|
||||
player->frameangle -= ANGLE_22h;
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue