]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/bot/bot.qh
Merge remote branch 'origin/mirceakitsune/fix_antilag_teleporttime' as of '44a728d415...
[xonotic/xonotic-data.pk3dir.git] / 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 float AI_STATUS_STUCK                                           = 2048; // Cannot reach any goal
17
18 .float isbot; // true if this client is actually a bot
19 .float aistatus;
20
21 // Skill system
22 float skill;
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_custom_weapon;
46 float bot_distance_far;
47 float bot_distance_close;
48
49 float bot_weapons_far[WEP_MAXCOUNT];
50 float bot_weapons_mid[WEP_MAXCOUNT];
51 float bot_weapons_close[WEP_MAXCOUNT];
52
53 entity bot_list;
54 entity player_list;
55 .entity nextbot;
56 .entity nextplayer;
57 .string cleanname;
58 .string netname_freeme;
59 .string playermodel_freeme;
60 .string playerskin_freeme;
61
62 .float bot_nextthink;
63
64 .float createdtime;
65 .float bot_preferredcolors;
66 .float bot_attack;
67 .float bot_dodge;
68 .float bot_dodgerating;
69
70 .float bot_pickup;
71 .float bot_pickupbasevalue;
72 .float bot_canfire;
73 .float bot_strategytime;
74
75 .float bot_forced_team;
76 .float bot_config_loaded;
77
78 float bot_strategytoken_taken;
79 entity bot_strategytoken;
80
81 float botframe_spawnedwaypoints;
82 float botframe_nextthink;
83 float botframe_nextdangertime;
84 float bot_cvar_nextthink;
85 float bot_ignore_bots; // let bots not attack other bots (only works in non-teamplay)
86
87 /*
88  * Functions
89  */
90
91 entity bot_spawn();
92
93 void bot_think();
94 void bot_setnameandstuff();
95 void bot_custom_weapon_priority_setup();
96 void bot_endgame();
97 void bot_relinkplayerlist();
98 void bot_clientdisconnect();
99 void bot_clientconnect();
100 void bot_removefromlargestteam();
101 void bot_removenewest();
102 void autoskill(float factor);
103 void bot_serverframe();
104
105 .void() bot_ai;
106 .float(entity player, entity item) bot_pickupevalfunc;
107
108 /*
109  * Imports
110  */
111
112 void() havocbot_setupbot;
113
114 float c1, c2, c3, c4;
115 void CheckAllowedTeams(entity for_whom); void GetTeamCounts(entity other);
116 float JoinBestTeam(entity pl, float only_return_best, float forcebestteam);