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