From a77c713a977f1bebb86268f432b045615ed3447d Mon Sep 17 00:00:00 2001 From: minenice55 Date: Sat, 13 Dec 2025 23:28:07 -0500 Subject: [PATCH] cooldown between bubble contacts will likely need more done to prevent melting from pvp interactions --- src/d_player.h | 1 + src/k_kart.c | 17 +++++++++++++++++ src/p_saveg.c | 1 + 3 files changed, 19 insertions(+) diff --git a/src/d_player.h b/src/d_player.h index 932197544..c97420b69 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -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") diff --git a/src/k_kart.c b/src/k_kart.c index 7c21a3001..c186281be 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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) diff --git a/src/p_saveg.c b/src/p_saveg.c index ea58d3f74..35e61978c 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -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);