add sborka
This commit is contained in:
46
garrysmod/addons/tacrp/lua/entities/tacrp_proj_rpg7.lua
Normal file
46
garrysmod/addons/tacrp/lua/entities/tacrp_proj_rpg7.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
AddCSLuaFile()
|
||||
|
||||
ENT.Base = "tacrp_proj_base"
|
||||
ENT.PrintName = "RPG-7 Rocket"
|
||||
ENT.Spawnable = false
|
||||
|
||||
ENT.Model = "models/weapons/tacint/rocket_deployed.mdl"
|
||||
|
||||
ENT.IsRocket = true // projectile has a booster and will not drop.
|
||||
|
||||
ENT.InstantFuse = false // projectile is armed immediately after firing.
|
||||
ENT.RemoteFuse = false // allow this projectile to be triggered by remote detonator.
|
||||
ENT.ImpactFuse = true // projectile explodes on impact.
|
||||
|
||||
ENT.ExplodeOnDamage = true
|
||||
ENT.ExplodeUnderwater = true
|
||||
|
||||
ENT.SafetyFuse = 0.075
|
||||
ENT.ImpactDamage = 150
|
||||
|
||||
ENT.AudioLoop = "TacRP/weapons/rpg7/rocket_flight-1.wav"
|
||||
|
||||
ENT.SmokeTrail = true
|
||||
|
||||
ENT.FlareColor = Color(255, 255, 255)
|
||||
|
||||
function ENT:Detonate(ent)
|
||||
local attacker = self.Attacker or self:GetOwner()
|
||||
|
||||
local mult = TacRP.ConVars["mult_damage_explosive"]:GetFloat() * (self.NPCDamage and 0.25 or 1)
|
||||
util.BlastDamage(self, attacker, self:GetPos(), 350, 200 * mult)
|
||||
self:ImpactTraceAttack(ent, 1000 * mult, 15000)
|
||||
|
||||
local fx = EffectData()
|
||||
fx:SetOrigin(self:GetPos())
|
||||
|
||||
if self:WaterLevel() > 0 then
|
||||
util.Effect("WaterSurfaceExplosion", fx)
|
||||
else
|
||||
util.Effect("Explosion", fx)
|
||||
end
|
||||
|
||||
self:EmitSound("TacRP/weapons/rpg7/explode.wav", 125)
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
Reference in New Issue
Block a user