From: terencehill Date: Fri, 14 Jul 2017 13:04:03 +0000 (+0200) Subject: Accuracy stats: also count damage dealt by projectiles hitting the enemy after the... X-Git-Tag: xonotic-v0.8.5~2281^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=aff8020b9fbf75b9cceb0df0fc781cde77c8c7d3;p=xonotic%2Fxonotic-data.pk3dir.git Accuracy stats: also count damage dealt by projectiles hitting the enemy after the one that freezes them --- diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 052a132b9..76574a334 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -370,11 +370,11 @@ void nade_napalm_boom(entity this) CSQCProjectile(fountain, true, PROJECTILE_NAPALM_FOUNTAIN, true); } -void nade_ice_freeze(entity freezefield, entity frost_target, float freeze_time) +void nade_ice_freeze(entity freezefield, entity frost_target, float freezetime) { frost_target.frozen_by = freezefield.realowner; Send_Effect(EFFECT_ELECTRO_IMPACT, frost_target.origin, '0 0 0', 1); - Freeze(frost_target, 1/freeze_time, 3, false); + Freeze(frost_target, 1 / freezetime, 3, false); Drop_Special_Items(frost_target); } diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index a6ca911bd..167f5e404 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -380,6 +380,7 @@ const float ACTIVE_TOGGLE = 3; .float revive_progress = _STAT(REVIVE_PROGRESS); .float revival_time; // time at which player was last revived .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal) +.float freeze_time; .entity iceblock; .entity frozen_by; // for ice fields diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 4f428ab1b..6be1c7dea 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -530,7 +530,7 @@ void Ice_Think(entity this) this.nextthink = time; } -void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypoint) +void Freeze (entity targ, float revivespeed, float frozen_type, float show_waypoint) { if(!IS_PLAYER(targ) && !IS_MONSTER(targ)) // only specified entities can be freezed return; @@ -543,10 +543,11 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo STAT(FROZEN, targ) = frozen_type; targ.revive_progress = ((frozen_type == 3) ? 1 : 0); targ.health = ((frozen_type == 3) ? targ_maxhealth : 1); - targ.revive_speed = freeze_time; + targ.revive_speed = revivespeed; if(targ.bot_attack) IL_REMOVE(g_bot_targets, targ); targ.bot_attack = false; + targ.freeze_time = time; entity ice = new(ice); ice.owner = targ; diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 6e4c67595..71503718a 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -94,7 +94,7 @@ bool accuracy_isgooddamage(entity attacker, entity targ) if (warmup_stage) return false; if (IS_DEAD(targ) && time > targ.death_time) return false; - if (STAT(FROZEN, targ)) return false; + if (STAT(FROZEN, targ) && time > targ.freeze_time) return false; if (SAME_TEAM(attacker, targ)) return false; if (mutator_check == MUT_ACCADD_INVALID) return true;