From: terencehill Date: Wed, 27 Jun 2018 12:29:56 +0000 (+0200) Subject: Bot AI: improve Keepaway bot roles X-Git-Tag: xonotic-v0.8.5~1923^2~15 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=60bf891425efed5eee1b3f212d7cc3174a4b9fde;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: improve Keepaway bot roles --- 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);