]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: improve Keepaway bot roles
authorterencehill <piuntn@gmail.com>
Wed, 27 Jun 2018 12:29:56 +0000 (14:29 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 27 Jun 2018 12:29:56 +0000 (14:29 +0200)
qcsrc/common/gamemodes/gamemode/keepaway/keepaway.qc

index 77a4a41e94c5ec8d13d07ae9e8dc7a3b345cf39b..7c0356b38d739d790cf150a4c93c71ae959bedeb 100644 (file)
@@ -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);