From 60bf891425efed5eee1b3f212d7cc3174a4b9fde Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 27 Jun 2018 14:29:56 +0200 Subject: [PATCH] Bot AI: improve Keepaway bot roles --- qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qc b/qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qc index 77a4a41e9..7c0356b38 100644 --- a/qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qc +++ b/qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qc @@ -213,20 +213,15 @@ void ka_Reset(entity this) void havocbot_goalrating_ball(entity this, float ratingscale, vector org) { - float t; entity ball_owner; ball_owner = ka_ball.owner; if (ball_owner == this) return; - // If ball is carried by player then hunt them down. if (ball_owner) - { - t = (GetResourceAmount(this, RESOURCE_HEALTH) + GetResourceAmount(this, RESOURCE_ARMOR)) / (GetResourceAmount(ball_owner, RESOURCE_HEALTH) + GetResourceAmount(ball_owner, RESOURCE_ARMOR)); - navigation_routerating(this, ball_owner, t * ratingscale, 2000); - } - else // Ball has been dropped so collect. + navigation_routerating(this, ball_owner, ratingscale, 2000); + else navigation_routerating(this, ka_ball, ratingscale, 2000); } @@ -263,7 +258,7 @@ void havocbot_role_ka_collector(entity this) navigation_goalrating_start(this); havocbot_goalrating_items(this, 10000, this.origin, 10000); havocbot_goalrating_enemyplayers(this, 500, this.origin, 10000); - havocbot_goalrating_ball(this, 20000, this.origin); + havocbot_goalrating_ball(this, 8000, this.origin); navigation_goalrating_end(this); navigation_goalrating_timeout_set(this); -- 2.39.2