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