]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/bot/bot.qh
some bot fixes :(
[divverent/nexuiz.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 .float bot_thinkskill;
24 .float bot_mouseskill;
25 .float bot_predictionskill;
26 .float bot_offsetskill;
27 .float totalfrags_lastcheck;
28
29 // Custom weapon priorities
30 float bot_custom_weapon;
31 float bot_distance_far;
32 float bot_distance_close;
33
34 float bot_weapons_far[WEP_LAST];
35 float bot_weapons_mid[WEP_LAST];
36 float bot_weapons_close[WEP_LAST];
37
38 entity bot_list;
39 entity player_list;
40 .entity nextbot;
41 .entity nextplayer;
42 .string netname_freeme;
43 .string playermodel_freeme;
44 .string playerskin_freeme;
45
46 .float bot_nextthink;
47
48 .float createdtime;
49 .float bot_preferredcolors;
50 .float bot_attack;
51 .float bot_dodge;
52 .float bot_dodgerating;
53
54 .float bot_pickup;
55 .float bot_pickupbasevalue;
56 .float bot_canfire;
57 .float bot_strategytime;
58
59 .float bot_forced_team;
60 .float bot_config_loaded;
61
62 float bot_strategytoken_taken;
63 entity bot_strategytoken;
64
65 float botframe_spawnedwaypoints;
66 float botframe_nextthink;
67 float botframe_nextdangertime;
68 float bot_cvar_nextthink;
69 float bot_ignore_bots; // let bots not attack other bots (only works in non-teamplay)
70
71 /*
72  * Functions
73  */
74
75 entity bot_spawn();
76
77 void bot_think();
78 void bot_setnameandstuff();
79 void bot_custom_weapon_priority_setup();
80 void bot_endgame();
81 void bot_relinkplayerlist();
82 void bot_clientdisconnect();
83 void bot_clientconnect();
84 void bot_removefromlargestteam();
85 void bot_removenewest();
86 void autoskill(float factor);
87 void bot_serverframe();
88
89 .void() bot_ai;
90 .float(entity player, entity item) bot_pickupevalfunc;
91
92 /*
93  * Imports
94  */
95
96 float sv_maxspeed;
97
98 void() havocbot_setupbot;
99
100 float c1, c2, c3, c4;
101 void CheckAllowedTeams(entity for_whom); void GetTeamCounts(entity other);
102 float JoinBestTeam(entity pl, float only_return_best, float forcebestteam);