]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mapinfo.qh
Merge branch 'martin-t/bullet-trails' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapinfo.qh
1 #pragma once
2
3 #include "util.qh"
4
5 // info about a map that MapInfo loads
6 string MapInfo_Map_bspname;
7 string MapInfo_Map_title;
8 string MapInfo_Map_titlestring; // either bspname: title or just title, depending on whether bspname is redundant
9 string MapInfo_Map_description;
10 string MapInfo_Map_author;
11 string MapInfo_Map_clientstuff; // not in cache, only for map load
12 string MapInfo_Map_fog; // not in cache, only for map load
13 int MapInfo_Map_supportedGametypes;
14 int MapInfo_Map_supportedFeatures;
15 int MapInfo_Map_flags;
16 vector MapInfo_Map_mins; // these are '0 0 0' if not supported!
17 vector MapInfo_Map_maxs; // these are '0 0 0' if not specified!
18
19 int MAPINFO_TYPE_ALL;
20 .int m_flags;
21
22 CLASS(Gametype, Object)
23     ATTRIB(Gametype, m_id, int, 0);
24     /** game type ID */
25     ATTRIB(Gametype, items, int, 0);
26     /** game type name as in cvar (with g_ prefix) */
27     ATTRIB(Gametype, netname, string);
28     /** game type short name */
29     ATTRIB(Gametype, mdl, string);
30     /** human readable name */
31     ATTRIB(Gametype, message, string);
32     /** does this gametype support teamplay? */
33     ATTRIB(Gametype, team, bool, false);
34     /** game type defaults */
35     ATTRIB(Gametype, model2, string);
36     /** game type description */
37     ATTRIB(Gametype, gametype_description, string);
38 #ifdef CSQC
39     ATTRIB(Gametype, m_modicons, void(vector pos, vector mySize));
40     ATTRIB(Gametype, m_modicons_reset, void());
41 #endif
42
43     ATTRIB(Gametype, m_mutators, string);
44     METHOD(Gametype, m_parse_mapinfo, bool(string k, string v))
45     {
46         return false;
47     }
48     METHOD(Gametype, m_generate_mapinfo, void(Gametype this, string v))
49     {
50         TC(Gametype, this);
51     }
52     METHOD(Gametype, m_isTwoBaseMode, bool())
53     {
54         return false;
55     }
56     METHOD(Gametype, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
57     {
58         return false;
59     }
60     METHOD(Gametype, m_isForcedSupported, bool(Gametype this))
61     {
62         return false;
63     }
64
65     METHOD(Gametype, describe, string(Gametype this))
66     {
67         TC(Gametype, this);
68         return this.gametype_description;
69     }
70
71     METHOD(Gametype, display, void(Gametype this, void(string name, string icon) returns))
72     {
73         TC(Gametype, this);
74         returns(this.message, strcat("gametype_", this.mdl));
75     }
76
77     METHOD(Gametype, gametype_init, void(Gametype this, string hname, string sname, string g_name, bool gteamplay, string mutators, string defaults, string gdescription))
78     {
79         this.netname = g_name;
80         this.mdl = sname;
81         this.message = hname;
82         this.team = gteamplay;
83         this.m_mutators = cons(sname, mutators);
84         this.model2 = defaults;
85         this.gametype_description = gdescription;
86
87         // same as `1 << m_id`
88         MAPINFO_TYPE_ALL |= this.items = this.m_flags = (MAPINFO_TYPE_ALL + 1);
89     }
90 ENDCLASS(Gametype)
91
92 REGISTRY(Gametypes, 24)
93 #define Gametypes_from(i) _Gametypes_from(i, NULL)
94 REGISTER_REGISTRY(Gametypes)
95 REGISTRY_CHECK(Gametypes)
96 #define REGISTER_GAMETYPE(NAME, inst) REGISTER(Gametypes, MAPINFO_TYPE, NAME, m_id, inst)
97
98 #define IS_GAMETYPE(NAME) (MapInfo_LoadedGametype == MAPINFO_TYPE_##NAME)
99
100 CLASS(Deathmatch, Gametype)
101     INIT(Deathmatch)
102     {
103         this.gametype_init(this, _("Deathmatch"),"dm","g_dm",false,"","timelimit=15 pointlimit=30 leadlimit=0",_("Score as many frags as you can"));
104     }
105     METHOD(Deathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
106     {
107         return true;
108     }
109 ENDCLASS(Deathmatch)
110 REGISTER_GAMETYPE(DEATHMATCH, NEW(Deathmatch));
111
112 CLASS(LastManStanding, Gametype)
113     INIT(LastManStanding)
114     {
115         this.gametype_init(this, _("Last Man Standing"),"lms","g_lms",false,"","timelimit=20 lives=9 leadlimit=0",_("Survive and kill until the enemies have no lives left"));
116     }
117     METHOD(LastManStanding, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
118     {
119         return true;
120     }
121 ENDCLASS(LastManStanding)
122 REGISTER_GAMETYPE(LMS, NEW(LastManStanding));
123
124 #ifdef CSQC
125 void HUD_Mod_Race(vector pos, vector mySize);
126 #endif
127 CLASS(Race, Gametype)
128     INIT(Race)
129     {
130         this.gametype_init(this, _("Race"),"rc","g_race",false,"","timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0",_("Race against other players to the finish line"));
131     }
132     METHOD(Race, m_parse_mapinfo, bool(string k, string v))
133     {
134         if (!k) {
135             cvar_set("g_race_qualifying_timelimit", cvar_defstring("g_race_qualifying_timelimit"));
136             return true;
137         }
138         switch (k) {
139             case "qualifying_timelimit":
140                 cvar_set("g_race_qualifying_timelimit", v);
141                 return true;
142         }
143         return false;
144     }
145     METHOD(Race, m_generate_mapinfo, void(Gametype this, string v))
146     {
147         if(v == "trigger_race_checkpoint")
148             MapInfo_Map_supportedGametypes |= this.m_flags;
149     }
150     METHOD(Race, m_isTwoBaseMode, bool())
151     {
152         return true;
153     }
154 #ifdef CSQC
155     ATTRIB(Race, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
156 #endif
157 ENDCLASS(Race)
158 REGISTER_GAMETYPE(RACE, NEW(Race));
159 #define g_race IS_GAMETYPE(RACE)
160
161 CLASS(RaceCTS, Gametype)
162     INIT(RaceCTS)
163     {
164         this.gametype_init(this, _("Race CTS"),"cts","g_cts",false,"cloaked","timelimit=20",_("Race for fastest time."));
165     }
166     METHOD(RaceCTS, m_generate_mapinfo, void(Gametype this, string v))
167     {
168         if(v == "target_startTimer")
169             MapInfo_Map_supportedGametypes |= this.m_flags;
170     }
171     METHOD(RaceCTS, m_setTeams, void(string sa))
172     {
173         // this is the skill of the map
174         // not parsed by anything yet
175         // for map databases
176         //  cvar_set("fraglimit", sa);
177     }
178 #ifdef CSQC
179     ATTRIB(RaceCTS, m_modicons, void(vector pos, vector mySize), HUD_Mod_Race);
180 #endif
181 ENDCLASS(RaceCTS)
182 REGISTER_GAMETYPE(CTS, NEW(RaceCTS));
183 #define g_cts IS_GAMETYPE(CTS)
184
185 CLASS(TeamDeathmatch, Gametype)
186     INIT(TeamDeathmatch)
187     {
188         this.gametype_init(this, _("Team Deathmatch"),"tdm","g_tdm",true,"","timelimit=15 pointlimit=50 teams=2 leadlimit=0",_("Help your team score the most frags against the enemy team"));
189     }
190     METHOD(TeamDeathmatch, m_parse_mapinfo, bool(string k, string v))
191     {
192         if (!k) {
193             cvar_set("g_tdm_teams", cvar_defstring("g_tdm_teams"));
194             return true;
195         }
196         switch (k) {
197             case "teams":
198                 cvar_set("g_tdm_teams", v);
199                 return true;
200         }
201         return false;
202     }
203     METHOD(TeamDeathmatch, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
204     {
205         if(spawnpoints >= 8 && diameter > 4096)
206             return true;
207         return false;
208     }
209     METHOD(TeamDeathmatch, m_isForcedSupported, bool(Gametype this))
210     {
211         if(cvar("g_tdm_on_dm_maps"))
212         {
213             // if this is set, all DM maps support TDM too
214             if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags))
215                 return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
216         }
217         return false;
218     }
219     METHOD(TeamDeathmatch, m_setTeams, void(string sa))
220     {
221         cvar_set("g_tdm_teams", sa);
222     }
223 ENDCLASS(TeamDeathmatch)
224 REGISTER_GAMETYPE(TEAM_DEATHMATCH, NEW(TeamDeathmatch));
225 #define g_tdm IS_GAMETYPE(TEAM_DEATHMATCH)
226
227 #ifdef CSQC
228 void HUD_Mod_CTF(vector pos, vector mySize);
229 void HUD_Mod_CTF_Reset();
230 #endif
231 CLASS(CaptureTheFlag, Gametype)
232     INIT(CaptureTheFlag)
233     {
234         this.gametype_init(this, _("Capture the Flag"),"ctf","g_ctf",true,"","timelimit=20 caplimit=10 leadlimit=6",_("Find and bring the enemy flag to your base to capture it, defend your base from the other team"));
235     }
236     METHOD(CaptureTheFlag, m_generate_mapinfo, void(Gametype this, string v))
237     {
238         if(v == "item_flag_team2" || v == "team_CTF_blueflag")
239             MapInfo_Map_supportedGametypes |= this.m_flags;
240     }
241     METHOD(CaptureTheFlag, m_isTwoBaseMode, bool())
242     {
243         return true;
244     }
245     METHOD(CaptureTheFlag, m_setTeams, void(string sa))
246     {
247         cvar_set("fraglimit", sa);
248     }
249 #ifdef CSQC
250     ATTRIB(CaptureTheFlag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CTF);
251     ATTRIB(CaptureTheFlag, m_modicons_reset, void(), HUD_Mod_CTF_Reset);
252 #endif
253 ENDCLASS(CaptureTheFlag)
254 REGISTER_GAMETYPE(CTF, NEW(CaptureTheFlag));
255 #define g_ctf IS_GAMETYPE(CTF)
256
257 #ifdef CSQC
258 void HUD_Mod_CA(vector pos, vector mySize);
259 #endif
260 CLASS(ClanArena, Gametype)
261     INIT(ClanArena)
262     {
263         this.gametype_init(this, _("Clan Arena"),"ca","g_ca",true,"","timelimit=20 pointlimit=10 teams=2 leadlimit=0",_("Kill all enemy teammates to win the round"));
264     }
265     METHOD(ClanArena, m_parse_mapinfo, bool(string k, string v))
266     {
267         if (!k) {
268             cvar_set("g_ca_teams", cvar_defstring("g_ca_teams"));
269             return true;
270         }
271         switch (k) {
272             case "teams":
273                 cvar_set("g_ca_teams", v);
274                 return true;
275         }
276         return false;
277     }
278     METHOD(ClanArena, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
279     {
280         if(spawnpoints >= 8 && diameter > 4096)
281             return true;
282         return false;
283     }
284     METHOD(ClanArena, m_setTeams, void(string sa))
285     {
286         cvar_set("g_ca_teams", sa);
287     }
288 #ifdef CSQC
289     ATTRIB(ClanArena, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
290 #endif
291 ENDCLASS(ClanArena)
292 REGISTER_GAMETYPE(CA, NEW(ClanArena));
293 #define g_ca IS_GAMETYPE(CA)
294
295 #ifdef CSQC
296 void HUD_Mod_Dom(vector pos, vector mySize);
297 #endif
298 CLASS(Domination, Gametype)
299     INIT(Domination)
300     {
301         this.gametype_init(this, _("Domination"),"dom","g_domination",true,"","timelimit=20 pointlimit=200 teams=2 leadlimit=0",_("Capture and defend all the control points to win"));
302     }
303     METHOD(Domination, m_parse_mapinfo, bool(string k, string v))
304     {
305         if (!k) {
306             cvar_set("g_domination_default_teams", cvar_defstring("g_domination_default_teams"));
307             return true;
308         }
309         switch (k) {
310             case "teams":
311                 cvar_set("g_domination_default_teams", v);
312                 return true;
313         }
314         return false;
315     }
316     METHOD(Domination, m_generate_mapinfo, void(Gametype this, string v))
317     {
318         if(v == "dom_controlpoint")
319             MapInfo_Map_supportedGametypes |= this.m_flags;
320     }
321 #ifdef CSQC
322     ATTRIB(Domination, m_modicons, void(vector pos, vector mySize), HUD_Mod_Dom);
323 #endif
324 ENDCLASS(Domination)
325 REGISTER_GAMETYPE(DOMINATION, NEW(Domination));
326
327 #ifdef CSQC
328 void HUD_Mod_KH(vector pos, vector mySize);
329 #endif
330 CLASS(KeyHunt, Gametype)
331     INIT(KeyHunt)
332     {
333         this.gametype_init(this, _("Key Hunt"),"kh","g_keyhunt",true,"","timelimit=20 pointlimit=1000 teams=3 leadlimit=0",_("Gather all the keys to win the round"));
334     }
335     METHOD(KeyHunt, m_parse_mapinfo, bool(string k, string v))
336     {
337         if (!k) {
338             cvar_set("g_keyhunt_teams", cvar_defstring("g_keyhunt_teams"));
339             return true;
340         }
341         switch (k) {
342             case "teams":
343                 cvar_set("g_keyhunt_teams", v);
344                 return true;
345         }
346         return false;
347     }
348     METHOD(KeyHunt, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
349     {
350         if(spawnpoints >= 12 && diameter > 5120)
351             return true;
352         return false;
353     }
354     METHOD(KeyHunt, m_setTeams, void(string sa))
355     {
356         cvar_set("g_keyhunt_teams", sa);
357     }
358 #ifdef CSQC
359     ATTRIB(KeyHunt, m_modicons, void(vector pos, vector mySize), HUD_Mod_KH);
360 #endif
361 ENDCLASS(KeyHunt)
362 REGISTER_GAMETYPE(KEYHUNT, NEW(KeyHunt));
363
364 CLASS(Assault, Gametype)
365     INIT(Assault)
366     {
367         this.gametype_init(this, _("Assault"),"as","g_assault",true,"","timelimit=20",_("Destroy obstacles to find and destroy the enemy power core before time runs out"));
368     }
369     METHOD(Assault, m_generate_mapinfo, void(Gametype this, string v))
370     {
371         if(v == "target_assault_roundend")
372             MapInfo_Map_supportedGametypes |= this.m_flags;
373     }
374     METHOD(Assault, m_isTwoBaseMode, bool())
375     {
376         return true;
377     }
378 ENDCLASS(Assault)
379 REGISTER_GAMETYPE(ASSAULT, NEW(Assault));
380 #define g_assault IS_GAMETYPE(ASSAULT)
381
382 CLASS(Onslaught, Gametype)
383     INIT(Onslaught)
384     {
385         this.gametype_init(this, _("Onslaught"),"ons","g_onslaught",true,"","pointlimit=1 timelimit=20",_("Capture control points to reach and destroy the enemy generator"));
386     }
387     METHOD(Onslaught, m_generate_mapinfo, void(Gametype this, string v))
388     {
389         if(v == "onslaught_generator")
390             MapInfo_Map_supportedGametypes |= this.m_flags;
391     }
392 ENDCLASS(Onslaught)
393 REGISTER_GAMETYPE(ONSLAUGHT, NEW(Onslaught));
394
395 #ifdef CSQC
396 void HUD_Mod_NexBall(vector pos, vector mySize);
397 #endif
398 CLASS(NexBall, Gametype)
399     INIT(NexBall)
400     {
401         this.gametype_init(this, _("Nexball"),"nb","g_nexball",true,"","timelimit=20 pointlimit=5 leadlimit=0",_("Shoot and kick the ball into the enemies goal, keep your goal clean"));
402     }
403     METHOD(NexBall, m_generate_mapinfo, void(Gametype this, string v))
404     {
405         if(substring(v, 0, 8) == "nexball_" || substring(v, 0, 4) == "ball")
406             MapInfo_Map_supportedGametypes |= this.m_flags;
407     }
408     METHOD(NexBall, m_isTwoBaseMode, bool())
409     {
410         return true;
411     }
412 #ifdef CSQC
413     ATTRIB(NexBall, m_modicons, void(vector pos, vector mySize), HUD_Mod_NexBall);
414 #endif
415 ENDCLASS(NexBall)
416 REGISTER_GAMETYPE(NEXBALL, NEW(NexBall));
417 #define g_nexball IS_GAMETYPE(NEXBALL)
418
419 CLASS(FreezeTag, Gametype)
420     INIT(FreezeTag)
421     {
422         this.gametype_init(this, _("Freeze Tag"),"ft","g_freezetag",true,"","timelimit=20 pointlimit=10 teams=2 leadlimit=0",_("Kill enemies to freeze them, stand next to frozen teammates to revive them; freeze all enemies to win"));
423     }
424     METHOD(FreezeTag, m_parse_mapinfo, bool(string k, string v))
425     {
426         if (!k) {
427             cvar_set("g_freezetag_teams", cvar_defstring("g_freezetag_teams"));
428             return true;
429         }
430         switch (k) {
431             case "teams":
432                 cvar_set("g_freezetag_teams", v);
433                 return true;
434         }
435         return false;
436     }
437     METHOD(FreezeTag, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
438     {
439         if(spawnpoints >= 8 && diameter > 4096)
440             return true;
441         return false;
442     }
443     METHOD(FreezeTag, m_setTeams, void(string sa))
444     {
445         cvar_set("g_freezetag_teams", sa);
446     }
447 #ifdef CSQC
448     ATTRIB(FreezeTag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA);
449 #endif
450 ENDCLASS(FreezeTag)
451 REGISTER_GAMETYPE(FREEZETAG, NEW(FreezeTag));
452 #define g_freezetag IS_GAMETYPE(FREEZETAG)
453
454 #ifdef CSQC
455 void HUD_Mod_Keepaway(vector pos, vector mySize);
456 #endif
457 CLASS(Keepaway, Gametype)
458     INIT(Keepaway)
459     {
460         this.gametype_init(this, _("Keepaway"),"ka","g_keepaway",false,"","timelimit=20 pointlimit=30",_("Hold the ball to get points for kills"));
461     }
462     METHOD(Keepaway, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
463     {
464         return true;
465     }
466 #ifdef CSQC
467     ATTRIB(Keepaway, m_modicons, void(vector pos, vector mySize), HUD_Mod_Keepaway);
468 #endif
469 ENDCLASS(Keepaway)
470 REGISTER_GAMETYPE(KEEPAWAY, NEW(Keepaway));
471
472 CLASS(Invasion, Gametype)
473     INIT(Invasion)
474     {
475         this.gametype_init(this, _("Invasion"),"inv","g_invasion",false,"","pointlimit=50 teams=0 type=0",_("Survive against waves of monsters"));
476     }
477     METHOD(Invasion, m_parse_mapinfo, bool(string k, string v))
478     {
479         switch (k) {
480             case "teams":
481                 cvar_set("g_invasion_teams", v);
482                 return true;
483             case "type":
484                 cvar_set("g_invasion_type", v);
485                 return true;
486         }
487         return false;
488     }
489     METHOD(Invasion, m_generate_mapinfo, void(Gametype this, string v))
490     {
491         if(v == "invasion_spawnpoint")
492             MapInfo_Map_supportedGametypes |= this.m_flags;
493     }
494 ENDCLASS(Invasion)
495 REGISTER_GAMETYPE(INVASION, NEW(Invasion));
496
497 CLASS(Duel, Gametype)
498     INIT(Duel)
499     {
500         this.gametype_init(this, _("Duel"),"duel","g_duel",false,"","timelimit=10 pointlimit=0 leadlimit=0",_("Fight in a one versus one arena battle to decide the winner"));
501     }
502     METHOD(Duel, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
503     {
504         return (diameter < 16384);
505     }
506     METHOD(Duel, m_isForcedSupported, bool(Gametype this))
507     {
508         // force all DM maps to work in duel?!
509         // TODO: we should really check the size of maps, some DM maps do not work for duel!
510         if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags))
511             return true;
512         return false;
513     }
514 ENDCLASS(Duel)
515 REGISTER_GAMETYPE(DUEL, NEW(Duel));
516 #define g_duel IS_GAMETYPE(DUEL)
517
518 const int MAPINFO_FEATURE_WEAPONS       = 1; // not defined for instagib-only maps
519 const int MAPINFO_FEATURE_VEHICLES      = 2;
520 const int MAPINFO_FEATURE_TURRETS       = 4;
521 const int MAPINFO_FEATURE_MONSTERS      = 8;
522
523 const int MAPINFO_FLAG_HIDDEN           = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually
524 const int MAPINFO_FLAG_FORBIDDEN        = 2; // don't even allow the map by a cvar setting that allows hidden maps
525 const int MAPINFO_FLAG_FRUSTRATING      = 4; // this map is near impossible to play, enable at your own risk
526 const int MAPINFO_FLAG_NOAUTOMAPLIST    = 8; // do not include when automatically building maplist (counts as hidden for maplist building purposes)
527
528 float MapInfo_count;
529
530 // load MapInfo_count; generate mapinfo for maps that miss them, and clear the
531 // cache; you need to call MapInfo_FilterGametype afterwards!
532 void MapInfo_Enumerate();
533
534 // filter the info by game type mask (updates MapInfo_count)
535 float MapInfo_progress;
536 float MapInfo_FilterGametype(Gametype gametypeFlags, float features, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then; use MapInfo_progress as progress indicator)
537 float _MapInfo_FilterGametype(int gametypeFlags, float features, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then; use MapInfo_progress as progress indicator)
538 void MapInfo_FilterString(string sf); // filter _MapInfo_filtered (created by MapInfo_FilterGametype) with keyword
539 int MapInfo_CurrentFeatures(); // retrieves currently required features from cvars
540 Gametype MapInfo_CurrentGametype(); // retrieves current gametype from cvars
541 int MapInfo_ForbiddenFlags(); // retrieves current flags from cvars
542 int MapInfo_RequiredFlags(); // retrieves current flags from cvars
543
544 // load info about the i-th map into the MapInfo_Map_* globals
545 float MapInfo_Get_ByID(float i); // 1 on success, 0 on failure
546 string MapInfo_BSPName_ByID(float i);
547
548 // load info about a map by name into the MapInfo_Map_* globals
549 int MapInfo_Get_ByName(string s, float allowGenerate, Gametype gametypeToSet); // 1 on success, 0 on failure, 2 if it autogenerated a mapinfo file
550
551 // look for a map by a prefix, returns the actual map name on success, string_null on failure or ambigous match
552 string MapInfo_FindName_match; // the name of the map that was found
553 float MapInfo_FindName_firstResult; // -1 if none were found, index of first one if not unique but found (FindName then returns -1)
554 float MapInfo_FindName(string s);
555 string MapInfo_FixName(string s);
556
557 // play a map
558 float MapInfo_CheckMap(string s); // returns 0 if the map can't be played with the current settings
559 void MapInfo_LoadMap(string s, float reinit);
560
561 // list all maps for the current game type
562 string MapInfo_ListAllowedMaps(Gametype type, float pFlagsRequired, float pFlagsForbidden);
563 // list all allowed maps (for any game type)
564 string MapInfo_ListAllAllowedMaps(float pFlagsRequired, float pFlagsForbidden);
565
566 // gets a gametype from a string
567 string _MapInfo_GetDefaultEx(Gametype t);
568 float _MapInfo_GetTeamPlayBool(Gametype t);
569 Gametype MapInfo_Type_FromString(string t);
570 string MapInfo_Type_Description(Gametype t);
571 string MapInfo_Type_ToString(Gametype t);
572 string MapInfo_Type_ToText(Gametype t);
573 void MapInfo_SwitchGameType(Gametype t);
574
575 // to be called from worldspawn to set up cvars
576 void MapInfo_LoadMapSettings(string s);
577 Gametype MapInfo_LoadedGametype; // game type that was active during map load
578
579 void MapInfo_Cache_Destroy(); // disable caching
580 void MapInfo_Cache_Create(); // enable caching
581 void MapInfo_Cache_Invalidate(); // delete cache if any, but keep enabled
582
583 void MapInfo_ClearTemps(); // call this when done with mapinfo for this frame
584
585 void MapInfo_Shutdown(); // call this in the shutdown handler
586
587 #define MAPINFO_SETTEMP_ACL_USER cvar_string("g_mapinfo_settemp_acl")
588 #define MAPINFO_SETTEMP_ACL_SYSTEM "-g_mapinfo_* -rcon_* -_* -g_ban* +*"