1 void() havocbot_role_ka_carrier;
2 void() havocbot_role_ka_collector;
3 void() havocbot_chooserole_ka;
8 // If you don't have the ball, get it; if you do, kill people.
10 void havocbot_goalrating_ball(float ratingscale, vector org)
13 local entity ball_owner;
14 ball_owner = ka_ball.owner;
16 if (ball_owner == self)
19 // If ball is carried by player then hunt them down.
22 t = (self.health + self.armorvalue) / (ball_owner.health + ball_owner.armorvalue);
23 navigation_routerating(ball_owner, t * ratingscale, 2000);
26 // Ball has been dropped so collect.
27 navigation_routerating(ka_ball, ratingscale, 2000);
30 void havocbot_role_ka_carrier()
32 if (self.deadflag != DEAD_NO)
35 if (time > self.bot_strategytime)
37 self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
39 navigation_goalrating_start();
40 havocbot_goalrating_items(10000, self.origin, 10000);
41 havocbot_goalrating_enemyplayers(20000, self.origin, 10000);
42 //havocbot_goalrating_waypoints(1, self.origin, 1000);
43 navigation_goalrating_end();
46 if (!self.ballcarried)
48 self.havocbot_role = havocbot_role_ka_collector;
49 self.bot_strategytime = 0;
53 void havocbot_role_ka_collector()
55 if (self.deadflag != DEAD_NO)
58 if (time > self.bot_strategytime)
60 self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
62 navigation_goalrating_start();
63 havocbot_goalrating_items(10000, self.origin, 10000);
64 havocbot_goalrating_enemyplayers(1000, self.origin, 10000);
65 havocbot_goalrating_ball(20000, self.origin);
66 navigation_goalrating_end();
71 self.havocbot_role = havocbot_role_ka_carrier;
72 self.bot_strategytime = 0;
76 void havocbot_chooserole_ka()
79 self.havocbot_role = havocbot_role_ka_carrier;
81 self.havocbot_role = havocbot_role_ka_collector;