]> de.git.xonotic.org Git - voretournament/voretournament.git/blob - data/qcsrc/server/bot/bot.qh
21adcf1a359ef632560275de3c07a1c5c49d68da
[voretournament/voretournament.git] / data / qcsrc / server / bot / bot.qh
1 /*
2  * Globals and Fields
3  */
4
5 float AI_STATUS_ROAMING                         = 1;    // Bot is just crawling the map. No enemies at sight
6 float AI_STATUS_ATTACKING                       = 2;    // There are enemies at sight
7 float AI_STATUS_RUNNING                         = 4;    // Bot is bunny hopping
8 float AI_STATUS_DANGER_AHEAD                    = 8;    // There is lava/slime/trigger_hurt ahead
9 float AI_STATUS_OUT_JUMPPAD                     = 16;   // Trying to get out of a "vertical" jump pad
10 float AI_STATUS_OUT_WATER                       = 32;   // Trying to get out of water
11 float AI_STATUS_WAYPOINT_PERSONAL_LINKING       = 64;   // Waiting for the personal waypoint to be linked
12 float AI_STATUS_WAYPOINT_PERSONAL_GOING         = 128;  // Going to a personal waypoint
13 float AI_STATUS_WAYPOINT_PERSONAL_REACHED       = 256;  // Personal waypoint reached
14 float AI_STATUS_JETPACK_FLYING                  = 512;
15 float AI_STATUS_JETPACK_LANDING                 = 1024;
16
17 .float isbot; // true if this client is actually a bot
18 .float aistatus;
19
20 // Skill system
21 float skill;
22 float autoskill_nextthink;
23
24 // havocbot_keyboardskill // keyboard movement
25 .float bot_moveskill; // moving technique
26 .float bot_dodgeskill; // dodging
27
28 .float bot_pingskill; // ping offset
29
30 .float bot_weaponskill; // weapon usage skill (combos, e.g.)
31 .float bot_aggresskill; // aggressivity, controls "think before fire" behaviour
32 .float bot_rangepreference; // weapon choice offset for range (>0 = prefer long range earlier "sniper", <0 = prefer short range "spammer")
33
34 .float bot_aimskill; // aim accuracy
35 .float bot_offsetskill; // aim breakage
36 .float bot_mouseskill; // mouse "speed"
37
38 .float bot_thinkskill; // target choice
39 .float bot_aiskill; // strategy choice
40
41 .float bot_vorethink; // vore decision time
42 .float bot_vorefear; // vore fear choice
43 .float bot_voreteamheal; // vore teamheal choice
44
45 .float totalfrags_lastcheck;
46
47 // Custom weapon priorities
48 float bot_custom_weapon;
49 float bot_distance_far;
50 float bot_distance_close;
51
52 float bot_weapons_far[WEP_MAXCOUNT];
53 float bot_weapons_mid[WEP_MAXCOUNT];
54 float bot_weapons_close[WEP_MAXCOUNT];
55
56 entity bot_list;
57 entity player_list;
58 .entity nextbot;
59 .entity nextplayer;
60 .string cleanname;
61 .string netname_freeme;
62 .string playermodel_freeme;
63 .string playerskin_freeme;
64
65 .float bot_nextthink;
66
67 .float createdtime;
68 .float bot_preferredcolors;
69 .float bot_attack;
70 .float bot_dodge;
71 .float bot_dodgerating;
72
73 .float bot_pickup;
74 .float bot_pickupbasevalue;
75 .float bot_canfire;
76 .float bot_strategytime;
77
78 .float bot_forced_team;
79 .float bot_config_loaded;
80
81 float bot_strategytoken_taken;
82 entity bot_strategytoken;
83
84 float botframe_spawnedwaypoints;
85 float botframe_nextthink;
86 float botframe_nextdangertime;
87 float bot_cvar_nextthink;
88 float bot_ignore_bots; // let bots not attack other bots (only works in non-teamplay)
89
90 /*
91  * Functions
92  */
93
94 entity bot_spawn();
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 float sv_maxspeed;
116
117 void() havocbot_setupbot;
118
119 float c1, c2, c3, c4;
120 void CheckAllowedTeams(entity for_whom); void GetTeamCounts(entity other);
121 float JoinBestTeam(entity pl, float only_return_best, float forcebestteam);