]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add unlimited ammo simple mutator
authorAriosJentu <darthpoezd@gmail.com>
Fri, 16 Aug 2019 15:38:08 +0000 (01:38 +1000)
committerAriosJentu <darthpoezd@gmail.com>
Fri, 16 Aug 2019 16:34:30 +0000 (02:34 +1000)
mutators.cfg
qcsrc/common/mutators/mutator/_mod.inc
qcsrc/common/mutators/mutator/_mod.qh
qcsrc/common/mutators/mutator/unlimitedammo/_mod.inc [new file with mode: 0644]
qcsrc/common/mutators/mutator/unlimitedammo/_mod.qh [new file with mode: 0644]
qcsrc/common/mutators/mutator/unlimitedammo/sv_unlimitedammo.qc [new file with mode: 0644]
qcsrc/common/mutators/mutator/unlimitedammo/sv_unlimitedammo.qh [new file with mode: 0644]

index 01e3a120a4285698382d3c408ef220b927bf87c8..c4737519abcb6659d9f5f4b839afa75206a043d4 100644 (file)
@@ -520,3 +520,8 @@ set g_smneg_cooldown_factor 0.25 "Stale-move negation: penalty cooldown factor"
 set g_random_items 0 "Whether to enable random items."
 set g_random_loot 0 "Whether to enable random loot."
 exec randomitems-xonotic.cfg
+
+// ================
+//  unlimited ammo
+// ================
+set g_unlimitedammo 0 "Enable unlimited ammo for game"
\ No newline at end of file
index 40a763c8ec04b39b9a39dfb3d8d915bf647e1324..c6d7877babd23636f7f0c119d87c3deabdff4f57 100644 (file)
@@ -36,6 +36,7 @@
 #include <common/mutators/mutator/stale_move_negation/_mod.inc>
 #include <common/mutators/mutator/superspec/_mod.inc>
 #include <common/mutators/mutator/touchexplode/_mod.inc>
+#include <common/mutators/mutator/unlimitedammo/_mod.inc>
 #include <common/mutators/mutator/vampire/_mod.inc>
 #include <common/mutators/mutator/vampirehook/_mod.inc>
 #include <common/mutators/mutator/walljump/_mod.inc>
index 6a9261dd41f394cd3496bf119ec6fa92e6ebb0f1..eba2ac8ec0b48ba6d8d77f9eaeab1ce16b4b801a 100644 (file)
@@ -36,6 +36,7 @@
 #include <common/mutators/mutator/stale_move_negation/_mod.qh>
 #include <common/mutators/mutator/superspec/_mod.qh>
 #include <common/mutators/mutator/touchexplode/_mod.qh>
+#include <common/mutators/mutator/unlimitedammo/_mod.qh>
 #include <common/mutators/mutator/vampire/_mod.qh>
 #include <common/mutators/mutator/vampirehook/_mod.qh>
 #include <common/mutators/mutator/walljump/_mod.qh>
diff --git a/qcsrc/common/mutators/mutator/unlimitedammo/_mod.inc b/qcsrc/common/mutators/mutator/unlimitedammo/_mod.inc
new file mode 100644 (file)
index 0000000..6209d14
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#ifdef SVQC
+    #include <common/mutators/mutator/unlimitedammo/sv_unlimitedammo.qc>
+#endif
diff --git a/qcsrc/common/mutators/mutator/unlimitedammo/_mod.qh b/qcsrc/common/mutators/mutator/unlimitedammo/_mod.qh
new file mode 100644 (file)
index 0000000..52e2f2b
--- /dev/null
@@ -0,0 +1,4 @@
+// generated file; do not modify
+#ifdef SVQC
+    #include <common/mutators/mutator/unlimitedammo/sv_unlimitedammo.qh>
+#endif
diff --git a/qcsrc/common/mutators/mutator/unlimitedammo/sv_unlimitedammo.qc b/qcsrc/common/mutators/mutator/unlimitedammo/sv_unlimitedammo.qc
new file mode 100644 (file)
index 0000000..c77f720
--- /dev/null
@@ -0,0 +1,12 @@
+#include "sv_unlimitedammo.qh"
+
+bool autocvar_g_unlimitedammo;
+
+REGISTER_MUTATOR(unlimitedammo, cvar("g_unlimitedammo"));
+
+MUTATOR_HOOKFUNCTION(unlimitedammo, SetStartItems)
+{
+       if (autocvar_g_unlimitedammo) {
+               start_items |= IT_UNLIMITED_AMMO;
+       }
+}
\ No newline at end of file
diff --git a/qcsrc/common/mutators/mutator/unlimitedammo/sv_unlimitedammo.qh b/qcsrc/common/mutators/mutator/unlimitedammo/sv_unlimitedammo.qh
new file mode 100644 (file)
index 0000000..7b9637e
--- /dev/null
@@ -0,0 +1 @@
+#pragma once
\ No newline at end of file