Polish arena effects, audio and diagnostics

This commit is contained in:
Leshyi committed 2026-11-30 01:26:42 +05:00
1 parent 2774e625c1
commit 16a359d4af
28 files changed
+512 -257

No files matched your search

+8 -63
View File
@@ -1,5 +1,5 @@
--!strict
local TweenService = game:GetService("TweenService")
local Diagnostics = require(script.Parent.ModeRuntime.ZoneDiagnostics)
local Credit = require(script.Parent.ModeRuntime.HotPointCredit)
local Sites = require(script.Parent:WaitForChild("ArenaObjectiveSites") :: ModuleScript)
@@ -26,7 +26,7 @@ local TEAM_SPEED = 1.5
local HIT_WINDOW = 1.2
local HIT_DECAY = .8
local neutral = Color3.fromRGB(183, 132, 255)
local neutral = Color3.fromRGB(255, 220, 96)
local contested = Color3.fromRGB(255, 211, 124)
local teamColor: {[Side]: Color3} = {Blue = Color3.fromRGB(76, 228, 255), Orange = Color3.fromRGB(255, 81, 105)}
@@ -35,7 +35,6 @@ function HotPoint.attachRing(mark: Marker, radius: number?): (Color3) -> ()
local body = mark.body
body.Transparency = .92
local beams: {Beam} = {}
local sparks: {ParticleEmitter} = {}
local function anchor(angle: number, height: number): Attachment
local radial = Vector3.new(math.cos(angle), 0, math.sin(angle))
local tangent = Vector3.new(-radial.Z, 0, radial.X)
@@ -81,22 +80,6 @@ function HotPoint.attachRing(mark: Marker, radius: number?): (Color3) -> ()
veil.Parent = body
table.insert(beams, veil)
end
local emitter = Instance.new("ParticleEmitter")
emitter.Name = "RisingSparks"
emitter.Texture = "rbxasset://textures/particles/sparkles_main.dds"
emitter.EmissionDirection = Enum.NormalId.Top
emitter.Rate, emitter.Speed = 12, NumberRange.new(16.5, 27)
emitter.Lifetime, emitter.SpreadAngle = NumberRange.new(.6, 1.08), Vector2.new(8, 8)
emitter.Rotation, emitter.RotSpeed = NumberRange.new(-180, 180), NumberRange.new(-95, 95)
emitter.LightEmission, emitter.LightInfluence, emitter.Brightness = 1, 0, 2
emitter.Size = NumberSequence.new({
NumberSequenceKeypoint.new(0, .16), NumberSequenceKeypoint.new(.25, .55), NumberSequenceKeypoint.new(1, .08),
})
emitter.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(.22, .12), NumberSequenceKeypoint.new(1, 1),
})
emitter.Parent = source
table.insert(sparks, emitter)
end
return function(tint: Color3)
body.Color, mark.label.TextColor3 = tint, tint
@@ -107,50 +90,12 @@ function HotPoint.attachRing(mark: Marker, radius: number?): (Color3) -> ()
ColorSequenceKeypoint.new(1, tint),
})
for _, beam in beams do beam.Color = spectrum end
for _, emitter in sparks do emitter.Color = spectrum end
end
end
local function collapse(mark: Marker)
local body = mark.body
local motion = TweenInfo.new(COLLAPSE_SECONDS, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
local center = body.CFrame:PointToObjectSpace(mark.origin + Vector3.yAxis * .29)
body:SetAttribute("ObjectiveArrowHidden", true)
mark.label.Visible = false
TweenService:Create(body, motion, {Size = Vector3.new(body.Size.X, .1, .1), Transparency = 1}):Play()
for _, item in body:GetDescendants() do
if item:IsA("Attachment") then
TweenService:Create(item, motion, {Position = center}):Play()
elseif item:IsA("Beam") then
TweenService:Create(item, motion, {Width0 = 0, Width1 = 0, CurveSize0 = 0, CurveSize1 = 0}):Play()
elseif item:IsA("ParticleEmitter") then
item.Enabled = false
elseif item:IsA("PointLight") then
TweenService:Create(item, motion, {Brightness = 0, Range = 0}):Play()
end
end
local source = Instance.new("Attachment")
source.CFrame = body.CFrame:ToObjectSpace(CFrame.new(mark.origin + Vector3.yAxis * .65))
source.Parent = body
local smoke = Instance.new("ParticleEmitter")
smoke.Name = "CaptureSmoke"
smoke.Texture = "rbxasset://textures/particles/smoke_main.dds"
smoke.Rate = 0
smoke.Lifetime = NumberRange.new(.8, 1.45)
smoke.Speed = NumberRange.new(7, 16)
smoke.SpreadAngle = Vector2.new(68, 68)
smoke.Rotation = NumberRange.new(-180, 180)
smoke.Acceleration = Vector3.yAxis * 6
smoke.Color = ColorSequence.new(body.Color:Lerp(Color3.fromRGB(215, 222, 236), .65))
smoke.Size = NumberSequence.new({
NumberSequenceKeypoint.new(0, 2), NumberSequenceKeypoint.new(.5, 6), NumberSequenceKeypoint.new(1, 10),
})
smoke.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, .28), NumberSequenceKeypoint.new(.42, .46), NumberSequenceKeypoint.new(1, 1),
})
smoke.Parent = source
smoke:Emit(32)
local function closeMarker(mark: Marker)
mark.body:SetAttribute("ObjectiveArrowHidden", true)
mark.body.Parent = nil
end
function HotPoint.start(config: Config): Capture
@@ -185,11 +130,11 @@ function HotPoint.start(config: Config): Capture
if delta.Y < -.5 or delta.Y > 60 or delta.X * delta.X + delta.Z * delta.Z > HotPoint.Radius ^ 2 then return false end
if delta.Y > 8 then
-- A jump over the point still counts when the first floor below is the capture floor.
local floor = workspace:Raycast(fighter.root.Position, -Vector3.yAxis * (delta.Y + .8), config.geometry)
local floor = Diagnostics.raycast(fighter.root.Position, -Vector3.yAxis * (delta.Y + .8), config.geometry)
return floor ~= nil and math.abs(floor.Position.Y - origin.Y) < .65
end
local to = origin + Vector3.yAxis * 2.7 - fighter.root.Position
return workspace:Raycast(fighter.root.Position, to, config.geometry) == nil
return Diagnostics.raycast(fighter.root.Position, to, config.geometry) == nil
end
local function step(fighters: {Fighter}, now: number, dt: number)
@@ -264,7 +209,7 @@ function HotPoint.start(config: Config): Capture
state:SetAttribute("HotPointPosition", nil)
state:SetAttribute("HotPointMovesAt", movesAt)
paintRing(teamColor[side])
if mark then collapse(mark) end
if mark then closeMarker(mark) end
else
local phase = if isContested then "Contested" elseif underFire then "UnderFire" else "Capturing"
publish(side, math.floor(100 * credit / CAPTURE_SECONDS), phase)