mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-26 19:20:55 +00:00
Merge branch 'deadtweaks' into 'master'
Update HUD anim counters when dead. Closes #49 See merge request KartKrew/Kart!106
This commit is contained in:
commit
fcba636616
3 changed files with 52 additions and 38 deletions
79
src/k_kart.c
79
src/k_kart.c
|
@ -4025,6 +4025,47 @@ static void K_UpdateInvincibilitySounds(player_t *player)
|
|||
#undef STOPTHIS
|
||||
}
|
||||
|
||||
void K_KartPlayerHUDUpdate(player_t *player)
|
||||
{
|
||||
if (player->kartstuff[k_lapanimation])
|
||||
player->kartstuff[k_lapanimation]--;
|
||||
|
||||
if (player->kartstuff[k_yougotem])
|
||||
player->kartstuff[k_yougotem]--;
|
||||
|
||||
if (G_BattleGametype() && (player->exiting || player->kartstuff[k_comebacktimer]))
|
||||
{
|
||||
if (player->exiting)
|
||||
{
|
||||
if (player->exiting < 6*TICRATE)
|
||||
player->kartstuff[k_cardanimation] += ((164-player->kartstuff[k_cardanimation])/8)+1;
|
||||
else if (player->exiting == 6*TICRATE)
|
||||
player->kartstuff[k_cardanimation] = 0;
|
||||
else if (player->kartstuff[k_cardanimation] < 2*TICRATE)
|
||||
player->kartstuff[k_cardanimation]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player->kartstuff[k_comebacktimer] < 6*TICRATE)
|
||||
player->kartstuff[k_cardanimation] -= ((164-player->kartstuff[k_cardanimation])/8)+1;
|
||||
else if (player->kartstuff[k_comebacktimer] < 9*TICRATE)
|
||||
player->kartstuff[k_cardanimation] += ((164-player->kartstuff[k_cardanimation])/8)+1;
|
||||
}
|
||||
|
||||
if (player->kartstuff[k_cardanimation] > 164)
|
||||
player->kartstuff[k_cardanimation] = 164;
|
||||
if (player->kartstuff[k_cardanimation] < 0)
|
||||
player->kartstuff[k_cardanimation] = 0;
|
||||
}
|
||||
else if (G_RaceGametype() && player->exiting)
|
||||
{
|
||||
if (player->kartstuff[k_cardanimation] < 2*TICRATE)
|
||||
player->kartstuff[k_cardanimation]++;
|
||||
}
|
||||
else
|
||||
player->kartstuff[k_cardanimation] = 0;
|
||||
}
|
||||
|
||||
/** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c
|
||||
|
||||
\param player player object passed from P_PlayerThink
|
||||
|
@ -4235,43 +4276,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->kartstuff[k_justbumped])
|
||||
player->kartstuff[k_justbumped]--;
|
||||
|
||||
if (player->kartstuff[k_lapanimation])
|
||||
player->kartstuff[k_lapanimation]--;
|
||||
|
||||
if (player->kartstuff[k_yougotem])
|
||||
player->kartstuff[k_yougotem]--;
|
||||
|
||||
if (G_BattleGametype() && (player->exiting || player->kartstuff[k_comebacktimer]))
|
||||
{
|
||||
if (player->exiting)
|
||||
{
|
||||
if (player->exiting < 6*TICRATE)
|
||||
player->kartstuff[k_cardanimation] += ((164-player->kartstuff[k_cardanimation])/8)+1;
|
||||
else if (player->exiting == 6*TICRATE)
|
||||
player->kartstuff[k_cardanimation] = 0;
|
||||
else if (player->kartstuff[k_cardanimation] < 2*TICRATE)
|
||||
player->kartstuff[k_cardanimation]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player->kartstuff[k_comebacktimer] < 6*TICRATE)
|
||||
player->kartstuff[k_cardanimation] -= ((164-player->kartstuff[k_cardanimation])/8)+1;
|
||||
else if (player->kartstuff[k_comebacktimer] < 9*TICRATE)
|
||||
player->kartstuff[k_cardanimation] += ((164-player->kartstuff[k_cardanimation])/8)+1;
|
||||
}
|
||||
|
||||
if (player->kartstuff[k_cardanimation] > 164)
|
||||
player->kartstuff[k_cardanimation] = 164;
|
||||
if (player->kartstuff[k_cardanimation] < 0)
|
||||
player->kartstuff[k_cardanimation] = 0;
|
||||
}
|
||||
else if (G_RaceGametype() && player->exiting)
|
||||
{
|
||||
if (player->kartstuff[k_cardanimation] < 2*TICRATE)
|
||||
player->kartstuff[k_cardanimation]++;
|
||||
}
|
||||
else
|
||||
player->kartstuff[k_cardanimation] = 0;
|
||||
K_KartPlayerHUDUpdate(player);
|
||||
|
||||
if (player->kartstuff[k_voices])
|
||||
player->kartstuff[k_voices]--;
|
||||
|
|
|
@ -24,6 +24,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
|||
void K_MatchGenericExtraFlags(mobj_t *mo, mobj_t *master);
|
||||
void K_RespawnChecker(player_t *player);
|
||||
void K_KartMoveAnimation(player_t *player);
|
||||
void K_KartPlayerHUDUpdate(player_t *player);
|
||||
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
|
||||
void K_KartPlayerAfterThink(player_t *player);
|
||||
void K_DoInstashield(player_t *player);
|
||||
|
|
10
src/p_user.c
10
src/p_user.c
|
@ -7946,6 +7946,8 @@ static void P_DeathThink(player_t *player)
|
|||
else
|
||||
player->kartstuff[k_timeovercam] = 0;
|
||||
|
||||
K_KartPlayerHUDUpdate(player);
|
||||
|
||||
if (player->deadtimer < INT32_MAX)
|
||||
player->deadtimer++;
|
||||
|
||||
|
@ -7984,6 +7986,9 @@ static void P_DeathThink(player_t *player)
|
|||
if (!player->mo)
|
||||
return;
|
||||
|
||||
player->mo->colorized = false;
|
||||
player->mo->color = player->skincolor;
|
||||
|
||||
P_CalcHeight(player);
|
||||
}
|
||||
|
||||
|
@ -9098,7 +9103,10 @@ void P_PlayerThink(player_t *player)
|
|||
|
||||
if (player->playerstate == PST_DEAD)
|
||||
{
|
||||
player->mo->flags2 &= ~MF2_SHADOW;
|
||||
if (player->spectator)
|
||||
player->mo->flags2 |= MF2_SHADOW;
|
||||
else
|
||||
player->mo->flags2 &= ~MF2_SHADOW;
|
||||
P_DeathThink(player);
|
||||
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue