1 void() havocbot_role_ft_freeing;
2 void() havocbot_role_ft_offense;
4 void havocbot_goalrating_freeplayers(float ratingscale, vector org, float sradius)
11 if ((head != self) && (head.team == self.team))
13 if (head.freezetag_frozen)
15 distance = vlen(head.origin - org);
16 if (distance > sradius)
18 navigation_routerating(head, ratingscale, 2000);
22 // If teamate is not frozen still seek them out as fight better
24 navigation_routerating(head, ratingscale/3, 2000);
30 void havocbot_role_ft_offense()
35 if(self.deadflag != DEAD_NO)
38 if (!self.havocbot_role_timeout)
39 self.havocbot_role_timeout = time + random() * 10 + 20;
41 // Count how many players on team are unfrozen.
45 if ((head.team == self.team) && (!head.freezetag_frozen))
49 // If only one left on team or if role has timed out then start trying to free players.
50 if (((unfrozen == 0) && (!self.freezetag_frozen)) || (time > self.havocbot_role_timeout))
52 dprint("changing role to freeing\n");
53 self.havocbot_role = havocbot_role_ft_freeing;
54 self.havocbot_role_timeout = 0;
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(20000, self.origin, 10000);
65 havocbot_goalrating_freeplayers(9000, self.origin, 10000);
66 //havocbot_goalrating_waypoints(1, self.origin, 1000);
67 navigation_goalrating_end();
71 void havocbot_role_ft_freeing()
73 if(self.deadflag != DEAD_NO)
76 if (!self.havocbot_role_timeout)
77 self.havocbot_role_timeout = time + random() * 10 + 20;
79 if (time > self.havocbot_role_timeout)
81 dprint("changing role to offense\n");
82 self.havocbot_role = havocbot_role_ft_offense;
83 self.havocbot_role_timeout = 0;
87 if (time > self.bot_strategytime)
89 self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
91 navigation_goalrating_start();
92 havocbot_goalrating_items(8000, self.origin, 10000);
93 havocbot_goalrating_enemyplayers(10000, self.origin, 10000);
94 havocbot_goalrating_freeplayers(20000, self.origin, 10000);
95 //havocbot_goalrating_waypoints(1, self.origin, 1000);
96 navigation_goalrating_end();
100 void havocbot_chooserole_ft()
102 if(self.deadflag != DEAD_NO)
106 self.havocbot_role = havocbot_role_ft_freeing;
108 self.havocbot_role = havocbot_role_ft_offense;