This commit is contained in:
Leshyi committed 2026-11-02 17:21:45 +03:00
1 parent 96d5945abe
commit 8c01ae9657
11 files changed
+756 -59

No files matched your search

+9 -5
View File
@@ -6,6 +6,7 @@
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Config = require(ReplicatedStorage.Shared.Config)
local BuggyStats = require(ReplicatedStorage.Shared.BuggyStats)
local GunMath = require(ReplicatedStorage.Shared.GunMath)
local Buggy = require(script.Parent.Buggy)
local World = require(script.Parent.World)
@@ -87,7 +88,7 @@ end
-- Взрыв снаряда пушки или ракеты: урон спадает от центра к краю, бочки рядом детонируют.
-- Стрелка не задевает. Багги в радиусе подбрасывает, водителю достаётся половина (если не прикрыт бронёй целиком).
local function blast(position: Vector3, spec, shooter: Player)
local function blast(position: Vector3, spec, shooter: Player, damage: number)
local explosion = Instance.new("Explosion")
explosion.Position = position
explosion.BlastRadius = spec.blastRadius
@@ -112,7 +113,7 @@ local function blast(position: Vector3, spec, shooter: Player)
if humanoid and not damaged[humanoid] and humanoid.Parent ~= shooter.Character then
damaged[humanoid] = true
humanoid:SetAttribute("LastHitBy", shooter.UserId)
humanoid:TakeDamage(spec.damage * falloff)
humanoid:TakeDamage(damage * falloff)
end
end)
explosion.Parent = workspace
@@ -171,7 +172,10 @@ function Weapons.Init(remotes: Folder)
if gun.overheated and gun.heat <= G.CoolResume then
gun.overheated = false
end
if gun.overheated or now - gun.lastShot < 0.8 / spec.fireRate then
-- Бусты из дропа: скорострельность и урон
local fireRate = spec.fireRate * BuggyStats.BoostMultiplier(player, "firerate")
local damage = spec.damage * BuggyStats.BoostMultiplier(player, "damage")
if gun.overheated or now - gun.lastShot < 0.8 / fireRate then
return
end
gun.lastShot = now
@@ -198,12 +202,12 @@ function Weapons.Init(remotes: Folder)
if spec.kind == "bullet" then
if result then
hit(result.Instance, player, spec.damage)
hit(result.Instance, player, damage)
end
else
-- Снаряд летит до точки попадания (клиенты рисуют полёт), там взрыв. Промах — взрыв в конце дальности.
local travel = (hitPosition - origin).Magnitude / spec.speed
task.delay(travel, blast, hitPosition, spec, player)
task.delay(travel, blast, hitPosition, spec, player, damage)
end
Tracer:FireAllClients(model, origin, hitPosition, player.UserId)
end)