From 13f17180d3342d8e0c472df08a85d864d995c740 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Wed, 4 Jun 2025 15:18:26 -0400 Subject: [PATCH] Fix krangled expreduce math, add maxbot shield error --- src/k_bot.cpp | 6 +++--- src/k_botitem.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/k_bot.cpp b/src/k_bot.cpp index 2daaf3cce..d9d91a134 100644 --- a/src/k_bot.cpp +++ b/src/k_bot.cpp @@ -683,11 +683,11 @@ fixed_t K_BotRubberband(const player_t *player) // Allow the status quo to assert itself a bit. Bots get most of their speed from their // mechanics adjustments, not from items, so kill some bot speed if they've got bad EXP. - if (player->gradingfactor < FRACUNIT) + if (player->gradingfactor < FRACUNIT && !(player->botvars.rival)) { - UINT8 levelreduce = 2; // How much to drop the "effective level" of bots that are consistently behind + UINT8 levelreduce = 3; // How much to drop the "effective level" of bots that are consistently behind fixed_t effgradingfactor = std::max(FRACUNIT/2, player->gradingfactor); - expreduce = Easing_Linear(effgradingfactor * 2 - FRACUNIT, 0, levelreduce*FRACUNIT); + expreduce = Easing_Linear((effgradingfactor - FRACUNIT/2) * 2, levelreduce*FRACUNIT, 0); } fixed_t difficultyEase = (((player->botvars.difficulty - 1) * FRACUNIT) - expreduce) / (MAXBOTDIFFICULTY - 1); diff --git a/src/k_botitem.cpp b/src/k_botitem.cpp index e3bb56c33..578c343eb 100644 --- a/src/k_botitem.cpp +++ b/src/k_botitem.cpp @@ -1201,7 +1201,7 @@ static void K_BotItemLightning(const player_t *player, ticcmd_t *cmd) ZoneScoped; fixed_t radius = 192 * player->mo->scale; - radius = Easing_Linear(FRACUNIT * player->botvars.difficulty / MAXBOTDIFFICULTY, 2*radius, radius); + radius = Easing_Linear(FRACUNIT * player->botvars.difficulty / MAXBOTDIFFICULTY, 2*radius, 4*radius/3); if (K_BotUseItemNearPlayer(player, cmd, radius) == false) { @@ -1243,7 +1243,7 @@ static void K_BotItemBubble(const player_t *player, ticcmd_t *cmd) if (player->bubblecool <= 0) { fixed_t radius = 192 * player->mo->scale; - radius = Easing_Linear(FRACUNIT * player->botvars.difficulty / MAXBOTDIFFICULTY, 2*radius, radius); + radius = Easing_Linear(FRACUNIT * player->botvars.difficulty / MAXBOTDIFFICULTY, 2*radius, 4*radius/3); for (i = 0; i < MAXPLAYERS; i++) {