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