Polish Citadel Assault objectives and results

This commit is contained in:
Leshyi committed 2026-11-29 23:49:25 +05:00
1 parent d1c42a36b8
commit c0b099e604
18 files changed
+555 -45

No files matched your search

+59 -13
View File
@@ -20,7 +20,11 @@ local objectiveCue = ReplicatedStorage:WaitForChild("ArenaObjectiveCue") :: Remo
local objectiveCueConnection = objectiveCue.OnClientEvent:Connect(function(captured: boolean | string)
Sounds.sound(if captured == "FlagDropped" then "FlagDropped" elseif captured == true then "HotPointCaptured" else "HotPointStart")
end)
local RoundStrings = require(ReplicatedStorage:WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).round
local Hunter = ReplicatedStorage:WaitForChild("Hunter")
local HunterStrings = require(Hunter:WaitForChild("Strings") :: ModuleScript)
local RoundStrings = HunterStrings.round
local SiegeResults = require(Hunter:WaitForChild("SiegeResults") :: ModuleScript)
local SiegeConfig = require(ReplicatedStorage:WaitForChild("CitadelAssaultConfig") :: ModuleScript)
local limit = state:GetAttribute("TeamLimit") :: number
local modeIds = {Modes.Procedural}
local function currentMode(): string
@@ -157,7 +161,12 @@ siegeBar.BackgroundColor3 = Color3.fromRGB(34, 45, 65)
siegeBar.BorderSizePixel = 0
siegeBar.Visible = false
siegeBar.Parent = objective
local siegeSteps = UI.label(objective, "SiegeSteps", "", UDim2.fromOffset(16, 96), UDim2.new(1, -32, 0, 22), 15, UI.Gold)
siegeSteps.Visible = false
local siegeChip = UI.label(objective, "SiegeChip", "", UDim2.fromOffset(16, 119), UDim2.new(1, -32, 0, 21), 14, UI.Mint)
siegeChip.Visible = false
local siegeSegments: {Frame} = {}
local siegeSegmentCount = 0
for i = 1, 10 do
local segment = Instance.new("Frame")
segment.Position = UDim2.fromScale((i - 1) / 10, 0)
@@ -405,7 +414,7 @@ local function refreshObjective()
local visible = player:GetAttribute("InArena") == true and match:GetAttribute("Phase") == "Round"
local needsLayout = visible ~= objective.Visible
objective.Visible = visible
siegeBar.Visible = false
siegeBar.Visible, siegeSteps.Visible, siegeChip.Visible = false, false, false
if visible then
local rule = Rules.get(match:GetAttribute("Ruleset"))
local accent = if player:GetAttribute("ArenaTeam") == "Orange" then orange else blue
@@ -420,21 +429,44 @@ local function refreshObjective()
local attacker = siege:GetAttribute("Attacker")
local seconds = (siege:GetAttribute("Seconds") :: number?) or 0
local zone = player:GetAttribute("CitadelZone")
local role = if attacker == player:GetAttribute("ArenaTeam") then "Вы атакуете" else "Вы защищаете"
local attacking = attacker == player:GetAttribute("ArenaTeam")
local role = if attacking then "▲ " .. RoundStrings.attack else "◆ " .. RoundStrings.defend
local point = (siege:GetAttribute("PointName") :: string?) or ""
objectiveTitle.Text = if phase == "RoleSwap" then "СМЕНА РОЛЕЙ" else string.format("АТАКА %d/2 · %d:%02d",
local roleColor = if attacking then accent else UI.Gold
objectiveTitle.Text = if phase == "RoleSwap" then RoundStrings.swap else string.format("АТАКА %d/2 · %d:%02d",
if phase == "Attack2" then 2 else 1, math.floor(seconds / 60), seconds % 60)
objectiveText.Text = role .. " · " .. point
objectiveText.Text = role .. (if point ~= "" then " · " .. point else "")
objectiveTitle.TextColor3 = roleColor
objectiveContour:SetAttribute("Accent", roleColor)
local hint = playerGui:GetAttribute("SiegeHint")
if typeof(hint) == "string" then text = hint end
if phase ~= "RoleSwap" and siege:GetAttribute("Point") then
if zone == "Height" then text = "Найдите нужный этаж"
elseif zone == "Blocked" then text = "Нет прямой видимости центра"
elseif zone == "Inside" and role == "Вы защищаете" then text = "Вы блокируете захват. Оставайтесь в круге!" end
siegeBar.Visible = true
siegeBar.Visible, siegeSteps.Visible = true, true
local progress = (siege:GetAttribute("Progress") :: number?) or 0
local filled = math.floor((progress + 1e-7) * 10)
local index = (siege:GetAttribute("Index") :: number?) or 1
local total = (siege:GetAttribute("Total") :: number?) or SiegeConfig.MAX_OBJECTIVES
local state = siege:GetAttribute("Status")
local attackColor = if attacker == "Orange" then orange else blue
local segmentColor = if state == "Contested" then SiegeConfig.CONTESTED_COLOR
elseif state == "Decaying" then attackColor:Lerp(muted, .45) else attackColor
for i, segment in siegeSegments do
segment.Visible = progress + 1e-8 >= i / #siegeSegments
segment.BackgroundColor3 = if siege:GetAttribute("Status") == "Contested" then orange else blue
segment.Visible = i <= filled
segment.BackgroundColor3 = segmentColor
if i == filled and filled > siegeSegmentCount then
segment.BackgroundTransparency = .55
TweenService:Create(segment, TweenInfo.new(.2), {BackgroundTransparency = 0}):Play()
end
end
siegeSegmentCount = filled
local dots: {string} = {}
for i = 1, total do dots[i] = if i < index then "✓" elseif i == index then "◆" else "○" end
siegeSteps.Text = table.concat(dots, " ") .. string.format(" %d%%", filled * 10)
siegeSteps.TextColor3 = roleColor
local copy = HunterStrings.hint.Siege
siegeChip.Visible = zone == "Inside" or zone == "Height" or zone == "Blocked"
siegeChip.Text = if zone == "Inside" then copy.inside elseif zone == "Height" then copy.wrongFloor else copy.noSight
siegeChip.TextColor3 = if zone == "Inside" then UI.Mint else UI.Gold
end
end
local tokens = (player:GetAttribute("ArenaTokens") :: number?) or 0
@@ -445,7 +477,7 @@ local function refreshObjective()
objectiveStatus.Visible = text ~= ""
objectiveStatus.Text = text
objectiveStatus.TextColor3 = accent:Lerp(ink, .3)
local height = if siegeBar.Visible then 101 elseif objectiveStatus.Visible then 88 else 62
local height = if siegeBar.Visible then 145 elseif objectiveStatus.Visible then 88 else 62
if height ~= objective.Size.Y.Offset then
objective.Size = UDim2.fromOffset(widthOfCard, height)
needsLayout = true
@@ -598,6 +630,10 @@ end
local blueResult = resultTeam("Blue", 23, "СИНИЕ", blue, blueDark)
local orangeResult = resultTeam("Orange", 491, "ОРАНЖЕВЫЕ", orange, orangeDark)
local siegeRecap = UI.label(resultsPanel, "SiegeTimes", "", UDim2.fromOffset(30, 0), UDim2.fromOffset(900, 84), 16, ink)
siegeRecap.TextWrapped = true
siegeRecap.TextXAlignment = Enum.TextXAlignment.Left
siegeRecap.Visible = false
local resultsExtra = UI.plate(resultsPanel, "ResultsExtra", UDim2.fromOffset(25, 0), UDim2.fromOffset(910, 98), UI.Gold)
local mvpChip = UI.label(resultsExtra, "MVP", "", UDim2.fromOffset(15, 4), UDim2.fromOffset(865, 28), 21, UI.Gold)
mvpChip.FontFace = UI.Display
@@ -644,10 +680,11 @@ local function setSummaryTeams(bluePlayers: {ResultPlayer}, orangePlayers: {Resu
populateResults(orangeResult, orangeTotal, orangePlayers)
local rowSpace = 35 * math.max(3, #bluePlayers, #orangePlayers)
local final = summaryView == "Final"
local height = 280 + rowSpace + (if final then 121 else 0)
local height = 280 + rowSpace + (if final then 121 else 0) + (if final and siegeRecap.Visible then 90 else 0)
blueResult.card.Position = UDim2.fromOffset(23, if final then 112 else 97)
orangeResult.card.Position = UDim2.fromOffset(491, if final then 112 else 97)
resultsExtra.Position = UDim2.fromOffset(25, height - 164)
siegeRecap.Position = UDim2.fromOffset(30, height - 250)
if resultsPanel.Size.Y.Offset == height then return end
resultsPanel.Size = UDim2.fromOffset(960, height)
blueResult.card.Size = UDim2.fromOffset(446, 117 + rowSpace)
@@ -659,6 +696,7 @@ end
local function startSummary(view: SummaryView, ruleId: unknown)
summaryView = view
siegeRecap.Visible = false
resultReason.Visible = view == "Final"
resultsExtra.Visible = view == "Final"
lobbyButton.Visible = view == "Live" and player:GetAttribute("InArena") == true
@@ -838,6 +876,12 @@ results.OnClientEvent:Connect(function(result: RoundResult, participantSide: str
if left <= 0 then return end
if resultsShade.Visible then hideResults() end
startSummary("Final", result.ruleset)
if result.ruleset == "Siege" and result.siegeTimes then
local lines = SiegeResults.rows(result.siegeTimes, SiegeConfig.MAX_OBJECTIVES)
table.insert(lines, SiegeResults.tiebreak)
siegeRecap.Text = table.concat(lines, "\n")
siegeRecap.Visible = true
end
setSummaryTeams(result.blue, result.orange, result.blueScore, result.orangeScore)
local winnerColor = if result.winner == "Blue" then blue elseif result.winner == "Orange" then orange else UI.Gold
resultWinner.Text = if result.winner == "Blue" then "СИНИЕ ПОБЕДИЛИ"
@@ -1017,9 +1061,11 @@ local function updateClock()
clockMotion:Play()
refreshControls()
end
local siegeHintConnection = playerGui:GetAttributeChangedSignal("SiegeHint"):Connect(refreshObjective)
local timerConnection = RunService.Heartbeat:Connect(updateClock)
script.Destroying:Once(function()
timerConnection:Disconnect()
siegeHintConnection:Disconnect()
if finalClockPulse then finalClockPulse:Cancel() end
votingChanged:Disconnect()
scoreboardFocus:Disconnect()