mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Fault HUD scrolls, faulting respawns you & holds you until the countdown's over
This commit is contained in:
parent
c45a67c3f9
commit
b39c8562a6
3 changed files with 46 additions and 29 deletions
35
src/k_kart.c
35
src/k_kart.c
|
|
@ -5293,6 +5293,11 @@ void K_KartPlayerHUDUpdate(player_t *player)
|
||||||
if (player->karthud[khud_tauntvoices])
|
if (player->karthud[khud_tauntvoices])
|
||||||
player->karthud[khud_tauntvoices]--;
|
player->karthud[khud_tauntvoices]--;
|
||||||
|
|
||||||
|
if (!(player->pflags & PF_SKIDDOWN))
|
||||||
|
player->karthud[khud_fault] = 0;
|
||||||
|
else if (player->karthud[khud_fault] > 0 && player->karthud[khud_fault] < 2*TICRATE)
|
||||||
|
player->karthud[khud_fault]++;
|
||||||
|
|
||||||
if (G_RaceGametype())
|
if (G_RaceGametype())
|
||||||
{
|
{
|
||||||
// 0 is the fast spin animation, set at 30 tics of ring boost or higher!
|
// 0 is the fast spin animation, set at 30 tics of ring boost or higher!
|
||||||
|
|
@ -10737,6 +10742,8 @@ static void K_drawKartStartCountdown(void)
|
||||||
|
|
||||||
if (stplyr->karthud[khud_fault] != 0)
|
if (stplyr->karthud[khud_fault] != 0)
|
||||||
{
|
{
|
||||||
|
INT32 x, xval;
|
||||||
|
|
||||||
if (r_splitscreen > 1) // 3/4p, stationary FIN
|
if (r_splitscreen > 1) // 3/4p, stationary FIN
|
||||||
{
|
{
|
||||||
pnum += 2;
|
pnum += 2;
|
||||||
|
|
@ -10749,7 +10756,25 @@ static void K_drawKartStartCountdown(void)
|
||||||
if ((leveltime % (2*5)) / 5) // blink
|
if ((leveltime % (2*5)) / 5) // blink
|
||||||
pnum += 1;
|
pnum += 1;
|
||||||
|
|
||||||
V_DrawScaledPatch(STCD_X - (SHORT(kp_racefault[pnum]->width)/2), STCD_Y - (SHORT(kp_racefault[pnum]->height)/2), splitflags, kp_racefault[pnum]);
|
if (r_splitscreen == 0)
|
||||||
|
{
|
||||||
|
x = ((vid.width<<FRACBITS)/vid.dupx);
|
||||||
|
xval = (SHORT(kp_racefault[pnum]->width)<<FRACBITS);
|
||||||
|
x = ((TICRATE - stplyr->karthud[khud_fault])*(xval > x ? xval : x))/TICRATE;
|
||||||
|
|
||||||
|
V_DrawFixedPatch(x + (STCD_X<<FRACBITS) - (xval>>1),
|
||||||
|
(STCD_Y<<FRACBITS) - (SHORT(kp_racefault[pnum]->height)<<(FRACBITS-1)),
|
||||||
|
FRACUNIT,
|
||||||
|
splitflags, kp_racefault[pnum], NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
V_DrawScaledPatch(STCD_X - (SHORT(kp_racefault[pnum]->width)/2), STCD_Y - (SHORT(kp_racefault[pnum]->height)/2), splitflags, kp_racefault[pnum]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (leveltime >= introtime && leveltime < starttime-(3*TICRATE))
|
||||||
|
{
|
||||||
|
K_drawKartStartBulbs();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -11596,12 +11621,8 @@ void K_drawKartHUD(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the countdowns after everything else.
|
// Draw the countdowns after everything else.
|
||||||
if (leveltime >= introtime && leveltime < starttime-(3*TICRATE))
|
if (leveltime >= introtime
|
||||||
{
|
&& leveltime < starttime+TICRATE)
|
||||||
K_drawKartStartBulbs();
|
|
||||||
}
|
|
||||||
else if (leveltime >= starttime-(3*TICRATE)
|
|
||||||
&& leveltime < starttime+TICRATE)
|
|
||||||
{
|
{
|
||||||
K_drawKartStartCountdown();
|
K_drawKartStartCountdown();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,13 +101,12 @@ void K_DoIngameRespawn(player_t *player)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (leveltime < starttime)
|
if (leveltime < starttime) // FAULT
|
||||||
{
|
{
|
||||||
player->powers[pw_nocontrol] = (starttime - leveltime) + 50;
|
player->powers[pw_nocontrol] = (starttime - leveltime) + 50;
|
||||||
player->pflags |= PF_SKIDDOWN; // cheeky pflag reuse
|
player->pflags |= PF_SKIDDOWN; // cheeky pflag reuse
|
||||||
S_StartSound(player->mo, sfx_s3k83);
|
S_StartSound(player->mo, sfx_s3k83);
|
||||||
player->karthud[khud_fault] = 1;
|
player->karthud[khud_fault] = 1;
|
||||||
player->mo->momx = player->mo->momy = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
player->kartstuff[k_ringboost] = 0;
|
player->kartstuff[k_ringboost] = 0;
|
||||||
|
|
@ -288,7 +287,7 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
|
||||||
player->mo->momx = player->mo->momy = player->mo->momz = 0;
|
player->mo->momx = player->mo->momy = player->mo->momz = 0;
|
||||||
|
|
||||||
player->powers[pw_flashing] = 2;
|
player->powers[pw_flashing] = 2;
|
||||||
player->powers[pw_nocontrol] = 2;
|
player->powers[pw_nocontrol] = max(2, player->powers[pw_nocontrol]);
|
||||||
|
|
||||||
if (leveltime % 8 == 0 && !mapreset)
|
if (leveltime % 8 == 0 && !mapreset)
|
||||||
{
|
{
|
||||||
|
|
@ -541,7 +540,8 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
|
||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
static void K_DropDashWait(player_t *player)
|
static void K_DropDashWait(player_t *player)
|
||||||
{
|
{
|
||||||
player->respawn.timer--;
|
if (player->powers[pw_nocontrol] == 0)
|
||||||
|
player->respawn.timer--;
|
||||||
|
|
||||||
if (leveltime % 8 == 0)
|
if (leveltime % 8 == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
32
src/p_spec.c
32
src/p_spec.c
|
|
@ -2066,7 +2066,12 @@ static void K_HandleLapIncrement(player_t *player)
|
||||||
{
|
{
|
||||||
if (player)
|
if (player)
|
||||||
{
|
{
|
||||||
if ((player->starpostnum == numstarposts) || (player->laps == 0))
|
if (leveltime < starttime)
|
||||||
|
{
|
||||||
|
// Will fault the player
|
||||||
|
K_DoIngameRespawn(player);
|
||||||
|
}
|
||||||
|
else if ((player->starpostnum == numstarposts) || (player->laps == 0))
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
UINT8 nump = 0;
|
UINT8 nump = 0;
|
||||||
|
|
@ -2101,6 +2106,14 @@ static void K_HandleLapIncrement(player_t *player)
|
||||||
player->karthud[khud_lapanimation] = 80;
|
player->karthud[khud_lapanimation] = 80;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rainbowstartavailable == true)
|
||||||
|
{
|
||||||
|
S_StartSound(player->mo, sfx_s23c);
|
||||||
|
player->kartstuff[k_startboost] = 125;
|
||||||
|
K_SpawnDriftBoostExplosion(player, 3);
|
||||||
|
rainbowstartavailable = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (netgame && player->laps >= (UINT8)cv_numlaps.value)
|
if (netgame && player->laps >= (UINT8)cv_numlaps.value)
|
||||||
CON_LogMessage(va(M_GetText("%s has finished the race.\n"), player_names[player-players]));
|
CON_LogMessage(va(M_GetText("%s has finished the race.\n"), player_names[player-players]));
|
||||||
|
|
||||||
|
|
@ -2184,23 +2197,6 @@ static void K_HandleLapIncrement(player_t *player)
|
||||||
{
|
{
|
||||||
S_StartSound(player->mo, sfx_s26d);
|
S_StartSound(player->mo, sfx_s26d);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (leveltime < starttime)
|
|
||||||
{
|
|
||||||
// LATER: replace with the rotatey knockback whenever we get around to it
|
|
||||||
player->powers[pw_nocontrol] = (starttime - leveltime) + 50;
|
|
||||||
player->pflags |= PF_SKIDDOWN; // cheeky pflag reuse
|
|
||||||
S_StartSound(player->mo, sfx_s3k83);
|
|
||||||
player->karthud[khud_fault] = 1;
|
|
||||||
player->mo->momx = player->mo->momy = 0;
|
|
||||||
}
|
|
||||||
else if (rainbowstartavailable == true)
|
|
||||||
{
|
|
||||||
S_StartSound(player->mo, sfx_s23c);
|
|
||||||
player->kartstuff[k_startboost] = 125;
|
|
||||||
K_SpawnDriftBoostExplosion(player, 3);
|
|
||||||
rainbowstartavailable = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue