From 2eed5f724a1886b1a47a43a10c90093bfdff82d5 Mon Sep 17 00:00:00 2001 From: Michael Busby Date: Wed, 3 Sep 2014 09:08:01 -0700 Subject: [PATCH 1/2] Added spit interpolation to l4d2_uniform_spit --- src/l4d2_uniform_spit.sp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/l4d2_uniform_spit.sp b/src/l4d2_uniform_spit.sp index b9c5014..40e6b20 100644 --- a/src/l4d2_uniform_spit.sp +++ b/src/l4d2_uniform_spit.sp @@ -9,12 +9,14 @@ new Handle:hCvarDamagePerTick; new Handle:hCvarMaxTicks; new Handle:hCvarGodframeTicks; +new Handle:hCvarInterpolationFactor; new Handle:hPuddles; new Float:damagePerTick; new maxTicks; new godframeTicks; +new spitInterpolationFactor; new bool:bLateLoad; @@ -38,6 +40,7 @@ public OnPluginStart() hCvarDamagePerTick = CreateConVar("l4d2_spit_dmg", "-1.0", "Damage per tick the spit inflicts. -1 to skip damage adjustments"); hCvarMaxTicks = CreateConVar("l4d2_spit_max_ticks", "28", "Maximum number of acid damage ticks"); hCvarGodframeTicks = CreateConVar("l4d2_spit_godframe_ticks", "4", "Number of initial godframed acid ticks"); + hCvarInterpolationFactor = CreateConVar("l4d2_spit_interpolation_factor", "0", "Interpolate this much extra damage above the normal spit damage based on tick count."); hPuddles = CreateTrie(); @@ -58,6 +61,7 @@ public OnConfigsExecuted() damagePerTick = GetConVarFloat(hCvarDamagePerTick); maxTicks = GetConVarInt(hCvarMaxTicks); godframeTicks = GetConVarInt(hCvarGodframeTicks); + spitInterpolationFactor = GetConVarInt(hCvarInterpolationFactor); } public OnClientPutInServer(client) @@ -126,6 +130,17 @@ public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damage if (damagePerTick > -1.0) { damage = damagePerTick; + + if(spitInterpolationFactor > 0) + { + // e.g. + // spitInterpolationFactor = 1 + // This will do an extra 1 damage every other frame. + // spitInterpolationFactor = 2 + // This will alternate between doing 0, 1, and 2 extra damage based on tick count. + + damage += count[victim] % spitInterpolationFactor; + } } if (godframeTicks >= count[victim] || count[victim] > maxTicks) { From 7f0440624984fbc44fd3108d6bb40baf2875e1d1 Mon Sep 17 00:00:00 2001 From: Michael Busby Date: Wed, 3 Sep 2014 09:10:48 -0700 Subject: [PATCH 2/2] Spit interpolation should require 2 or higher --- src/l4d2_uniform_spit.sp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/l4d2_uniform_spit.sp b/src/l4d2_uniform_spit.sp index 40e6b20..ddd8d87 100644 --- a/src/l4d2_uniform_spit.sp +++ b/src/l4d2_uniform_spit.sp @@ -131,12 +131,12 @@ public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damage { damage = damagePerTick; - if(spitInterpolationFactor > 0) + if(spitInterpolationFactor > 1) { // e.g. - // spitInterpolationFactor = 1 - // This will do an extra 1 damage every other frame. // spitInterpolationFactor = 2 + // This will do an extra 1 damage every other frame. + // spitInterpolationFactor = 3 // This will alternate between doing 0, 1, and 2 extra damage based on tick count. damage += count[victim] % spitInterpolationFactor;