mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Split instashield and guard cooldown
This commit is contained in:
parent
cac02bb01a
commit
de8f4812cf
5 changed files with 17 additions and 1 deletions
|
|
@ -743,6 +743,7 @@ struct player_t
|
|||
mobj_t *sliptideZipIndicator;
|
||||
|
||||
UINT8 instaShieldCooldown;
|
||||
UINT8 guardCooldown;
|
||||
|
||||
uint8_t public_key[PUBKEYLENGTH];
|
||||
|
||||
|
|
|
|||
|
|
@ -832,6 +832,7 @@ boolean K_InstaWhipCollide(mobj_t *shield, mobj_t *victim)
|
|||
attackerPlayer->spindashboost = 0;
|
||||
attackerPlayer->sneakertimer = 0;
|
||||
attackerPlayer->instaShieldCooldown = TICRATE*2;
|
||||
attackerPlayer->guardCooldown = TICRATE*2;
|
||||
attackerPlayer->flashing = 0;
|
||||
|
||||
mobj_t *broly = Obj_SpawnBrolyKi(victim, victimHitlag);
|
||||
|
|
|
|||
10
src/k_kart.c
10
src/k_kart.c
|
|
@ -3647,6 +3647,7 @@ void K_DoGuardBreak(mobj_t *t1, mobj_t *t2) {
|
|||
|
||||
// short-circuit instashield for vfx visibility
|
||||
t1->player->instaShieldCooldown = 2*TICRATE;
|
||||
t1->player->guardCooldown = 2*TICRATE;
|
||||
|
||||
S_StartSound(t1, sfx_gbrk);
|
||||
K_AddHitLag(t1, 24, true);
|
||||
|
|
@ -7920,6 +7921,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (!P_IsObjectOnGround(player->mo))
|
||||
player->instaShieldCooldown = max(player->instaShieldCooldown, 1);
|
||||
}
|
||||
|
||||
if (player->guardCooldown)
|
||||
player->guardCooldown--;
|
||||
|
||||
|
||||
if (player->startboost > 0 && onground == true)
|
||||
|
|
@ -8142,6 +8146,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
player->pflags &= ~PF_DRIFTINPUT;
|
||||
}
|
||||
|
||||
if (K_PlayerGuard(player))
|
||||
player->instaShieldCooldown = max(player->instaShieldCooldown, 12);
|
||||
|
||||
// Roulette Code
|
||||
K_KartItemRoulette(player, cmd);
|
||||
|
||||
|
|
@ -9831,7 +9838,7 @@ boolean K_PlayerEBrake(player_t *player)
|
|||
|
||||
boolean K_PlayerGuard(player_t *player)
|
||||
{
|
||||
return (K_PlayerEBrake(player) && player->spheres > 0 && player->instaShieldCooldown == 0);
|
||||
return (K_PlayerEBrake(player) && player->spheres > 0 && player->guardCooldown == 0);
|
||||
}
|
||||
|
||||
SINT8 K_Sliptiding(player_t *player)
|
||||
|
|
@ -10609,6 +10616,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
else
|
||||
{
|
||||
player->instaShieldCooldown = 50;
|
||||
player->guardCooldown = 50;
|
||||
S_StartSound(player->mo, sfx_iwhp);
|
||||
mobj_t *whip = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_INSTAWHIP);
|
||||
P_SetScale(whip, player->mo->scale);
|
||||
|
|
|
|||
|
|
@ -321,6 +321,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->sliptideZipBoost);
|
||||
else if (fastcmp(field,"instaShieldCooldown"))
|
||||
lua_pushinteger(L, plr->instaShieldCooldown);
|
||||
else if (fastcmp(field,"guardCooldown"))
|
||||
lua_pushinteger(L, plr->guardCooldown);
|
||||
/*
|
||||
else if (fastcmp(field,"itemroulette"))
|
||||
lua_pushinteger(L, plr->itemroulette);
|
||||
|
|
@ -717,6 +719,8 @@ static int player_set(lua_State *L)
|
|||
plr->sliptideZipBoost = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"instaShieldCooldown"))
|
||||
plr->instaShieldCooldown = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"guardCooldown"))
|
||||
plr->guardCooldown = luaL_checkinteger(L, 3);
|
||||
/*
|
||||
else if (fastcmp(field,"itemroulette"))
|
||||
plr->itemroulette = luaL_checkinteger(L, 3);
|
||||
|
|
|
|||
|
|
@ -420,6 +420,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
||||
|
||||
WRITEUINT8(save->p, players[i].instaShieldCooldown);
|
||||
WRITEUINT8(save->p, players[i].guardCooldown);
|
||||
|
||||
// respawnvars_t
|
||||
WRITEUINT8(save->p, players[i].respawn.state);
|
||||
|
|
@ -807,6 +808,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
READMEM(save->p, players[i].public_key, PUBKEYLENGTH);
|
||||
|
||||
players[i].instaShieldCooldown = READUINT8(save->p);
|
||||
players[i].guardCooldown = READUINT8(save->p);
|
||||
|
||||
// respawnvars_t
|
||||
players[i].respawn.state = READUINT8(save->p);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue