In Battle, pop bubble on damage or clash and increase cooldown

This commit is contained in:
Antonio Martinez 2025-06-25 15:57:34 -04:00
parent 4e23ebe95b
commit 72c680b54f
3 changed files with 19 additions and 4 deletions

View file

@ -885,18 +885,28 @@ boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2)
thing = oldthing;
P_SetTarget(&g_tm.thing, oldg_tm.thing);*/
boolean hit = false;
if (K_KartBouncing(t2, t1->target) == true)
{
if (t2->player && t1->target && t1->target->player)
{
K_PvPTouchDamage(t2, t1->target);
hit = K_PvPTouchDamage(t2, t1->target);
}
// Don't play from t1 else it gets cut out... for some reason.
S_StartSound(t2, sfx_s3k44);
}
return true;
if (hit && (gametyperules & GTR_BUMPERS))
{
K_PopBubbleShield(t1->target->player);
return false;
}
else
{
return true;
}
}
if (K_BubbleShieldCanReflect(t1, t2))

View file

@ -72,8 +72,11 @@
// comeback is Battle Mode's karma comeback, also bool
// mapreset is set when enough players fill an empty server
static void K_PopBubbleShield(player_t *player)
void K_PopBubbleShield(player_t *player)
{
if (player->curshield != KSHIELD_BUBBLE)
return;
S_StartSound(player->mo, sfx_kc31);
K_StripItems(player);
K_AddHitLag(player->mo, 4, false);
@ -14566,7 +14569,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
S_StartSound(player->mo, sfx_s3k75);
player->bubbleblowup++;
player->bubblecool = player->bubbleblowup*4;
player->bubblecool = player->bubbleblowup * (gametyperules & GTR_BUMPERS ? 6 : 4);
if (player->bubbleblowup > bubbletime*2)
{

View file

@ -111,6 +111,8 @@ Make sure this matches the actual number of states
angle_t K_ReflectAngle(angle_t angle, angle_t against, fixed_t maxspeed, fixed_t yourspeed);
void K_PopBubbleShield(player_t *player);
boolean K_IsDuelItem(mobjtype_t type);
boolean K_DuelItemAlwaysSpawns(mapthing_t *mt);
boolean K_InRaceDuel(void);