Make bots properly use the flameshield rebalance

This commit is contained in:
NepDisk 2025-07-16 11:32:55 -04:00
parent 9ee65fc0e7
commit 0b1324aed3
2 changed files with 24 additions and 21 deletions

View file

@ -1246,17 +1246,34 @@ static void K_BotItemFlame(const player_t *player, ticcmd_t *cmd)
if (player->botvars.itemconfirm > TICRATE)
{
if (player->flametimer > 0)
if (player->botvars.difficulty >= 6 && player->flametimer <= 2*TICRATE)
{
cmd->buttons |= BT_ATTACK;
cmd->bot.itemconfirm = 0;
}
else if (player->flametimer > 0)
{
if (player->botvars.difficulty < 6 || player->flamestore < FLAMESTOREMAX - TICRATE/4)
{
cmd->buttons |= BT_ATTACK;
cmd->bot.itemconfirm = 0;
}
else
{
UINT8 difficultyadjust = MAXBOTDIFFICULTY - player->botvars.difficulty;
cmd->bot.itemconfirm = (-TICRATE/2) - difficultyadjust;
}
}
}
else
{
if (player->botvars.difficulty >= 6 && player->flametimer <= 2*TICRATE)
{
cmd->bot.itemconfirm = 0;
}
cmd->bot.itemconfirm++;
}
}
/*--------------------------------------------------
@ -1559,6 +1576,10 @@ void K_UpdateBotGameplayVarsItemUsage(player_t *player)
{
;
}
else if (player->flametimer > 0)
{
;
}
else
{
switch (player->itemtype)
@ -1567,24 +1588,6 @@ void K_UpdateBotGameplayVarsItemUsage(player_t *player)
{
break;
}
case KITEM_FLAMESHIELD:
{
if (player->botvars.itemconfirm == 0
&& (player->itemflags & IF_HOLDREADY) == IF_HOLDREADY)
{
INT32 flamemax = player->flametimer;
if (player->flamestore < flamemax || flamemax == 0)
{
;
}
else
{
player->botvars.itemconfirm = (3 * flamemax / 4) + (TICRATE / 2);
}
}
break;
}
}
}
}

View file

@ -10812,7 +10812,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
}
player->flamedash += incr;
player->flamestore = min(player->flamestore + metincr, TICRATE*2);
player->flamestore = min(player->flamestore + metincr, FLAMESTOREMAX);
player->flametimer -= comincr;
if (player->flametimer <= 0)