X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fapi.qh;h=fbf1a982c5f6fa951fbb706cce17a020ee2c1517;hp=9dc20ebb3b70e765544fc5331aaad5ade413cb63;hb=5fb2f3c4e123910e6291d6337fadd61f5199f5a5;hpb=13719cec41a5a1b20d0fff3fe1b6df449bc2a884 diff --git a/qcsrc/server/bot/api.qh b/qcsrc/server/bot/api.qh index 9dc20ebb3..fbf1a982c 100644 --- a/qcsrc/server/bot/api.qh +++ b/qcsrc/server/bot/api.qh @@ -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 -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,39 @@ 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, .entity weaponentity, 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); +void havocbot_goalrating_waypoints(entity this, float ratingscale, vector org, float sradius); +.entity bot_basewaypoint; +.bool navigation_dynamicgoal; +void navigation_dynamicgoal_init(entity this, bool initially_static); +void navigation_dynamicgoal_set(entity this); +void navigation_dynamicgoal_unset(entity this); 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 +92,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);