From: otta8634 Date: Sun, 9 Mar 2025 11:07:57 +0000 (+0800) Subject: Add damage/force multipliers to keyhunt X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=91bb70170debef8a5d66ea074b00010d18076fc0;p=xonotic%2Fxonotic-data.pk3dir.git Add damage/force multipliers to keyhunt Implemented the same way as for ka/tka. Multipliers are 1 by default. --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 27778c755..9f40ccd7a 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -468,6 +468,10 @@ set g_balance_keyhunt_score_capture 100 set g_balance_keyhunt_score_push 60 set g_balance_keyhunt_score_destroyed 50 set g_balance_keyhunt_score_destroyed_ownfactor 1 +set g_balance_keyhunt_carrier_damage "1 1 1" "damage multiplier of key carriers; to themselves (X), to other carriers (Y), to noncarriers (Z)" +set g_balance_keyhunt_carrier_force "1 1 1" "force multiplier of key carriers; to themselves (X), to other carriers (Y), to noncarriers (Z)" +set g_balance_keyhunt_noncarrier_damage "1 1 1" "damage multiplier of players who don't have a key; to themselves (X), to carriers (Y), to other noncarriers (Z)" +set g_balance_keyhunt_noncarrier_force "1 1 1" "force multiplier of players who don't have a key; to themselves (X), to carriers (Y), to other noncarriers (Z)" set g_balance_keyhunt_dropvelocity 300 set g_balance_keyhunt_throwvelocity 400 set g_balance_keyhunt_protecttime 0.8 diff --git a/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc b/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc index 85814dfec..c0bb9aedf 100644 --- a/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc +++ b/qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc @@ -18,6 +18,11 @@ float autocvar_g_balance_keyhunt_dropvelocity; float autocvar_g_balance_keyhunt_maxdist; float autocvar_g_balance_keyhunt_protecttime; +vector autocvar_g_balance_keyhunt_carrier_damage; +vector autocvar_g_balance_keyhunt_carrier_force; +vector autocvar_g_balance_keyhunt_noncarrier_damage; +vector autocvar_g_balance_keyhunt_noncarrier_force; + int autocvar_g_balance_keyhunt_score_capture; int autocvar_g_balance_keyhunt_score_carrierfrag; int autocvar_g_balance_keyhunt_score_collect; @@ -1226,6 +1231,53 @@ void havocbot_role_kh_freelancer(entity this) // register this as a mutator +MUTATOR_HOOKFUNCTION(kh, Damage_Calculate) // for changing damage and force values that are applied to players +{ + entity frag_attacker = M_ARGV(1, entity); + entity frag_target = M_ARGV(2, entity); + + // as a gamemode rule, only apply scaling to player versus player combat + if (!IS_PLAYER(frag_attacker) || !IS_PLAYER(frag_target)) + return; + + if (frag_attacker.kh_next != NULL) // if the attacker is a key carrier + { + if (frag_target == frag_attacker) // damage done to themselves + { + M_ARGV(4, float) *= autocvar_g_balance_keyhunt_carrier_damage.x; + M_ARGV(6, vector) *= autocvar_g_balance_keyhunt_carrier_force.x; + } + else if (frag_target.kh_next != NULL) // damage done to other key carriers + { + M_ARGV(4, float) *= autocvar_g_balance_keyhunt_carrier_damage.y; + M_ARGV(6, vector) *= autocvar_g_balance_keyhunt_carrier_force.y; + } + else // damage done to noncarriers + { + M_ARGV(4, float) *= autocvar_g_balance_keyhunt_carrier_damage.z; + M_ARGV(6, vector) *= autocvar_g_balance_keyhunt_carrier_force.z; + } + } + else + { + if (frag_target == frag_attacker) // damage done to themselves + { + M_ARGV(4, float) *= autocvar_g_balance_keyhunt_noncarrier_damage.x; + M_ARGV(6, vector) *= autocvar_g_balance_keyhunt_noncarrier_force.x; + } + else if (frag_target.kh_next != NULL) // damage done to key carriers + { + M_ARGV(4, float) *= autocvar_g_balance_keyhunt_noncarrier_damage.y; + M_ARGV(6, vector) *= autocvar_g_balance_keyhunt_noncarrier_force.y; + } + else // damage done to other noncarriers + { + M_ARGV(4, float) *= autocvar_g_balance_keyhunt_noncarrier_damage.z; + M_ARGV(6, vector) *= autocvar_g_balance_keyhunt_noncarrier_force.z; + } + } +} + MUTATOR_HOOKFUNCTION(kh, ClientDisconnect) { entity player = M_ARGV(0, entity);