From 4e6fa59b487976e92ade2d58e64fd68cfd6f1758 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Mon, 2 Jun 2025 19:57:31 -0400 Subject: [PATCH] Bail stun etc --- src/k_kart.c | 13 +++++++++---- src/k_kart.h | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b94e74757..cb62aa853 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9813,9 +9813,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) // UINT16 oldringboost = player->ringboost; - if (player->superring == 0 || player->stunned) + if (!player->baildrop && (player->superring == 0 || player->stunned)) player->ringboost -= max((player->ringboost / roller), 1); - else if (K_LegacyRingboost(player)) + else if (K_LegacyRingboost(player) || player->baildrop) player->ringboost--; else player->ringboost -= min(K_GetFullKartRingPower(player, false) - 1, max(player->ringboost / 2 / roller, 1)); @@ -10005,6 +10005,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->baildrop) { + if (player->stunned & 0x8000) + player->stunned = 0x8000 | BAILSTUN; + else + player->stunned = BAILSTUN; + mobj_t *pmo = player->mo; // particle spawn #define BAILSPARKLE_MAXBAIL 61 // amount of bail rings needed for max sparkle spawn frequency @@ -13981,10 +13986,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->rings = 0; } - UINT32 totalrings = player->rings + player->superring + player->pickuprings; + UINT32 totalrings = player->rings + player->superring + player->pickuprings + debtrings; totalrings = max(totalrings, 0); UINT32 bailboost = FixedInt(FixedMul(totalrings*FRACUNIT, BAIL_BOOST)); - UINT32 baildrop = debtrings + FixedInt(FixedMul((totalrings)*FRACUNIT, BAIL_DROP)); + UINT32 baildrop = FixedInt(FixedMul((totalrings)*FRACUNIT, BAIL_DROP)); if (player->itemRoulette.active) { diff --git a/src/k_kart.h b/src/k_kart.h index 1193dd60e..b2e3a02a6 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -45,9 +45,10 @@ Make sure this matches the actual number of states #define PUNISHWINDOW (7*TICRATE/10) #define BAIL_MAXCHARGE (84) // tics to bail when in painstate nad in air, on ground is half, if you touch this, also update Obj_BailChargeThink synced animation logic -#define BAIL_DROP (FRACUNIT/2) +#define BAIL_DROP (FRACUNIT) #define BAIL_BOOST (FRACUNIT) #define BAIL_DROPFREQUENCY (3) +#define BAILSTUN (TICRATE*10) #define MAXCOMBOTHRUST (mapobjectscale*20) #define MAXCOMBOFLOAT (mapobjectscale*10)