]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/bot/default/bot.qh
Bots: define the API boundaries
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / bot.qh
1 #ifndef BOT_H
2 #define BOT_H
3 /*
4  * Globals and Fields
5  */
6
7 const int AI_STATUS_ROAMING                                             = 1;    // Bot is just crawling the map. No enemies at sight
8 const int AI_STATUS_ATTACKING                                   = 2;    // There are enemies at sight
9 const int AI_STATUS_RUNNING                                             = 4;    // Bot is bunny hopping
10 const int AI_STATUS_DANGER_AHEAD                                = 8;    // There is lava/slime/trigger_hurt ahead
11 const int AI_STATUS_OUT_JUMPPAD                                 = 16;   // Trying to get out of a "vertical" jump pad
12 const int AI_STATUS_OUT_WATER                                   = 32;   // Trying to get out of water
13 const int AI_STATUS_WAYPOINT_PERSONAL_LINKING   = 64;   // Waiting for the personal waypoint to be linked
14 const int AI_STATUS_WAYPOINT_PERSONAL_GOING             = 128;  // Going to a personal waypoint
15 const int AI_STATUS_WAYPOINT_PERSONAL_REACHED   = 256;  // Personal waypoint reached
16 const int AI_STATUS_JETPACK_FLYING                              = 512;
17 const int AI_STATUS_JETPACK_LANDING                             = 1024;
18 const int AI_STATUS_STUCK                                               = 2048; // Cannot reach any goal
19
20 .float isbot; // true if this client is actually a bot
21 .int aistatus;
22
23 // Skill system
24 float autoskill_nextthink;
25
26 // havocbot_keyboardskill // keyboard movement
27 .float bot_moveskill; // moving technique
28 .float bot_dodgeskill; // dodging
29
30 .float bot_pingskill; // ping offset
31
32 .float bot_weaponskill; // weapon usage skill (combos, e.g.)
33 .float bot_aggresskill; // aggressivity, controls "think before fire" behaviour
34 .float bot_rangepreference; // weapon choice offset for range (>0 = prefer long range earlier "sniper", <0 = prefer short range "spammer")
35
36 .float bot_aimskill; // aim accuracy
37 .float bot_offsetskill; // aim breakage
38 .float bot_mouseskill; // mouse "speed"
39
40 .float bot_thinkskill; // target choice
41 .float bot_aiskill; // strategy choice
42
43 .float totalfrags_lastcheck;
44
45
46
47 entity bot_list;
48 entity player_list;
49 .entity nextbot;
50 .entity nextplayer;
51 .string cleanname;
52 .string netname_freeme;
53 .string playermodel_freeme;
54 .string playerskin_freeme;
55
56 .float bot_nextthink;
57
58 .float createdtime;
59 .float bot_preferredcolors;
60 .float bot_attack;
61 .float bot_dodge;
62 .float bot_dodgerating;
63
64 .float bot_pickup;
65 .float bot_pickupbasevalue;
66 .float bot_canfire;
67 .float bot_strategytime;
68
69 .float bot_forced_team;
70 .float bot_config_loaded;
71
72 float bot_strategytoken_taken;
73 entity bot_strategytoken;
74
75 float botframe_spawnedwaypoints;
76 float botframe_nextthink;
77 float botframe_nextdangertime;
78 float bot_cvar_nextthink;
79
80 /*
81  * Functions
82  */
83
84 entity bot_spawn();
85 float bot_fixcount();
86
87 void bot_think();
88 void bot_setnameandstuff();
89 void bot_custom_weapon_priority_setup();
90 void bot_endgame();
91 void bot_relinkplayerlist();
92 void bot_clientdisconnect();
93 void bot_clientconnect();
94 void bot_removefromlargestteam();
95 void bot_removenewest();
96 void autoskill(float factor);
97 void bot_serverframe();
98
99 .void() bot_ai;
100 .float(entity player, entity item) bot_pickupevalfunc;
101
102 /*
103  * Imports
104  */
105
106 void() havocbot_setupbot;
107
108 void bot_calculate_stepheightvec(void);
109 #endif