]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/world.qh
Merge branch 'bones_was_here/no_clobber_DP_cmds' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / world.qh
1 #pragma once
2
3 #include <common/weapons/_all.qh>
4
5 bool autocvar__sv_init;
6 bool autocvar__endmatch;
7 bool autocvar_g_use_ammunition;
8 bool autocvar_g_jetpack;
9 int autocvar_g_warmup;
10 bool autocvar_g_warmup_allguns;
11 bool autocvar_g_warmup_allow_timeout;
12 #define autocvar_g_weaponarena cvar_string("g_weaponarena")
13 string autocvar_quit_and_redirect;
14 float autocvar_quit_and_redirect_timer;
15 bool autocvar_quit_when_empty;
16 string autocvar_sessionid;
17 bool autocvar_sv_curl_serverpackages_auto;
18 bool autocvar_sv_db_saveasdump;
19 bool autocvar_sv_logscores_bots;
20 bool autocvar_sv_logscores_console;
21 bool autocvar_sv_logscores_file;
22 string autocvar_sv_logscores_filename;
23 float autocvar_sv_mapchange_delay;
24 float autocvar_timelimit_increment;
25 float autocvar_timelimit_decrement;
26 float autocvar_timelimit_min;
27 float autocvar_timelimit_max;
28 float autocvar_timelimit_overtime;
29 int autocvar_timelimit_overtimes;
30 float autocvar_timelimit_suddendeath;
31 bool autocvar_sv_gameplayfix_droptofloorstartsolid;
32 bool autocvar_sv_gameplayfix_droptofloorstartsolid_nudgetocorrect;
33
34 bool autocvar_sv_mapformat_is_quake3;
35 bool autocvar_sv_mapformat_is_quake2;
36
37 float checkrules_equality;
38 float checkrules_suddendeathwarning;
39 float checkrules_suddendeathend;
40 int checkrules_overtimesadded; //how many overtimes have been already added
41
42 // flag set on worldspawn so that the code knows if it is dedicated or not
43 bool server_is_dedicated;
44
45 int world_initialized;
46
47 string cvar_changes;
48 string cvar_purechanges;
49 float cvar_purechanges_count;
50
51 string modname;
52
53 string gamemode_name;
54
55 string record_type;
56
57 string autocvar_sv_termsofservice_url;
58 // only escape the terms of service url on map change
59 string sv_termsofservice_url_escaped;
60
61 string clientstuff;
62
63 string matchid;
64
65 .string fog;
66
67 string redirection_target;
68
69 string cache_mutatormsg;
70 string cache_lastmutatormsg;
71
72 float default_player_alpha;
73 float default_weapon_alpha;
74
75 float g_pickup_shells_max;
76 float g_pickup_nails_max;
77 float g_pickup_rockets_max;
78 float g_pickup_cells_max;
79 float g_pickup_plasma_max;
80 float g_pickup_fuel_max;
81 float g_pickup_weapons_anyway;
82 float g_weaponarena;
83 WepSet g_weaponarena_weapons;
84 float g_weaponarena_random; // TODO
85 string g_weaponarena_list;
86
87 WepSet start_weapons;
88 WepSet start_weapons_default;
89 WepSet start_weapons_defaultmask;
90 int start_items;
91 float start_ammo_shells;
92 float start_ammo_nails;
93 float start_ammo_rockets;
94 float start_ammo_cells;
95 float start_ammo_plasma;
96 float start_ammo_fuel;
97 /// \brief Number of random start weapons to give to players.
98 int random_start_weapons_count;
99 /// \brief Holds a list of possible random start weapons.
100 string autocvar_g_random_start_weapons;
101 /// \brief Entity that contains amount of ammo to give with random start
102 /// weapons.
103 entity random_start_ammo;
104 float start_health;
105 float start_armorvalue;
106 WepSet warmup_start_weapons;
107 WepSet warmup_start_weapons_default;
108 WepSet warmup_start_weapons_defaultmask;
109 #define WARMUP_START_WEAPONS ((autocvar_g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
110 float warmup_start_ammo_shells;
111 float warmup_start_ammo_nails;
112 float warmup_start_ammo_rockets;
113 float warmup_start_ammo_cells;
114 float warmup_start_ammo_plasma;
115 float warmup_start_ammo_fuel;
116 float warmup_start_health;
117 float warmup_start_armorvalue;
118 float g_weapon_stay;
119
120 float want_weapon(entity weaponinfo, float allguns); // WEAPONTODO: what still needs done?
121
122 float g_grappling_hook;
123 int warmup_stage;
124
125 bool sv_ready_restart_after_countdown;
126
127 .void(entity this) initialize_entity;
128 .int initialize_entity_order;
129 .entity initialize_entity_next;
130 entity initialize_entity_first;
131
132 void InitializeEntitiesRun();
133
134 void InitializeEntity(entity e, void(entity this) func, int order);
135
136 // database
137 float ServerProgsDB;
138 float TemporaryDB;
139
140 .float winning;
141 const int WINNING_NO = 0; // no winner, but time limits may terminate the game
142 const int WINNING_YES = 1; // winner found
143 const int WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
144 const int WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
145
146 float WinningCondition_Scores(float limit, float leadlimit);
147 void SetWinners(.float field, float value);
148 void ReadyRestart(bool forceWarmupEnd);
149
150 void DumpStats(float final);
151
152 bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance, bool frompos);
153
154 float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance);
155
156 void CheckRules_World();
157 float RedirectionThink();
158
159 // quake 3 music compatibility
160 .string music;
161 .string noise;
162
163 void readplayerstartcvars();
164
165 void readlevelcvars();
166
167 .vector dropped_origin;
168 void droptofloor(entity this);
169
170 IntrusiveList g_moveables;
171 STATIC_INIT(g_moveables) { g_moveables = IL_NEW(); }
172
173 bool observe_blocked_if_eliminated = false; // forbids eliminated players from observing