mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Flicker player and add hitlag when collecting a powerup
This commit is contained in:
parent
126c43b250
commit
cb21a9c8cd
5 changed files with 35 additions and 13 deletions
|
|
@ -972,6 +972,7 @@ struct player_t
|
|||
UINT8 defenseLockout; // Committed to universal attack/defense, make 'em vulnerable! No whip/guard.
|
||||
UINT8 instaWhipChargeLockout; // Input safety
|
||||
boolean oldGuard;
|
||||
tic_t powerupVFXTimer; // Battle powerup feedback
|
||||
|
||||
UINT8 preventfailsafe; // Set when taking damage to prevent cheesing eggboxes
|
||||
|
||||
|
|
|
|||
|
|
@ -8893,6 +8893,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
player->analoginput = false;
|
||||
}
|
||||
|
||||
if (player->powerupVFXTimer > 0)
|
||||
{
|
||||
player->powerupVFXTimer--;
|
||||
}
|
||||
|
||||
if (player->dotrickfx && !player->mo->hitlag)
|
||||
{
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "p_mobj.h"
|
||||
#include "s_sound.h"
|
||||
#include "p_tick.h"
|
||||
#include "k_hitlag.h"
|
||||
|
||||
tic_t K_PowerUpRemaining(const player_t* player, kartitems_t powerup)
|
||||
{
|
||||
|
|
@ -55,6 +56,8 @@ void K_GivePowerUp(player_t* player, kartitems_t powerup, tic_t time)
|
|||
|
||||
S_StartSound(NULL, sfx_gsha7);
|
||||
player->flashing = 2*TICRATE;
|
||||
K_AddHitLag(player->mo, BATTLE_POWERUP_VFX_TIME, false);
|
||||
player->powerupVFXTimer = BATTLE_POWERUP_VFX_TIME;
|
||||
|
||||
g_darkness.start = leveltime;
|
||||
g_darkness.end = leveltime + BATTLE_POWERUP_VFX_TIME + DARKNESS_FADE_TIME;
|
||||
|
|
|
|||
|
|
@ -584,6 +584,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT8(save->p, players[i].instaWhipCharge);
|
||||
WRITEUINT8(save->p, players[i].defenseLockout);
|
||||
WRITEUINT8(save->p, players[i].oldGuard);
|
||||
WRITEUINT8(save->p, players[i].powerupVFXTimer);
|
||||
|
||||
WRITEUINT8(save->p, players[i].preventfailsafe);
|
||||
|
||||
|
|
@ -1166,6 +1167,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].instaWhipCharge = READUINT8(save->p);
|
||||
players[i].defenseLockout = READUINT8(save->p);
|
||||
players[i].oldGuard = READUINT8(save->p);
|
||||
players[i].powerupVFXTimer = READUINT8(save->p);
|
||||
|
||||
players[i].preventfailsafe = READUINT8(save->p);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,18 @@ INT32 R_ThingLightLevel(mobj_t* thing)
|
|||
|
||||
if (player)
|
||||
{
|
||||
if ((player->instaWhipCharge || player->defenseLockout) && !player->whip && (leveltime & 1))
|
||||
if (player->powerupVFXTimer)
|
||||
{
|
||||
if ((leveltime & 1))
|
||||
{
|
||||
lightlevel -= 255;
|
||||
}
|
||||
else
|
||||
{
|
||||
lightlevel += 255;
|
||||
}
|
||||
}
|
||||
else if ((player->instaWhipCharge || player->defenseLockout) && !player->whip && (leveltime & 1))
|
||||
{
|
||||
// Darken on every other frame of instawhip cooldown
|
||||
lightlevel -= 128;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue