From: drjaska Date: Fri, 5 Mar 2021 21:33:35 +0000 (+0200) Subject: included the gamemode folder X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f49f0673e2f584be18ec45a5041f5f7fd0d1562a;p=xonotic%2Fxonotic-data.pk3dir.git included the gamemode folder --- diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/_mod.inc b/qcsrc/common/gamemodes/gamemode/mayhem/_mod.inc new file mode 100644 index 000000000..37daedbee --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/mayhem/_mod.inc @@ -0,0 +1,5 @@ +// generated file; do not modify +#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/_mod.qh b/qcsrc/common/gamemodes/gamemode/mayhem/_mod.qh new file mode 100644 index 000000000..abe19802e --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/mayhem/_mod.qh @@ -0,0 +1,5 @@ +// generated file; do not modify +#include +#ifdef SVQC + #include +#endif diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/mayhem.qc b/qcsrc/common/gamemodes/gamemode/mayhem/mayhem.qc new file mode 100644 index 000000000..6af742888 --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/mayhem/mayhem.qc @@ -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 index 000000000..eca9883d7 --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/mayhem/mayhem.qh @@ -0,0 +1,16 @@ +#pragma once + +#include + +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 index 000000000..e86c58a8e --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc @@ -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 index 000000000..004ae6eaa --- /dev/null +++ b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qh @@ -0,0 +1,8 @@ +#pragma once + +#include +REGISTER_MUTATOR(mayhem, false) +{ + MUTATOR_STATIC(); + return 0; +}