]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/bot/bot.qh
Merge remote-tracking branch 'origin/master' into terencehill/menu_remove_tab_title
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / 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 skill;
25 float autoskill_nextthink;
26
27 // havocbot_keyboardskill // keyboard movement
28 .float bot_moveskill; // moving technique
29 .float bot_dodgeskill; // dodging
30
31 .float bot_pingskill; // ping offset
32
33 .float bot_weaponskill; // weapon usage skill (combos, e.g.)
34 .float bot_aggresskill; // aggressivity, controls "think before fire" behaviour
35 .float bot_rangepreference; // weapon choice offset for range (>0 = prefer long range earlier "sniper", <0 = prefer short range "spammer")
36
37 .float bot_aimskill; // aim accuracy
38 .float bot_offsetskill; // aim breakage
39 .float bot_mouseskill; // mouse "speed"
40
41 .float bot_thinkskill; // target choice
42 .float bot_aiskill; // strategy choice
43
44 .float totalfrags_lastcheck;
45
46 // Custom weapon priorities
47 float bot_custom_weapon;
48 float bot_distance_far;
49 float bot_distance_close;
50
51 float bot_weapons_far[WEP_MAXCOUNT];
52 float bot_weapons_mid[WEP_MAXCOUNT];
53 float bot_weapons_close[WEP_MAXCOUNT];
54
55 entity bot_list;
56 entity player_list;
57 .entity nextbot;
58 .entity nextplayer;
59 .string cleanname;
60 .string netname_freeme;
61 .string playermodel_freeme;
62 .string playerskin_freeme;
63
64 .float bot_nextthink;
65
66 .float createdtime;
67 .float bot_preferredcolors;
68 .float bot_attack;
69 .float bot_dodge;
70 .float bot_dodgerating;
71
72 .float bot_pickup;
73 .float bot_pickupbasevalue;
74 .float bot_canfire;
75 .float bot_strategytime;
76
77 .float bot_forced_team;
78 .float bot_config_loaded;
79
80 float bot_strategytoken_taken;
81 entity bot_strategytoken;
82
83 float botframe_spawnedwaypoints;
84 float botframe_nextthink;
85 float botframe_nextdangertime;
86 float bot_cvar_nextthink;
87 float bot_ignore_bots; // let bots not attack other bots (only works in non-teamplay)
88
89 /*
90  * Functions
91  */
92
93 entity bot_spawn();
94 float bot_fixcount();
95
96 void bot_think();
97 void bot_setnameandstuff();
98 void bot_custom_weapon_priority_setup();
99 void bot_endgame();
100 void bot_relinkplayerlist();
101 void bot_clientdisconnect();
102 void bot_clientconnect();
103 void bot_removefromlargestteam();
104 void bot_removenewest();
105 void autoskill(float factor);
106 void bot_serverframe();
107
108 .void() bot_ai;
109 .float(entity player, entity item) bot_pickupevalfunc;
110
111 /*
112  * Imports
113  */
114
115 void() havocbot_setupbot;
116
117 //float c1, c2, c3, c4;
118 void CheckAllowedTeams(entity for_whom); void GetTeamCounts(entity other);
119 float JoinBestTeam(entity pl, float only_return_best, float forcebestteam);
120
121 void bot_calculate_stepheightvec(void);
122 #endif