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
|
|
@ -409,7 +409,7 @@ struct botvars_t
|
|||
|
||||
typedef enum
|
||||
{
|
||||
UFOD_GENERIC = 1,
|
||||
UFOD_GENERIC = 1,
|
||||
UFOD_BOOST = 1<<1,
|
||||
UFOD_WHIP = 1<<2,
|
||||
UFOD_BANANA = 1<<3,
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
25
src/k_kart.c
25
src/k_kart.c
|
|
@ -3827,14 +3827,14 @@ void K_DoPowerClash(mobj_t *t1, mobj_t *t2) {
|
|||
{
|
||||
t1->player->instashield = 1;
|
||||
t1->player->speedpunt += 20;
|
||||
lag1 -= min(lag1, t1->player->speedpunt/10);
|
||||
lag1 -= min(lag1, t1->player->speedpunt/10);
|
||||
}
|
||||
|
||||
if (t2->player)
|
||||
{
|
||||
t2->player->instashield = 1;
|
||||
t2->player->speedpunt += 20;
|
||||
lag2 -= min(lag1, t2->player->speedpunt/10);
|
||||
lag2 -= min(lag1, t2->player->speedpunt/10);
|
||||
}
|
||||
|
||||
S_StartSound(t1, sfx_parry);
|
||||
|
|
@ -8231,7 +8231,7 @@ static void K_UpdateTripwire(player_t *player)
|
|||
if (triplevel != TRIPWIRE_CONSUME)
|
||||
player->tripwireLeniency = max(player->tripwireLeniency, TRIPWIRETIME);
|
||||
}
|
||||
|
||||
|
||||
// TRIPWIRE_CONSUME is only applied in very specific cases (currently, riding Garden Top)
|
||||
// and doesn't need leniency; however, it should track leniency from other pass conditions,
|
||||
// so that stripping Garden Top feels consistent.
|
||||
|
|
@ -8580,10 +8580,10 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
|
||||
if (P_PlayerInPain(player))
|
||||
{
|
||||
player->ringboost = 0;
|
||||
player->ringboost = 0;
|
||||
}
|
||||
else if (player->ringboost)
|
||||
{
|
||||
{
|
||||
// These values can get FUCKED ever since ring-stacking speed changes.
|
||||
// If we're not actively being awarded rings, roll off extreme ringboost durations.
|
||||
if (player->superring == 0)
|
||||
|
|
@ -8608,7 +8608,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->flamedash)
|
||||
{
|
||||
player->flamedash--;
|
||||
|
||||
|
||||
if (player->flamedash == 0)
|
||||
S_StopSoundByID(player->mo, sfx_fshld1);
|
||||
else if (player->flamedash == 3 && player->curshield == KSHIELD_FLAME) // "Why 3?" We can't blend sounds so this is the best shit I've got
|
||||
|
|
@ -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;
|
||||
|
|
@ -9067,7 +9072,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
else
|
||||
{
|
||||
player->eggmanexplode--;
|
||||
|
||||
|
||||
if (!S_SoundPlaying(player->mo, sfx_kc51))
|
||||
S_StartSound(player->mo, sfx_kc51);
|
||||
if (player->eggmanexplode == 5*TICRATE/2)
|
||||
|
|
@ -11830,7 +11835,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
UINT32 behind = K_GetItemRouletteDistance(player, player->itemRoulette.playing);
|
||||
UINT32 behindMulti = behind / 500;
|
||||
behindMulti = min(behindMulti, 60);
|
||||
|
||||
|
||||
|
||||
UINT32 award = 5*player->ringboxaward + 10;
|
||||
if (!cv_thunderdome.value)
|
||||
|
|
@ -12323,7 +12328,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
player->ballhogcharge++;
|
||||
if (player->ballhogcharge % BALLHOGINCREMENT == 0)
|
||||
{
|
||||
sfxenum_t hogsound[] =
|
||||
sfxenum_t hogsound[] =
|
||||
{
|
||||
sfx_bhog00,
|
||||
sfx_bhog01,
|
||||
|
|
@ -12982,7 +12987,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
if (P_MobjWasRemoved(player->trickIndicator) == false)
|
||||
trickcolor = player->trickIndicator->color;
|
||||
|
||||
if (player->trickpanel == TRICKSTATE_FORWARD)
|
||||
if (player->trickpanel == TRICKSTATE_FORWARD)
|
||||
{
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
@ -6047,7 +6049,7 @@ static inline void P_ArchiveMisc(savebuffer_t *save)
|
|||
if (mapnum < nummapheaders && mapheaderinfo[mapnum] != NULL)
|
||||
{
|
||||
WRITEUINT8(save->p, roundqueue.entries[i].overridden);
|
||||
|
||||
|
||||
if (roundqueue.entries[i].overridden == true)
|
||||
{
|
||||
WRITESTRINGL(save->p, mapheaderinfo[mapnum]->lumpname, MAXMAPLUMPNAME);
|
||||
|
|
|
|||
|
|
@ -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