3 #include <common/weapons/_all.qh>
5 bool autocvar__sv_init;
6 bool autocvar_g_use_ammunition;
7 bool autocvar_g_jetpack;
8 bool autocvar_g_warmup_allguns;
9 bool autocvar_g_warmup_allow_timeout;
10 #define autocvar_g_weaponarena cvar_string("g_weaponarena")
11 string autocvar_quit_and_redirect;
12 float autocvar_quit_and_redirect_timer;
13 bool autocvar_quit_when_empty;
14 string autocvar_sessionid;
15 bool autocvar_sv_curl_serverpackages_auto;
16 bool autocvar_sv_db_saveasdump;
17 bool autocvar_sv_logscores_bots;
18 bool autocvar_sv_logscores_console;
19 bool autocvar_sv_logscores_file;
20 string autocvar_sv_logscores_filename;
21 float autocvar_sv_mapchange_delay;
22 float autocvar_timelimit_increment;
23 float autocvar_timelimit_decrement;
24 float autocvar_timelimit_min;
25 float autocvar_timelimit_max;
26 float autocvar_timelimit_overtime;
27 int autocvar_timelimit_overtimes;
28 float autocvar_timelimit_suddendeath;
30 float checkrules_equality;
31 float checkrules_suddendeathwarning;
32 float checkrules_suddendeathend;
34 // flag set on worldspawn so that the code knows if it is dedicated or not
35 bool server_is_dedicated;
37 int world_initialized;
40 string cvar_purechanges;
41 float cvar_purechanges_count;
49 string autocvar_sv_termsofservice_url;
50 // only escape the terms of service url on map change
51 string sv_termsofservice_url_escaped;
59 string redirection_target;
61 string cache_mutatormsg;
62 string cache_lastmutatormsg;
64 float default_player_alpha;
65 float default_weapon_alpha;
67 float g_pickup_shells_max;
68 float g_pickup_nails_max;
69 float g_pickup_rockets_max;
70 float g_pickup_cells_max;
71 float g_pickup_plasma_max;
72 float g_pickup_fuel_max;
73 float g_pickup_weapons_anyway;
75 WepSet g_weaponarena_weapons;
76 float g_weaponarena_random; // TODO
77 string g_weaponarena_list;
80 WepSet start_weapons_default;
81 WepSet start_weapons_defaultmask;
83 float start_ammo_shells;
84 float start_ammo_nails;
85 float start_ammo_rockets;
86 float start_ammo_cells;
87 float start_ammo_plasma;
88 float start_ammo_fuel;
89 /// \brief Number of random start weapons to give to players.
90 int random_start_weapons_count;
91 /// \brief Holds a list of possible random start weapons.
92 string autocvar_g_random_start_weapons;
93 /// \brief Entity that contains amount of ammo to give with random start
95 entity random_start_ammo;
97 float start_armorvalue;
98 WepSet warmup_start_weapons;
99 WepSet warmup_start_weapons_default;
100 WepSet warmup_start_weapons_defaultmask;
101 #define WARMUP_START_WEAPONS ((autocvar_g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
102 float warmup_start_ammo_shells;
103 float warmup_start_ammo_nails;
104 float warmup_start_ammo_rockets;
105 float warmup_start_ammo_cells;
106 float warmup_start_ammo_plasma;
107 float warmup_start_ammo_fuel;
108 float warmup_start_health;
109 float warmup_start_armorvalue;
112 float want_weapon(entity weaponinfo, float allguns); // WEAPONTODO: what still needs done?
114 float g_grappling_hook;
117 bool sv_ready_restart_after_countdown;
119 .void(entity this) initialize_entity;
120 .int initialize_entity_order;
121 .entity initialize_entity_next;
122 entity initialize_entity_first;
124 void InitializeEntitiesRun();
126 void InitializeEntity(entity e, void(entity this) func, int order);
133 const int WINNING_NO = 0; // no winner, but time limits may terminate the game
134 const int WINNING_YES = 1; // winner found
135 const int WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
136 const int WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
138 float WinningCondition_Scores(float limit, float leadlimit);
139 void SetWinners(.float field, float value);
140 void ReadyRestart(bool forceWarmupEnd);
142 void DumpStats(float final);
144 bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance);
146 float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance);
148 void CheckRules_World();
149 float RedirectionThink();
151 void readplayerstartcvars();
153 void readlevelcvars();
155 .vector dropped_origin;
156 void droptofloor(entity this);
158 IntrusiveList g_moveables;
159 STATIC_INIT(g_moveables) { g_moveables = IL_NEW(); }