From: Lyberta Date: Wed, 30 Aug 2017 05:05:00 +0000 (+0300) Subject: URS: Improved vampire buff. X-Git-Tag: xonotic-v0.8.5~2459^2~10^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7e7a410ef2577fbcf8af63f07879eff2b678573d;p=xonotic%2Fxonotic-data.pk3dir.git URS: Improved vampire buff. --- diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 7038f01ff..e039a96b9 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -542,10 +542,15 @@ MUTATOR_HOOKFUNCTION(buffs, Damage_Calculate) if(frag_target.takedamage) if(DIFF_TEAM(frag_attacker, frag_target)) { - float hp = GetResourceAmount(frag_attacker, RESOURCE_HEALTH); - SetResourceAmount(frag_attacker, RESOURCE_HEALTH, bound(0, hp + bound(0, frag_damage * autocvar_g_buffs_vampire_damage_steal, GetResourceAmount(frag_target, RESOURCE_HEALTH)), g_pickup_healthsmall_max)); - if(frag_target.armorvalue) - frag_attacker.armorvalue = bound(0, frag_attacker.armorvalue + bound(0, frag_damage * autocvar_g_buffs_vampire_damage_steal, frag_target.armorvalue), g_pickup_armorsmall_max); + float amount = bound(0, frag_damage * autocvar_g_buffs_vampire_damage_steal, + GetResourceAmount(frag_target, RESOURCE_HEALTH)); + GiveResourceWithLimit(frag_attacker, RESOURCE_HEALTH, amount, g_pickup_healthsmall_max); + if (frag_target.armorvalue) + { + amount = bound(0, frag_damage * autocvar_g_buffs_vampire_damage_steal, + GetResourceAmount(frag_target, RESOURCE_ARMOR)); + GiveResourceWithLimit(frag_attacker, RESOURCE_ARMOR, amount, g_pickup_armorsmall_max); + } } M_ARGV(4, float) = frag_damage;