From b6af96cf410184b31c002febb081ab9c663db277 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Fri, 13 Mar 2026 20:45:41 -0400 Subject: [PATCH] start alt thunder --- src/d_main.cpp | 2 +- src/d_player.h | 2 ++ src/k_hud.c | 4 ++++ src/k_items.c | 57 ++++++++++++++++++++++++++++++++++++++++---------- src/k_items.h | 1 + 5 files changed, 54 insertions(+), 12 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 3f6fedf33..f3a5b60bc 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -93,7 +93,7 @@ #define ASSET_HASH_TEXTURES_KART 0xb4211b2f32b6a291 #define ASSET_HASH_CHARS_KART 0x1e68a3e01aa5c68b #define ASSET_HASH_MAPS_KART 0x38558ed00da41ce9 -#define ASSET_HASH_MAIN_PK3 0x9a54c263d9f325cd +#define ASSET_HASH_MAIN_PK3 0x049b68caee0ba709 #define ASSET_HASH_MAPPATCH_PK3 0x1745690024efbaf8 #define ASSET_HASH_BONUSCHARS_KART 0x60e6f13d822a7461 #ifdef USE_PATCH_FILE diff --git a/src/d_player.h b/src/d_player.h index 9e5d8cb45..74b746f46 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -698,6 +698,8 @@ struct player_t mobj_t *shieldtracer; // Blankart: Shield mobj + tic_t altthundercharge; // charge of Alt. Thunder Shield + UINT8 bubblecool; // Bubble Shield use cooldown UINT8 bubbleblowup; // Bubble Shield usage blowup UINT8 bubblehealth; // Bubble Shield health diff --git a/src/k_hud.c b/src/k_hud.c index 72570a284..e62e44b9a 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -1505,6 +1505,10 @@ static void K_drawKartItem(void) itembar = FixedDiv(stplyr->bubblehealth, MAXBUBBLEHEALTH); } + else if (stplyr->altthundercharge > 0) + { + itembar = FixedDiv(stplyr->altthundercharge, ALTTHUNDERCHARGETIME); + } else if (stplyr->bricktimer > 0) { if (leveltime & 2) diff --git a/src/k_items.c b/src/k_items.c index b67993b7d..843e007ad 100644 --- a/src/k_items.c +++ b/src/k_items.c @@ -2408,19 +2408,54 @@ void K_PlayerItemThink(player_t *player, boolean onground) S_StartSound(player->mo, sfx_s3k41); } - if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) + if (K_IsKartItemAlternate(KITEM_THUNDERSHIELD)) { - K_DoThunderShield(player); - if (player->itemamount > 0) + if (!HOLDING_ITEM && NO_HYUDORO) { - // Why is this a conditional? - // Thunder shield: the only item that allows you to - // activate a mine while you're out of its radius, - // the SAME tic it sets your itemamount to 0 - // ...:dumbestass: - player->itemamount--; - K_PlayAttackTaunt(player->mo); - K_BotResetItemConfirm(player, false); + if (buttons & BT_ATTACK) + { + player->itemflags &= ~IF_HOLDREADY; + player->altthundercharge++; + } + else + { + if (player->altthundercharge) + { + if (player->altthundercharge >= ALTTHUNDERCHARGETIME) + { + K_DoThunderShield(player); + } + else + { + } + if (player->itemamount > 0) + { + player->itemamount--; + K_PlayAttackTaunt(player->mo); + K_BotResetItemConfirm(player, false); + } + } + player->itemflags |= IF_HOLDREADY; + player->altthundercharge = 0; + } + } + } + else + { + if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) + { + K_DoThunderShield(player); + if (player->itemamount > 0) + { + // Why is this a conditional? + // Thunder shield: the only item that allows you to + // activate a mine while you're out of its radius, + // the SAME tic it sets your itemamount to 0 + // ...:dumbestass: + player->itemamount--; + K_PlayAttackTaunt(player->mo); + K_BotResetItemConfirm(player, false); + } } } break; diff --git a/src/k_items.h b/src/k_items.h index 272363bd4..4e62d36ed 100644 --- a/src/k_items.h +++ b/src/k_items.h @@ -235,6 +235,7 @@ extern consvar_t cv_karteggmine_slotbrick; extern consvar_t cv_kartthunder_radius; #define BUBBLEBOOSTTIME (7 * sneakertime / 10) +#define ALTTHUNDERCHARGETIME ((92*TICRATE)/60) #ifdef __cplusplus } // extern "C"