]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a gametype flag to signify that the mode forces its own weapon arena (allows...
authorMario <mario.mario@y7mail.com>
Sun, 1 Nov 2020 10:58:46 +0000 (20:58 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 1 Nov 2020 10:58:46 +0000 (20:58 +1000)
qcsrc/common/gamemodes/gamemode/nexball/nexball.qh
qcsrc/common/mapinfo.qh
qcsrc/common/mutators/mutator/instagib/sv_instagib.qh
qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc
qcsrc/common/mutators/mutator/nix/sv_nix.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qh

index 9a8fca3ab9c874d6745217ce71e8add77791d6b3..a8fdaa4ef5d9ebd2502b5bd3f3fd266dba0a502b 100644 (file)
@@ -8,7 +8,7 @@ void HUD_Mod_NexBall(vector pos, vector mySize);
 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))
     {
index 2d350b2fed3c1b26c46cab2e3c58bcb598ce1436..be1a4ef7c686dd8bb7861b8edb764ff4cbac3c3f 100644 (file)
@@ -21,6 +21,7 @@ const int GAMETYPE_FLAG_USEPOINTS       = BIT(1); // gametype has point-based sc
 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;
@@ -41,6 +42,8 @@ CLASS(Gametype, Object)
     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 */
@@ -107,6 +110,7 @@ CLASS(Gametype, Object)
         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);
index b3216cdcc4951acd349e6b252d7b8b6625977010..f50f0f947c521f7a436c27758bae5d66624b3ddf 100644 (file)
@@ -31,7 +31,7 @@ void instagib_invisibility(entity this);
 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
        {
index a56efaf83cffbf086b2cbca93f5798cfce6b7d20..2596770daa57be0c2b595873d79f18ecb40ee66f 100644 (file)
@@ -3,7 +3,7 @@
 #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)
 {
index 0ec051a8cbfc7e7acbb4c54ff64798f3b3d7a2c6..e23d533edffde69b72bf4ec98a8267c23770e558 100644 (file)
@@ -39,7 +39,7 @@ float nix_nextweapon;
 
 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
        {
index 63e3c19ef531ccae456e9bfb8c0986cb72c7bc72..4712ec2fadf1016e574e24628eeaf921ec588f5c 100644 (file)
@@ -8,7 +8,7 @@ bool autocvar_g_overkill_filter_armormega;
 
 .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
        {