function EFFECT:Init( data ) self.plane = data:GetEntity() self.emitter = ParticleEmitter( self.plane:GetPos(), false ) self.start = CurTime() self.die_time = CurTime() + data:GetScale() end function EFFECT:SpawnWrench(pos) local wrench_mat = "nanite_wrench_red" if self.plane:GetTeam() == TEAM_BLUE then wrench_mat = "nanite_wrench_blue" end local p = self.emitter:Add( wrench_mat, pos) p:SetDieTime(math.Rand(0.3,0.5)) p:SetGravity( Vector(0,0,50)) p:SetVelocity(self.plane:GetVelocity() + VectorRand() * 10) p:SetAirResistance(40) p:SetStartSize(math.Rand(3,4)) p:SetEndSize(math.Rand(4,6)) p:SetRoll(math.Rand(-10,10)) p:SetRollDelta(math.Rand(-2,2)) local col = team.GetColor(self.plane:GetTeam()) //p:SetColor(col.r,col.g,col.b,255) p:SetEndAlpha( 0 ) end function EFFECT:Think() if !ValidEntity(self.plane) || self.die_time < CurTime() then return false end if math.random(1,3) == 1 then local pos = self.plane:GetPos() + self.plane:GetUp() * 10 + self.plane:GetForward() * -30 self:SpawnWrench(pos) local pos = self.plane:GetPos() + self.plane:GetRight() * 32 + self.plane:GetForward() * -15 self:SpawnWrench(pos) local pos = self.plane:GetPos() + self.plane:GetRight() * -32 + self.plane:GetForward() * -15 self:SpawnWrench(pos) end return true end function EFFECT:Render() end