Removing blood client-side trigger as not working. Replaced with small bleeding + explosion. Related to #10.
parent
e05231b293
commit
744a73a3c3
|
@ -5,8 +5,8 @@
|
||||||
* cl_fxfake.lua
|
* cl_fxfake.lua
|
||||||
*
|
*
|
||||||
* Purpose:
|
* Purpose:
|
||||||
* Fake shoot and blood effect on client-side via a trigger from server-side,
|
* Fake client-side effects via a user message trigger from server-side, as for some
|
||||||
* as for some reason the effects are not rendered on client-side automatically.
|
* reason these effects are not rendered on client-side automatically.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Carl Kittelberger (Icedream)
|
* Copyright (C) 2013 Carl Kittelberger (Icedream)
|
||||||
*
|
*
|
||||||
|
@ -38,14 +38,4 @@ usermessage.Hook("disguiserShootFX", function(um)
|
||||||
-- Render shoot effect
|
-- Render shoot effect
|
||||||
swep:DoShootEffect(
|
swep:DoShootEffect(
|
||||||
hitpos, hitnormal, entity, physbone, bFirstTimePredicted)
|
hitpos, hitnormal, entity, physbone, bFirstTimePredicted)
|
||||||
end)
|
|
||||||
|
|
||||||
usermessage.Hook("disguiserBlood", function(um)
|
|
||||||
local edata = EffectData()
|
|
||||||
edata:SetStart(um:ReadVector())
|
|
||||||
edata:SetOrigin(um:ReadVector())
|
|
||||||
edata:SetNormal(um:ReadVectorNormal())
|
|
||||||
edata:SetEntity(um:ReadEntity())
|
|
||||||
util.Effect("BloodImpact", edata)
|
|
||||||
util.Decal("Splash.Large", um:ReadVector(), um:ReadVector())
|
|
||||||
end)
|
end)
|
|
@ -364,29 +364,15 @@ hook.Add("PlayerDeath", "Disguiser.ThirdPersonDeath", function(victim, inflictor
|
||||||
dentity:Fire("kill", "", 2)
|
dentity:Fire("kill", "", 2)
|
||||||
dentity:Fire("enablemotion","",0)
|
dentity:Fire("enablemotion","",0)
|
||||||
|
|
||||||
// Manually draw additional blood (for some reason setting the blood color has no effect)
|
// Let the entity bleed wahahaha. I'm mad, ain't I?
|
||||||
local traceworld = {}
|
|
||||||
traceworld.start = victim:GetPos() + Vector(0, 0, 20)
|
|
||||||
traceworld.endpos = traceworld.start + (Vector(0,0,-1) * 8000) // aim max. 8000 units down
|
|
||||||
traceworld.filter = victim
|
|
||||||
local trw = util.TraceLine(traceworld) // Send the trace and get the results.
|
|
||||||
local edata = EffectData()
|
|
||||||
edata:SetStart(victim:GetPos() - physics:GetVelocity())
|
|
||||||
edata:SetOrigin(victim:GetPos())
|
|
||||||
edata:SetNormal(trw.Normal)
|
|
||||||
edata:SetEntity(dentity)
|
|
||||||
util.Effect("BloodImpact", edata)
|
util.Effect("BloodImpact", edata)
|
||||||
util.Decal("Splash.Large", trw.HitPos + trw.HitNormal, trw.HitPos - trw.HitNormal)
|
util.Decal("Splash.Large", trw.HitPos + trw.HitNormal, trw.HitPos - trw.HitNormal)
|
||||||
|
|
||||||
// Make it appear on clientside of victim
|
// BOOOOM!
|
||||||
umsg.Start("disguiserBlood", victim)
|
local boomFx = ents.Create("env_explosion")
|
||||||
umsg.Vector(victim:GetPos() - physics:GetVelocity())
|
boomFx:SetPos(dentity:GetPos())
|
||||||
umsg.Vector(victim:GetPos())
|
boomFx:Spawn()
|
||||||
umsg.VectorNormal(trw.Normal)
|
boomFx.Fire("explode", "", 0)
|
||||||
umsg.Entity(dentity)
|
|
||||||
umsg.Vector(trw.HitPos + trw.HitNormal)
|
|
||||||
umsg.Vector(trw.HitPos - trw.HitNormal)
|
|
||||||
umsg.End()
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue