Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
duel.qh
Go to the documentation of this file.
1#pragma once
2
4#include <common/mapinfo.qh>
5
8 {
9 this.gametype_init(this, _("Duel"),"duel","g_duel",GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_1V1,"","timelimit=10 pointlimit=0 leadlimit=0",_("Fight in a one versus one arena battle to decide the winner"));
10 }
11 METHOD(Duel, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
12 {
13 return (diameter < 3250);
14 }
16 {
17 if(!cvar("g_duel_not_dm_maps")) // all DM maps support duel too
18 {
19 // TODO: we should really check the size of maps, some DM maps do not work for duel!
20 if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.gametype_flags))
21 {
22#ifdef CSQC // server admins might not read their server console output, also prevents spam
23 LOG_WARNF("This map doesn't support Duel in Xonotic newer than 0.9.0. To fix it add \"gametype duel\" to the \"%s.mapinfo\" file.", MapInfo_Map_bspname);
24#endif
25 return true; // TODO: references another gametype (alternatively, we could check which gametypes are always enabled and append this if any are supported)
26 }
27 }
28 return false;
29 }
32#define g_duel IS_GAMETYPE(DUEL)
Definition duel.qh:6
virtual void m_isForcedSupported()
Definition duel.qh:15
virtual void m_isAlwaysSupported()
Definition duel.qh:11
Duel()
Definition duel.qh:7
virtual void gametype_init()
Definition mapinfo.qh:117
#define LOG_WARNF(...)
Definition log.qh:62
vector MapInfo_Map_supportedGametypes
Definition mapinfo.qh:13
const int GAMETYPE_FLAG_USEPOINTS
Definition mapinfo.qh:20
string MapInfo_Map_bspname
Definition mapinfo.qh:6
#define REGISTER_GAMETYPE(NAME, inst)
Definition mapinfo.qh:149
const int GAMETYPE_FLAG_1V1
Definition mapinfo.qh:25
vector gametype_flags
Definition mapinfo.qh:28
float cvar(string name)
#define NEW(cname,...)
Definition oo.qh:117
#define INIT(cname)
Definition oo.qh:210
#define CLASS(...)
Definition oo.qh:145
#define ENDCLASS(cname)
Definition oo.qh:281
#define METHOD(cname, name, prototype)
Definition oo.qh:269