cooldown between bubble contacts

will likely need more done to prevent melting from pvp interactions
This commit is contained in:
minenice55 2025-12-13 23:28:07 -05:00
parent e639ea6225
commit a77c713a97
3 changed files with 19 additions and 0 deletions

View file

@ -644,6 +644,7 @@ struct player_t
UINT8 bubbleblowup; // Bubble Shield usage blowup
UINT8 bubblehealth; // Bubble Shield health
UINT16 bubbleboost; // Bubble shield boost timer
tic_t bubblebuffer; // Prevents Bubble Shield from taking damage
UINT16 flamedash; // Flame Shield dash power
INT32 flametimer; // Flame Shield dash meter left ("fuel")

View file

@ -5294,6 +5294,12 @@ boolean K_IsBubbleDefending(const player_t *player)
// Depletes a bubble shield's health, and pops the shield at 0 health.
void K_RemoveBubbleHealth(player_t *player, INT16 sub)
{
// don't damage if we have some buffer time
if (player->bubblebuffer > 0)
{
return;
}
// experiment: inflated bubble shield applies a direct reduction to all incoming damage
if (K_IsBubbleDefending(player))
{
@ -5302,7 +5308,13 @@ void K_RemoveBubbleHealth(player_t *player, INT16 sub)
player->bubblehealth = (UINT8)(max(0, (INT16)(player->bubblehealth) - sub));
if (player->bubblehealth <= 0)
{
K_PopPlayerShield(player);
}
else
{
player->bubblebuffer = 4;
}
}
// Detects type of Mobj for bubble shield chipping
@ -7271,6 +7283,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->bubbleboost--;
}
if (player->bubblebuffer)
{
player->bubblebuffer--;
}
if (player->growshrinktimer != 0)
{
if (player->growshrinktimer > 0)

View file

@ -681,6 +681,7 @@ static void P_NetSyncPlayers(savebuffer_t *save)
SYNC(players[i].bubbleblowup);
SYNC(players[i].bubblehealth);
SYNC(players[i].bubbleboost);
SYNC(players[i].bubblebuffer);
SYNC(players[i].flamedash);
SYNC(players[i].flametimer);