CLASS(NexBall, Gametype)
INIT(NexBall)
{
- this.gametype_init(this, _("Nexball"),"nb","g_nexball",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=5 leadlimit=0",_("Shoot and kick the ball into the enemies goal, keep your goal clean"));
+ this.gametype_init(this, _("Nexball"),"nb","g_nexball",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_WEAPONARENA,"","timelimit=20 pointlimit=5 leadlimit=0",_("Shoot and kick the ball into the enemies goal, keep your goal clean"));
}
METHOD(NexBall, m_generate_mapinfo, void(Gametype this, string v))
{
const int GAMETYPE_FLAG_PREFERRED = BIT(2); // preferred (when available) in random selections
const int GAMETYPE_FLAG_PRIORITY = BIT(3); // priority selection when preferred gametype isn't available in random selections
const int GAMETYPE_FLAG_HIDELIMITS = BIT(4); // don't display a score limit needed for winning the match in the scoreboard
+const int GAMETYPE_FLAG_WEAPONARENA = BIT(5); // gametype has a forced weapon arena, weapon arena mutators should disable themselves when this is set
int MAPINFO_TYPE_ALL;
.int m_flags;
ATTRIB(Gametype, frags, bool, true);
/** should this gametype display a score limit in the scoreboard? */
ATTRIB(Gametype, m_hidelimits, bool, false);
+ /** does this gametype enforce its own weapon arena? */
+ ATTRIB(Gametype, m_weaponarena, bool, false);
/** game type defaults */
ATTRIB(Gametype, model2, string);
/** game type description */
this.frags = (gflags & GAMETYPE_FLAG_USEPOINTS);
this.m_priority = ((gflags & GAMETYPE_FLAG_PREFERRED) ? 2 : ((gflags & GAMETYPE_FLAG_PRIORITY) ? 1 : 0));
this.m_hidelimits = (gflags & GAMETYPE_FLAG_HIDELIMITS);
+ this.m_weaponarena = (gflags & GAMETYPE_FLAG_WEAPONARENA);
// same as `1 << m_id`
MAPINFO_TYPE_ALL |= this.items = this.m_flags = (MAPINFO_TYPE_ALL + 1);
void instagib_extralife(entity this);
void instagib_speed(entity this);
-REGISTER_MUTATOR(mutator_instagib, autocvar_g_instagib && !g_nexball)
+REGISTER_MUTATOR(mutator_instagib, autocvar_g_instagib && !MapInfo_LoadedGametype.m_weaponarena)
{
MUTATOR_ONADD
{
#include "../overkill/sv_overkill.qh"
string autocvar_g_melee_only;
-REGISTER_MUTATOR(melee_only, expr_evaluate(autocvar_g_melee_only) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok) && !g_nexball);
+REGISTER_MUTATOR(melee_only, expr_evaluate(autocvar_g_melee_only) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok) && !MapInfo_LoadedGametype.m_weaponarena);
MUTATOR_HOOKFUNCTION(melee_only, SetStartItems, CBC_ORDER_LAST)
{
bool NIX_CanChooseWeapon(int wpn);
-REGISTER_MUTATOR(nix, expr_evaluate(cvar_string("g_nix")) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok))
+REGISTER_MUTATOR(nix, expr_evaluate(cvar_string("g_nix")) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok) && !MapInfo_LoadedGametype.m_weaponarena)
{
MUTATOR_ONADD
{
.float ok_item;
-REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !MUTATOR_IS_ENABLED(mutator_instagib) && !g_nexball && cvar_string("g_mod_balance") == "Overkill")
+REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MapInfo_LoadedGametype.m_weaponarena && cvar_string("g_mod_balance") == "Overkill")
{
MUTATOR_ONADD
{