}
}
-//Race:
-//go to next checkpoint, and annoy enemies
-.float race_checkpoint;
-void havocbot_role_race()
-{
- if(self.deadflag != DEAD_NO)
- return;
-
- entity e;
- if (self.bot_strategytime < time)
- {
- self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
- navigation_goalrating_start();
- /*
- havocbot_goalrating_items(100, self.origin, 10000);
- havocbot_goalrating_enemyplayers(500, self.origin, 20000);
- */
-
- for(e = world; (e = find(e, classname, "trigger_race_checkpoint")) != world; )
- {
- if(e.cnt == self.race_checkpoint)
- {
- navigation_routerating(e, 1000000, 5000);
- }
- else if(self.race_checkpoint == -1)
- {
- navigation_routerating(e, 1000000, 5000);
- }
- }
-
- navigation_goalrating_end();
- }
-}
-
void havocbot_chooserole_dm()
{
self.havocbot_role = havocbot_role_dm;
+// legacy bot roles
+.float race_checkpoint;
+void havocbot_role_cts()
+{
+ if(self.deadflag != DEAD_NO)
+ return;
+
+ entity e;
+ if (self.bot_strategytime < time)
+ {
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
+ navigation_goalrating_start();
+
+ for(e = world; (e = find(e, classname, "trigger_race_checkpoint")) != world; )
+ {
+ if(e.cnt == self.race_checkpoint)
+ {
+ navigation_routerating(e, 1000000, 5000);
+ }
+ else if(self.race_checkpoint == -1)
+ {
+ navigation_routerating(e, 1000000, 5000);
+ }
+ }
+
+ navigation_goalrating_end();
+ }
+}
+
void cts_ScoreRules()
{
ScoreRules_basics(0, 0, 0, FALSE);
return FALSE;
}
-MUTATOR_HOOKFUNCTION(cts_HavocBot_ChooseRule)
+MUTATOR_HOOKFUNCTION(cts_BotRoles)
{
- self.havocbot_role = havocbot_role_race;
+ self.havocbot_role = havocbot_role_cts;
return TRUE;
}
MUTATOR_HOOK(PlayerSpawn, cts_PlayerSpawn, CBC_ORDER_ANY);
MUTATOR_HOOK(PutClientInServer, cts_PutClientInServer, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDies, cts_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRule, cts_HavocBot_ChooseRule, CBC_ORDER_ANY);
+ MUTATOR_HOOK(HavocBot_ChooseRule, cts_BotRoles, CBC_ORDER_ANY);
MUTATOR_HOOK(GetPressedKeys, cts_PlayerPostThink, CBC_ORDER_ANY);
MUTATOR_HOOK(ForbidThrowCurrentWeapon, cts_ForbidThrowing, CBC_ORDER_ANY);
MUTATOR_HOOK(FilterItem, cts_FilterItem, CBC_ORDER_ANY);
+// legacy bot roles
+.float race_checkpoint;
+void havocbot_role_race()
+{
+ if(self.deadflag != DEAD_NO)
+ return;
+
+ entity e;
+ if (self.bot_strategytime < time)
+ {
+ self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
+ navigation_goalrating_start();
+
+ for(e = world; (e = find(e, classname, "trigger_race_checkpoint")) != world; )
+ {
+ if(e.cnt == self.race_checkpoint)
+ {
+ navigation_routerating(e, 1000000, 5000);
+ }
+ else if(self.race_checkpoint == -1)
+ {
+ navigation_routerating(e, 1000000, 5000);
+ }
+ }
+
+ navigation_goalrating_end();
+ }
+}
+
void race_ScoreRules()
{
ScoreRules_basics(race_teams, 0, 0, FALSE);
return FALSE;
}
-MUTATOR_HOOKFUNCTION(race_HavocBot_ChooseRule)
+MUTATOR_HOOKFUNCTION(race_BotRoles)
{
self.havocbot_role = havocbot_role_race;
return TRUE;
MUTATOR_HOOK(PlayerSpawn, race_PlayerSpawn, CBC_ORDER_ANY);
MUTATOR_HOOK(PutClientInServer, race_PutClientInServer, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDies, race_PlayerDies, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRule, race_HavocBot_ChooseRule, CBC_ORDER_ANY);
+ MUTATOR_HOOK(HavocBot_ChooseRule, race_BotRoles, CBC_ORDER_ANY);
MUTATOR_HOOK(GetPressedKeys, race_PlayerPostThink, CBC_ORDER_ANY);
MUTATOR_HOOK(ForbidPlayerScore_Clear, race_ForbidClearPlayerScore, CBC_ORDER_ANY);
MUTATOR_HOOK(GetTeamCount, race_GetTeamCount, CBC_ORDER_ANY);