]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added Overkill weapons mutator. 561/head
authorLyberta <lyberta@lyberta.net>
Sun, 10 Jun 2018 07:47:41 +0000 (10:47 +0300)
committerLyberta <lyberta@lyberta.net>
Sun, 10 Jun 2018 07:47:41 +0000 (10:47 +0300)
mutators.cfg
qcsrc/common/mutators/mutator/overkill/_mod.inc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qh
qcsrc/common/mutators/mutator/overkill/sv_weapons.qc [new file with mode: 0644]
randomitems-xonotic.cfg

index c997a807f459574846fc3de6b11af14ddbe7447b..a4c8144fc209b51b36863d5735b19522ca633408 100644 (file)
@@ -55,6 +55,7 @@ set g_instagib_friendlypush 1 "allow pushing teammates with the vaporizer primar
 //  overkill
 // ==========
 set g_overkill 0 "internal cvar, to enable overkill, use  `exec ruleset-overkill.cfg`"
+set g_overkill_weapons 0 "Whether to enable overkill weapons outside of overkill ruleset."
 
 set g_overkill_powerups_replace 1
 set g_overkill_itemwaypoints 1
index 57fb6c2460d9c3e21948893c4662ad7b9788c493..017cc2082adfc7a9468e293dde68c276160abff5 100644 (file)
@@ -10,3 +10,6 @@
 #include <common/mutators/mutator/overkill/oknex.qc>
 #include <common/mutators/mutator/overkill/okrpc.qc>
 #include <common/mutators/mutator/overkill/okshotgun.qc>
+#ifdef SVQC
+    #include <common/mutators/mutator/overkill/sv_weapons.qc>
+#endif
index b6ff5e14d37fdf83e2d82e915ef36b0fe830b067..9fa66e8b2a18c12523da72e4c45820d0c711fe7e 100644 (file)
@@ -1,5 +1,9 @@
 #include "sv_overkill.qh"
 
+#include "okshotgun.qh"
+#include "okhmg.qh"
+#include "okrpc.qh"
+
 bool autocvar_g_overkill_powerups_replace;
 
 bool autocvar_g_overkill_itemwaypoints = true;
index 4949edb1e82fdac49e7edf57b69efb092ceef229..79e5dd3c5b0cbce85cee0d53108046f8a14bf3fa 100644 (file)
@@ -1,10 +1,5 @@
 #pragma once
 
-#include "okshotgun.qh"
-#include "okmachinegun.qh"
-#include "okhmg.qh"
-#include "okrpc.qh"
-
 string autocvar_g_overkill;
 bool autocvar_g_overkill_filter_healthmega;
 bool autocvar_g_overkill_filter_armormedium;
@@ -35,13 +30,6 @@ REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !MUTATOR_IS_ENABLED(m
                {
                        ITEM_ArmorMega.spawnflags |= ITEM_FLAG_MUTATORBLOCKED;
                }
-
-               WEP_OVERKILL_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-               WEP_OVERKILL_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-
-               WEP_OVERKILL_SHOTGUN.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-               WEP_OVERKILL_MACHINEGUN.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
-               WEP_OVERKILL_NEX.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
        }
 
        MUTATOR_ONREMOVE
@@ -50,12 +38,5 @@ REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !MUTATOR_IS_ENABLED(m
                ITEM_ArmorMedium.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
                ITEM_ArmorBig.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
                ITEM_ArmorMega.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED;
-
-               WEP_OVERKILL_RPC.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
-               WEP_OVERKILL_HMG.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
-
-               WEP_OVERKILL_SHOTGUN.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
-               WEP_OVERKILL_MACHINEGUN.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
-               WEP_OVERKILL_NEX.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
        }
 }
diff --git a/qcsrc/common/mutators/mutator/overkill/sv_weapons.qc b/qcsrc/common/mutators/mutator/overkill/sv_weapons.qc
new file mode 100644 (file)
index 0000000..4a131e3
--- /dev/null
@@ -0,0 +1,22 @@
+string autocvar_g_overkill_weapons;
+
+REGISTER_MUTATOR(ok_weapons, expr_evaluate(autocvar_g_overkill_weapons) || MUTATOR_IS_ENABLED(ok))
+{
+       MUTATOR_ONADD
+       {
+               WEP_OVERKILL_SHOTGUN.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+               WEP_OVERKILL_MACHINEGUN.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+               WEP_OVERKILL_NEX.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+               WEP_OVERKILL_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+               WEP_OVERKILL_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
+       }
+
+       MUTATOR_ONREMOVE
+       {
+               WEP_OVERKILL_SHOTGUN.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+               WEP_OVERKILL_MACHINEGUN.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+               WEP_OVERKILL_NEX.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+               WEP_OVERKILL_HMG.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+               WEP_OVERKILL_RPC.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
+       }
+}
index bffa2b1ac466fe903b9aceedbdfaab9ab2f804cd..47611a9e23a5120f20b3663a4abcbd501ec6e58e 100644 (file)
@@ -91,6 +91,11 @@ set g_random_items_weapon_hlac_probability 0 "Probability of random HLAC spawnin
 set g_random_items_weapon_rifle_probability 0 "Probability of random rifle spawning in the map."
 set g_random_items_weapon_seeker_probability 0 "Probability of random TAG seeker spawning in the map."
 set g_random_items_weapon_vaporizer_probability 0 "Probability of random vaporizer spawning in the map."
+set g_random_items_weapon_okshotgun_probability 0 "Probability of random overkill shotgun spawning in the map."
+set g_random_items_weapon_okmachinegun_probability 0 "Probability of random overkill machinegun spawning in the map."
+set g_random_items_weapon_oknex_probability 0 "Probability of random overkill nex spawning in the map."
+set g_random_items_weapon_okhmg_probability 0 "Probability of random overkill HMG spawning in the map."
+set g_random_items_weapon_okrpc_probability 0 "Probability of random overkill RPC spawning in the map."
 set g_random_items_item_strength_probability 1 "Probability of random strength spawning in the map."
 set g_random_items_item_shield_probability 1 "Probability of random shield spawning in the map."
 set g_random_items_item_fuel_regen_probability 0 "Probability of random fuel regeneration spawning in the map."
@@ -148,6 +153,11 @@ set g_random_loot_weapon_hlac_probability 0 "Probability of random HLAC spawning
 set g_random_loot_weapon_rifle_probability 0 "Probability of random rifle spawning as loot."
 set g_random_loot_weapon_seeker_probability 0 "Probability of random TAG seeker spawning as loot."
 set g_random_loot_weapon_vaporizer_probability 0 "Probability of random vaporizer spawning as loot."
+set g_random_loot_weapon_okshotgun_probability 0 "Probability of random overkill shotgun spawning as loot."
+set g_random_loot_weapon_okmachinegun_probability 0 "Probability of random overkill machinegun spawning as loot."
+set g_random_loot_weapon_oknex_probability 0 "Probability of random overkill nex spawning as loot."
+set g_random_loot_weapon_okhmg_probability 0 "Probability of random overkill HMG spawning as loot."
+set g_random_loot_weapon_okrpc_probability 0 "Probability of random overkill RPC spawning as loot."
 set g_random_loot_item_strength_probability 1 "Probability of random strength spawning as loot."
 set g_random_loot_item_shield_probability 1 "Probability of random shield spawning as loot."
 set g_random_loot_item_fuel_regen_probability 0 "Probability of random fuel regeneration spawning as loot."