From: AriosJentu Date: Fri, 16 Aug 2019 15:38:08 +0000 (+1000) Subject: Add unlimited ammo simple mutator X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c0f074c1ef2cfd26292617f57527dcd2b52bc2b4;p=xonotic%2Fxonotic-data.pk3dir.git Add unlimited ammo simple mutator --- diff --git a/mutators.cfg b/mutators.cfg index 01e3a120a..c4737519a 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -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 diff --git a/qcsrc/common/mutators/mutator/_mod.inc b/qcsrc/common/mutators/mutator/_mod.inc index 40a763c8e..c6d7877ba 100644 --- a/qcsrc/common/mutators/mutator/_mod.inc +++ b/qcsrc/common/mutators/mutator/_mod.inc @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/qcsrc/common/mutators/mutator/_mod.qh b/qcsrc/common/mutators/mutator/_mod.qh index 6a9261dd4..eba2ac8ec 100644 --- a/qcsrc/common/mutators/mutator/_mod.qh +++ b/qcsrc/common/mutators/mutator/_mod.qh @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/qcsrc/common/mutators/mutator/unlimitedammo/_mod.inc b/qcsrc/common/mutators/mutator/unlimitedammo/_mod.inc new file mode 100644 index 000000000..6209d1421 --- /dev/null +++ b/qcsrc/common/mutators/mutator/unlimitedammo/_mod.inc @@ -0,0 +1,4 @@ +// generated file; do not modify +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/mutators/mutator/unlimitedammo/_mod.qh b/qcsrc/common/mutators/mutator/unlimitedammo/_mod.qh new file mode 100644 index 000000000..52e2f2bd5 --- /dev/null +++ b/qcsrc/common/mutators/mutator/unlimitedammo/_mod.qh @@ -0,0 +1,4 @@ +// generated file; do not modify +#ifdef SVQC + #include +#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 index 000000000..c77f720ea --- /dev/null +++ b/qcsrc/common/mutators/mutator/unlimitedammo/sv_unlimitedammo.qc @@ -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 index 000000000..7b9637ef9 --- /dev/null +++ b/qcsrc/common/mutators/mutator/unlimitedammo/sv_unlimitedammo.qh @@ -0,0 +1 @@ +#pragma once \ No newline at end of file