]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/api.qh
Bots: add navigation_clearroute and goalcurrent to public API
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / api.qh
index 9dc20ebb3b70e765544fc5331aaad5ade413cb63..dbe3197a7c97c0a6cbbe2e7e108281a4444adb5f 100644 (file)
@@ -1,30 +1,23 @@
-#ifndef BOT_API_H
-#define BOT_API_H
+#pragma once
 
-#include "../defs.qh"
-#include "../autocvars.qh"
-#include "../../common/weapons/all.qh"
-#include "../../common/teams.qh"
-#include "../teamplay.qh"
-#include "../miscfunctions.qh"
-#include "../campaign.qh"
-#include "../cl_client.qh"
-#include "../mutators/mutators_include.qh"
-#include "../constants.qh"
-#include "../weapons/weaponsystem.qh"
+#include <common/weapons/_all.qh>
 
-const int WAYPOINTFLAG_GENERATED = 0x800000;
+const int WAYPOINTFLAG_GENERATED = BIT(23);
+const int WAYPOINTFLAG_ITEM = BIT(22);
+const int WAYPOINTFLAG_TELEPORT = BIT(21);
+const int WAYPOINTFLAG_NORELINK = BIT(20);
+const int WAYPOINTFLAG_PERSONAL = BIT(19);
+const int WAYPOINTFLAG_PROTECTED = BIT(18);  // Useless WP detection never kills these.
+const int WAYPOINTFLAG_USEFUL = BIT(17);  // Useless WP detection temporary flag.
+const int WAYPOINTFLAG_DEAD_END = BIT(16);  // Useless WP detection temporary flag.
 
-int autocvar_bot_vs_human;
-int autocvar_bot_number;
-bool autocvar_bot_sound_monopoly;
-float autocvar_bot_ai_strategyinterval;
+entity kh_worldkeylist;
+.entity kh_worldkeynext;
 
 float bot_custom_weapon;
 float bot_weapons_close[Weapons_MAX];
 float bot_weapons_far[Weapons_MAX];
 float bot_weapons_mid[Weapons_MAX];
-float currentbots;
 float skill;
 
 .float bot_attack;
@@ -53,33 +46,33 @@ float skill;
 .float wpcost;
 .int wpflags;
 
-bool bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float applygravity);
-void bot_clientconnect();
-void bot_clientdisconnect();
+bool bot_aim(entity this, float shotspeed, float shotspeedupward, float maxshottime, float applygravity);
+void bot_clientconnect(entity this);
+void bot_clientdisconnect(entity this);
 void bot_cmdhelp(string scmd);
 void bot_endgame();
 bool bot_fixcount();
 void bot_list_commands();
 void bot_queuecommand(entity bot, string cmdstring);
+void bot_clear(entity this);
 void bot_relinkplayerlist();
 void bot_resetqueues();
 void bot_serverframe();
-bool bot_shouldattack(entity e);
-void bot_think();
+bool bot_shouldattack(entity this, entity e);
+void bot_think(entity this);
 
 entity find_bot_by_name(string name);
 entity find_bot_by_number(float number);
 
-void havocbot_goalrating_controlpoints(float ratingscale, vector org, float sradius);
-void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradius);
-void havocbot_goalrating_items(float ratingscale, vector org, float sradius);
+void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius);
+void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius);
 
 entity navigation_findnearestwaypoint(entity ent, float walkfromwp);
-void navigation_goalrating_end();
-void navigation_goalrating_start();
-void navigation_markroutes(entity fixed_source_waypoint);
+void navigation_goalrating_end(entity this);
+void navigation_goalrating_start(entity this);
+void navigation_markroutes(entity this, entity fixed_source_waypoint);
 void navigation_markroutes_inverted(entity fixed_source_waypoint);
-void navigation_routerating(entity e, float f, float rangebias);
+void navigation_routerating(entity this, entity e, float f, float rangebias);
 
 bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float movemode);
 
@@ -93,4 +86,5 @@ void waypoint_spawnforteleporter(entity e, vector destination, float timetaken);
 void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken);
 entity waypoint_spawn(vector m1, vector m2, float f);
 
-#endif
+.entity goalcurrent;
+void navigation_clearroute(entity this);