Slug Rifle headshot damage now displays 9999.

Slug Rifle headshots now display 9999 as their damage value (this is
only display damage, the actual damage isn't even relevant).
Slug Rifle passive no longer works on bosses.
This commit is contained in:
JetBoom 2014-11-08 23:14:15 -05:00
parent 1d517c5375
commit 45b5b7e952
2 changed files with 12 additions and 1 deletions

View file

@ -120,6 +120,11 @@ function SWEP.BulletCallback(attacker, tr, dmginfo)
if tr.HitGroup == HITGROUP_HEAD then if tr.HitGroup == HITGROUP_HEAD then
local ent = tr.Entity local ent = tr.Entity
if ent:IsValid() and ent:IsPlayer() then if ent:IsValid() and ent:IsPlayer() then
if ent:Team() == TEAM_UNDEAD and ent:GetZombieClassTable().Boss then
GenericBulletCallback(attacker, tr, dmginfo)
return
end
ent.Gibbed = CurTime() ent.Gibbed = CurTime()
end end
@ -128,5 +133,6 @@ function SWEP.BulletCallback(attacker, tr, dmginfo)
end end
end end
INFDAMAGEFLOATER = true
GenericBulletCallback(attacker, tr, dmginfo) GenericBulletCallback(attacker, tr, dmginfo)
end end

View file

@ -2462,7 +2462,12 @@ function GM:DamageFloater(attacker, victim, dmginfo)
if dmgpos == vector_origin then dmgpos = victim:NearestPoint(attacker:EyePos()) end if dmgpos == vector_origin then dmgpos = victim:NearestPoint(attacker:EyePos()) end
net.Start(victim:IsPlayer() and "zs_dmg" or "zs_dmg_prop") net.Start(victim:IsPlayer() and "zs_dmg" or "zs_dmg_prop")
net.WriteUInt(math.ceil(dmginfo:GetDamage()), 16) if INFDAMAGEFLOATER then
INFDAMAGEFLOATER = nil
net.WriteUInt(9999, 16)
else
net.WriteUInt(math.ceil(dmginfo:GetDamage()), 16)
end
net.WriteVector(dmgpos) net.WriteVector(dmgpos)
net.Send(attacker) net.Send(attacker)
end end