Accuracy stats: also count damage dealt by projectiles hitting the enemy after the...
authorterencehill <piuntn@gmail.com>
Fri, 14 Jul 2017 13:04:03 +0000 (15:04 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 14 Jul 2017 13:04:03 +0000 (15:04 +0200)
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/weapons/accuracy.qc

index 052a132b93b1aea01e8bf0924947c9c31b253700..76574a3344e07bae29a6c08f5864a008d13fe7e8 100644 (file)
@@ -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);
 }
index a6ca911bdc64fe4d5cbe29ae4d8bb149348b349e..167f5e404f7dee9ac5e07bb41d10e70ef92dd69f 100644 (file)
@@ -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
 
index 4f428ab1b84defe579d00ae8f5afe84f36f91fa7..6be1c7deaabdce0f0f441f4ffcad2ce0d218bbe4 100644 (file)
@@ -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;
index 6e4c67595895c4c3121f11cfe4c08ef329447dbd..71503718aa4b9dc40fdd7bb306d032e49663e513 100644 (file)
@@ -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;