From 878c8caabd9450a8967ff28766c5e2582cdd5039 Mon Sep 17 00:00:00 2001 From: drjaska Date: Sat, 6 Mar 2021 04:23:08 +0200 Subject: [PATCH] Gameplay-wise the mode is fully functional, AFAIK there are no hooks to prevent rotting but if someone really wants regen without rot they can edit cvars and go into modified, idc. Only things left to add to ffa mayhem are a new icon and fixing map info. Going to start creating team mayhem mow. --- gamemodes-server.cfg | 4 +++- qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 121a43d77..d8e1e0300 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -569,4 +569,6 @@ set g_duel_not_dm_maps 0 "when this is set, DM maps will NOT be listed in duel" // ======== // mayhem // ======== -set g_mayhem 0 "Mayhem: the player with most frags in total mayhem wins" \ No newline at end of file +set g_mayhem 0 "Mayhem: the player with most frags in total mayhem wins" +set g_mayhem_regenerate 0 "allow players to regenerate hp. rates controlled by hp regeneration and rotting cvars" +set g_mayhem_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena" \ No newline at end of file diff --git a/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc index 5fbe7a096..11fc13a5d 100644 --- a/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc +++ b/qcsrc/common/gamemodes/gamemode/mayhem/sv_mayhem.qc @@ -52,4 +52,16 @@ MUTATOR_HOOKFUNCTION(mayhem, FilterItem) return true; else return false; +} + +MUTATOR_HOOKFUNCTION(mayhem, Damage_Calculate) +{ + entity frag_attacker = M_ARGV(1, entity); + entity frag_target = M_ARGV(2, entity); + float frag_damage = M_ARGV(4, float); + + if (frag_target == frag_attacker) + frag_damage = 0; + + M_ARGV(4, float) = frag_damage; } \ No newline at end of file -- 2.39.2