mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 02:00:11 +00:00
Add K_DoInvincibility
This commit is contained in:
parent
67d4f96154
commit
74841257ad
2 changed files with 25 additions and 19 deletions
43
src/k_kart.c
43
src/k_kart.c
|
|
@ -5741,6 +5741,29 @@ static void K_ThrowLandMine(player_t *player)
|
|||
throwmo->movecount = 0; // above player
|
||||
}
|
||||
|
||||
void K_DoInvincibility(player_t *player)
|
||||
{
|
||||
if (!player->invincibilitytimer)
|
||||
{
|
||||
mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_INVULNFLASH);
|
||||
P_SetTarget(&overlay->target, player->mo);
|
||||
overlay->destscale = player->mo->scale;
|
||||
P_SetScale(overlay, player->mo->scale);
|
||||
}
|
||||
player->invincibilitytimer += itemtime+(2*TICRATE); // 10 seconds
|
||||
|
||||
if (P_IsLocalPlayer(player) == true)
|
||||
{
|
||||
S_ChangeMusicSpecial("kinvnc");
|
||||
}
|
||||
else //used to be "if (P_IsDisplayPlayer(player) == false)"
|
||||
{
|
||||
S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmi : sfx_kinvnc));
|
||||
}
|
||||
|
||||
P_RestoreMusic(player);
|
||||
}
|
||||
|
||||
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source)
|
||||
{
|
||||
mobj_t *cachenext;
|
||||
|
|
@ -9662,25 +9685,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
case KITEM_INVINCIBILITY:
|
||||
if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) // Doesn't hold your item slot hostage normally, so you're free to waste it if you have multiple
|
||||
{
|
||||
if (!player->invincibilitytimer)
|
||||
{
|
||||
mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_INVULNFLASH);
|
||||
P_SetTarget(&overlay->target, player->mo);
|
||||
overlay->destscale = player->mo->scale;
|
||||
P_SetScale(overlay, player->mo->scale);
|
||||
}
|
||||
player->invincibilitytimer += itemtime+(2*TICRATE); // 10 seconds
|
||||
|
||||
if (P_IsLocalPlayer(player) == true)
|
||||
{
|
||||
S_ChangeMusicSpecial("kinvnc");
|
||||
}
|
||||
else //used to be "if (P_IsDisplayPlayer(player) == false)"
|
||||
{
|
||||
S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmi : sfx_kinvnc));
|
||||
}
|
||||
|
||||
P_RestoreMusic(player);
|
||||
K_DoInvincibility(player);
|
||||
K_PlayPowerGloatSound(player->mo);
|
||||
player->itemamount--;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing,
|
|||
void K_PuntMine(mobj_t *mine, mobj_t *punter);
|
||||
void K_DoSneaker(player_t *player, INT32 type);
|
||||
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound);
|
||||
void K_DoInvincibility(player_t *player);
|
||||
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source);
|
||||
void K_UpdateHnextList(player_t *player, boolean clean);
|
||||
void K_DropHnextList(player_t *player, boolean keepshields);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue