]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
included the gamemode folder
authordrjaska <drjaska83@gmail.com>
Fri, 5 Mar 2021 21:33:35 +0000 (23:33 +0200)
committerdrjaska <drjaska83@gmail.com>
Fri, 5 Mar 2021 21:33:35 +0000 (23:33 +0200)
qcsrc/common/gamemodes/gamemode/mayhem/_mod.inc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/mayhem/_mod.qh [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/mayhem/mayhem.qc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/mayhem/mayhem.qh [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc [new file with mode: 0644]
qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qh [new file with mode: 0644]

diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/_mod.inc b/qcsrc/common/gamemodes/gamemode/mayhem/_mod.inc
new file mode 100644 (file)
index 0000000..37daedb
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include <common/gamemodes/gamemode/mayhem/mayhem.qc>
+#ifdef SVQC
+    #include <common/gamemodes/gamemode/mayhem/sv_mayhem.qc>
+#endif
diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/_mod.qh b/qcsrc/common/gamemodes/gamemode/mayhem/_mod.qh
new file mode 100644 (file)
index 0000000..abe1980
--- /dev/null
@@ -0,0 +1,5 @@
+// generated file; do not modify
+#include <common/gamemodes/gamemode/mayhem/mayhem.qh>
+#ifdef SVQC
+    #include <common/gamemodes/gamemode/mayhem/sv_mayhem.qh>
+#endif
diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/mayhem.qc b/qcsrc/common/gamemodes/gamemode/mayhem/mayhem.qc
new file mode 100644 (file)
index 0000000..6af7428
--- /dev/null
@@ -0,0 +1 @@
+#include "mayhem.qh"
diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/mayhem.qh b/qcsrc/common/gamemodes/gamemode/mayhem/mayhem.qh
new file mode 100644 (file)
index 0000000..eca9883
--- /dev/null
@@ -0,0 +1,16 @@
+#pragma once
+
+#include <common/mapinfo.qh>
+
+CLASS(mayhem, Gametype)
+    INIT(mayhem)
+    {
+        this.gametype_init(this, _("Mayhem"),"mayhem","g_mayhem",GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_PREFERRED,"","timelimit=15 pointlimit=30 leadlimit=0",_("Score as many frags as you can"));
+    }
+    METHOD(mayhem, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+    {
+        return true;
+    }
+    ATTRIB(mayhem, m_legacydefaults, string, "30 20 0");
+ENDCLASS(mayhem)
+REGISTER_GAMETYPE(MAYHEM, NEW(mayhem));
diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc
new file mode 100644 (file)
index 0000000..e86c58a
--- /dev/null
@@ -0,0 +1,50 @@
+#include "sv_mayhem.qh"
+
+MUTATOR_HOOKFUNCTION(mayhem, Scores_CountFragsRemaining)
+{
+       // announce remaining frags
+       return true;
+}
+
+MUTATOR_HOOKFUNCTION(mayhem, SetStartItems)
+{
+       start_items       &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
+       start_health       = warmup_start_health       = cvar("g_lms_start_health");
+       start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
+       start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
+       start_ammo_nails   = warmup_start_ammo_nails   = cvar("g_lms_start_ammo_nails");
+       start_ammo_rockets = warmup_start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
+       start_ammo_cells   = warmup_start_ammo_cells   = cvar("g_lms_start_ammo_cells");
+       start_ammo_plasma  = warmup_start_ammo_plasma  = cvar("g_lms_start_ammo_plasma");
+       start_ammo_fuel    = warmup_start_ammo_fuel    = cvar("g_lms_start_ammo_fuel");
+}
+
+MUTATOR_HOOKFUNCTION(mayhem, PlayerRegen)
+{
+       if(autocvar_g_mayhem_regenerate)
+               return false;
+       return true;
+}
+
+MUTATOR_HOOKFUNCTION(mayhem, ForbidThrowCurrentWeapon)
+{
+       return true;
+}
+
+MUTATOR_HOOKFUNCTION(mayhem, SetWeaponArena)
+{
+       if (M_ARGV(0, string) == "0" || M_ARGV(0, string) == "")
+               M_ARGV(0, string) = autocvar_g_mayhem_weaponarena;
+}
+
+MUTATOR_HOOKFUNCTION(mayhem, FilterItem)
+{
+       entity item = M_ARGV(0, entity);
+
+       if (autocvar_g_powerups <= 0)
+       if (item.flags & FL_POWERUP)
+               return true;
+
+       if (autocvar_g_pickup_items <= 0)
+               return true;
+}
\ No newline at end of file
diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qh b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qh
new file mode 100644 (file)
index 0000000..004ae6e
--- /dev/null
@@ -0,0 +1,8 @@
+#pragma once
+
+#include <common/mutators/base.qh>
+REGISTER_MUTATOR(mayhem, false)
+{
+    MUTATOR_STATIC();
+       return 0;
+}