From: drjaska Date: Sat, 6 Mar 2021 02:23:08 +0000 (+0200) Subject: Gameplay-wise the mode is fully functional, AFAIK there are no hooks to X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=878c8caabd9450a8967ff28766c5e2582cdd5039;p=xonotic%2Fxonotic-data.pk3dir.git 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. --- 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