Залив

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,29 @@
include("shared.lua")
local BaseClass = baseclass.Get(ENT.Base)
local flareMaterial = Material("sprites/orangecore1_gmod")
ENT.bTracerOn = false
function ENT:DrawTracer()
end
function ENT:DrawBullet()
if (!self.bTracerOn) then
ParticleEffectAttach("bullet_sniper_smoke", PATTACH_ABSORIGIN_FOLLOW, self, 0)
self.bTracerOn = true
end
if (GetViewEntity() == self:GetOwner()) then
local angle = (self:GetPos() - EyePos()):Angle()
angle:RotateAroundAxis(EyeAngles():Right(), 90)
local dist = math.min(self:GetPos():Distance(EyePos()), 2300)
cam.Start3D2D(self:GetPos(), angle, dist * 0.0001)
surface.SetDrawColor(255, 255, 255, 255)
surface.SetMaterial(flareMaterial)
surface.DrawTexturedRectRotated(0, 0, 32, 32, 0)
cam.End3D2D()
end
end

View File

@@ -0,0 +1,55 @@
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
function ENT:GetDamageType()
return DMG_SNIPER
end
ENT.m_gravity = 0
ENT.Maxs = Vector(3, 3, 3)
function ENT:PhysicsUpdate(phys)
self.m_gravity = self.m_gravity + (self.Projectile.Gravity)
phys:SetPos(self.LastPos + phys:GetAngles():Forward() * (self.Projectile.Speed * FrameTime()) - (Vector(0, 0, self.m_gravity) * FrameTime()))
if (!self.bCollided) then
--Aim assist
if (GetConVar("mgbase_debug_projectiles"):GetInt() > 0) then
debugoverlay.Box(phys:GetPos(), -self.Maxs, self.Maxs, 0, Color(0, 200, 50, 10))
end
local trData = {
start = self.LastPos,
endpos = phys:GetPos(),
filter = {self:GetOwner(), self},
mask = MASK_SHOT_PORTAL,
collisiongroup = COLLISION_GROUP_PROJECTILE,
mins = -self.Maxs,
maxs = self.Maxs
}
local tr = util.TraceHull(trData)
if (tr.Hit && (tr.Entity:IsPlayer() || tr.Entity:IsNPC())) then
self:Impact(tr, phys, true)
return
end
--Normal hitscan
if (GetConVar("mgbase_debug_projectiles"):GetInt() > 0) then
debugoverlay.Line(self.LastPos, phys:GetPos(), 1, Color(255, 0, 0, 1))
end
tr = util.TraceLine(trData)
if (tr.Hit) then
self:Impact(tr, phys, false)
return
end
end
self.LastPos = phys:GetPos()
end

View File

@@ -0,0 +1,5 @@
ENT.Base = "mg_bullet"
game.AddParticles("particles/mw19_attachments.pcf")
PrecacheParticleSystem("bullet_sniper_smoke")
PrecacheParticleSystem("bullet_sniper_tracer")