Залив

This commit is contained in:
Refosel
2026-03-30 10:39:52 +03:00
commit 2b57c019cb
2010 changed files with 185745 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
include("shared.lua")
killicon.Add("mg_arrow_knockback", "VGUI/entities/mg_crossbow", Color(255, 0, 0, 255))

View File

@@ -0,0 +1,33 @@
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
ENT.Model = Model("models/viper/mw/attachments/crossbow/attachment_vm_sn_crossbow_mag_firebolt.mdl")
ENT.AoeEntity = nil
local BaseClass = baseclass.Get(ENT.Base)
function ENT:Impact(tr, phys, bHull)
BaseClass.Impact(self, tr, phys, bHull)
if (tr.HitSky) then
return
end
self:EmitSound("MW19_Crossbow.Knockback")
local radius = self.KnockbackRadius
for _, e in pairs(ents.FindInSphere(tr.HitPos, radius)) do
if ((e:IsPlayer() || e:IsNPC()) && !e:IsLineOfSightClear(tr.HitPos + tr.HitNormal * 10)) then
continue
end
local force = self.KnockbackForce * (e:IsNPC() && 1.5 || 1)
local dir = (e:WorldSpaceCenter() - tr.HitPos):GetNormalized()
local curVel = e:GetVelocity()
e:SetVelocity(Vector(curVel.x, curVel.y, 200) + dir * force)
end
end

View File

@@ -0,0 +1,14 @@
ENT.Base = "mg_arrow"
ENT.Type = "anim"
ENT.KnockbackRadius = 320
ENT.KnockbackForce = 300
sound.Add({
name = "MW19_Crossbow.Knockback",
channel = CHAN_BODY,
volume = 1,
level = 100,
pitch = {95, 105},
sound = {"@viper/shared/smoke_expl_body_01.ogg"}
})