]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/bot/default/bot.qh
Update default video settings
[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 .bool isbot; // true if this client is actually a bot
20 .int aistatus;
21
22 // Skill system
23 #define SUPERBOT (skill > 100)
24
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_distance_far;
48 float bot_distance_close;
49
50 entity bot_list;
51 .entity nextbot;
52 .string cleanname;
53 // the *_freeme fields exist only to avoid an engine crash
54 // when trying to strunzone the original fields
55 .string netname_freeme;
56 .string playermodel_freeme;
57 .string playerskin_freeme;
58
59 .float bot_nextthink;
60
61 .float createdtime;
62 .float bot_preferredcolors;
63 .float bot_attack;
64 .float bot_dodge;
65 .float bot_dodgerating;
66
67 .float bot_pickup;
68 .float bot_pickupbasevalue;
69 .bool bot_pickup_respawning;
70 .float bot_strategytime;
71 .float bot_jump_time;
72
73 .float bot_forced_team;
74 .float bot_config_loaded;
75
76 float bot_strategytoken_taken;
77 entity bot_strategytoken;
78
79 float botframe_spawnedwaypoints;
80 float botframe_nextthink;
81 float botframe_nextdangertime;
82
83 int _content_type;
84 #define IN_LAVA(pos) (_content_type = pointcontents(pos), (_content_type == CONTENT_LAVA || _content_type == CONTENT_SLIME))
85 #define IN_LIQUID(pos) (_content_type = pointcontents(pos), (_content_type == CONTENT_WATER || _content_type == CONTENT_LAVA || _content_type == CONTENT_SLIME))
86 #define SUBMERGED(pos) IN_LIQUID(pos + autocvar_sv_player_viewoffset)
87 #define WETFEET(pos) IN_LIQUID(pos + eZ * (m1.z + 1))
88
89 /*
90  * Functions
91  */
92
93 entity bot_spawn();
94 bool bot_fixcount(bool multiple_per_frame);
95
96 void bot_think(entity this);
97 void bot_setnameandstuff(entity this);
98 void bot_custom_weapon_priority_setup();
99 void bot_endgame();
100 void bot_relinkplayerlist();
101 void bot_clientdisconnect(entity this);
102 void bot_clientconnect(entity this);
103 void bot_removefromlargestteam();
104 void bot_removenewest();
105 void autoskill(float factor);
106 void bot_serverframe();
107
108 .void(entity this) bot_ai;
109 .float(entity player, entity item) bot_pickupevalfunc;
110
111 /*
112  * Imports
113  */
114
115 void(entity this) havocbot_setupbot;
116
117 void bot_calculate_stepheightvec();