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

+7 -35
View File
@@ -4,12 +4,13 @@ local Types = require(Runtime.Types)
local Common = require(Runtime.Common)
local Kinds = require(game.ReplicatedStorage.Hunter.EventKinds)
local Strings = require(game.ReplicatedStorage.Hunter.Strings)
local Diagnostics = require(Runtime.ZoneDiagnostics)
local Context = require(Runtime.Context)
local Rules = require(Runtime.FlagRules)
local HotPoint = require(Runtime.Parent.HotPoint)
type Fighter = Types.Fighter
type Flag = {
marker: Common.Marker, stars: ParticleEmitter, mist: ParticleEmitter, light: PointLight, banner: BasePart,
marker: Common.Marker, light: PointLight, banner: BasePart,
carrier: Player?, tether: WeldConstraint?, droppedUntil: number,
}
local function makeFlag(parent: Instance, roof: Vector3): Flag
@@ -35,33 +36,7 @@ local function makeFlag(parent: Instance, roof: Vector3): Flag
local banner = attach("Banner", Vector3.new(2.65, 1.48, .15), Vector3.new(1.35, 1.45, 0), Common.gold)
attach("CrownLight", Vector3.new(.33, .33, .33), Vector3.yAxis * 2.34, Common.neutral).Shape = Enum.PartType.Ball
local aura = Instance.new("Attachment")
aura.Name = "FlagAura"
aura.Position = -Vector3.yAxis * 1.75
aura.Parent = body
local stars = Instance.new("ParticleEmitter")
stars.Name = "Stars"
stars.Texture = "rbxasset://textures/particles/sparkles_main.dds"
stars.Color = ColorSequence.new(Common.neutral, Common.gold)
stars.LightEmission, stars.LightInfluence = 1, 0
stars.Rate, stars.Speed, stars.Lifetime = 24, NumberRange.new(3, 6), NumberRange.new(.7, 1.4)
stars.SpreadAngle = Vector2.new(65, 65)
stars.Rotation, stars.RotSpeed = NumberRange.new(-180, 180), NumberRange.new(-90, 90)
stars.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, .22), NumberSequenceKeypoint.new(.4, .52), NumberSequenceKeypoint.new(1, 0)})
stars.Parent = aura
local mist = Instance.new("ParticleEmitter")
mist.Name = "ColoredMist"
mist.Texture = "rbxasset://textures/particles/smoke_main.dds"
mist.Color = ColorSequence.new(Common.neutral, Common.gold)
mist.LightEmission, mist.LightInfluence = .55, 0
mist.Rate, mist.Speed, mist.Lifetime = 9, NumberRange.new(1, 4), NumberRange.new(.7, 1.2)
mist.SpreadAngle = Vector2.new(110, 110)
mist.Size = NumberSequence.new(1.4, 4)
mist.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, .72), NumberSequenceKeypoint.new(.45, .79), NumberSequenceKeypoint.new(1, 1)})
mist.Parent = aura
return {marker = mark, stars = stars, mist = mist, light = light, banner = banner,
return {marker = mark, light = light, banner = banner,
carrier = nil, tether = nil, droppedUntil = 0}
end
@@ -88,8 +63,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
mark.body.CFrame = CFrame.new(at + Vector3.yAxis * 2.4)
mark.label.Text = if droppedUntil > 0 then Strings.flagDropLabel else Strings.flagRoofLabel
mark.label.TextColor3, object.banner.Color = Common.gold, Common.gold
object.stars.Enabled, object.mist.Enabled, object.light.Enabled = true, true, true
object.stars:Emit(16)
object.light.Enabled = true
end
local function pickUpFlag(object: Flag, fighter: Fighter)
@@ -108,14 +82,12 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
local tint = Common.color(fighter.side)
object.marker.label.Text = Strings.flagCarrierLabel(fighter.player.DisplayName)
object.marker.label.TextColor3, object.banner.Color = tint, tint
object.stars.Enabled, object.mist.Enabled, object.light.Enabled = false, false, false
object.stars:Clear()
object.mist:Clear()
object.light.Enabled = false
end
local function dropCarried(player: Player, at: Vector3?, now: number, fighters: {Fighter}?)
if flag.carrier == player then
if at then
local floor = workspace:Raycast(at + Vector3.yAxis * .3, -Vector3.yAxis * 50, geometry)
local floor = Diagnostics.raycast(at + Vector3.yAxis * .3, -Vector3.yAxis * 50, geometry)
if floor then
putFlag(flag, floor.Position, now + Rules.RETURN_SECONDS)
for _, fighter in (fighters or Context.collect(ctx.members())) do ctx.legacy(fighter.player, "FlagDropped") end
@@ -140,7 +112,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
if Common.boundsAt(fighter.root.Position, base, HotPoint.Radius, 7) then
ctx.scoring.add(fighter.side, 1, Kinds.FlagScored, fighter.player)
ctx.contribute(fighter.player, "deliveries", 1)
ctx.events.fire(Kinds.FlagScored, {side = fighter.side, userId = fighter.player.UserId})
ctx.events.fire(Kinds.FlagScored, {side = fighter.side, userId = fighter.player.UserId, at = base})
ctx.cue(fighters, true, nil)
putFlag(flag, flag.marker.origin, 0)
ctx.events.fire(Kinds.FlagReturned, {at = flag.marker.origin})