You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB
Lua

AddCSLuaFile()
-- maybe doing it later
DEFINE_BASECLASS( "base_anim" )
ENT.Type = "anim"
ENT.PrintName = "Thrown Food"
ENT.Author = "catSIXe"
function ENT:Initialize()
self:SetModel( "models/props_junk/PopCan01a.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
end
function ENT:Throw(ply)
end
function ENT:PhysicsCollide()
local effectdata = EffectData()
effectdata:SetOrigin(self.Entity:GetPos())
effectdata:SetEntity(self.Entity)
effectdata:SetStart(self.Entity:GetPos())
effectdata:SetNormal(Vector(0,0,1))
--util.Effect("ManhackSparks", effectdata)
util.Effect("cball_explode", effectdata)
util.Effect("Explosion", effectdata)
local thumper = effectdata
thumper:SetOrigin(self.Entity:GetPos())
thumper:SetScale(500)
thumper:SetMagnitude(500)
util.Effect("ThumperDust", effectdata)
local scorchstart = self.Entity:GetPos() + ((Vector(0,0,1)) * 5)
local scorchend = self.Entity:GetPos() + ((Vector(0,0,-1)) * 5)
SafeRemoveEntity(self.Entity)
util.Decal("Scorch", scorchstart, scorchend)
end