mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-26 04:51:43 +00:00
Improve Ballhog charge conditions
This commit is contained in:
parent
bd2507bee7
commit
7c962fc0fa
1 changed files with 18 additions and 6 deletions
|
|
@ -923,6 +923,7 @@ static void K_BotItemBallhog(player_t *player, ticcmd_t *cmd)
|
|||
boolean tryLookback = false;
|
||||
UINT8 snipeMul = 2;
|
||||
player_t *target = NULL;
|
||||
boolean hold = false;
|
||||
|
||||
if (player->speed > topspeed)
|
||||
{
|
||||
|
|
@ -930,8 +931,6 @@ static void K_BotItemBallhog(player_t *player, ticcmd_t *cmd)
|
|||
snipeMul = 3; // Confirm faster when you'll throw it with a bunch of extra speed!!
|
||||
}
|
||||
|
||||
player->botvars.itemconfirm++;
|
||||
|
||||
target = K_PlayerInCone(player, radius, 15, false);
|
||||
if (target != NULL)
|
||||
{
|
||||
|
|
@ -955,11 +954,24 @@ static void K_BotItemBallhog(player_t *player, ticcmd_t *cmd)
|
|||
cmd->buttons |= BT_LOOKBACK;
|
||||
}
|
||||
|
||||
if (player->botvars.itemconfirm > 10*TICRATE)
|
||||
if (target != NULL)
|
||||
{
|
||||
// Charge up!
|
||||
hold = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we lose sight of the target, then we'll just
|
||||
// let go and it'll do a partial-blast.
|
||||
|
||||
// If we've been waiting for too long though, then
|
||||
// we'll go for the full charge :)
|
||||
player->botvars.itemconfirm++;
|
||||
hold = (player->botvars.itemconfirm > 10*TICRATE);
|
||||
}
|
||||
|
||||
if (hold == true)
|
||||
{
|
||||
// Charge up. If we lose sight of the target, then
|
||||
// we'll just let go and do a partial-charge.
|
||||
// Otherwise we'll go for full-charge :)
|
||||
cmd->throwdir = KART_FULLTURN * throwdir;
|
||||
cmd->buttons |= BT_ATTACK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue