Compare commits
14
Commits
df6ab8efe1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c88c3501b3 | ||
|
|
16a359d4af | ||
|
|
2774e625c1 | ||
|
|
b2402183a6 | ||
|
|
6bb5fba771 | ||
|
|
7a1c80c22a | ||
|
|
ebe8db5359 | ||
|
|
0c949fadf0 | ||
|
|
9fb926537c | ||
|
|
522344e34b | ||
|
|
d3648c485b | ||
|
|
c0b099e604 | ||
|
|
d1c42a36b8 | ||
|
|
b87a3770a1 |
No files matched your search
BIN
Binary file not shown.
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
## A1. Роль и цель
|
## A1. Роль и цель
|
||||||
|
|
||||||
Ты работаешь в Roblox-проекте **Hunter** (Luau, VS Code + Rojo). Это командный шутер на процедурно генерируемой арене: команды **Blue** и **Orange**, восемь режимов. Задача: превратить режимы из «сырых» в **структурированные, красивые и продуманные по ритму раунда и поведению игроков**, не ломая существующую игру.
|
Ты работаешь в Roblox-проекте **Hunter** (Luau, VS Code + MCP). Это командный шутер на процедурно генерируемой арене: команды **Blue** и **Orange**, восемь режимов. Задача: превратить режимы из «сырых» в **структурированные, красивые и продуманные по ритму раунда и поведению игроков**, не ломая существующую игру.
|
||||||
|
|
||||||
Принципы:
|
Принципы:
|
||||||
- **Сервер авторитетен.** Состояние матча, очки, захваты и таймеры считает только сервер. Клиент отображает и проигрывает эффекты.
|
- **Сервер авторитетен.** Состояние матча, очки, захваты и таймеры считает только сервер. Клиент отображает и проигрывает эффекты.
|
||||||
|
|||||||
+14
-2
@@ -4,12 +4,20 @@
|
|||||||
"$className": "DataModel",
|
"$className": "DataModel",
|
||||||
"ReplicatedStorage": {
|
"ReplicatedStorage": {
|
||||||
"$ignoreUnknownInstances": true,
|
"$ignoreUnknownInstances": true,
|
||||||
"CitadelAssaultConfig": { "$path": "scripts/CitadelAssaultConfig.luau" }
|
"CitadelAssaultConfig": { "$path": "scripts/CitadelAssaultConfig.luau" },
|
||||||
|
"Hunter": { "$path": "scripts/Hunter" },
|
||||||
|
"MatchRules": { "$path": "scripts/MatchRules.luau" },
|
||||||
|
"SniperEffects": { "$path": "scripts/SniperEffects.luau" }
|
||||||
},
|
},
|
||||||
"ServerScriptService": {
|
"ServerScriptService": {
|
||||||
"$ignoreUnknownInstances": true,
|
"$ignoreUnknownInstances": true,
|
||||||
"ArenaObjectives": { "$path": "scripts/ArenaObjectives.luau" },
|
"ArenaObjectives": { "$path": "scripts/ArenaObjectives.luau" },
|
||||||
|
"ArenaObjectiveSites": { "$path": "scripts/ArenaObjectiveSites.luau" },
|
||||||
|
"ModeRuntime": { "$path": "scripts/ModeRuntime" },
|
||||||
"ArenaRounds": { "$path": "scripts/ArenaRounds.server.luau" },
|
"ArenaRounds": { "$path": "scripts/ArenaRounds.server.luau" },
|
||||||
|
"ArenaSpawns": { "$path": "scripts/ArenaSpawns.luau" },
|
||||||
|
"SniperShots": { "$path": "scripts/SniperShots.server.luau" },
|
||||||
|
"HotPoint": { "$path": "scripts/HotPoint.luau" },
|
||||||
"CitadelCaptureService": { "$path": "scripts/CitadelCaptureService.luau" },
|
"CitadelCaptureService": { "$path": "scripts/CitadelCaptureService.luau" },
|
||||||
"CitadelScoreService": { "$path": "scripts/CitadelScoreService.luau" },
|
"CitadelScoreService": { "$path": "scripts/CitadelScoreService.luau" },
|
||||||
"CitadelSpawnService": { "$path": "scripts/CitadelSpawnService.luau" }
|
"CitadelSpawnService": { "$path": "scripts/CitadelSpawnService.luau" }
|
||||||
@@ -18,7 +26,11 @@
|
|||||||
"$ignoreUnknownInstances": true,
|
"$ignoreUnknownInstances": true,
|
||||||
"StarterPlayerScripts": {
|
"StarterPlayerScripts": {
|
||||||
"$ignoreUnknownInstances": true,
|
"$ignoreUnknownInstances": true,
|
||||||
"ArenaRoundHud": { "$path": "scripts/ArenaRoundHud.client.luau" }
|
"ArenaRoundHud": { "$path": "scripts/ArenaRoundHud.client.luau" },
|
||||||
|
"HealthBar": { "$path": "scripts/HealthBar.client.luau" },
|
||||||
|
"ObjectiveArrows": { "$path": "scripts/ObjectiveArrows.client.luau" },
|
||||||
|
"OwnMovementAudio": { "$path": "scripts/OwnMovementAudio.client.luau" },
|
||||||
|
"ArenaClient": { "$path": "scripts/ArenaClient" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# Режимы Hunter
|
||||||
|
|
||||||
|
Синие играют против оранжевых на процедурной арене. Общий профиль задаёт 5 секунд на брифинг, 3 на отсчёт, 300 на матч и 30 на финальный рывок. Обычное возрождение и защита после него занимают по 2 секунды. Индивидуальные настройки приведены ниже. Сервер рассчитывает счёт и состояние целей, клиент показывает события и воспроизводит сигналы.
|
||||||
|
|
||||||
|
| Режим и профиль | Цель и правила | События и подсказки | Статистика |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| Командный бой · `TeamDeathmatch` | Больше устранений за матч. Устранение даёт очко, при равном счёте объявляется ничья. | Лента серий и подсказка о задаче в брифинге. | Командный счёт, убийства и смерти. |
|
||||||
|
| Горячая точка · `HotPoint` | Захватить текущую зону. Одному нужно 10 секунд, с союзником захват в 1,5 раза быстрее. Соперник оспаривает захват. После захвата цель перемещается. | Начало и оспаривание захвата, схлопывание кольца с дымом, уведомления о захвате и смене точки, указатель направления. | Очки команды и вклад в захват. |
|
||||||
|
| Три точки · `Domination` | Взять точку за 3 секунды без противника. Каждая удерживаемая точка даёт очко в секунду. | Захват, оспаривание, потеря и полный контроль. Подсказка сообщает состояние зоны. | Командные очки и вклад в контроль. |
|
||||||
|
| Захват флага · `CaptureFlag` | Забрать флаг с крыши и донести до своей базы. После смерти носителя флаг падает, через 20 секунд возвращается. Доставка даёт очко и возвращает флаг на крышу. | Подбор, падение, возврат и доставка. Маркер носителя и аура свободного флага. | Командный счёт и доставки флага. |
|
||||||
|
| Охота за жетонами · `TrophyHunt` | Собирать жетоны после устранений и сдавать на своей базе. Жетоны выпадают при гибели носителя. Сданный жетон даёт очко. | Подбор, выпадение, потеря и сдача. На панели виден запас, жетоны на земле мерцают перед исчезновением. | Командный счёт и число сданных жетонов. |
|
||||||
|
| Штурм · `Siege` | Атакующие удерживают круг 4 секунды и берут рубежи по очереди. Затем команды меняются ролями. Длительность задаёт `CitadelAssaultConfig.MATCH_DURATION`. | Захват рубежа, взятие всех рубежей, смена ролей. Указатель рубежа и подсказки о положении в зоне. | Число рубежей и времена захвата каждой стороны. |
|
||||||
|
| Одна жизнь · `OneLife` | Выиграть три мини-раунда. В каждом одна жизнь и до 45 секунд. Преимущество получает команда с большим числом живых. Финальный рывок отключён. | Начало и конец мини-раунда, подсказка об одной жизни. | Счёт мини-раундов, обычная статистика боя. |
|
||||||
|
| Охота на лидера · `HuntLeader` | Защитить своего лидера и устранить вражеского. Обычное устранение даёт одно очко, лидер даёт три. После смерти назначается новый лидер. | Назначение и гибель лидера, маркер цели. | Командные очки и устранения лидеров. |
|
||||||
|
|
||||||
|
## Как добавить новый режим
|
||||||
|
|
||||||
|
1. Добавить модуль в `scripts/ModeRuntime/Modes` с уникальным `id` и методами из `Types.Mode`. Использовать контекст режима для счёта и очистки.
|
||||||
|
2. Зарегистрировать режим в `MatchRules.All`.
|
||||||
|
3. Добавить профиль в `Hunter/ModeProfiles`. Указать цель, три правила и отклонения от общего тайминга.
|
||||||
|
4. Добавить тексты в `Hunter/Strings` и профиль режима.
|
||||||
|
5. Подключить провайдер подсказок через `Hunter/Hints` и проверить длину строки.
|
||||||
|
6. Описать события в `Hunter/EventKinds` и обработать их в `ArenaClient/ModeFeedback`. Для важных переходов использовать два канала из трёх.
|
||||||
|
7. Покрыть чистую логику тестами и прогнать полный матч, выход и вход, итоги и голосование в Studio.
|
||||||
|
|
||||||
|
## QA этапа 4
|
||||||
|
|
||||||
|
✓ означает пройденную проверку, ☐ означает отсутствие прогона, — обозначает неприменимый сценарий.
|
||||||
|
|
||||||
|
| Сценарий | TDM | HotPoint | Domination | CTF | Trophy | Siege | OneLife | Leader |
|
||||||
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
||||||
|
| Выход среди раунда | ✓ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ |
|
||||||
|
| Вход среди раунда | ✓ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ |
|
||||||
|
| Смерть во время выполнения цели | — | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ |
|
||||||
|
| Команда опустела | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ |
|
||||||
|
| Брифинг блокирует стрельбу и движение | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ |
|
||||||
|
| Начало и конец финального рывка | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | — | ☐ |
|
||||||
|
| Читаемость HUD и FPS в мобильном эмуляторе | ✓ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ |
|
||||||
|
| Десять полных раундов и проверка соединений и Tween | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ |
|
||||||
|
| Десять ускоренных серверных циклов режима без игроков | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||||
|
|
||||||
|
В одиночной сессии Play проверены модульные тесты бюджетов и подсказок. После 100 повторов кольца, столба и частиц число эмиттеров осталось 20. При 30 запросах одного звукового эффекта осталось 6 активных экземпляров. В каждом из восьми режимов десять раз вызван серверный шаг с шагом игрового времени 0,1 или 0,2 секунды до завершения режима или истечения его таймера. После очистки число объектов арены возвращалось к исходному и запись матча удалялась. Этот тест не измеряет клиентские соединения и Tween в полных матчах.
|
||||||
|
|
||||||
|
В эмуляторе iPhone 17 Pro проверены боевой HUD «Командного боя» в альбомной и портретной ориентациях, выход в лобби и повторный вход посреди раунда. В четырёхсекундной выборке в альбомной ориентации средняя частота составила 60 FPS, самый длинный кадр занял 19 мс. Мобильный пул содержал 10 эмиттеров из допустимых 80. Выборка относится к одиночной сессии Studio и одному режиму.
|
||||||
|
|
||||||
|
Оставшиеся русские подписи интерфейса и режимов перенесены в `Hunter/Strings`. Формулировки и порядок подстановки значений сохранены.
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
--!strict
|
||||||
|
local Players = game:GetService("Players")
|
||||||
|
local RS = game:GetService("ReplicatedStorage")
|
||||||
|
local TweenService = game:GetService("TweenService")
|
||||||
|
local Input = game:GetService("UserInputService")
|
||||||
|
local Config = require(RS.Hunter.EffectsConfig)
|
||||||
|
local Budget = require(RS.Hunter.EffectsBudget)
|
||||||
|
local profile = Budget.profile(Input.TouchEnabled, Input.KeyboardEnabled)
|
||||||
|
local localPlayer = Players.LocalPlayer
|
||||||
|
local root = Instance.new("Folder")
|
||||||
|
root.Name = "HunterClientVfx"
|
||||||
|
root.Parent = workspace
|
||||||
|
type Slot = {part: Part, tween: Tween?, effect: ParticleEmitter?}
|
||||||
|
local rotation = CFrame.Angles(0, 0, math.pi / 2)
|
||||||
|
|
||||||
|
local function pool(name: string, size: number, particles: boolean): () -> Slot
|
||||||
|
local slots: {Slot} = {}
|
||||||
|
local cursor = 0
|
||||||
|
for i = 1, size do
|
||||||
|
local part = Instance.new("Part")
|
||||||
|
part.Name = name
|
||||||
|
part.Anchored, part.CanCollide, part.CanQuery, part.CanTouch = true, false, false, false
|
||||||
|
part.CastShadow = false
|
||||||
|
part.Shape, part.Material, part.Transparency = Enum.PartType.Cylinder, Enum.Material.Neon, 1
|
||||||
|
part.Size = Vector3.one
|
||||||
|
part.Parent = root
|
||||||
|
local emitter: ParticleEmitter? = nil
|
||||||
|
if particles then
|
||||||
|
emitter = Instance.new("ParticleEmitter")
|
||||||
|
emitter.Texture = "rbxasset://textures/particles/sparkles_main.dds"
|
||||||
|
emitter.Rate = 0
|
||||||
|
emitter.Lifetime = NumberRange.new(.3, .65)
|
||||||
|
emitter.Speed = NumberRange.new(9, 24)
|
||||||
|
emitter.SpreadAngle = Vector2.new(145, 145)
|
||||||
|
emitter.Size = NumberSequence.new(.42, 0)
|
||||||
|
emitter.LightEmission, emitter.LightInfluence = 1, 0
|
||||||
|
emitter.Parent = part
|
||||||
|
end
|
||||||
|
slots[i] = {part = part, effect = emitter, tween = nil}
|
||||||
|
end
|
||||||
|
return function()
|
||||||
|
cursor = cursor % size + 1
|
||||||
|
local slot = slots[cursor]
|
||||||
|
if slot.tween then slot.tween:Cancel(); slot.tween = nil end
|
||||||
|
if slot.effect then slot.effect:Clear() end
|
||||||
|
slot.part.Transparency = 1
|
||||||
|
return slot
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local rings = pool("Ring", profile.worldSlots, false)
|
||||||
|
local columns = pool("Column", profile.worldSlots, false)
|
||||||
|
local bursts = pool("Burst", math.min(profile.burstSlots, profile.maxEmitters), true)
|
||||||
|
local gui = Instance.new("ScreenGui")
|
||||||
|
gui.Name = "ArenaScreenVfx"
|
||||||
|
gui.DisplayOrder = 7
|
||||||
|
gui.ResetOnSpawn = false
|
||||||
|
gui.Parent = localPlayer:WaitForChild("PlayerGui")
|
||||||
|
local flash = Instance.new("Frame")
|
||||||
|
flash.BorderSizePixel = 0
|
||||||
|
flash.Size = UDim2.fromScale(1, 1)
|
||||||
|
flash.BackgroundTransparency = 1
|
||||||
|
flash.Parent = gui
|
||||||
|
local flashTween: Tween? = nil
|
||||||
|
|
||||||
|
local ArenaVfx = {}
|
||||||
|
local function animate(slot: Slot, seconds: number, props: {[string]: any})
|
||||||
|
local tween = TweenService:Create(slot.part, TweenInfo.new(math.clamp(seconds, .05, .6), Enum.EasingStyle.Quad, Enum.EasingDirection.Out), props)
|
||||||
|
slot.tween = tween
|
||||||
|
tween:Play()
|
||||||
|
end
|
||||||
|
|
||||||
|
function ArenaVfx.ring(at: Vector3, radius: number, color: Color3, seconds: number, inward: boolean?)
|
||||||
|
local slot = rings()
|
||||||
|
slot.part.CFrame = CFrame.new(at + Vector3.yAxis * .24) * rotation
|
||||||
|
local diameter = radius * 2
|
||||||
|
local start = if inward then diameter else diameter * .55
|
||||||
|
local finish = if inward then .1 else diameter * 1.6
|
||||||
|
slot.part.Size = Vector3.new(.1, start, start)
|
||||||
|
slot.part.Color, slot.part.Transparency = color, .7
|
||||||
|
animate(slot, seconds, {Size = Vector3.new(.1, finish, finish), Transparency = 1})
|
||||||
|
end
|
||||||
|
|
||||||
|
function ArenaVfx.burst(at: Vector3, color: Color3, count: number, smoke: boolean?)
|
||||||
|
local amount = Budget.particles(count, profile.scale)
|
||||||
|
if amount == 0 then return end
|
||||||
|
local slot = bursts()
|
||||||
|
slot.part.CFrame = CFrame.new(at + Vector3.yAxis)
|
||||||
|
local emitter = assert(slot.effect)
|
||||||
|
emitter.Texture = if smoke then "rbxasset://textures/particles/smoke_main.dds" else "rbxasset://textures/particles/sparkles_main.dds"
|
||||||
|
emitter.Size = if smoke then NumberSequence.new(2, 8) else NumberSequence.new(.42, 0)
|
||||||
|
emitter.Transparency = if smoke then NumberSequence.new(.35, 1) else NumberSequence.new(.06, 1)
|
||||||
|
emitter.Color = ColorSequence.new(color, Color3.new(1, 1, 1))
|
||||||
|
emitter:Emit(amount)
|
||||||
|
end
|
||||||
|
|
||||||
|
function ArenaVfx.column(at: Vector3, color: Color3)
|
||||||
|
local slot = columns()
|
||||||
|
slot.part.CFrame = CFrame.new(at + Vector3.yAxis) * rotation
|
||||||
|
slot.part.Size = Vector3.new(1, 3, 3)
|
||||||
|
slot.part.Color, slot.part.Transparency = color, .72
|
||||||
|
animate(slot, Config.FeedbackSeconds, {CFrame = CFrame.new(at + Vector3.yAxis * 22) * rotation,
|
||||||
|
Size = Vector3.new(44, 4, 4), Transparency = 1})
|
||||||
|
end
|
||||||
|
|
||||||
|
function ArenaVfx.flash(color: Color3)
|
||||||
|
if flashTween then flashTween:Cancel() end
|
||||||
|
flash.BackgroundColor3, flash.BackgroundTransparency = color, .93
|
||||||
|
flashTween = TweenService:Create(flash, TweenInfo.new(.32), {BackgroundTransparency = 1})
|
||||||
|
flashTween:Play()
|
||||||
|
end
|
||||||
|
return ArenaVfx
|
||||||
@@ -0,0 +1,233 @@
|
|||||||
|
--!strict
|
||||||
|
local Players = game:GetService("Players")
|
||||||
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
|
local RunService = game:GetService("RunService")
|
||||||
|
local Input = game:GetService("UserInputService")
|
||||||
|
local TweenService = game:GetService("TweenService")
|
||||||
|
local UI = require(ReplicatedStorage:WaitForChild("HunterUI") :: ModuleScript)
|
||||||
|
local Rules = require(ReplicatedStorage:WaitForChild("MatchRules") :: ModuleScript)
|
||||||
|
local Sounds = require(ReplicatedStorage:WaitForChild("SniperEffects") :: ModuleScript)
|
||||||
|
local Siege = require(ReplicatedStorage:WaitForChild("CitadelAssaultConfig") :: ModuleScript)
|
||||||
|
local Hunter = ReplicatedStorage:WaitForChild("Hunter")
|
||||||
|
local Profiles = require(Hunter:WaitForChild("ModeProfiles") :: ModuleScript)
|
||||||
|
local Config = require(Hunter:WaitForChild("RoundConfig") :: ModuleScript)
|
||||||
|
local Strings = require(Hunter:WaitForChild("Strings") :: ModuleScript)
|
||||||
|
local match = ReplicatedStorage:WaitForChild("ArenaRound"):WaitForChild("Procedural")
|
||||||
|
local player = Players.LocalPlayer
|
||||||
|
local playerGui = player:WaitForChild("PlayerGui")
|
||||||
|
|
||||||
|
local gui = Instance.new("ScreenGui")
|
||||||
|
gui.Name = "RoundPresentation"
|
||||||
|
gui.ResetOnSpawn = false
|
||||||
|
gui.IgnoreGuiInset = true
|
||||||
|
gui.DisplayOrder = 24
|
||||||
|
gui.Parent = playerGui
|
||||||
|
|
||||||
|
local vignette = Instance.new("CanvasGroup")
|
||||||
|
vignette.Name = "FinalPushVignette"
|
||||||
|
vignette.Size = UDim2.fromScale(1, 1)
|
||||||
|
vignette.BackgroundTransparency = 1
|
||||||
|
vignette.Visible = false
|
||||||
|
vignette.Parent = gui
|
||||||
|
local edges = {
|
||||||
|
{0, 0, 1, .2, 90}, {0, .8, 1, .2, 270},
|
||||||
|
{0, 0, .14, 1, 0}, {.86, 0, .14, 1, 180},
|
||||||
|
}
|
||||||
|
for _, side in edges do
|
||||||
|
local edge = Instance.new("Frame")
|
||||||
|
edge.Position = UDim2.fromScale(side[1], side[2])
|
||||||
|
edge.Size = UDim2.fromScale(side[3], side[4])
|
||||||
|
edge.BorderSizePixel = 0
|
||||||
|
edge.BackgroundColor3 = Color3.fromRGB(255, 60, 70)
|
||||||
|
edge.Parent = vignette
|
||||||
|
local gradient = Instance.new("UIGradient", edge)
|
||||||
|
gradient.Rotation = side[5]
|
||||||
|
gradient.Transparency = NumberSequence.new(.38, 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
local swapShade = Instance.new("Frame")
|
||||||
|
swapShade.Name = "RoleSwapShade"
|
||||||
|
swapShade.Size = UDim2.fromScale(1, 1)
|
||||||
|
swapShade.BackgroundColor3 = UI.Panel
|
||||||
|
swapShade.BackgroundTransparency = 1
|
||||||
|
swapShade.Visible = false
|
||||||
|
swapShade.Parent = gui
|
||||||
|
|
||||||
|
local card = Instance.new("CanvasGroup")
|
||||||
|
card.Name = "Briefing"
|
||||||
|
card.AnchorPoint = Vector2.new(.5, .5)
|
||||||
|
card.Position = UDim2.fromScale(.5, .5)
|
||||||
|
card.Size = UDim2.new(.85, 0, 0, 260)
|
||||||
|
card.BackgroundTransparency = 1
|
||||||
|
card.Visible = false
|
||||||
|
card.Parent = gui
|
||||||
|
local max = Instance.new("UISizeConstraint", card)
|
||||||
|
max.MaxSize = Vector2.new(520, 260)
|
||||||
|
local plate = UI.plate(card, "Plate", UDim2.new(), UDim2.fromScale(1, 1), UI.Blue)
|
||||||
|
local contour = UI.contour(plate, UI.Blue)
|
||||||
|
UI.label(plate, "Mode", Strings.round.mode, UDim2.fromOffset(12, 12), UDim2.new(1, -24, 0, 19), 14, UI.Muted)
|
||||||
|
local title = UI.label(plate, "Title", "", UDim2.fromOffset(12, 31), UDim2.new(1, -24, 0, 40), 34, UI.Blue)
|
||||||
|
title.FontFace = UI.Display
|
||||||
|
local goal = UI.label(plate, "Goal", "", UDim2.fromOffset(18, 70), UDim2.new(1, -36, 0, 35), 18, UI.Ink)
|
||||||
|
goal.TextWrapped = true
|
||||||
|
local rules: {TextLabel} = {}
|
||||||
|
for i = 1, 3 do
|
||||||
|
local line = UI.label(plate, "Rule" .. i, "", UDim2.fromOffset(25, 108 + (i - 1) * 23), UDim2.new(1, -50, 0, 23), 15, UI.Ink)
|
||||||
|
line.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
|
table.insert(rules, line)
|
||||||
|
end
|
||||||
|
local role = UI.label(plate, "Role", "", UDim2.fromOffset(18, 182), UDim2.new(1, -36, 0, 24), 17, UI.Gold)
|
||||||
|
local tutorial = UI.label(plate, "Tutorial", "", UDim2.fromOffset(18, 207), UDim2.new(1, -36, 0, 31), 14, UI.Muted)
|
||||||
|
tutorial.TextWrapped = true
|
||||||
|
local track = UI.element("ProgressBar", plate, UDim2.fromScale(.07, .94), UDim2.new(.86, 0, 0, 4))
|
||||||
|
local fill = track:WaitForChild("Fill") :: Frame
|
||||||
|
|
||||||
|
local banner = UI.plate(gui, "RoundBanner", UDim2.fromScale(.5, .28), UDim2.new(.82, 0, 0, 78), UI.Gold)
|
||||||
|
banner.AnchorPoint = Vector2.new(.5, .5)
|
||||||
|
Instance.new("UISizeConstraint", banner).MaxSize = Vector2.new(500, 78)
|
||||||
|
local bannerTitle = UI.label(banner, "Title", "", UDim2.fromOffset(0, 6), UDim2.new(1, 0, 0, 36), 27, UI.Gold)
|
||||||
|
bannerTitle.FontFace = UI.Display
|
||||||
|
local bannerDetail = UI.label(banner, "Detail", "", UDim2.fromOffset(12, 43), UDim2.new(1, -24, 0, 25), 16, UI.Ink)
|
||||||
|
local respawn = UI.label(gui, "Respawn", "", UDim2.fromScale(.5, .63), UDim2.new(.85, 0, 0, 42), 27, UI.Ink)
|
||||||
|
respawn.AnchorPoint = Vector2.new(.5, .5)
|
||||||
|
respawn.FontFace = UI.Display
|
||||||
|
UI.edge(respawn, UI.Panel, 0)
|
||||||
|
banner.Visible, respawn.Visible = false, false
|
||||||
|
|
||||||
|
local seen: {[string]: boolean} = {}
|
||||||
|
local oldStage: string? = nil
|
||||||
|
local wasInArena = false
|
||||||
|
local briefUntil, bannerUntil = 0, 0
|
||||||
|
local lastTick = -1
|
||||||
|
local barTween: Tween? = nil
|
||||||
|
local slide: Tween? = nil
|
||||||
|
local fade: Tween? = nil
|
||||||
|
local pulse: Tween? = nil
|
||||||
|
local swapTween: Tween? = nil
|
||||||
|
local shakeUntil = 0
|
||||||
|
|
||||||
|
local function showBriefing(id: string, now: number, untilAt: number, short: boolean)
|
||||||
|
local profile = Profiles[id]
|
||||||
|
if not profile then return end
|
||||||
|
local side = player:GetAttribute("ArenaTeam")
|
||||||
|
local tone = if side == "Orange" then UI.Orange else UI.Blue
|
||||||
|
title.TextColor3 = tone
|
||||||
|
title.Text = Rules.get(id).title
|
||||||
|
goal.Text = profile.goal
|
||||||
|
contour:SetAttribute("Accent", tone)
|
||||||
|
UI.tintPlate(plate, tone)
|
||||||
|
for i, line in rules do
|
||||||
|
line.Visible = not short
|
||||||
|
line.Text = "✓ " .. profile.rules[i]
|
||||||
|
end
|
||||||
|
local attacker = match:FindFirstChild("CitadelMatchState")
|
||||||
|
local attackerSide = attacker and attacker:GetAttribute("Attacker") or Siege.FIRST_ATTACKER
|
||||||
|
role.Position = UDim2.fromOffset(18, if short then 122 else 182)
|
||||||
|
role.Text = if id == "Siege" then (if side == attackerSide then Strings.round.attack else Strings.round.defend) else Strings.team(side)
|
||||||
|
tutorial.Visible = not short and not seen[id]
|
||||||
|
tutorial.Text = Strings.round.tutorial[id] or ""
|
||||||
|
if not short then seen[id] = true end
|
||||||
|
card.Size = UDim2.new(.85, 0, 0, if short then 168 else 260)
|
||||||
|
briefUntil = untilAt
|
||||||
|
card.Position, card.GroupTransparency, card.Visible = UDim2.fromScale(.5, .54), 1, true
|
||||||
|
if barTween then barTween:Cancel() end
|
||||||
|
if slide then slide:Cancel() end
|
||||||
|
if fade then fade:Cancel() end
|
||||||
|
local entrance = TweenInfo.new(.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out)
|
||||||
|
slide = TweenService:Create(card, entrance, {Position = UDim2.fromScale(.5, .5)})
|
||||||
|
fade = TweenService:Create(card, entrance, {GroupTransparency = 0})
|
||||||
|
local duration = math.max(.05, if short then Config.lateBriefingSeconds else profile.briefingSeconds)
|
||||||
|
fill.Size = UDim2.fromScale(math.clamp((untilAt - now) / duration, 0, 1), 1)
|
||||||
|
barTween = TweenService:Create(fill, TweenInfo.new(math.max(.05, untilAt - now), Enum.EasingStyle.Linear), {Size = UDim2.fromScale(0, 1)})
|
||||||
|
slide:Play()
|
||||||
|
fade:Play()
|
||||||
|
barTween:Play()
|
||||||
|
end
|
||||||
|
|
||||||
|
local function showBanner(heading: string, detail: string, untilAt: number)
|
||||||
|
bannerTitle.Text, bannerDetail.Text = heading, detail
|
||||||
|
bannerUntil = untilAt
|
||||||
|
banner.Visible = true
|
||||||
|
end
|
||||||
|
|
||||||
|
local function update()
|
||||||
|
local now = workspace:GetServerTimeNow()
|
||||||
|
local inArena = player:GetAttribute("InArena") == true
|
||||||
|
local stage = match:GetAttribute("RoundStage") :: string?
|
||||||
|
local id = Rules.get(match:GetAttribute("Ruleset")).id
|
||||||
|
local final = inArena and stage == "FinalPush"
|
||||||
|
local swapping = inArena and stage == "RoleSwap"
|
||||||
|
if swapping ~= swapShade.Visible then
|
||||||
|
swapShade.Visible = swapping
|
||||||
|
if swapTween then swapTween:Cancel(); swapTween = nil end
|
||||||
|
if swapping then
|
||||||
|
swapShade.BackgroundTransparency = 1
|
||||||
|
swapTween = TweenService:Create(swapShade, TweenInfo.new(.22), {BackgroundTransparency = .28})
|
||||||
|
swapTween:Play()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if final ~= vignette.Visible then
|
||||||
|
vignette.Visible = final
|
||||||
|
if pulse then pulse:Cancel(); pulse = nil end
|
||||||
|
if final then
|
||||||
|
vignette.GroupTransparency = .46
|
||||||
|
pulse = TweenService:Create(vignette, TweenInfo.new(.9, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true),
|
||||||
|
{GroupTransparency = .75})
|
||||||
|
pulse:Play()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if inArena and (stage ~= oldStage or not wasInArena) then
|
||||||
|
card.Visible = false
|
||||||
|
banner.Visible = false
|
||||||
|
lastTick = -1
|
||||||
|
if stage == "Briefing" then
|
||||||
|
local limit = match:GetAttribute("StageEndsAt")
|
||||||
|
if typeof(limit) == "number" and limit > now then showBriefing(id, now, limit, false) end
|
||||||
|
elseif stage == "RoleSwap" then
|
||||||
|
local limit = match:GetAttribute("StageEndsAt")
|
||||||
|
if typeof(limit) == "number" then showBanner("⇄ " .. Strings.round.swap, if player:GetAttribute("ArenaTeam") == "Orange" then Strings.round.attack else Strings.round.defend, limit) end
|
||||||
|
elseif stage == "Live" or stage == "FinalPush" then
|
||||||
|
if final then
|
||||||
|
showBanner(Strings.round.final, Strings.round.finalPush[id] or "", now + Config.finalBannerSeconds)
|
||||||
|
Sounds.sound("FinalPush")
|
||||||
|
elseif oldStage == "Countdown" and wasInArena then
|
||||||
|
showBanner(Strings.round.fight, "", now + Config.startBannerSeconds)
|
||||||
|
Sounds.sound("RoundStart")
|
||||||
|
if Config.CameraShake and not Input.TouchEnabled then shakeUntil = os.clock() + .22 end
|
||||||
|
elseif not wasInArena then
|
||||||
|
showBriefing(id, now, now + Config.lateBriefingSeconds, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
card.Visible = card.Visible and inArena and now < briefUntil
|
||||||
|
banner.Visible = banner.Visible and inArena and now < bannerUntil
|
||||||
|
local shieldAt = player:GetAttribute("RoundRespawnAt")
|
||||||
|
local left = if typeof(shieldAt) == "number" then math.ceil(shieldAt - now) else 0
|
||||||
|
respawn.Visible = inArena and left > 0
|
||||||
|
if respawn.Visible then respawn.Text = string.format(Strings.round.respawn, left) end
|
||||||
|
if final then
|
||||||
|
local endsAt = match:GetAttribute("EndsAt")
|
||||||
|
local seconds = if typeof(endsAt) == "number" then math.ceil(endsAt - now) else 0
|
||||||
|
if seconds > 0 and seconds <= Config.finalTickSeconds and seconds ~= lastTick then
|
||||||
|
lastTick = seconds
|
||||||
|
Sounds.sound("Tick")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
oldStage, wasInArena = stage, inArena
|
||||||
|
end
|
||||||
|
|
||||||
|
local connection = RunService.Heartbeat:Connect(update)
|
||||||
|
local shakeName = "HunterRoundStartShake"
|
||||||
|
if Config.CameraShake and not Input.TouchEnabled then
|
||||||
|
RunService:BindToRenderStep(shakeName, Enum.RenderPriority.Camera.Value + 1, function()
|
||||||
|
local camera = workspace.CurrentCamera
|
||||||
|
local left = shakeUntil - os.clock()
|
||||||
|
if camera and left > 0 then camera.CFrame *= CFrame.Angles(math.sin(left * 85) * left * .027, 0, 0) end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
script.Destroying:Once(function()
|
||||||
|
connection:Disconnect()
|
||||||
|
if Config.CameraShake and not Input.TouchEnabled then RunService:UnbindFromRenderStep(shakeName) end
|
||||||
|
for _, tween in {barTween, slide, fade, pulse, swapTween} do if tween then tween:Cancel() end end
|
||||||
|
gui:Destroy()
|
||||||
|
end)
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
--!strict
|
||||||
|
local Players = game:GetService("Players")
|
||||||
|
local rs = game:GetService("ReplicatedStorage")
|
||||||
|
local RunService = game:GetService("RunService")
|
||||||
|
local UI = require(rs:WaitForChild("HunterUI") :: ModuleScript)
|
||||||
|
local Sounds = require(rs:WaitForChild("SniperEffects") :: ModuleScript)
|
||||||
|
local Input = game:GetService("UserInputService")
|
||||||
|
local mobile = Input.TouchEnabled and not Input.KeyboardEnabled
|
||||||
|
local Config = require(rs.CitadelAssaultConfig)
|
||||||
|
local Strings = require(rs.Hunter.Strings)
|
||||||
|
local Hints = require(rs.Hunter.Hints)
|
||||||
|
local Kinds = require(rs.Hunter.EventKinds)
|
||||||
|
local Stage = require(rs.Hunter.Stage)
|
||||||
|
local Provider = require(script.Parent.HintProviders.Siege)
|
||||||
|
local Router = require(script.Parent.EventRouter)
|
||||||
|
local player = Players.LocalPlayer
|
||||||
|
local pg = player:WaitForChild("PlayerGui")
|
||||||
|
local match = rs:WaitForChild("ArenaRound"):WaitForChild("Procedural")
|
||||||
|
local T = Strings.hint.Siege
|
||||||
|
local gui = Instance.new("ScreenGui")
|
||||||
|
gui.Name, gui.DisplayOrder, gui.ResetOnSpawn, gui.Enabled = "CitadelGuide", 25, false, false
|
||||||
|
gui.Parent = pg
|
||||||
|
local panel = UI.plate(gui, "Direction", UDim2.fromScale(.5, .77), UDim2.new(.88, 0, 0, 74), UI.Outline)
|
||||||
|
panel.AnchorPoint = Vector2.new(.5, .5)
|
||||||
|
Instance.new("UISizeConstraint", panel).MaxSize = Vector2.new(326, 74)
|
||||||
|
local contour = UI.contour(panel, UI.Gold)
|
||||||
|
local arrow = UI.label(panel, "Arrow", "▲", UDim2.fromOffset(10, 15), UDim2.fromOffset(34, 34), 24, UI.Gold)
|
||||||
|
local title = UI.label(panel, "Title", "", UDim2.fromOffset(53, 5), UDim2.new(1, -59, 0, 22), 17, UI.Ink)
|
||||||
|
local distance = UI.label(panel, "Distance", "", UDim2.fromOffset(53, 27), UDim2.new(1, -59, 0, 18), 15, UI.Ink)
|
||||||
|
local nextLine = UI.label(panel, "Next", "", UDim2.fromOffset(53, 47), UDim2.new(1, -59, 0, 19), 13, UI.Muted)
|
||||||
|
for _, line in {title, distance, nextLine} do line.TextXAlignment = Enum.TextXAlignment.Left end
|
||||||
|
local hints = Hints.new()
|
||||||
|
local pending: Hints.Hint? = nil
|
||||||
|
local count = 0
|
||||||
|
local shownTutorial = false
|
||||||
|
local lastGeneration: unknown = nil
|
||||||
|
local previousZone: string? = nil
|
||||||
|
local previousStatus: string? = nil
|
||||||
|
local lastTick = 0
|
||||||
|
local charge: Sound? = nil
|
||||||
|
local currentTarget: Vector3? = nil
|
||||||
|
local function stopCharge()
|
||||||
|
if charge then charge:Destroy(); charge = nil end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function eligible(): boolean
|
||||||
|
return player:GetAttribute("InArena") == true and match:GetAttribute("Ruleset") == "Siege" and match:GetAttribute("Phase") == "Round"
|
||||||
|
end
|
||||||
|
|
||||||
|
local function push(key: string, message: string, priority: number, ttl: number?)
|
||||||
|
if not Config.HintsEnabled or not eligible() then return end
|
||||||
|
pending = {key = key, text = message, priority = priority, ttl = ttl or 4, cooldown = Config.HINT_COOLDOWN}
|
||||||
|
end
|
||||||
|
|
||||||
|
local subscriptions = {
|
||||||
|
Router.on(Kinds.ZoneStarted, function(p)
|
||||||
|
if not eligible() then return end
|
||||||
|
if p.side ~= player:GetAttribute("ArenaTeam") then push("sg_def_new", T.defNew(p.index or 1), 90) end
|
||||||
|
end),
|
||||||
|
Router.on(Kinds.ZoneCaptured, function(p)
|
||||||
|
if not eligible() then return end
|
||||||
|
local i = p.index or 1
|
||||||
|
local won = p.side == player:GetAttribute("ArenaTeam")
|
||||||
|
push(if won then "sg_captured" else "sg_def_lost", if won then T.captured(i) else T.defLost(i + 1, Config.MAX_OBJECTIVES), 90)
|
||||||
|
end),
|
||||||
|
Router.on(Kinds.AllObjectivesTaken, function(p)
|
||||||
|
if p.side == player:GetAttribute("ArenaTeam") then push("sg_all", T.all, 94) end
|
||||||
|
end),
|
||||||
|
Router.on(Kinds.RoleSwap, function(p)
|
||||||
|
if not eligible() then return end
|
||||||
|
Sounds.sound("SiegeEnter")
|
||||||
|
push("sg_new_role", if p.side == player:GetAttribute("ArenaTeam") then T.newAttack else T.newDefense, 96, 5)
|
||||||
|
end),
|
||||||
|
}
|
||||||
|
local function update()
|
||||||
|
local data = match:FindFirstChild("CitadelMatchState")
|
||||||
|
local character = player.Character
|
||||||
|
local root = character and character:FindFirstChild("HumanoidRootPart")
|
||||||
|
local human = character and character:FindFirstChildOfClass("Humanoid")
|
||||||
|
if not eligible() or not data or not root or not root:IsA("BasePart") or not human or human.Health <= 0 then
|
||||||
|
gui.Enabled = false
|
||||||
|
currentTarget = nil
|
||||||
|
pg:SetAttribute("SiegeHint", nil)
|
||||||
|
stopCharge()
|
||||||
|
previousZone, previousStatus, lastTick = nil, nil, 0
|
||||||
|
if not eligible() then hints = Hints.new(); pending = nil end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local phase = data:GetAttribute("Phase")
|
||||||
|
local stage = match:GetAttribute("RoundStage")
|
||||||
|
if not Stage.combatAllowed(match) then
|
||||||
|
gui.Enabled = false
|
||||||
|
pg:SetAttribute("SiegeHint", nil)
|
||||||
|
stopCharge()
|
||||||
|
previousZone, previousStatus, lastTick = nil, nil, 0
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local generation = match:GetAttribute("MapGeneration")
|
||||||
|
if lastGeneration ~= generation then count += 1; lastGeneration = generation end
|
||||||
|
local status = data:GetAttribute("Status") :: string?
|
||||||
|
local zone = player:GetAttribute("CitadelZone") :: string?
|
||||||
|
local side = player:GetAttribute("ArenaTeam")
|
||||||
|
local attacking = side == data:GetAttribute("Attacker")
|
||||||
|
local point = data:GetAttribute("Point")
|
||||||
|
local index = (data:GetAttribute("Index") :: number?) or 1
|
||||||
|
local fraction = (data:GetAttribute("Progress") :: number?) or 0
|
||||||
|
local percent = math.floor((fraction + 1e-7) * 10) * 10
|
||||||
|
local delta = if typeof(point) == "Vector3" then point - root.Position else Vector3.zero
|
||||||
|
if not shownTutorial and Config.HintsEnabled and typeof(point) == "Vector3" and not pending then
|
||||||
|
shownTutorial = true
|
||||||
|
push("sg_tutorial", T.tutorial, 95, 6)
|
||||||
|
end
|
||||||
|
local candidates = Provider.candidates({
|
||||||
|
zone = zone, status = status, attacking = attacking, seconds = (data:GetAttribute("Seconds") :: number?) or 0,
|
||||||
|
first = phase == "Attack1", distance = delta.Magnitude, dy = delta.Y, progress = percent, experienced = count > 3,
|
||||||
|
})
|
||||||
|
if pending then table.insert(candidates, pending); pending = nil end
|
||||||
|
local chosen = if Config.HintsEnabled then Hints.pick(hints, candidates, workspace:GetServerTimeNow()) else nil
|
||||||
|
pg:SetAttribute("SiegeHint", if chosen then (if mobile then Hints.compact(chosen.text) else chosen.text) else nil)
|
||||||
|
|
||||||
|
if zone == "Inside" and previousZone ~= zone then Sounds.sound("SiegeEnter") end
|
||||||
|
if zone == "Inside" and status == "Capturing" and attacking then
|
||||||
|
if not charge then charge = Sounds.sound("SiegeCharge") end
|
||||||
|
if charge then charge.PlaybackSpeed = .9 + .6 * fraction end
|
||||||
|
if percent > lastTick then Sounds.sound("SiegeTick") end
|
||||||
|
elseif charge then stopCharge() end
|
||||||
|
if status ~= previousStatus and status == "Contested" then Sounds.sound("SiegeBlocked")
|
||||||
|
elseif status ~= previousStatus and status == "Decaying" and attacking then Sounds.sound("SiegeDecay") end
|
||||||
|
previousZone, previousStatus, lastTick = zone, status, percent
|
||||||
|
|
||||||
|
local results = pg:FindFirstChild("ArenaResults")
|
||||||
|
local main = pg:FindFirstChild("MainMenu")
|
||||||
|
local blocked = pg:GetAttribute("HunterVoting") == true or (results and results:GetAttribute("LiveScoreboardOpen") == true)
|
||||||
|
or (main and main:IsA("ScreenGui") and main.Enabled)
|
||||||
|
gui.Enabled = not blocked and stage ~= "RoleSwap" and typeof(point) == "Vector3" and zone ~= "Inside" and
|
||||||
|
(attacking or status == "Capturing" or status == "Contested")
|
||||||
|
currentTarget = if gui.Enabled and typeof(point) == "Vector3" then point else nil
|
||||||
|
if not gui.Enabled then return end
|
||||||
|
local tint = if not attacking then UI.Gold elseif side == "Orange" then UI.Orange else UI.Blue
|
||||||
|
contour:SetAttribute("Accent", tint)
|
||||||
|
arrow.TextColor3 = tint
|
||||||
|
title.Text = if attacking then T.point(index, tostring(data:GetAttribute("PointName") or "")) else T.defend
|
||||||
|
distance.Text = Strings.studs(delta.Magnitude) .. (if delta.Y > 8 then T.above elseif delta.Y < -8 then T.below else "")
|
||||||
|
local following = data:GetAttribute("NextPoint")
|
||||||
|
nextLine.Text = if typeof(following) == "Vector3" then T.next(index + 1, Strings.studs((following - root.Position).Magnitude)) else ""
|
||||||
|
end
|
||||||
|
local interval = 0
|
||||||
|
local tick = RunService.Heartbeat:Connect(function(dt)
|
||||||
|
interval += dt
|
||||||
|
if interval < Config.CHECK_INTERVAL then return end
|
||||||
|
interval %= Config.CHECK_INTERVAL
|
||||||
|
update()
|
||||||
|
end)
|
||||||
|
local render = RunService.RenderStepped:Connect(function()
|
||||||
|
local camera = workspace.CurrentCamera
|
||||||
|
local target = currentTarget
|
||||||
|
if not camera or not target then return end
|
||||||
|
local root = player.Character and player.Character.PrimaryPart
|
||||||
|
if not root then return end
|
||||||
|
local delta = target - root.Position
|
||||||
|
local localDelta = camera.CFrame:VectorToObjectSpace(Vector3.new(delta.X, 0, delta.Z))
|
||||||
|
arrow.Rotation = math.deg(math.atan2(localDelta.X, -localDelta.Z))
|
||||||
|
end)
|
||||||
|
script.Destroying:Once(function()
|
||||||
|
stopCharge()
|
||||||
|
tick:Disconnect()
|
||||||
|
render:Disconnect()
|
||||||
|
for _, cancel in subscriptions do cancel() end
|
||||||
|
gui:Destroy()
|
||||||
|
end)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
--!strict
|
||||||
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
|
local remote = ReplicatedStorage:WaitForChild("ArenaObjectiveEvent") :: RemoteEvent
|
||||||
|
type Handler = (any) -> ()
|
||||||
|
local handlers: {[string]: {Handler}} = {}
|
||||||
|
local Router = {}
|
||||||
|
|
||||||
|
function Router.on(kind: string, handler: Handler): () -> ()
|
||||||
|
local list = handlers[kind] or {}
|
||||||
|
handlers[kind] = list
|
||||||
|
table.insert(list, handler)
|
||||||
|
return function()
|
||||||
|
local index = table.find(list, handler)
|
||||||
|
if index then table.remove(list, index) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
remote.OnClientEvent:Connect(function(kind: string, payload: any)
|
||||||
|
if typeof(payload) ~= "table" then return end
|
||||||
|
for _, handler in table.clone(handlers[kind] or {}) do task.spawn(handler, payload) end
|
||||||
|
end)
|
||||||
|
|
||||||
|
return Router
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
--!strict
|
||||||
|
local Players = game:GetService("Players")
|
||||||
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
|
local TweenService = game:GetService("TweenService")
|
||||||
|
local UI = require(ReplicatedStorage:WaitForChild("HunterUI") :: ModuleScript)
|
||||||
|
local Strings = require(ReplicatedStorage:WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript)
|
||||||
|
local Router = require(script.Parent:WaitForChild("EventRouter") :: ModuleScript)
|
||||||
|
local player = Players.LocalPlayer
|
||||||
|
local playerGui = player:WaitForChild("PlayerGui")
|
||||||
|
local hud = playerGui:WaitForChild("ArenaRoundHud")
|
||||||
|
local match = ReplicatedStorage:WaitForChild("ArenaRound"):WaitForChild("Procedural")
|
||||||
|
local MAX_ROWS, LIFETIME, FADE = 4, 6, .35
|
||||||
|
local gui = Instance.new("ScreenGui")
|
||||||
|
gui.Name = "ArenaObjectiveFeed"
|
||||||
|
gui.DisplayOrder = 12
|
||||||
|
gui.ResetOnSpawn = false
|
||||||
|
gui.Parent = playerGui
|
||||||
|
|
||||||
|
local stack = Instance.new("Frame")
|
||||||
|
stack.BackgroundTransparency = 1
|
||||||
|
stack.Position = UDim2.fromOffset(16, 194)
|
||||||
|
stack.Size = UDim2.new(.6, 0, 0, 190)
|
||||||
|
stack.Parent = gui
|
||||||
|
local limit = Instance.new("UISizeConstraint", stack)
|
||||||
|
limit.MaxSize = Vector2.new(345, 190)
|
||||||
|
local scale = Instance.new("UIScale", stack)
|
||||||
|
local layout = Instance.new("UIListLayout", stack)
|
||||||
|
layout.SortOrder = Enum.SortOrder.LayoutOrder
|
||||||
|
layout.Padding = UDim.new(0, 5)
|
||||||
|
local connections: {RBXScriptConnection} = {}
|
||||||
|
local function resize()
|
||||||
|
scale.Scale = UI.combatScale(gui)
|
||||||
|
local bottom = hud:GetAttribute("ContentBottom")
|
||||||
|
stack.Position = UDim2.fromOffset(16, math.max(194, (if typeof(bottom) == "number" then bottom else 0) + 12))
|
||||||
|
end
|
||||||
|
resize()
|
||||||
|
table.insert(connections, stack:GetPropertyChangedSignal("AbsoluteSize"):Connect(resize))
|
||||||
|
table.insert(connections, hud:GetAttributeChangedSignal("ContentBottom"):Connect(resize))
|
||||||
|
|
||||||
|
local menu = playerGui:WaitForChild("ArenaResults")
|
||||||
|
local watchedMenu: ScreenGui? = nil
|
||||||
|
local menuConnection: RBXScriptConnection? = nil
|
||||||
|
local rows: {CanvasGroup} = {}
|
||||||
|
local order = 0
|
||||||
|
local alive = true
|
||||||
|
|
||||||
|
local function refresh()
|
||||||
|
local active = player:GetAttribute("InArena") == true and match:GetAttribute("Phase") == "Round"
|
||||||
|
gui.Enabled = active and menu:GetAttribute("LiveScoreboardOpen") ~= true
|
||||||
|
and playerGui:GetAttribute("HunterVoting") ~= true and not (watchedMenu and watchedMenu.Enabled)
|
||||||
|
if not active then
|
||||||
|
for _, row in rows do row:Destroy() end
|
||||||
|
table.clear(rows)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local function watchMenu(instance: Instance)
|
||||||
|
if instance.Name ~= "MainMenu" or not instance:IsA("ScreenGui") then return end
|
||||||
|
if menuConnection then menuConnection:Disconnect() end
|
||||||
|
watchedMenu = instance
|
||||||
|
menuConnection = instance:GetPropertyChangedSignal("Enabled"):Connect(refresh)
|
||||||
|
refresh()
|
||||||
|
end
|
||||||
|
local initialMenu = playerGui:FindFirstChild("MainMenu")
|
||||||
|
if initialMenu then watchMenu(initialMenu) end
|
||||||
|
table.insert(connections, playerGui.ChildAdded:Connect(watchMenu))
|
||||||
|
table.insert(connections, playerGui.ChildRemoved:Connect(function(child)
|
||||||
|
if child ~= watchedMenu then return end
|
||||||
|
if menuConnection then menuConnection:Disconnect(); menuConnection = nil end
|
||||||
|
watchedMenu = nil
|
||||||
|
refresh()
|
||||||
|
end))
|
||||||
|
table.insert(connections, menu:GetAttributeChangedSignal("LiveScoreboardOpen"):Connect(refresh))
|
||||||
|
table.insert(connections, playerGui:GetAttributeChangedSignal("HunterVoting"):Connect(refresh))
|
||||||
|
table.insert(connections, player:GetAttributeChangedSignal("InArena"):Connect(refresh))
|
||||||
|
table.insert(connections, match:GetAttributeChangedSignal("Phase"):Connect(refresh))
|
||||||
|
refresh()
|
||||||
|
|
||||||
|
local function remove(row: CanvasGroup)
|
||||||
|
local index = table.find(rows, row)
|
||||||
|
if not index then return end
|
||||||
|
table.remove(rows, index)
|
||||||
|
row:Destroy()
|
||||||
|
end
|
||||||
|
local function add(message: string, side: string?)
|
||||||
|
if not alive or player:GetAttribute("InArena") ~= true or match:GetAttribute("Phase") ~= "Round" then return end
|
||||||
|
order -= 1
|
||||||
|
local tint = if side == "Blue" then UI.Blue elseif side == "Orange" then UI.Orange else UI.Gold
|
||||||
|
local row = Instance.new("CanvasGroup")
|
||||||
|
row.Name = "Event"
|
||||||
|
row.LayoutOrder = order
|
||||||
|
row.Size = UDim2.new(1, 0, 0, 36)
|
||||||
|
row.BackgroundTransparency = 1
|
||||||
|
row.GroupTransparency = 1
|
||||||
|
local plate = UI.plate(row, "Plate", UDim2.new(), UDim2.fromScale(1, 1), tint)
|
||||||
|
local dot = Instance.new("Frame", plate)
|
||||||
|
dot.AnchorPoint = Vector2.new(0, .5)
|
||||||
|
dot.Position = UDim2.new(0, 10, .5, 0)
|
||||||
|
dot.Size = UDim2.fromOffset(8, 8)
|
||||||
|
dot.BackgroundColor3 = tint
|
||||||
|
dot.BorderSizePixel = 0
|
||||||
|
Instance.new("UICorner", dot).CornerRadius = UDim.new(1, 0)
|
||||||
|
local label = UI.label(plate, "Message", message, UDim2.fromOffset(25, 0), UDim2.new(1, -34, 1, 0), 16, UI.Ink)
|
||||||
|
label.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
|
label.TextTruncate = Enum.TextTruncate.AtEnd
|
||||||
|
row.Parent = stack
|
||||||
|
table.insert(rows, 1, row)
|
||||||
|
if #rows > MAX_ROWS then remove(rows[#rows]) end
|
||||||
|
TweenService:Create(row, TweenInfo.new(.15), {GroupTransparency = 0}):Play()
|
||||||
|
task.delay(LIFETIME - FADE, function()
|
||||||
|
if not row.Parent then return end
|
||||||
|
TweenService:Create(row, TweenInfo.new(FADE), {GroupTransparency = 1}):Play()
|
||||||
|
task.delay(FADE, remove, row)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local unsubscribe: {() -> ()} = {}
|
||||||
|
for kind, format in Strings.feed do
|
||||||
|
table.insert(unsubscribe, Router.on(kind, function(payload) add(format(payload), payload.side) end))
|
||||||
|
end
|
||||||
|
script.Destroying:Once(function()
|
||||||
|
alive = false
|
||||||
|
for _, clean in unsubscribe do clean() end
|
||||||
|
for _, connection in connections do connection:Disconnect() end
|
||||||
|
if menuConnection then menuConnection:Disconnect() end
|
||||||
|
gui:Destroy()
|
||||||
|
end)
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
--!strict
|
||||||
|
local rs = game:GetService("ReplicatedStorage")
|
||||||
|
local S = require(rs.Hunter.Strings).flagHints
|
||||||
|
local H = require(rs.Hunter.Hints)
|
||||||
|
local Provider = {}
|
||||||
|
|
||||||
|
function Provider.candidates(match: Instance, player: Player): {H.Hint}
|
||||||
|
local side = match:GetAttribute("FlagCarrierSide")
|
||||||
|
local at = match:GetAttribute("FlagReturnAt")
|
||||||
|
local own = player:GetAttribute("ArenaTeam")
|
||||||
|
local key, text, priority = "flag_roof", S.roof, 30
|
||||||
|
if player:GetAttribute("ArenaFlag") == true then key,text,priority = "flag_deliver",S.deliver,90
|
||||||
|
elseif typeof(side) == "string" and side ~= own then key,text,priority = "flag_enemy",S.enemy,80
|
||||||
|
elseif side == own and typeof(side) == "string" then key,text,priority = "flag_escort",S.escort,60
|
||||||
|
elseif typeof(at) == "number" then
|
||||||
|
key,text,priority = "flag_drop",string.format(S.dropped,math.max(0,math.ceil(at-workspace:GetServerTimeNow()))),70
|
||||||
|
end
|
||||||
|
return {{key=key,text=text,priority=priority,ttl=.4}}
|
||||||
|
end
|
||||||
|
|
||||||
|
function Provider.target(match: Instance, player: Player): (Vector3?, string?, string?)
|
||||||
|
local own = player:GetAttribute("ArenaTeam")
|
||||||
|
if player:GetAttribute("ArenaFlag") == true and typeof(own) == "string" then
|
||||||
|
local base = match:GetAttribute("FlagBase_" .. own)
|
||||||
|
return if typeof(base) == "Vector3" then base else nil, S.base, own
|
||||||
|
end
|
||||||
|
local point = match:GetAttribute("FlagPosition")
|
||||||
|
local carrierSide = match:GetAttribute("FlagCarrierSide")
|
||||||
|
local name = if carrierSide == own and typeof(carrierSide) == "string" then S.escortTitle else S.title
|
||||||
|
return if typeof(point) == "Vector3" then point else nil, name, if typeof(carrierSide) == "string" then carrierSide else nil
|
||||||
|
end
|
||||||
|
|
||||||
|
function Provider.highlight(_match: Instance, _viewer: Player, member: Player): boolean
|
||||||
|
return member:GetAttribute("ArenaFlag") == true
|
||||||
|
end
|
||||||
|
return Provider
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
--!strict
|
||||||
|
local rs = game:GetService("ReplicatedStorage")
|
||||||
|
local Hints = require(rs.Hunter.Hints)
|
||||||
|
local S = require(rs.Hunter.Strings).domination
|
||||||
|
local Provider = {}
|
||||||
|
|
||||||
|
function Provider.candidates(match: Instance, player: Player): {Hints.Hint}
|
||||||
|
local side = player:GetAttribute("ArenaTeam")
|
||||||
|
local zone = player:GetAttribute("DominationZone")
|
||||||
|
local out: {Hints.Hint} = {}
|
||||||
|
local function add(key: string, text: string, priority: number)
|
||||||
|
table.insert(out, {key = key, text = text, priority = priority, ttl = .4})
|
||||||
|
end
|
||||||
|
if zone == "Height" then add("dp_height", S.height, 80)
|
||||||
|
elseif zone == "Blocked" then add("dp_blocked", S.blocked, 80) end
|
||||||
|
for _, key in {"A", "B", "C"} do
|
||||||
|
if match:GetAttribute("ZoneContested_" .. key) == true then add("dp_contest_" .. key, S.contested(key), 60)
|
||||||
|
elseif match:GetAttribute("ZoneOwner_" .. key) == nil then add("dp_free_" .. key, S.free(key), 40) end
|
||||||
|
end
|
||||||
|
if typeof(side) == "string" then
|
||||||
|
local rate = match:GetAttribute("ScoreRate_" .. side)
|
||||||
|
if typeof(rate) == "number" and rate > 0 then add("dp_rate", S.hold(rate), 20) end
|
||||||
|
end
|
||||||
|
return out
|
||||||
|
end
|
||||||
|
return Provider
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
--!strict
|
||||||
|
local rs = game:GetService("ReplicatedStorage")
|
||||||
|
local Hints = require(rs.Hunter.Hints)
|
||||||
|
local S = require(rs.Hunter.Strings).hotHints
|
||||||
|
local taught = setmetatable({}, {__mode = "k"})
|
||||||
|
local Provider = {}
|
||||||
|
function Provider.candidates(match: Instance, player: Player): {Hints.Hint}
|
||||||
|
local out: {Hints.Hint} = {}
|
||||||
|
local function add(key: string, text: string, priority: number, ttl: number?)
|
||||||
|
table.insert(out,{key=key,text=text,priority=priority,ttl=ttl or .4})
|
||||||
|
end
|
||||||
|
local phase = match:GetAttribute("HotPointPhase")
|
||||||
|
local point = match:GetAttribute("HotPointPosition")
|
||||||
|
local movesAt = match:GetAttribute("HotPointMovesAt")
|
||||||
|
local left = if typeof(movesAt) == "number" then math.ceil(movesAt - workspace:GetServerTimeNow()) else 0
|
||||||
|
if phase == "Captured" then add("hp_capture", string.format(S.captured,math.max(0,left)),90)
|
||||||
|
elseif left > 0 and left <= 5 then add("hp_next",string.format(S.next,left),85)
|
||||||
|
elseif phase == "UnderFire" and match:GetAttribute("HotPointTeam") == player:GetAttribute("ArenaTeam") then add("hp_fire",S.fire,60)
|
||||||
|
elseif typeof(point) == "Vector3" and not phase then add("hp_enter",S.enter,40)
|
||||||
|
elseif phase == "Capturing" and not taught[player] and match:GetAttribute("HotPointTeam") == player:GetAttribute("ArenaTeam") then
|
||||||
|
taught[player] = true
|
||||||
|
add("hp_team",S.team,20,4)
|
||||||
|
end
|
||||||
|
return out
|
||||||
|
end
|
||||||
|
return Provider
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
--!strict
|
||||||
|
local rs=game:GetService("ReplicatedStorage")
|
||||||
|
local H=require(rs.Hunter.Hints)
|
||||||
|
local S=require(rs.Hunter.Strings).leaderHints
|
||||||
|
local Provider={}
|
||||||
|
local function sides(player: Player): (string,string)
|
||||||
|
if player:GetAttribute("ArenaTeam")=="Orange" then return "Orange","Blue" end
|
||||||
|
return "Blue","Orange"
|
||||||
|
end
|
||||||
|
function Provider.candidates(match: Instance, player: Player): {H.Hint}
|
||||||
|
if player:GetAttribute("ArenaLeader")==true then return {{key="hl_self",text=S.self,priority=80,ttl=.4}} end
|
||||||
|
local own,enemy=sides(player)
|
||||||
|
local ally=match:GetAttribute("LeaderName_"..own)
|
||||||
|
local opponent=match:GetAttribute("LeaderName_"..enemy)
|
||||||
|
local root=player.Character and player.Character.PrimaryPart
|
||||||
|
local target=match:GetAttribute("LeaderPosition_"..enemy)
|
||||||
|
local nearby=root and typeof(target)=="Vector3" and (root.Position-target).Magnitude<95
|
||||||
|
if typeof(opponent)=="string" and (nearby or typeof(ally)~="string") then
|
||||||
|
return {{key="hl_enemy",text=string.format(S.enemy,opponent),priority=60,ttl=.4}}
|
||||||
|
end
|
||||||
|
if typeof(ally)=="string" then return {{key="hl_ally",text=string.format(S.ally,ally),priority=50,ttl=.4}} end
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
function Provider.target(match: Instance, player: Player): (Vector3?,string?,string?)
|
||||||
|
if player:GetAttribute("ArenaLeader")==true then return nil end
|
||||||
|
local own=sides(player)
|
||||||
|
local point=match:GetAttribute("LeaderPosition_"..own)
|
||||||
|
local name=match:GetAttribute("LeaderName_"..own)
|
||||||
|
return if typeof(point)=="Vector3" then point else nil, if typeof(name)=="string" then string.format(S.ally,name) else nil, own
|
||||||
|
end
|
||||||
|
function Provider.highlight(_match: Instance, viewer: Player, member: Player): boolean
|
||||||
|
return member:GetAttribute("InArena")==true and member:GetAttribute("ArenaLeader")==true
|
||||||
|
and member:GetAttribute("ArenaTeam")~=viewer:GetAttribute("ArenaTeam")
|
||||||
|
end
|
||||||
|
return Provider
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
--!strict
|
||||||
|
local rs=game:GetService("ReplicatedStorage")
|
||||||
|
local H=require(rs.Hunter.Hints)
|
||||||
|
local S=require(rs.Hunter.Strings).lifeHints
|
||||||
|
return {candidates=function(match: Instance, player: Player): {H.Hint}
|
||||||
|
if match:GetAttribute("MiniRoundActive")==true and player:GetAttribute("ArenaWaiting")==true then
|
||||||
|
return {{key="life_watch",text=S.wait,priority=60,ttl=.4}}
|
||||||
|
end
|
||||||
|
return {}
|
||||||
|
end}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
--!strict
|
||||||
|
local rs = game:GetService("ReplicatedStorage")
|
||||||
|
local Strings = require(rs.Hunter.Strings)
|
||||||
|
local Config = require(rs.CitadelAssaultConfig)
|
||||||
|
local Hints = require(rs.Hunter.Hints)
|
||||||
|
local text = Strings.hint.Siege
|
||||||
|
export type Snapshot = {zone: string?, status: string?, attacking: boolean, seconds: number, first: boolean, distance: number, dy: number, progress: number, experienced: boolean}
|
||||||
|
local Provider = {}
|
||||||
|
|
||||||
|
function Provider.candidates(s: Snapshot): {Hints.Hint}
|
||||||
|
local candidates: {Hints.Hint} = {}
|
||||||
|
if not Config.HintsEnabled then return candidates end
|
||||||
|
local function add(key: string, message: string, priority: number)
|
||||||
|
table.insert(candidates, {key = key, text = message, priority = priority, ttl = .4, cooldown = Config.HINT_COOLDOWN})
|
||||||
|
end
|
||||||
|
local copy = if s.experienced then text.short else text
|
||||||
|
if s.first and s.seconds > 0 and s.seconds <= Config.SWAP_WARNING then add("sg_swap", text.swap(s.seconds), 85) end
|
||||||
|
if s.zone == "Height" then add("sg_height", if s.attacking then text.height(s.dy) else copy.defHeight, 80)
|
||||||
|
elseif s.zone == "Blocked" then add("sg_blocked", if s.attacking then copy.blocked else copy.defBlocked, 80)
|
||||||
|
elseif s.attacking then
|
||||||
|
if s.status == "Contested" then add("sg_contested", copy.contested, 70)
|
||||||
|
elseif s.status == "Decaying" then add("sg_decay", copy.decay, 60)
|
||||||
|
elseif s.zone == "Inside" and s.status == "Capturing" then add("sg_capturing", text.capturing(s.progress), 40)
|
||||||
|
elseif s.zone == "Outside" then add("sg_far", text.far(s.distance), 40) end
|
||||||
|
elseif s.zone == "Inside" then add("sg_def_block", copy.defBlock, 60)
|
||||||
|
elseif s.status == "Capturing" then add("sg_def_far", copy.defFar, 70) end
|
||||||
|
return candidates
|
||||||
|
end
|
||||||
|
|
||||||
|
return Provider
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
--!strict
|
||||||
|
local rs=game:GetService("ReplicatedStorage")
|
||||||
|
local H=require(rs.Hunter.Hints)
|
||||||
|
local Rules=require(rs.Hunter.TeamDeathmatchRules)
|
||||||
|
local S=require(rs.Hunter.Strings).teamDeathmatch
|
||||||
|
return {candidates=function(match: Instance, player: Player): {H.Hint}
|
||||||
|
if match:GetAttribute("RoundStage")~="FinalPush" then return {} end
|
||||||
|
local own=player:GetAttribute("ArenaTeam")
|
||||||
|
if own~="Blue" and own~="Orange" then return {} end
|
||||||
|
local rival=if own=="Blue" then "Orange" else "Blue"
|
||||||
|
local n=Rules.chaseGap((match:GetAttribute(own.."Score") :: number?) or 0,(match:GetAttribute(rival.."Score") :: number?) or 0)
|
||||||
|
if n then return {{key="tdm_gap",text=string.format(S.chase,n),priority=60,ttl=.4}} end
|
||||||
|
return {}
|
||||||
|
end}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
--!strict
|
||||||
|
local rs=game:GetService("ReplicatedStorage")
|
||||||
|
local S=require(rs.Hunter.Strings).trophyHints
|
||||||
|
local H=require(rs.Hunter.Hints)
|
||||||
|
local Provider={}
|
||||||
|
function Provider.candidates(_match: Instance, player: Player): {H.Hint}
|
||||||
|
local count=player:GetAttribute("ArenaTokens")
|
||||||
|
if typeof(count)=="number" and count>=3 then
|
||||||
|
return {{key="th_bank",text=string.format(S.carry,count),priority=70,ttl=.4}}
|
||||||
|
end
|
||||||
|
local root=player.Character and player.Character.PrimaryPart
|
||||||
|
local world=workspace:FindFirstChild("ProceduralArena")
|
||||||
|
local folder=world and world:FindFirstChild("MatchObjectives")
|
||||||
|
if not root or not folder then return {} end
|
||||||
|
for _,token in folder:GetChildren() do
|
||||||
|
if token.Name=="Tokens" and token:IsA("BasePart") and (root.Position-token.Position).Magnitude<18 then
|
||||||
|
return {{key="th_near",text=S.near,priority=30,ttl=.4}}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
return Provider
|
||||||
@@ -0,0 +1,197 @@
|
|||||||
|
--!strict
|
||||||
|
local Players = game:GetService("Players")
|
||||||
|
local rs = game:GetService("ReplicatedStorage")
|
||||||
|
local RunService = game:GetService("RunService")
|
||||||
|
local TweenService = game:GetService("TweenService")
|
||||||
|
local UI = require(rs:WaitForChild("HunterUI") :: ModuleScript)
|
||||||
|
local Sounds = require(rs:WaitForChild("SniperEffects") :: ModuleScript)
|
||||||
|
local S = require(rs.Hunter.Strings)
|
||||||
|
local Hints = require(rs.Hunter.Hints)
|
||||||
|
local Kinds = require(rs.Hunter.EventKinds)
|
||||||
|
local Router = require(script.Parent.EventRouter)
|
||||||
|
local Vfx = require(script.Parent.ArenaVfx)
|
||||||
|
local Config = require(rs.Hunter.EffectsConfig)
|
||||||
|
local Input = game:GetService("UserInputService")
|
||||||
|
local mobile = Input.TouchEnabled and not Input.KeyboardEnabled
|
||||||
|
|
||||||
|
local player = Players.LocalPlayer
|
||||||
|
local pg = player:WaitForChild("PlayerGui")
|
||||||
|
local match = rs:WaitForChild("ArenaRound"):WaitForChild("Procedural")
|
||||||
|
local providers = script.Parent:WaitForChild("HintProviders")
|
||||||
|
local gui = Instance.new("ScreenGui")
|
||||||
|
gui.Name, gui.DisplayOrder, gui.ResetOnSpawn = "ModeFeedback", 24, false
|
||||||
|
gui.Parent = pg
|
||||||
|
local banner = UI.plate(gui, "EventBanner", UDim2.fromScale(.5, .34), UDim2.new(.8, 0, 0, 58), UI.Gold)
|
||||||
|
banner.AnchorPoint = Vector2.new(.5,.5)
|
||||||
|
Instance.new("UISizeConstraint", banner).MaxSize = Vector2.new(430,58)
|
||||||
|
local contour = UI.contour(banner, UI.Gold)
|
||||||
|
local title = UI.label(banner,"Title","",UDim2.fromScale(.02,0),UDim2.fromScale(.96,1),24,UI.Ink)
|
||||||
|
title.FontFace = UI.Display
|
||||||
|
banner.Visible = false
|
||||||
|
|
||||||
|
local pending: Hints.Hint? = nil
|
||||||
|
local activeMode: string? = nil
|
||||||
|
local provider: any = nil
|
||||||
|
local selection = Hints.new()
|
||||||
|
local bannerUntil = 0
|
||||||
|
|
||||||
|
local function tint(side: string?): Color3
|
||||||
|
return if side == "Blue" then UI.Blue elseif side == "Orange" then UI.Orange else UI.Gold
|
||||||
|
end
|
||||||
|
|
||||||
|
local function showWave(at: Vector3, color: Color3)
|
||||||
|
Vfx.ring(at, 18, color, Config.FeedbackSeconds)
|
||||||
|
end
|
||||||
|
|
||||||
|
local lastFlagAura = 0
|
||||||
|
local roleColumnAt = 0
|
||||||
|
local bannerScale = Instance.new("UIScale", banner)
|
||||||
|
local bannerTween: Tween? = nil
|
||||||
|
local function adjustScale() bannerScale.Scale = UI.combatScale(gui) end
|
||||||
|
local resize = gui:GetPropertyChangedSignal("AbsoluteSize"):Connect(adjustScale)
|
||||||
|
adjustScale()
|
||||||
|
banner:GetPropertyChangedSignal("Visible"):Connect(function()
|
||||||
|
if bannerTween then bannerTween:Cancel() end
|
||||||
|
if not banner.Visible then return end
|
||||||
|
banner.Position = UDim2.fromScale(.5, .365)
|
||||||
|
bannerTween = TweenService:Create(banner, TweenInfo.new(Config.BannerMotionSeconds, Enum.EasingStyle.Quart), {Position = UDim2.fromScale(.5, .34)})
|
||||||
|
bannerTween:Play()
|
||||||
|
end)
|
||||||
|
|
||||||
|
local function event(kind: string, p: any)
|
||||||
|
if player:GetAttribute("InArena") ~= true or match:GetAttribute("Phase") ~= "Round" then return end
|
||||||
|
local id = match:GetAttribute("Ruleset")
|
||||||
|
local tone = tint(p.side)
|
||||||
|
local at = p.at
|
||||||
|
if typeof(at) == "Vector3" then
|
||||||
|
if kind == Kinds.ZoneCaptured and id == "HotPoint" then
|
||||||
|
Vfx.ring(at, 18, tone, Config.FeedbackSeconds, true)
|
||||||
|
Vfx.burst(at, tone, 30, true)
|
||||||
|
elseif kind == Kinds.ZoneCaptured and id == "Siege" then
|
||||||
|
Vfx.ring(at, 11, tone, Config.FeedbackSeconds)
|
||||||
|
Vfx.burst(at, tone, 24)
|
||||||
|
Vfx.flash(UI.Ink)
|
||||||
|
elseif kind == Kinds.ZoneStarted and id == "Siege" then
|
||||||
|
Vfx.column(at, UI.Gold)
|
||||||
|
elseif kind == Kinds.ZoneContested then
|
||||||
|
Vfx.ring(at, if id == "Siege" then 11 else 18, Config.Danger, .35)
|
||||||
|
elseif kind == Kinds.FlagDropped or kind == Kinds.FlagReturned or kind == Kinds.FlagScored or kind == Kinds.TokensBanked then
|
||||||
|
Vfx.burst(at, tone, 16)
|
||||||
|
elseif kind == Kinds.TokenDropped then
|
||||||
|
Vfx.burst(at, UI.Gold, 12)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if kind == Kinds.AllObjectivesTaken then Sounds.sound("AllTaken") end
|
||||||
|
if kind == Kinds.RoleSwap then Sounds.sound("RoleSwap") end
|
||||||
|
if kind == Kinds.FlagPicked then Sounds.sound("FlagPicked") end
|
||||||
|
if kind == Kinds.TokenPicked then Sounds.sound("TokenPick") end
|
||||||
|
if kind == Kinds.FlagScored then Sounds.sound("FlagScored") end
|
||||||
|
if kind == Kinds.TokensBanked and p.userId == player.UserId then Sounds.sound("TokensBanked") end
|
||||||
|
if id == "CaptureFlag" and (kind == Kinds.FlagPicked or kind == Kinds.FlagScored) then
|
||||||
|
contour:SetAttribute("Accent", tone)
|
||||||
|
title.Text = if kind == Kinds.FlagScored then S.flagHints.scored
|
||||||
|
elseif p.side == player:GetAttribute("ArenaTeam") then S.flagHints.picked else S.flagHints.enemyPicked
|
||||||
|
bannerUntil = workspace:GetServerTimeNow() + 2.7
|
||||||
|
end
|
||||||
|
if id == "TeamDeathmatch" and kind == Kinds.Streak then
|
||||||
|
contour:SetAttribute("Accent",tone)
|
||||||
|
title.Text=string.format(S.teamDeathmatch.streak,p.text or "",p.value or 0)
|
||||||
|
bannerUntil=workspace:GetServerTimeNow()+2.7
|
||||||
|
if p.userId~=player.UserId then Sounds.sound("RoundStart") end
|
||||||
|
end
|
||||||
|
if id == "HuntLeader" and (kind == Kinds.LeaderAssigned or kind == Kinds.LeaderDown) then
|
||||||
|
local now=workspace:GetServerTimeNow()
|
||||||
|
if kind == Kinds.LeaderDown or now>=bannerUntil then
|
||||||
|
contour:SetAttribute("Accent",tone)
|
||||||
|
title.Text=if kind==Kinds.LeaderDown then S.leaderHints.down else string.format(S.leaderHints.new,p.text or "")
|
||||||
|
bannerUntil=now+2.5
|
||||||
|
end
|
||||||
|
if kind==Kinds.LeaderDown then
|
||||||
|
Sounds.sound("LeaderDown")
|
||||||
|
if typeof(p.at)=="Vector3" then showWave(p.at,tone) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if id == "OneLife" and (kind == Kinds.MiniRoundStarted or kind == Kinds.MiniRoundEnded) then
|
||||||
|
contour:SetAttribute("Accent",tone)
|
||||||
|
local copy=S.lifeHints
|
||||||
|
local blue,orange=p.blue or 0,p.orange or 0
|
||||||
|
title.Text=if kind == Kinds.MiniRoundStarted then string.format(copy.begin,p.index or 1,blue,orange)
|
||||||
|
elseif not p.side then copy.draw else string.format(copy.win,S.team(p.side),math.max(blue,orange),math.min(blue,orange))
|
||||||
|
bannerUntil=workspace:GetServerTimeNow()+2.8
|
||||||
|
Sounds.sound(if kind==Kinds.MiniRoundStarted then "MiniRoundStart" else "ZoneCaptured")
|
||||||
|
end
|
||||||
|
if id == "TrophyHunt" and p.userId == player.UserId then
|
||||||
|
if kind == Kinds.TokensBanked then
|
||||||
|
contour:SetAttribute("Accent", tone)
|
||||||
|
title.Text = string.format(S.trophyHints.banked, p.value or 0)
|
||||||
|
bannerUntil = workspace:GetServerTimeNow() + 2.7
|
||||||
|
elseif kind == Kinds.TokensLost then
|
||||||
|
pending = {key="th_lost",priority=60,text=S.trophyHints.lost,ttl=4}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if id == "Domination" then
|
||||||
|
if kind == Kinds.ZoneLost and p.side == player:GetAttribute("ArenaTeam") then
|
||||||
|
pending = {key="dp_lost",priority=70,text=S.domination.lost(string.sub(p.text or "A",1,1)),ttl=4}
|
||||||
|
elseif kind == Kinds.FullControl then
|
||||||
|
contour:SetAttribute("Accent",tone)
|
||||||
|
title.Text = S.domination.control
|
||||||
|
bannerUntil = workspace:GetServerTimeNow()+3
|
||||||
|
Sounds.sound("RoundStart")
|
||||||
|
elseif kind == Kinds.ZoneCaptured and typeof(p.at)=="Vector3" then
|
||||||
|
showWave(p.at,tone)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local subscriptions: {() -> ()} = {}
|
||||||
|
for _, kind in Kinds do table.insert(subscriptions,Router.on(kind,function(p) event(kind,p) end)) end
|
||||||
|
local elapsed = 0
|
||||||
|
local heartbeat = RunService.Heartbeat:Connect(function(dt)
|
||||||
|
elapsed += dt
|
||||||
|
if elapsed < .12 then return end
|
||||||
|
elapsed %= .12
|
||||||
|
local now = workspace:GetServerTimeNow()
|
||||||
|
local mode = match:GetAttribute("Ruleset")
|
||||||
|
local playing = player:GetAttribute("InArena") == true and match:GetAttribute("Phase")=="Round"
|
||||||
|
if playing and mode == "CaptureFlag" and now - lastFlagAura >= .8 and match:GetAttribute("FlagCarrierSide") == nil then
|
||||||
|
local at = match:GetAttribute("FlagPosition")
|
||||||
|
if typeof(at) == "Vector3" then
|
||||||
|
Vfx.burst(at, UI.Gold, 14)
|
||||||
|
lastFlagAura = now
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if playing and mode == "Siege" and now - roleColumnAt >= .75 then
|
||||||
|
local data = match:FindFirstChild("CitadelMatchState")
|
||||||
|
local at = data and data:GetAttribute("Point")
|
||||||
|
if data and typeof(at) == "Vector3" and data:GetAttribute("Phase") ~= "RoleSwap" then
|
||||||
|
local status = data:GetAttribute("Status")
|
||||||
|
local hue = if status == "Contested" then Config.Danger elseif status == "Idle" then UI.Gold
|
||||||
|
elseif status == "Decaying" then UI.Muted else tint(data:GetAttribute("Attacker"))
|
||||||
|
Vfx.column(at, hue)
|
||||||
|
roleColumnAt = now
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not playing or typeof(mode)~="string" or mode=="Siege" then
|
||||||
|
activeMode, provider, pending, bannerUntil = nil,nil,nil,0
|
||||||
|
pg:SetAttribute("ModeHint",nil)
|
||||||
|
banner.Visible = false
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if mode ~= activeMode then
|
||||||
|
activeMode, selection = mode,Hints.new()
|
||||||
|
local source = providers:FindFirstChild(mode)
|
||||||
|
provider = if source and source:IsA("ModuleScript") then require(source) else nil
|
||||||
|
end
|
||||||
|
local candidates = if provider then provider.candidates(match,player) else {}
|
||||||
|
if pending then table.insert(candidates,pending);pending=nil end
|
||||||
|
local hint = Hints.pick(selection,candidates,now)
|
||||||
|
pg:SetAttribute("ModeHint",if hint then (if mobile then Hints.compact(hint.text) else hint.text) else nil)
|
||||||
|
local results = pg:FindFirstChild("ArenaResults")
|
||||||
|
banner.Visible = now<bannerUntil and pg:GetAttribute("HunterVoting")~=true and (not results or results:GetAttribute("LiveScoreboardOpen")~=true)
|
||||||
|
end)
|
||||||
|
script.Destroying:Once(function()
|
||||||
|
heartbeat:Disconnect()
|
||||||
|
for _, remove in subscriptions do remove() end
|
||||||
|
resize:Disconnect()
|
||||||
|
if bannerTween then bannerTween:Cancel() end
|
||||||
|
gui:Destroy()
|
||||||
|
end)
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
--!strict
|
||||||
|
local Players = game:GetService("Players")
|
||||||
|
local rs = game:GetService("ReplicatedStorage")
|
||||||
|
local RunService = game:GetService("RunService")
|
||||||
|
local UI = require(rs:WaitForChild("HunterUI") :: ModuleScript)
|
||||||
|
local S = require(rs.Hunter.Strings)
|
||||||
|
local Stage = require(rs.Hunter.Stage)
|
||||||
|
local player = Players.LocalPlayer
|
||||||
|
local pg = player:WaitForChild("PlayerGui")
|
||||||
|
local match = rs:WaitForChild("ArenaRound"):WaitForChild("Procedural")
|
||||||
|
local providers = script.Parent.HintProviders
|
||||||
|
local gui = Instance.new("ScreenGui")
|
||||||
|
gui.Name, gui.DisplayOrder, gui.ResetOnSpawn, gui.Enabled = "ModeGuide", 25, false, false
|
||||||
|
gui.Parent = pg
|
||||||
|
local panel = UI.plate(gui,"Direction",UDim2.fromScale(.5,.73),UDim2.new(.85,0,0,60),UI.Outline)
|
||||||
|
panel.AnchorPoint = Vector2.new(.5,.5)
|
||||||
|
Instance.new("UISizeConstraint",panel).MaxSize = Vector2.new(326,60)
|
||||||
|
local contour = UI.contour(panel,UI.Gold)
|
||||||
|
local arrow = UI.label(panel,"Arrow","▲",UDim2.fromOffset(11,10),UDim2.fromOffset(40,38),26,UI.Gold)
|
||||||
|
local title = UI.label(panel,"Title","",UDim2.fromOffset(54,6),UDim2.new(1,-65,0,22),18,UI.Ink)
|
||||||
|
local detail = UI.label(panel,"Distance","",UDim2.fromOffset(54,30),UDim2.new(1,-65,0,22),15,UI.Muted)
|
||||||
|
title.TextXAlignment, detail.TextXAlignment = Enum.TextXAlignment.Left, Enum.TextXAlignment.Left
|
||||||
|
local markers = Instance.new("Folder")
|
||||||
|
markers.Name = "ModeTargets"
|
||||||
|
markers.Parent = workspace
|
||||||
|
local highlights: {[Player]: Highlight} = {}
|
||||||
|
local provider: any = nil
|
||||||
|
local currentMode: string? = nil
|
||||||
|
local current: Vector3? = nil
|
||||||
|
local function color(side: unknown): Color3
|
||||||
|
return if side=="Blue" then UI.Blue elseif side=="Orange" then UI.Orange else UI.Gold
|
||||||
|
end
|
||||||
|
local function refresh()
|
||||||
|
local id = match:GetAttribute("Ruleset")
|
||||||
|
local active = player:GetAttribute("InArena")==true and match:GetAttribute("Phase")=="Round" and Stage.combatAllowed(match)
|
||||||
|
if id~=currentMode then
|
||||||
|
currentMode = if typeof(id)=="string" then id else nil
|
||||||
|
local module = if typeof(id)=="string" then providers:FindFirstChild(id) else nil
|
||||||
|
provider = if module and module:IsA("ModuleScript") then require(module) else nil
|
||||||
|
end
|
||||||
|
local ready: {[Player]: boolean} = {}
|
||||||
|
if active and provider and provider.highlight then
|
||||||
|
for _, member in Players:GetPlayers() do
|
||||||
|
local character = member.Character
|
||||||
|
if member~=player and character and provider.highlight(match,player,member) then
|
||||||
|
ready[member]=true
|
||||||
|
local entry=highlights[member]
|
||||||
|
if not entry then
|
||||||
|
entry=Instance.new("Highlight")
|
||||||
|
entry.Name = "ModeTarget"
|
||||||
|
entry.DepthMode=Enum.HighlightDepthMode.AlwaysOnTop
|
||||||
|
entry.FillTransparency=.77
|
||||||
|
entry.OutlineTransparency=.16
|
||||||
|
entry.Parent=markers
|
||||||
|
highlights[member]=entry
|
||||||
|
end
|
||||||
|
entry.Adornee=character
|
||||||
|
local tone=color(member:GetAttribute("ArenaTeam"))
|
||||||
|
entry.FillColor,entry.OutlineColor=tone,tone
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for member,entry in highlights do
|
||||||
|
if not ready[member] then entry:Destroy(); highlights[member]=nil end
|
||||||
|
end
|
||||||
|
local root=player.Character and player.Character.PrimaryPart
|
||||||
|
local menu=pg:FindFirstChild("MainMenu")
|
||||||
|
local results=pg:FindFirstChild("ArenaResults")
|
||||||
|
local blocked=pg:GetAttribute("HunterVoting")==true or (menu and menu:IsA("ScreenGui") and menu.Enabled)
|
||||||
|
or (results and results:GetAttribute("LiveScoreboardOpen")==true)
|
||||||
|
gui.Enabled=active and not blocked
|
||||||
|
panel.Visible=false
|
||||||
|
current=nil
|
||||||
|
if not gui.Enabled or not root or not provider or not provider.target then return end
|
||||||
|
local point,label,side=provider.target(match,player)
|
||||||
|
if not point or not label then return end
|
||||||
|
local delta=point-root.Position
|
||||||
|
current=point
|
||||||
|
panel.Visible=true
|
||||||
|
title.Text=label
|
||||||
|
local copy=S.hint.Siege
|
||||||
|
detail.Text=S.studs(delta.Magnitude)..(if delta.Y>8 then copy.above elseif delta.Y < -8 then copy.below else "")
|
||||||
|
local tint=color(side)
|
||||||
|
arrow.TextColor3=tint
|
||||||
|
contour:SetAttribute("Accent",tint)
|
||||||
|
end
|
||||||
|
local elapsed=0
|
||||||
|
local step=RunService.Heartbeat:Connect(function(dt)
|
||||||
|
elapsed+=dt
|
||||||
|
if elapsed < .14 then return end
|
||||||
|
elapsed%=.14
|
||||||
|
refresh()
|
||||||
|
end)
|
||||||
|
local render=RunService.RenderStepped:Connect(function()
|
||||||
|
local camera=workspace.CurrentCamera
|
||||||
|
local root=player.Character and player.Character.PrimaryPart
|
||||||
|
if not camera or not root or not current then return end
|
||||||
|
local d=current-root.Position
|
||||||
|
local v=camera.CFrame:VectorToObjectSpace(Vector3.new(d.X,0,d.Z))
|
||||||
|
arrow.Rotation=math.deg(math.atan2(v.X,-v.Z))
|
||||||
|
end)
|
||||||
|
script.Destroying:Once(function()
|
||||||
|
step:Disconnect()
|
||||||
|
render:Disconnect()
|
||||||
|
markers:Destroy()
|
||||||
|
gui:Destroy()
|
||||||
|
end)
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
--!strict
|
||||||
|
local Players=game:GetService("Players")
|
||||||
|
local rs=game:GetService("ReplicatedStorage")
|
||||||
|
local RunService=game:GetService("RunService")
|
||||||
|
local UI=require(rs:WaitForChild("HunterUI") :: ModuleScript)
|
||||||
|
local S=require(rs.Hunter.Strings).lifeHints
|
||||||
|
local player=Players.LocalPlayer
|
||||||
|
local pg=player:WaitForChild("PlayerGui")
|
||||||
|
local match=rs:WaitForChild("ArenaRound"):WaitForChild("Procedural")
|
||||||
|
local gui=Instance.new("ScreenGui")
|
||||||
|
gui.Name,gui.DisplayOrder,gui.ResetOnSpawn,gui.Enabled="OneLifeSpectator",23,false,false
|
||||||
|
gui.Parent=pg
|
||||||
|
local panel=UI.plate(gui,"Spectator",UDim2.fromScale(.5,.84),UDim2.new(.85,0,0,56),UI.Blue)
|
||||||
|
panel.AnchorPoint=Vector2.new(.5,.5)
|
||||||
|
Instance.new("UISizeConstraint",panel).MaxSize=Vector2.new(360,56)
|
||||||
|
local name=UI.label(panel,"Target","",UDim2.fromOffset(51,0),UDim2.new(1,-102,1,0),16,UI.Ink)
|
||||||
|
name.TextTruncate=Enum.TextTruncate.AtEnd
|
||||||
|
local targets: {Player}={}
|
||||||
|
local selected: Player?=nil
|
||||||
|
local control: Humanoid?=nil
|
||||||
|
|
||||||
|
local function assign()
|
||||||
|
local camera=workspace.CurrentCamera
|
||||||
|
local subject=selected and selected.Character and selected.Character:FindFirstChildOfClass("Humanoid")
|
||||||
|
if not camera or not subject then return end
|
||||||
|
control=subject
|
||||||
|
camera.CameraSubject=subject
|
||||||
|
name.Text=string.format(S.spectate, selected and selected.DisplayName or "")
|
||||||
|
end
|
||||||
|
|
||||||
|
for index, sign in {-1,1} do
|
||||||
|
local button=Instance.new("TextButton")
|
||||||
|
button.Name=if sign<0 then "Previous" else "Next"
|
||||||
|
button.AnchorPoint=Vector2.new(if sign<0 then 0 else 1,.5)
|
||||||
|
button.Position=UDim2.new(index-1,if sign<0 then 7 else -7,.5,0)
|
||||||
|
button.Size=UDim2.fromOffset(38,38)
|
||||||
|
button.BackgroundColor3=UI.Panel
|
||||||
|
button.TextColor3=UI.Ink
|
||||||
|
button.TextSize=22
|
||||||
|
button.Text=if sign<0 then "◀" else "▶"
|
||||||
|
button.Parent=panel
|
||||||
|
UI.bindButton(button, UI.Blue, true)
|
||||||
|
button.Activated:Connect(function()
|
||||||
|
if #targets<2 then return end
|
||||||
|
local current=table.find(targets,selected :: Player) or 1
|
||||||
|
selected=targets[(current+sign-1)%#targets+1]
|
||||||
|
assign()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function reset()
|
||||||
|
local camera=workspace.CurrentCamera
|
||||||
|
local human=player.Character and player.Character:FindFirstChildOfClass("Humanoid")
|
||||||
|
if camera and human and control and camera.CameraSubject==control then camera.CameraSubject=human end
|
||||||
|
control,selected=nil,nil
|
||||||
|
pg:SetAttribute("HunterSpectating",nil)
|
||||||
|
gui.Enabled=false
|
||||||
|
end
|
||||||
|
|
||||||
|
local elapsed=0
|
||||||
|
local step=RunService.Heartbeat:Connect(function(dt)
|
||||||
|
elapsed+=dt
|
||||||
|
if elapsed<.15 then return end
|
||||||
|
elapsed%=.15
|
||||||
|
local active=player:GetAttribute("InArena")==true and player:GetAttribute("ArenaWaiting")==true
|
||||||
|
and match:GetAttribute("Ruleset")=="OneLife" and match:GetAttribute("MiniRoundActive")==true
|
||||||
|
if not active then if control or gui.Enabled then reset() end; return end
|
||||||
|
local side=player:GetAttribute("ArenaTeam")
|
||||||
|
table.clear(targets)
|
||||||
|
for _, other in Players:GetPlayers() do
|
||||||
|
local human=other.Character and other.Character:FindFirstChildOfClass("Humanoid")
|
||||||
|
if other~=player and other:GetAttribute("ArenaTeam")==side and other:GetAttribute("InArena")==true
|
||||||
|
and other:GetAttribute("ArenaWaiting")~=true and human and human.Health>0 then
|
||||||
|
table.insert(targets,other)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #targets==0 then reset(); return end
|
||||||
|
if not selected or not table.find(targets,selected) then selected=targets[1] end
|
||||||
|
assign()
|
||||||
|
local summary=pg:FindFirstChild("ArenaResults")
|
||||||
|
local blocked=summary and summary:GetAttribute("LiveScoreboardOpen")==true
|
||||||
|
gui.Enabled=not blocked
|
||||||
|
pg:SetAttribute("HunterSpectating",if gui.Enabled then true else nil)
|
||||||
|
end)
|
||||||
|
script.Destroying:Once(function()
|
||||||
|
step:Disconnect()
|
||||||
|
reset()
|
||||||
|
gui:Destroy()
|
||||||
|
end)
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
--!strict
|
||||||
|
local rs=game:GetService("ReplicatedStorage")
|
||||||
|
local Players=game:GetService("Players")
|
||||||
|
local RunService=game:GetService("RunService")
|
||||||
|
local TweenService=game:GetService("TweenService")
|
||||||
|
local UI=require(rs:WaitForChild("HunterUI") :: ModuleScript)
|
||||||
|
local Kinds=require(rs.Hunter.EventKinds)
|
||||||
|
local Router=require(script.Parent.EventRouter)
|
||||||
|
local player=Players.LocalPlayer
|
||||||
|
local match=rs:WaitForChild("ArenaRound"):WaitForChild("Procedural")
|
||||||
|
local gui=Instance.new("ScreenGui")
|
||||||
|
gui.Name,gui.DisplayOrder,gui.ResetOnSpawn="TrophyCounter",23,false
|
||||||
|
gui.Parent=player:WaitForChild("PlayerGui")
|
||||||
|
local plate=UI.plate(gui,"Coins",UDim2.new(.5,0,1,-85),UDim2.fromOffset(106,48),UI.Gold)
|
||||||
|
plate.AnchorPoint=Vector2.new(.5,1)
|
||||||
|
local art=UI.element("GoldCoin",plate,UDim2.fromOffset(6,4),UDim2.fromOffset(40,40)) :: Frame
|
||||||
|
local rig=UI.bindCoin(art)
|
||||||
|
local label=UI.label(plate,"Count","×0",UDim2.fromOffset(47,0),UDim2.fromOffset(52,48),24,UI.Gold)
|
||||||
|
label.FontFace=UI.Display
|
||||||
|
local scale=Instance.new("UIScale",plate)
|
||||||
|
local bounce: Tween?=nil
|
||||||
|
local last=0
|
||||||
|
local function update()
|
||||||
|
local count=player:GetAttribute("ArenaTokens")
|
||||||
|
local n=if typeof(count)=="number" then count else 0
|
||||||
|
gui.Enabled=player:GetAttribute("InArena")==true and match:GetAttribute("Ruleset")=="TrophyHunt" and match:GetAttribute("Phase")=="Round"
|
||||||
|
label.Text="×"..n
|
||||||
|
if gui.Enabled and n>last then
|
||||||
|
if bounce then bounce:Cancel() end
|
||||||
|
scale.Scale=1.18
|
||||||
|
bounce=TweenService:Create(scale,TweenInfo.new(.32,Enum.EasingStyle.Back,Enum.EasingDirection.Out),{Scale=1})
|
||||||
|
bounce:Play()
|
||||||
|
end
|
||||||
|
last=n
|
||||||
|
end
|
||||||
|
local connections={player:GetAttributeChangedSignal("ArenaTokens"):Connect(update),player:GetAttributeChangedSignal("InArena"):Connect(update),
|
||||||
|
match:GetAttributeChangedSignal("Ruleset"):Connect(update),match:GetAttributeChangedSignal("Phase"):Connect(update)}
|
||||||
|
local tokens: {[BasePart]: boolean} = {}
|
||||||
|
local arena = workspace:WaitForChild("ProceduralArena")
|
||||||
|
local function add(item: Instance)
|
||||||
|
if item:IsA("BasePart") and item.Name == "Tokens" then tokens[item] = true end
|
||||||
|
end
|
||||||
|
for _, item in arena:GetDescendants() do add(item) end
|
||||||
|
local created = arena.DescendantAdded:Connect(add)
|
||||||
|
local removed = arena.DescendantRemoving:Connect(function(item)
|
||||||
|
if item:IsA("BasePart") then tokens[item] = nil end
|
||||||
|
end)
|
||||||
|
local draw=RunService.RenderStepped:Connect(function()
|
||||||
|
local now = workspace:GetServerTimeNow()
|
||||||
|
for token in tokens do
|
||||||
|
local deadline = token:GetAttribute("TokenExpiresAt")
|
||||||
|
local flashSeconds = token:GetAttribute("TokenFlashSeconds")
|
||||||
|
local flashing = typeof(deadline) == "number" and typeof(flashSeconds) == "number" and deadline - now <= flashSeconds
|
||||||
|
token.LocalTransparencyModifier = if flashing then .32 + .26 * math.sin(now * math.pi * 2 / .76) else 0
|
||||||
|
end
|
||||||
|
if not gui.Enabled then return end
|
||||||
|
local t=os.clock()
|
||||||
|
UI.spinCoin(rig,t*2,math.max(0,math.cos(t*2))*.55,t%1)
|
||||||
|
end)
|
||||||
|
|
||||||
|
local pool: {Part}={}
|
||||||
|
local motions: {[Part]: Tween}={}
|
||||||
|
for i=1,6 do
|
||||||
|
local coin=Instance.new("Part")
|
||||||
|
coin.Name="TrophySpark"
|
||||||
|
coin.Shape,coin.Material,coin.Color=Enum.PartType.Cylinder,Enum.Material.Neon,UI.Gold
|
||||||
|
coin.Size=Vector3.new(.12,.62,.62)
|
||||||
|
coin.Anchored,coin.CanCollide,coin.CanQuery,coin.CanTouch=true,false,false,false
|
||||||
|
coin.Transparency=1
|
||||||
|
coin.Parent=workspace
|
||||||
|
table.insert(pool,coin)
|
||||||
|
end
|
||||||
|
local off=Router.on(Kinds.TokenDropped,function(payload)
|
||||||
|
if not gui.Enabled or typeof(payload.at)~="Vector3" then return end
|
||||||
|
for i,coin in pool do
|
||||||
|
if motions[coin] then motions[coin]:Cancel() end
|
||||||
|
local a=i*math.pi/3
|
||||||
|
local from=payload.at+Vector3.yAxis*.7
|
||||||
|
coin.CFrame=CFrame.new(from)*CFrame.Angles(a,0,0)
|
||||||
|
coin.Transparency=.1
|
||||||
|
local tween=TweenService:Create(coin,TweenInfo.new(.55,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),
|
||||||
|
{CFrame=CFrame.new(from+Vector3.new(math.cos(a)*4,2.4,math.sin(a)*4))*CFrame.Angles(a,1.7,1),Transparency=1})
|
||||||
|
motions[coin]=tween
|
||||||
|
tween:Play()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
update()
|
||||||
|
script.Destroying:Once(function()
|
||||||
|
draw:Disconnect()
|
||||||
|
created:Disconnect()
|
||||||
|
removed:Disconnect()
|
||||||
|
for token in tokens do token.LocalTransparencyModifier = 0 end
|
||||||
|
for _, cn in connections do cn:Disconnect() end
|
||||||
|
off()
|
||||||
|
for _, coin in pool do
|
||||||
|
if motions[coin] then motions[coin]:Cancel() end
|
||||||
|
coin:Destroy()
|
||||||
|
end
|
||||||
|
gui:Destroy()
|
||||||
|
end)
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
--!strict
|
||||||
|
local RS = game:GetService("ReplicatedStorage")
|
||||||
|
local Config = require(RS.Hunter.EffectsConfig)
|
||||||
|
if not Config.Debug then return end
|
||||||
|
local Players = game:GetService("Players")
|
||||||
|
local UI = require(RS:WaitForChild("HunterUI") :: ModuleScript)
|
||||||
|
local player = Players.LocalPlayer
|
||||||
|
local match = RS:WaitForChild("ArenaRound"):WaitForChild("Procedural")
|
||||||
|
local gui = Instance.new("ScreenGui")
|
||||||
|
gui.Name = "ArenaZoneDebug"
|
||||||
|
gui.ResetOnSpawn = false
|
||||||
|
gui.Parent = player:WaitForChild("PlayerGui")
|
||||||
|
local label = UI.label(gui, "Metrics", "", UDim2.new(.5, -180, 0, 10), UDim2.fromOffset(360, 25), 15, UI.Gold)
|
||||||
|
local function part(name: string): Part
|
||||||
|
local p = Instance.new("Part")
|
||||||
|
p.Name = name
|
||||||
|
p.Transparency = 1
|
||||||
|
p.Anchored, p.CanCollide, p.CanTouch, p.CanQuery = true, false, false, false
|
||||||
|
p.Parent = workspace
|
||||||
|
return p
|
||||||
|
end
|
||||||
|
local line, bounds = part("DebugSight"), part("DebugRadius")
|
||||||
|
bounds.Shape = Enum.PartType.Cylinder
|
||||||
|
local running = true
|
||||||
|
task.spawn(function()
|
||||||
|
while running do
|
||||||
|
local siege = match:FindFirstChild("CitadelMatchState")
|
||||||
|
local position = if siege then siege:GetAttribute("Point") else match:GetAttribute("HotPointPosition")
|
||||||
|
local root = player.Character and player.Character.PrimaryPart
|
||||||
|
label.Text = string.format("Ray %d / %d · Events/s %d · %s", match:GetAttribute("DebugRays") or 0,
|
||||||
|
match:GetAttribute("DebugFighters") or 0, match:GetAttribute("DebugEvents") or 0, player:GetAttribute("CitadelZone") or "—")
|
||||||
|
if root and typeof(position) == "Vector3" then
|
||||||
|
local r = if siege then siege:GetAttribute("Radius") or 11 else 18
|
||||||
|
bounds.Size = Vector3.new(.12,r*2,r*2)
|
||||||
|
bounds.CFrame = CFrame.new(position + Vector3.yAxis * .1) * CFrame.Angles(0,0,math.pi/2)
|
||||||
|
bounds.Color, bounds.Transparency = UI.Gold, .82
|
||||||
|
local target = position + Vector3.yAxis * 2
|
||||||
|
line.CFrame = CFrame.lookAt((root.Position + target) / 2,target)
|
||||||
|
line.Size = Vector3.new(.07,.07,(root.Position-target).Magnitude)
|
||||||
|
line.Color = if player:GetAttribute("CitadelZone") == "Blocked" then Config.Danger else UI.Mint
|
||||||
|
line.Transparency = .3
|
||||||
|
else
|
||||||
|
bounds.Transparency, line.Transparency = 1, 1
|
||||||
|
end
|
||||||
|
task.wait(.2)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
script.Destroying:Once(function()
|
||||||
|
running = false
|
||||||
|
line:Destroy()
|
||||||
|
bounds:Destroy()
|
||||||
|
gui:Destroy()
|
||||||
|
end)
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.ArenaObjectiveSites
|
||||||
|
|
||||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
local Modes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScript)
|
local Modes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScript)
|
||||||
|
|
||||||
@@ -32,13 +34,13 @@ function Sites.resolve(id: string): Map
|
|||||||
local gallery = {Vector3.new(0, level, 44), Vector3.new(0, level, -44)}
|
local gallery = {Vector3.new(0, level, 44), Vector3.new(0, level, -44)}
|
||||||
local roof = {Vector3.yAxis * level * 2, Vector3.new(0, level * 2, 12)}
|
local roof = {Vector3.yAxis * level * 2, Vector3.new(0, level * 2, 12)}
|
||||||
return {
|
return {
|
||||||
blue = find("База синих", {-base}).position,
|
blue = find(Text.bazaSinikh, {-base}).position,
|
||||||
orange = find("База оранжевых", {base}).position,
|
orange = find(Text.bazaOranzhevykh, {base}).position,
|
||||||
ground = find("Нижний проход", {Vector3.zero, Vector3.new(0, 0, 6)}),
|
ground = find(Text.nizhniyProkhod, {Vector3.zero, Vector3.new(0, 0, 6)}),
|
||||||
gallery = find("Средняя галерея", gallery),
|
gallery = find(Text.srednyayaGalereya, gallery),
|
||||||
roof = find("Крыша цитадели", roof),
|
roof = find(Text.kryshaTsitadeli, roof),
|
||||||
west = find("Западный фланг", {Vector3.new(-162.6, 0, 0), Vector3.new(-145, 0, 0), Vector3.new(-120, 0, 0)}),
|
west = find(Text.zapadnyyFlang, {Vector3.new(-162.6, 0, 0), Vector3.new(-145, 0, 0), Vector3.new(-120, 0, 0)}),
|
||||||
east = find("Восточный фланг", {Vector3.new(162.6, 0, 0), Vector3.new(145, 0, 0), Vector3.new(120, 0, 0)}),
|
east = find(Text.vostochnyyFlang, {Vector3.new(162.6, 0, 0), Vector3.new(145, 0, 0), Vector3.new(120, 0, 0)}),
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -59,8 +61,8 @@ local function fits(center: Vector3, geometry: RaycastParams, radius: number): b
|
|||||||
return workspace:Raycast(center + Vector3.yAxis * .25, Vector3.yAxis * 9, geometry) == nil
|
return workspace:Raycast(center + Vector3.yAxis * .25, Vector3.yAxis * 9, geometry) == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function Sites.clearCircle(center: Vector3, geometry: RaycastParams, radius: number): Vector3
|
function Sites.clearCircle(center: Vector3, geometry: RaycastParams, radius: number): (Vector3, boolean)
|
||||||
if fits(center, geometry, radius) then return center end
|
if fits(center, geometry, radius) then return center, true end
|
||||||
for distance = 3, 48, 3 do
|
for distance = 3, 48, 3 do
|
||||||
for index = 0, 15 do
|
for index = 0, 15 do
|
||||||
local angle = index * math.pi / 8
|
local angle = index * math.pi / 8
|
||||||
@@ -68,11 +70,11 @@ function Sites.clearCircle(center: Vector3, geometry: RaycastParams, radius: num
|
|||||||
local floor = workspace:Raycast(at + Vector3.yAxis * 1.2, -Vector3.yAxis * 2.4, geometry)
|
local floor = workspace:Raycast(at + Vector3.yAxis * 1.2, -Vector3.yAxis * 2.4, geometry)
|
||||||
if floor and floor.Normal.Y >= .95 and math.abs(floor.Position.Y - center.Y) <= .35
|
if floor and floor.Normal.Y >= .95 and math.abs(floor.Position.Y - center.Y) <= .35
|
||||||
and fits(floor.Position, geometry, radius) then
|
and fits(floor.Position, geometry, radius) then
|
||||||
return floor.Position
|
return floor.Position, true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return center
|
return center, false
|
||||||
end
|
end
|
||||||
|
|
||||||
function Sites.hotPath(id: string, map: Map, radius: number): {Site}
|
function Sites.hotPath(id: string, map: Map, radius: number): {Site}
|
||||||
|
|||||||
+56
-652
@@ -1,25 +1,11 @@
|
|||||||
--!strict
|
--!strict
|
||||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
local Modes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScript)
|
local Runtime = script.Parent:WaitForChild("ModeRuntime")
|
||||||
local Sites = require(script.Parent:WaitForChild("ArenaObjectiveSites") :: ModuleScript)
|
local Types = require(Runtime:WaitForChild("Types") :: ModuleScript)
|
||||||
local HotPoint = require(script.Parent:WaitForChild("HotPoint") :: ModuleScript)
|
local Context = require(Runtime:WaitForChild("Context") :: ModuleScript)
|
||||||
local SiegeConfig = require(ReplicatedStorage:WaitForChild("CitadelAssaultConfig") :: ModuleScript)
|
|
||||||
local Capture = require(script.Parent:WaitForChild("CitadelCaptureService") :: ModuleScript)
|
local Diagnostics = require(Runtime:WaitForChild("ZoneDiagnostics") :: ModuleScript)
|
||||||
local Score = require(script.Parent:WaitForChild("CitadelScoreService") :: ModuleScript)
|
|
||||||
local SiegeSpawn = require(script.Parent:WaitForChild("CitadelSpawnService") :: ModuleScript)
|
|
||||||
local CollectionService = game:GetService("CollectionService")
|
|
||||||
|
|
||||||
type Side = "Blue" | "Orange"
|
|
||||||
type Fighter = HotPoint.Fighter
|
|
||||||
type Marker = HotPoint.Marker & {recolor: ((Color3) -> ())?}
|
|
||||||
type Zone = {site: Sites.Site, marker: Marker, owner: Side?, claiming: Side?, progress: number}
|
|
||||||
type Flag = {
|
|
||||||
marker: Marker, stars: ParticleEmitter, mist: ParticleEmitter, light: PointLight, banner: BasePart,
|
|
||||||
carrier: Player?, tether: WeldConstraint?, droppedUntil: number,
|
|
||||||
}
|
|
||||||
type Drop = {marker: Marker, amount: number, expires: number}
|
|
||||||
type Config = {arena: string, rule: string, state: Instance, now: number, duration: number,
|
|
||||||
members: () -> {Player}, bench: (Player) -> (), deploy: (Player) -> (), balanceWaiting: () -> ()}
|
|
||||||
export type Match = {
|
export type Match = {
|
||||||
step: (number) -> boolean, kill: (Player, Player, Vector3, number) -> (),
|
step: (number) -> boolean, kill: (Player, Player, Vector3, number) -> (),
|
||||||
hit: ((Player, number, boolean) -> ())?,
|
hit: ((Player, number, boolean) -> ())?,
|
||||||
@@ -27,655 +13,73 @@ export type Match = {
|
|||||||
winner: () -> string, destroy: () -> (),
|
winner: () -> string, destroy: () -> (),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local registry: {[string]: Types.Mode} = {}
|
||||||
|
for _, module in Runtime:WaitForChild("Modes"):GetChildren() do
|
||||||
|
if module:IsA("ModuleScript") then
|
||||||
|
local mode = require(module) :: Types.Mode
|
||||||
|
assert(not registry[mode.id], "Duplicate mode: " .. mode.id)
|
||||||
|
registry[mode.id] = mode
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local cue = Instance.new("RemoteEvent")
|
||||||
|
cue.Name = "ArenaObjectiveCue"
|
||||||
|
cue.Parent = ReplicatedStorage
|
||||||
local active: {[string]: Match} = {}
|
local active: {[string]: Match} = {}
|
||||||
local Objectives = {}
|
local Objectives = {}
|
||||||
local objectiveCue = Instance.new("RemoteEvent")
|
|
||||||
objectiveCue.Name = "ArenaObjectiveCue"
|
|
||||||
objectiveCue.Parent = ReplicatedStorage
|
|
||||||
local sides: {Side} = {"Blue", "Orange"}
|
|
||||||
local blue = Color3.fromRGB(67, 216, 255)
|
|
||||||
local orange = Color3.fromRGB(255, 150, 68)
|
|
||||||
local gold = Color3.fromRGB(255, 220, 96)
|
|
||||||
local neutral = Color3.fromRGB(188, 150, 255)
|
|
||||||
local rng = Random.new()
|
|
||||||
|
|
||||||
local function opposite(side: Side): Side
|
|
||||||
return if side == "Blue" then "Orange" else "Blue"
|
|
||||||
end
|
|
||||||
|
|
||||||
local function color(side: Side?): Color3
|
|
||||||
return if side == "Blue" then blue elseif side == "Orange" then orange else neutral
|
|
||||||
end
|
|
||||||
|
|
||||||
local function sideOf(player: Player): Side?
|
|
||||||
local side = player:GetAttribute("ArenaTeam")
|
|
||||||
return if side == "Blue" then "Blue" elseif side == "Orange" then "Orange" else nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local function boundsAt(position: Vector3, target: Vector3, radius: number, height: number): boolean
|
|
||||||
local delta = position - target
|
|
||||||
return math.abs(delta.Y) < height and delta.X * delta.X + delta.Z * delta.Z <= radius * radius
|
|
||||||
end
|
|
||||||
|
|
||||||
local function label(adornee: BasePart, name: string, tint: Color3, offset: number, waypoint: boolean?): TextLabel
|
|
||||||
local gui = Instance.new("BillboardGui")
|
|
||||||
gui.Name = "ObjectiveLabel"
|
|
||||||
gui.Size = UDim2.fromOffset(220, 26)
|
|
||||||
gui.StudsOffsetWorldSpace = Vector3.yAxis * offset
|
|
||||||
gui.MaxDistance = if waypoint then 710 else 170
|
|
||||||
gui.AlwaysOnTop = waypoint == true
|
|
||||||
gui.LightInfluence = 0
|
|
||||||
gui.Parent = adornee
|
|
||||||
local text = Instance.new("TextLabel")
|
|
||||||
text.Size = UDim2.fromScale(1, 1)
|
|
||||||
text.BackgroundTransparency = 1
|
|
||||||
text.Font = Enum.Font.GothamBlack
|
|
||||||
text.TextSize = 15
|
|
||||||
text.Text, text.TextColor3 = name, tint
|
|
||||||
text.TextStrokeColor3, text.TextStrokeTransparency = Color3.fromRGB(9, 13, 25), .14
|
|
||||||
text.Parent = gui
|
|
||||||
return text
|
|
||||||
end
|
|
||||||
|
|
||||||
local function marker(parent: Instance, id: string, name: string, at: Vector3, tint: Color3, diameter: number, tall: boolean?): Marker
|
|
||||||
local part = Instance.new("Part")
|
|
||||||
part.Name = id
|
|
||||||
if not tall then part:SetAttribute("ObjectiveArrow", true) end
|
|
||||||
part.Shape = if tall then Enum.PartType.Ball else Enum.PartType.Cylinder
|
|
||||||
part.Size = if tall then Vector3.new(diameter, diameter, diameter) else Vector3.new(.16, diameter, diameter)
|
|
||||||
part.CFrame = CFrame.new(at + Vector3.yAxis * (if tall then 2.4 else .12)) * CFrame.Angles(0, 0, math.pi / 2)
|
|
||||||
part.Anchored, part.CanCollide, part.CanQuery, part.CanTouch, part.CastShadow = true, false, false, false, false
|
|
||||||
part.Material, part.Color = Enum.Material.Neon, tint
|
|
||||||
part.Transparency = if tall then .04 else .76
|
|
||||||
local aura = Instance.new("PointLight")
|
|
||||||
aura.Range, aura.Brightness, aura.Color = if tall then 13 else 9, .7, tint
|
|
||||||
aura.Parent = part
|
|
||||||
part.Parent = parent
|
|
||||||
return {body = part, label = label(part, name, tint, if tall then 2.1 else 4, id ~= "Tokens"), origin = at}
|
|
||||||
end
|
|
||||||
|
|
||||||
local function ring(parent: Instance, id: string, name: string, at: Vector3, tint: Color3): Marker
|
|
||||||
local mark = marker(parent, id, name, at, tint, HotPoint.Radius * 2)
|
|
||||||
local recolor = HotPoint.attachRing(mark)
|
|
||||||
mark.recolor = recolor
|
|
||||||
recolor(tint)
|
|
||||||
return mark
|
|
||||||
end
|
|
||||||
|
|
||||||
local function paint(mark: Marker, tint: Color3)
|
|
||||||
if mark.body.Color == tint then return end
|
|
||||||
if mark.recolor then
|
|
||||||
mark.recolor(tint)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
mark.body.Color = tint
|
|
||||||
mark.label.TextColor3 = tint
|
|
||||||
local aura = mark.body:FindFirstChildOfClass("PointLight")
|
|
||||||
if aura then aura.Color = tint end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function makeFlag(parent: Instance, roof: Vector3): Flag
|
|
||||||
local mark = marker(parent, "CitadelFlag", "ФЛАГ · КРЫША", roof, gold, 2.6, true)
|
|
||||||
local body = mark.body
|
|
||||||
body.Transparency = 1
|
|
||||||
body.CFrame = CFrame.new(body.Position)
|
|
||||||
local light = assert(body:FindFirstChildOfClass("PointLight"))
|
|
||||||
light.Range, light.Brightness = 21, 1.6
|
|
||||||
|
|
||||||
local function attach(name: string, size: Vector3, offset: Vector3, tint: Color3): Part
|
|
||||||
local part = Instance.new("Part")
|
|
||||||
part.Name, part.Size, part.Color = name, size, tint
|
|
||||||
part.CFrame = body.CFrame + offset
|
|
||||||
part.Material = Enum.Material.Neon
|
|
||||||
part.Massless, part.CanCollide, part.CanTouch, part.CanQuery = true, false, false, false
|
|
||||||
part.Parent = body
|
|
||||||
local weld = Instance.new("WeldConstraint")
|
|
||||||
weld.Part0, weld.Part1, weld.Parent = body, part, part
|
|
||||||
return part
|
|
||||||
end
|
|
||||||
attach("Pole", Vector3.new(.17, 4.5, .17), Vector3.zero, Color3.fromRGB(235, 235, 255))
|
|
||||||
local banner = attach("Banner", Vector3.new(2.65, 1.48, .15), Vector3.new(1.35, 1.45, 0), gold)
|
|
||||||
attach("CrownLight", Vector3.new(.33, .33, .33), Vector3.yAxis * 2.34, 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(neutral, 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(neutral, 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,
|
|
||||||
carrier = nil, tether = nil, droppedUntil = 0}
|
|
||||||
end
|
|
||||||
|
|
||||||
local function visibleAt(fighter: Fighter, at: Vector3, geometry: RaycastParams): boolean
|
|
||||||
return workspace:Raycast(fighter.root.Position, at - fighter.root.Position, geometry) == nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local function presence(fighters: {Fighter}, zone: Zone, geometry: RaycastParams): (boolean, boolean)
|
|
||||||
local b, o = false, false
|
|
||||||
-- Separate vertically stacked objectives by avatar foot height.
|
|
||||||
for _, fighter in fighters do
|
|
||||||
if boundsAt(fighter.root.Position, zone.site.position, HotPoint.Radius, 8)
|
|
||||||
and visibleAt(fighter, zone.site.position + Vector3.yAxis * 2.7, geometry) then
|
|
||||||
if fighter.side == "Blue" then b = true else o = true end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return b, o
|
|
||||||
end
|
|
||||||
|
|
||||||
function Objectives.current(arena: string): Match?
|
function Objectives.current(arena: string): Match?
|
||||||
return active[arena]
|
return active[arena]
|
||||||
end
|
end
|
||||||
|
|
||||||
function Objectives.start(config: Config): Match
|
function Objectives.start(config: Types.Config): Match
|
||||||
local rule, state, arena = config.rule, config.state, config.arena
|
local mode = assert(registry[config.rule], "Unknown mode: " .. config.rule)
|
||||||
local world = Modes.geometry(arena)
|
local ctx = Context.create(config, mode, cue)
|
||||||
local geometry = Modes.collision(arena)
|
local success, result = pcall(mode.start, ctx)
|
||||||
local map = if rule == "TeamDeathmatch" or rule == "HuntLeader" then nil else Sites.resolve(arena)
|
if not success then
|
||||||
local hotPath = if rule == "HotPoint" and map then Sites.hotPath(arena, map, HotPoint.Radius) else nil
|
ctx.janitor.clean()
|
||||||
local folder = Instance.new("Folder")
|
ctx.folder:Destroy()
|
||||||
folder.Name = "MatchObjectives"
|
error(result)
|
||||||
folder.Parent = world
|
|
||||||
local blueScore, orangeScore = 0, 0
|
|
||||||
local function add(side: Side, points: number)
|
|
||||||
if side == "Blue" then blueScore += points else orangeScore += points end
|
|
||||||
state:SetAttribute(side .. "Score", if side == "Blue" then blueScore else orangeScore)
|
|
||||||
end
|
end
|
||||||
local function status(text: string)
|
local instance = result :: Types.ModeInstance
|
||||||
if state:GetAttribute("ObjectiveStatus") ~= text then state:SetAttribute("ObjectiveStatus", text) end
|
local lastStep = ctx.liveAt
|
||||||
end
|
local profileLabel = "Mode." .. mode.id .. ".step"
|
||||||
state:SetAttribute("BlueScore", 0)
|
local destroyed = false
|
||||||
state:SetAttribute("OrangeScore", 0)
|
|
||||||
state:SetAttribute("ObjectiveStatus", "")
|
|
||||||
local function collect(members: {Player}): {Fighter}
|
|
||||||
local found: {Fighter} = {}
|
|
||||||
for _, p in members do
|
|
||||||
local side = sideOf(p)
|
|
||||||
local c = p.Character
|
|
||||||
local h = c and c:FindFirstChildOfClass("Humanoid")
|
|
||||||
local r = c and c:FindFirstChild("HumanoidRootPart")
|
|
||||||
if side and h and h.Health > 0 and r and r:IsA("BasePart") and p:GetAttribute("InArena") == true
|
|
||||||
and p:GetAttribute("ArenaWaiting") ~= true then
|
|
||||||
table.insert(found, {player = p, side = side, root = r})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return found
|
|
||||||
end
|
|
||||||
local function cue(fighters: {Fighter}, captured: boolean, side: Side?)
|
|
||||||
for _, fighter in fighters do
|
|
||||||
if captured or fighter.side == side then objectiveCue:FireClient(fighter.player, captured) end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local function makeZone(site: Sites.Site, name: string): Zone
|
|
||||||
site = {name = site.name, position = Sites.clearCircle(site.position, geometry, HotPoint.Radius)}
|
|
||||||
return {site = site, marker = ring(folder, name, site.name, site.position, neutral), owner = nil, claiming = nil, progress = 0}
|
|
||||||
end
|
|
||||||
local zones: {Zone} = {}
|
|
||||||
local hotPoint = if hotPath then HotPoint.start({
|
|
||||||
state = state, geometry = geometry, sites = hotPath, startedAt = config.now,
|
|
||||||
marker = function(site: Sites.Site): Marker
|
|
||||||
return marker(folder, "HotPoint", "ГОРЯЧАЯ ТОЧКА", site.position, neutral, HotPoint.Radius * 2)
|
|
||||||
end,
|
|
||||||
score = add, status = status,
|
|
||||||
}) else nil
|
|
||||||
local flag = if rule == "CaptureFlag" and map then makeFlag(folder, map.roof.position) else nil
|
|
||||||
local tokens: {Drop} = {}
|
|
||||||
local carried: {[Player]: number} = {}
|
|
||||||
local leaders: {[Side]: Player} = {}
|
|
||||||
local previousLeader: {[Side]: Player} = {}
|
|
||||||
local leaderLabels: {[Player]: BillboardGui} = {}
|
|
||||||
local siegeTimes: Score.Ledger = {Blue = {}, Orange = {}}
|
|
||||||
local siegeSide: Side = if SiegeConfig.FIRST_ATTACKER == "Orange" then "Orange" else "Blue"
|
|
||||||
local siegeIndex, siegeProgress = 1, 0
|
|
||||||
local siegeCaptureStarted = false
|
|
||||||
local hadSiegeSwap = false
|
|
||||||
local siegeState: Folder? = nil
|
|
||||||
local lifeActive, miniNumber = false, 0
|
|
||||||
local lifeEnds, nextMini = math.huge, config.now + 2
|
|
||||||
local lastStep, nextScore = config.now, config.now + 1
|
|
||||||
local match: Match
|
local match: Match
|
||||||
|
|
||||||
if map then
|
|
||||||
if rule == "Domination" then
|
|
||||||
for i, site in {map.west, map.gallery, map.east} do
|
|
||||||
local key = string.char(64 + i)
|
|
||||||
local zone = makeZone(site, key)
|
|
||||||
zone.marker.label.Text = key .. " · " .. site.name
|
|
||||||
table.insert(zones, zone)
|
|
||||||
end
|
|
||||||
elseif rule == "CaptureFlag" or rule == "TrophyHunt" then
|
|
||||||
map.blue = Sites.clearCircle(map.blue, geometry, HotPoint.Radius)
|
|
||||||
map.orange = Sites.clearCircle(map.orange, geometry, HotPoint.Radius)
|
|
||||||
for _, side in sides do
|
|
||||||
local at = if side == "Blue" then map.blue else map.orange
|
|
||||||
local name = if side == "Blue" then "БАЗА СИНИХ" else "БАЗА ОРАНЖЕВЫХ"
|
|
||||||
ring(folder, side .. "Base", name, at, color(side))
|
|
||||||
|
|
||||||
end
|
|
||||||
elseif rule == "Siege" then
|
|
||||||
local data = Instance.new("Folder")
|
|
||||||
data.Name = "CitadelMatchState"
|
|
||||||
data.Parent = state
|
|
||||||
siegeState = data
|
|
||||||
local sites: {Sites.Site} = {map.ground, map.gallery, map.roof}
|
|
||||||
for _, point in CollectionService:GetTagged("CitadelPoint") do
|
|
||||||
if not point:IsA("BasePart") or not point:IsDescendantOf(world) then continue end
|
|
||||||
local index = point:GetAttribute("Index")
|
|
||||||
if typeof(index) == "number" and index % 1 == 0 and sites[index] then
|
|
||||||
sites[index] = {name = sites[index].name, position = point.Position}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for i, site in sites do
|
|
||||||
local zone = makeZone(site, "Checkpoint" .. i)
|
|
||||||
zone.marker.body:SetAttribute("Index", i)
|
|
||||||
zone.marker.body.Parent = nil
|
|
||||||
table.insert(zones, zone)
|
|
||||||
end
|
|
||||||
zones[1].marker.body.Parent = folder
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function putFlag(object: Flag, at: Vector3, droppedUntil: number)
|
|
||||||
if object.carrier then object.carrier:SetAttribute("ArenaFlag", nil) end
|
|
||||||
if object.tether then object.tether:Destroy() end
|
|
||||||
object.carrier, object.tether, object.droppedUntil = nil, nil, droppedUntil
|
|
||||||
local mark = object.marker
|
|
||||||
mark.body.Anchored = true
|
|
||||||
mark.body.CFrame = CFrame.new(at + Vector3.yAxis * 2.4)
|
|
||||||
mark.label.Text = if droppedUntil > 0 then "ФЛАГ УПАЛ" else "ФЛАГ · КРЫША"
|
|
||||||
mark.label.TextColor3, object.banner.Color = gold, gold
|
|
||||||
object.stars.Enabled, object.mist.Enabled, object.light.Enabled = true, true, true
|
|
||||||
object.stars:Emit(16)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function pickUpFlag(object: Flag, fighter: Fighter)
|
|
||||||
local body = object.marker.body
|
|
||||||
body.CFrame = fighter.root.CFrame * CFrame.new(0, 3.15, .65)
|
|
||||||
body.Massless = true
|
|
||||||
local tether = Instance.new("WeldConstraint")
|
|
||||||
tether.Part0, tether.Part1 = body, fighter.root
|
|
||||||
tether.Parent = body
|
|
||||||
body.Anchored = false
|
|
||||||
object.carrier, object.tether, object.droppedUntil = fighter.player, tether, 0
|
|
||||||
fighter.player:SetAttribute("ArenaFlag", true)
|
|
||||||
local tint = color(fighter.side)
|
|
||||||
object.marker.label.Text = 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()
|
|
||||||
end
|
|
||||||
local function floorAt(at: Vector3): Vector3
|
|
||||||
local hit = workspace:Raycast(at + Vector3.yAxis * .3, -Vector3.yAxis * 50, geometry)
|
|
||||||
return if hit then hit.Position else (if map then map.ground.position else at)
|
|
||||||
end
|
|
||||||
local function tokenDrop(at: Vector3, amount: number, now: number)
|
|
||||||
local floor = floorAt(at)
|
|
||||||
for _, existing in tokens do
|
|
||||||
if boundsAt(existing.marker.origin, floor, 3.5, 3) then
|
|
||||||
existing.amount += amount
|
|
||||||
existing.expires = now + 42
|
|
||||||
existing.marker.label.Text = "ЖЕТОНЫ ×" .. existing.amount
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if #tokens >= 60 then
|
|
||||||
local old = table.remove(tokens, 1)
|
|
||||||
old.marker.body:Destroy()
|
|
||||||
end
|
|
||||||
table.insert(tokens, {marker = marker(folder, "Tokens", "ЖЕТОНЫ ×" .. amount, floor, gold, 1.55, true), amount = amount, expires = now + 42})
|
|
||||||
end
|
|
||||||
local function dropCarried(player: Player, at: Vector3?, now: number)
|
|
||||||
if flag and flag.carrier == player then
|
|
||||||
if at then
|
|
||||||
local floor = workspace:Raycast(at + Vector3.yAxis * .3, -Vector3.yAxis * 50, geometry)
|
|
||||||
local landing = if floor then floor.Position else at
|
|
||||||
putFlag(flag, landing, now + 20)
|
|
||||||
for _, fighter in collect(config.members()) do objectiveCue:FireClient(fighter.player, "FlagDropped") end
|
|
||||||
else
|
|
||||||
putFlag(flag, flag.marker.origin, 0)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local amount = carried[player]
|
|
||||||
if amount then
|
|
||||||
carried[player] = nil
|
|
||||||
player:SetAttribute("ArenaTokens", nil)
|
|
||||||
if at then tokenDrop(at, amount, now) end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local function clearLeader(side: Side)
|
|
||||||
local p = leaders[side]
|
|
||||||
if not p then return end
|
|
||||||
previousLeader[side] = p
|
|
||||||
leaders[side] = nil
|
|
||||||
p:SetAttribute("ArenaLeader", nil)
|
|
||||||
local badge = leaderLabels[p]
|
|
||||||
if badge then badge:Destroy() end
|
|
||||||
leaderLabels[p] = nil
|
|
||||||
end
|
|
||||||
local function updateLeaders(fighters: {Fighter})
|
|
||||||
for _, side in sides do
|
|
||||||
local roster: {Fighter} = {}
|
|
||||||
local present = false
|
|
||||||
for _, f in fighters do
|
|
||||||
if f.side ~= side then continue end
|
|
||||||
table.insert(roster, f)
|
|
||||||
if f.player == leaders[side] then present = true end
|
|
||||||
end
|
|
||||||
if present then continue end
|
|
||||||
clearLeader(side)
|
|
||||||
if #roster == 0 then continue end
|
|
||||||
local pick = rng:NextInteger(1, #roster)
|
|
||||||
if #roster > 1 and roster[pick].player == previousLeader[side] then pick = pick % #roster + 1 end
|
|
||||||
local p = roster[pick].player
|
|
||||||
local head = p.Character and p.Character:FindFirstChild("Head")
|
|
||||||
if not head or not head:IsA("BasePart") then continue end
|
|
||||||
leaders[side] = p
|
|
||||||
p:SetAttribute("ArenaLeader", true)
|
|
||||||
leaderLabels[p] = label(head, "ЛИДЕР", gold, 2.7).Parent :: BillboardGui
|
|
||||||
end
|
|
||||||
local a, b = leaders.Blue, leaders.Orange
|
|
||||||
status("Лидеры · " .. (if a then a.DisplayName else "—") .. " / " .. (if b then b.DisplayName else "—"))
|
|
||||||
end
|
|
||||||
local function runFlag(fighters: {Fighter}, now: number)
|
|
||||||
if not flag or not map then return end
|
|
||||||
if flag.carrier then
|
|
||||||
for _, fighter in fighters do
|
|
||||||
if fighter.player ~= flag.carrier then continue end
|
|
||||||
local base = if fighter.side == "Blue" then map.blue else map.orange
|
|
||||||
if boundsAt(fighter.root.Position, base, HotPoint.Radius, 7) then
|
|
||||||
add(fighter.side, 1)
|
|
||||||
cue(fighters, true, nil)
|
|
||||||
putFlag(flag, flag.marker.origin, 0)
|
|
||||||
status("Флаг вернулся на крышу цитадели")
|
|
||||||
end
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local carrier = flag.carrier
|
|
||||||
local root = carrier.Character and carrier.Character.PrimaryPart
|
|
||||||
dropCarried(carrier, root and root.Position, now)
|
|
||||||
return
|
|
||||||
elseif flag.droppedUntil > 0 and now >= flag.droppedUntil then
|
|
||||||
putFlag(flag, flag.marker.origin, 0)
|
|
||||||
end
|
|
||||||
local at = flag.marker.body.Position
|
|
||||||
for _, fighter in fighters do
|
|
||||||
if boundsAt(fighter.root.Position, at, 5.5, 6.5) and visibleAt(fighter, at, geometry) then
|
|
||||||
pickUpFlag(flag, fighter)
|
|
||||||
cue(fighters, false, fighter.side)
|
|
||||||
status(fighter.player.DisplayName .. " несёт флаг")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
status(if flag.droppedUntil > 0 then "Флаг на земле · Подберите его" else "Флаг на крыше цитадели")
|
|
||||||
end
|
|
||||||
local function runTrophies(fighters: {Fighter}, now: number)
|
|
||||||
if not map then return end
|
|
||||||
for i = #tokens, 1, -1 do
|
|
||||||
local token = tokens[i]
|
|
||||||
local collector: Fighter? = nil
|
|
||||||
if now < token.expires then
|
|
||||||
for _, f in fighters do
|
|
||||||
if boundsAt(f.root.Position, token.marker.origin, 5, 6) and visibleAt(f, token.marker.body.Position, geometry) then collector = f; break end
|
|
||||||
end
|
|
||||||
if not collector then continue end
|
|
||||||
local p = collector.player
|
|
||||||
if not carried[p] then cue(fighters, false, collector.side) end
|
|
||||||
carried[p] = (carried[p] or 0) + token.amount
|
|
||||||
p:SetAttribute("ArenaTokens", carried[p])
|
|
||||||
end
|
|
||||||
token.marker.body:Destroy()
|
|
||||||
table.remove(tokens, i)
|
|
||||||
end
|
|
||||||
for _, f in fighters do
|
|
||||||
local amount = carried[f.player]
|
|
||||||
if amount and boundsAt(f.root.Position, if f.side == "Blue" then map.blue else map.orange, HotPoint.Radius, 7) then
|
|
||||||
add(f.side, amount)
|
|
||||||
cue(fighters, true, nil)
|
|
||||||
carried[f.player] = nil
|
|
||||||
f.player:SetAttribute("ArenaTokens", nil)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
status("Сдавайте собранные жетоны на своей базе")
|
|
||||||
end
|
|
||||||
local function runSiege(members: {Player}, fighters: {Fighter}, now: number, dt: number): boolean
|
|
||||||
local data = assert(siegeState)
|
|
||||||
local half = SiegeConfig.ATTACK_DURATION
|
|
||||||
local elapsed = now - config.now
|
|
||||||
if elapsed >= half and not hadSiegeSwap then
|
|
||||||
hadSiegeSwap = true
|
|
||||||
for _, z in zones do z.marker.body.Parent = nil end
|
|
||||||
siegeSide, siegeIndex, siegeProgress = opposite(siegeSide), 1, 0
|
|
||||||
siegeCaptureStarted = false
|
|
||||||
local arenaSites = assert(map)
|
|
||||||
local ordinals = {Blue = 0, Orange = 0}
|
|
||||||
for _, p in members do
|
|
||||||
config.deploy(p)
|
|
||||||
local side, character = sideOf(p), p.Character
|
|
||||||
if not side or not character or not character.PrimaryPart then continue end
|
|
||||||
local attack = side == siegeSide
|
|
||||||
ordinals[side] += 1
|
|
||||||
local at = SiegeSpawn.position(world, attack, if attack then arenaSites.blue else arenaSites.orange, ordinals[side])
|
|
||||||
character:PivotTo(CFrame.new(at + Vector3.yAxis * 4))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local swap = elapsed >= half and elapsed < half + SiegeConfig.SWAP_FREEZE
|
|
||||||
local attackStart = if hadSiegeSwap then half + SiegeConfig.SWAP_FREEZE else 0
|
|
||||||
data:SetAttribute("Phase", if swap then "RoleSwap" elseif hadSiegeSwap then "Attack2" else "Attack1")
|
|
||||||
data:SetAttribute("Attacker", siegeSide)
|
|
||||||
data:SetAttribute("Seconds", math.clamp(math.ceil(half - (elapsed - attackStart)), 0, half))
|
|
||||||
if swap then
|
|
||||||
data:SetAttribute("Progress", 0)
|
|
||||||
data:SetAttribute("Status", "Idle")
|
|
||||||
status("СМЕНА РОЛЕЙ")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local attacker = if siegeSide == "Blue" then "Синие" else "Оранжевые"
|
|
||||||
local zone = zones[siegeIndex]
|
|
||||||
data:SetAttribute("Index", siegeIndex)
|
|
||||||
if not zone then
|
|
||||||
data:SetAttribute("Point", nil)
|
|
||||||
data:SetAttribute("NextPoint", nil)
|
|
||||||
status("Все рубежи взяты!")
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
zone.marker.body.Parent = folder
|
|
||||||
local attack, defense = false, false
|
|
||||||
for _, fighter in fighters do
|
|
||||||
local delta = fighter.root.Position - zone.site.position
|
|
||||||
local reason = "Outside"
|
|
||||||
if delta.X * delta.X + delta.Z * delta.Z <= HotPoint.Radius ^ 2 then
|
|
||||||
if math.abs(delta.Y) > SiegeConfig.HEIGHT_TOLERANCE then reason = "Height"
|
|
||||||
elseif not visibleAt(fighter, zone.site.position + Vector3.yAxis * SiegeConfig.SIGHT_HEIGHT, geometry) then reason = "Blocked"
|
|
||||||
else
|
|
||||||
reason = "Inside"
|
|
||||||
if fighter.side == siegeSide then attack = true else defense = true end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
fighter.player:SetAttribute("CitadelZone", reason)
|
|
||||||
end
|
|
||||||
local progress, phase = Capture.advance(siegeProgress, math.min(dt, math.max(0, elapsed - attackStart)), attack, defense,
|
|
||||||
SiegeConfig.CAPTURE_TIME, SiegeConfig.DECAY_MULTIPLIER)
|
|
||||||
if phase == "Capturing" and not siegeCaptureStarted then
|
|
||||||
cue(fighters, false, siegeSide)
|
|
||||||
siegeCaptureStarted = true
|
|
||||||
elseif progress == 0 and phase ~= "Capturing" then
|
|
||||||
siegeCaptureStarted = false
|
|
||||||
end
|
|
||||||
siegeProgress = progress
|
|
||||||
data:SetAttribute("Progress", progress)
|
|
||||||
data:SetAttribute("Status", phase)
|
|
||||||
data:SetAttribute("Point", zone.site.position)
|
|
||||||
data:SetAttribute("PointName", zone.site.name)
|
|
||||||
local nextZone = zones[siegeIndex + 1]
|
|
||||||
data:SetAttribute("NextPoint", if nextZone then nextZone.site.position else nil)
|
|
||||||
local percent = math.floor(progress / SiegeConfig.HUD_PROGRESS_STEP + 1e-8) * SiegeConfig.HUD_PROGRESS_STEP * 100
|
|
||||||
local reason = if phase == "Contested" then "Зона оспаривается!" elseif phase == "Decaying" then "Захват откатывается"
|
|
||||||
elseif phase == "Capturing" then "Захват идёт" else "Двигайтесь к синему кругу"
|
|
||||||
status(string.format("%s · Рубеж %d/%d · %d%% · %s", attacker, siegeIndex, #zones, percent, reason))
|
|
||||||
paint(zone.marker, if phase == "Contested" then orange else blue)
|
|
||||||
if phase ~= "Captured" or not Score.record(siegeTimes, siegeSide, siegeIndex, elapsed - attackStart) then return false end
|
|
||||||
add(siegeSide, SiegeConfig.POINTS_PER_OBJECTIVE)
|
|
||||||
cue(fighters, true, nil)
|
|
||||||
siegeCaptureStarted = false
|
|
||||||
data:SetAttribute(siegeSide .. "Time" .. siegeIndex, elapsed - attackStart)
|
|
||||||
zone.marker.body.Parent = nil
|
|
||||||
siegeIndex += 1
|
|
||||||
siegeProgress = 0
|
|
||||||
return siegeIndex > #zones
|
|
||||||
end
|
|
||||||
local function runOneLife(members: {Player}, fighters: {Fighter}, now: number): boolean
|
|
||||||
if lifeActive then
|
|
||||||
local b, o = 0, 0
|
|
||||||
for _, f in fighters do if f.side == "Blue" then b += 1 else o += 1 end end
|
|
||||||
if (b > 0 and o > 0) and now < lifeEnds then
|
|
||||||
status(string.format("Мини-раунд %d · Живы %d / %d · %d с", miniNumber, b, o, math.ceil(lifeEnds - now)))
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if b ~= o then add(if b > o then "Blue" else "Orange", 1) end
|
|
||||||
if blueScore >= 3 or orangeScore >= 3 then return true end
|
|
||||||
for _, p in members do config.bench(p) end
|
|
||||||
lifeActive, nextMini = false, now + 4
|
|
||||||
end
|
|
||||||
if now >= nextMini then config.balanceWaiting() end
|
|
||||||
local ready: {Player} = {}
|
|
||||||
local b, o = false, false
|
|
||||||
for _, p in members do
|
|
||||||
local c = p.Character
|
|
||||||
local h = c and c:FindFirstChildOfClass("Humanoid")
|
|
||||||
if not c or not c.PrimaryPart or not h or h.Health <= 0 then continue end
|
|
||||||
table.insert(ready, p)
|
|
||||||
if sideOf(p) == "Blue" then b = true else o = true end
|
|
||||||
end
|
|
||||||
if b and o and now >= nextMini then
|
|
||||||
for _, p in ready do config.deploy(p) end
|
|
||||||
miniNumber += 1
|
|
||||||
lifeActive, lifeEnds = true, now + 45
|
|
||||||
status("Мини-раунд " .. miniNumber)
|
|
||||||
elseif not b or not o then
|
|
||||||
status("Ждём игроков в обеих командах")
|
|
||||||
else
|
|
||||||
status("Следующий мини-раунд через " .. math.ceil(nextMini - now) .. " с")
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local function step(now: number): boolean
|
|
||||||
if rule == "TeamDeathmatch" then return false end
|
|
||||||
local elapsed = math.max(0, now - lastStep)
|
|
||||||
local dt = math.min(elapsed, .5)
|
|
||||||
lastStep = now
|
|
||||||
local members = config.members()
|
|
||||||
local fighters = collect(members)
|
|
||||||
if rule == "OneLife" then return runOneLife(members, fighters, now) end
|
|
||||||
if rule == "HuntLeader" then updateLeaders(fighters); return false end
|
|
||||||
if rule == "CaptureFlag" then runFlag(fighters, now); return false end
|
|
||||||
if rule == "TrophyHunt" then runTrophies(fighters, now); return false end
|
|
||||||
if rule == "Siege" then return runSiege(members, fighters, now, dt) end
|
|
||||||
if hotPoint then hotPoint.step(fighters, now, elapsed); return false end
|
|
||||||
|
|
||||||
local scoreNow = now >= nextScore
|
|
||||||
if scoreNow then nextScore = now + 1 end
|
|
||||||
local ownedBlue, ownedOrange = 0, 0
|
|
||||||
for _, zone in zones do
|
|
||||||
local b, o = presence(fighters, zone, geometry)
|
|
||||||
local side: Side? = if b == o then nil elseif b then "Blue" else "Orange"
|
|
||||||
if side and side ~= zone.owner then
|
|
||||||
if zone.claiming ~= side then
|
|
||||||
zone.claiming, zone.progress = side, 0
|
|
||||||
cue(fighters, false, side)
|
|
||||||
end
|
|
||||||
zone.progress += dt
|
|
||||||
if zone.progress >= 3 then
|
|
||||||
zone.owner, zone.progress = side, 0
|
|
||||||
cue(fighters, true, nil)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
zone.claiming, zone.progress = nil, 0
|
|
||||||
end
|
|
||||||
paint(zone.marker, color(zone.owner))
|
|
||||||
if zone.owner == "Blue" then ownedBlue += 1 elseif zone.owner == "Orange" then ownedOrange += 1 end
|
|
||||||
end
|
|
||||||
if scoreNow then
|
|
||||||
if ownedBlue > 0 then add("Blue", ownedBlue) end
|
|
||||||
if ownedOrange > 0 then add("Orange", ownedOrange) end
|
|
||||||
end
|
|
||||||
status(string.format("Точки под контролем · %d / %d", ownedBlue, ownedOrange))
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
match = {
|
match = {
|
||||||
step = step,
|
step = function(now)
|
||||||
hit = if hotPoint then hotPoint.hit else nil,
|
if destroyed then return false end
|
||||||
kill = function(player, victim, at, now)
|
local elapsed = math.max(0, now - lastStep)
|
||||||
local side = sideOf(player)
|
lastStep = now
|
||||||
if not side then return end
|
debug.profilebegin(profileLabel)
|
||||||
if rule == "TeamDeathmatch" then
|
Diagnostics.begin()
|
||||||
add(side, 1)
|
local fighters = Context.collect(ctx.members())
|
||||||
elseif rule == "HuntLeader" then
|
local ok, ended = pcall(instance.step, now, math.min(elapsed, .5), fighters, elapsed)
|
||||||
local target = opposite(side)
|
Diagnostics.finish(ctx.state, #fighters, now)
|
||||||
local bonus = leaders[target] == victim
|
debug.profileend()
|
||||||
add(side, if bonus then 3 else 1)
|
if not ok then error(ended, 0) end
|
||||||
if bonus then clearLeader(target) end
|
return ended
|
||||||
elseif rule == "TrophyHunt" then
|
|
||||||
tokenDrop(at, 1, now)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
death = function(player, at, now)
|
|
||||||
if hotPoint then hotPoint.death(player) end
|
|
||||||
dropCarried(player, at, now)
|
|
||||||
if rule == "OneLife" then config.bench(player) end
|
|
||||||
end,
|
|
||||||
leaving = function(player, at, now)
|
|
||||||
if hotPoint then hotPoint.death(player) end
|
|
||||||
dropCarried(player, at, now)
|
|
||||||
local side = sideOf(player)
|
|
||||||
if side and leaders[side] == player then clearLeader(side) end
|
|
||||||
end,
|
end,
|
||||||
|
kill = instance.kill, hit = instance.hit, death = instance.death, leaving = instance.leaving,
|
||||||
winner = function()
|
winner = function()
|
||||||
if rule == "Siege" then
|
local side, reason = instance.winner()
|
||||||
local winner, reason = Score.winner(siegeTimes, SiegeConfig.TIE_EPSILON)
|
ctx.state:SetAttribute("ResultReason", reason)
|
||||||
state:SetAttribute("CitadelResultReason", reason)
|
return side
|
||||||
return winner
|
|
||||||
end
|
|
||||||
if blueScore ~= orangeScore then return if blueScore > orangeScore then "Blue" else "Orange" end
|
|
||||||
return "Draw"
|
|
||||||
end,
|
end,
|
||||||
destroy = function()
|
destroy = function()
|
||||||
if siegeState then
|
if destroyed then return end
|
||||||
siegeState:Destroy()
|
destroyed = true
|
||||||
for _, p in config.members() do p:SetAttribute("CitadelZone", nil) end
|
if active[config.arena] == match then active[config.arena] = nil end
|
||||||
end
|
local ok, issue = pcall(instance.destroy)
|
||||||
if active[arena] == match then active[arena] = nil end
|
ctx.janitor.clean()
|
||||||
if hotPoint then hotPoint.destroy() end
|
ctx.folder:Destroy()
|
||||||
for _, side in sides do clearLeader(side) end
|
ctx.status("")
|
||||||
for p in carried do p:SetAttribute("ArenaTokens", nil) end
|
ctx.state:SetAttribute("RoundStage", nil)
|
||||||
if flag and flag.carrier then flag.carrier:SetAttribute("ArenaFlag", nil) end
|
for _, attr in {"DebugRays", "DebugFighters", "DebugEvents"} do ctx.state:SetAttribute(attr, nil) end
|
||||||
for _, z in zones do z.marker.body:Destroy() end
|
if not ok then warn(issue) end
|
||||||
folder:Destroy()
|
|
||||||
status("")
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
active[arena] = match
|
active[config.arena] = match
|
||||||
return match
|
return match
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ local objectiveCue = ReplicatedStorage:WaitForChild("ArenaObjectiveCue") :: Remo
|
|||||||
local objectiveCueConnection = objectiveCue.OnClientEvent:Connect(function(captured: boolean | string)
|
local objectiveCueConnection = objectiveCue.OnClientEvent:Connect(function(captured: boolean | string)
|
||||||
Sounds.sound(if captured == "FlagDropped" then "FlagDropped" elseif captured == true then "HotPointCaptured" else "HotPointStart")
|
Sounds.sound(if captured == "FlagDropped" then "FlagDropped" elseif captured == true then "HotPointCaptured" else "HotPointStart")
|
||||||
end)
|
end)
|
||||||
|
local Hunter = ReplicatedStorage:WaitForChild("Hunter")
|
||||||
|
local HunterStrings = require(Hunter:WaitForChild("Strings") :: ModuleScript)
|
||||||
|
local Text = HunterStrings.interface.ArenaRoundHud
|
||||||
|
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 limit = state:GetAttribute("TeamLimit") :: number
|
||||||
local modeIds = {Modes.Procedural}
|
local modeIds = {Modes.Procedural}
|
||||||
local function currentMode(): string
|
local function currentMode(): string
|
||||||
@@ -156,7 +162,44 @@ siegeBar.BackgroundColor3 = Color3.fromRGB(34, 45, 65)
|
|||||||
siegeBar.BorderSizePixel = 0
|
siegeBar.BorderSizePixel = 0
|
||||||
siegeBar.Visible = false
|
siegeBar.Visible = false
|
||||||
siegeBar.Parent = objective
|
siegeBar.Parent = objective
|
||||||
|
local lifeBoard = UI.label(objective,"OneLifeBoard","",UDim2.fromOffset(15,90),UDim2.new(1,-30,0,25),17,UI.Gold)
|
||||||
|
lifeBoard.Visible=false
|
||||||
|
local dominationChips = Instance.new("Frame")
|
||||||
|
dominationChips.Name = "DominationChips"
|
||||||
|
dominationChips.Position = UDim2.fromOffset(15, 88)
|
||||||
|
dominationChips.Size = UDim2.new(1, -30, 0, 40)
|
||||||
|
dominationChips.BackgroundTransparency = 1
|
||||||
|
dominationChips.Visible = false
|
||||||
|
dominationChips.Parent = objective
|
||||||
|
local domSlots: {[string]: {chip: GuiObject, text: TextLabel, ticks: {Frame}}} = {}
|
||||||
|
for i, key in {"A", "B", "C"} do
|
||||||
|
local chip = UI.element("ScoreChip", dominationChips, UDim2.new((i - 1) / 3, 0, 0, 0), UDim2.new(1 / 3, -6, 0, 25))
|
||||||
|
local templateValue = chip:FindFirstChild("Value")
|
||||||
|
if templateValue and templateValue:IsA("TextLabel") then templateValue.Visible = false end
|
||||||
|
local text = UI.label(chip, "Zone", key, UDim2.new(), UDim2.fromScale(1, 1), 17, ink)
|
||||||
|
local ticks: {Frame} = {}
|
||||||
|
for segment = 1, 10 do
|
||||||
|
local angle = (segment - 1) * math.pi / 5 - math.pi / 2
|
||||||
|
local dot = Instance.new("Frame")
|
||||||
|
dot.Name = "CaptureProgress"
|
||||||
|
dot.AnchorPoint = Vector2.new(.5, .5)
|
||||||
|
dot.Position = UDim2.new(.5, math.cos(angle) * 12, .5, math.sin(angle) * 10)
|
||||||
|
dot.Size = UDim2.fromOffset(3, 3)
|
||||||
|
dot.BorderSizePixel = 0
|
||||||
|
dot.Visible = false
|
||||||
|
dot.Parent = chip
|
||||||
|
Instance.new("UICorner", dot).CornerRadius = UDim.new(1, 0)
|
||||||
|
table.insert(ticks, dot)
|
||||||
|
end
|
||||||
|
domSlots[key] = {chip = chip, text = text, ticks = ticks}
|
||||||
|
end
|
||||||
|
local rateLabel = UI.label(dominationChips, "ScoreRate", "", UDim2.fromOffset(0, 26), UDim2.new(1, 0, 0, 17), 13, muted)
|
||||||
|
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 siegeSegments: {Frame} = {}
|
||||||
|
local siegeSegmentCount = 0
|
||||||
for i = 1, 10 do
|
for i = 1, 10 do
|
||||||
local segment = Instance.new("Frame")
|
local segment = Instance.new("Frame")
|
||||||
segment.Position = UDim2.fromScale((i - 1) / 10, 0)
|
segment.Position = UDim2.fromScale((i - 1) / 10, 0)
|
||||||
@@ -213,7 +256,7 @@ countdown.Visible = false
|
|||||||
local allyCapture = Color3.fromRGB(90, 247, 170)
|
local allyCapture = Color3.fromRGB(90, 247, 170)
|
||||||
local enemyCapture = Color3.fromRGB(255, 79, 105)
|
local enemyCapture = Color3.fromRGB(255, 79, 105)
|
||||||
local captureHud = UI.plate(hudLayout, "HotPointCapture", UDim2.new(.5, 0, 0, 10), UDim2.fromOffset(384, 52), UI.Outline)
|
local captureHud = UI.plate(hudLayout, "HotPointCapture", UDim2.new(.5, 0, 0, 10), UDim2.fromOffset(384, 52), UI.Outline)
|
||||||
captureHud.AnchorPoint, captureHud.Visible = Vector2.new(.5, 0), false
|
captureHud.AnchorPoint, captureHud.Visible = Vector2.new(.5, 1), false
|
||||||
local captureArc = UI.contour(captureHud, allyCapture)
|
local captureArc = UI.contour(captureHud, allyCapture)
|
||||||
local captureLabel = UI.label(captureHud, "Status", "", UDim2.fromOffset(14, 5), UDim2.new(1, -77, 0, 24), 15, ink)
|
local captureLabel = UI.label(captureHud, "Status", "", UDim2.fromOffset(14, 5), UDim2.new(1, -77, 0, 24), 15, ink)
|
||||||
captureLabel.FontFace = UI.Display
|
captureLabel.FontFace = UI.Display
|
||||||
@@ -225,7 +268,17 @@ local captureTrack = UI.element("ProgressBar", captureHud, UDim2.fromOffset(14,
|
|||||||
captureTrack.Name = "CaptureProgress"
|
captureTrack.Name = "CaptureProgress"
|
||||||
local captureFill = captureTrack:WaitForChild("Fill") :: Frame
|
local captureFill = captureTrack:WaitForChild("Fill") :: Frame
|
||||||
captureFill.Size = UDim2.fromScale(0, 1)
|
captureFill.Size = UDim2.fromScale(0, 1)
|
||||||
UI.sheen(captureFill)
|
captureFill.Visible = false
|
||||||
|
local hotSegments: {Frame} = {}
|
||||||
|
for i = 1, 10 do
|
||||||
|
local segment = Instance.new("Frame")
|
||||||
|
segment.Name = "CaptureSegment"
|
||||||
|
segment.Position = UDim2.fromScale((i-1)/10, 0)
|
||||||
|
segment.Size = UDim2.new(.1, -2, 1, 0)
|
||||||
|
segment.BorderSizePixel = 0
|
||||||
|
segment.Parent = captureTrack
|
||||||
|
table.insert(hotSegments, segment)
|
||||||
|
end
|
||||||
local captureTween: Tween? = nil
|
local captureTween: Tween? = nil
|
||||||
local captureTeam: string? = nil
|
local captureTeam: string? = nil
|
||||||
local capturePercent = 0
|
local capturePercent = 0
|
||||||
@@ -280,7 +333,7 @@ local function showCountdownBeat(seconds: number)
|
|||||||
digitMotion:Play()
|
digitMotion:Play()
|
||||||
echoMotion:Play()
|
echoMotion:Play()
|
||||||
echoFade:Play()
|
echoFade:Play()
|
||||||
countdownSound = Sounds.sound("RoundCountdown")
|
countdownSound = Sounds.sound("Countdown")
|
||||||
end
|
end
|
||||||
|
|
||||||
local teamStats = UI.plate(hudLayout, "TeamKillStats", UDim2.fromOffset(15, 74), UDim2.fromOffset(widthOfCard, 55), UI.Outline)
|
local teamStats = UI.plate(hudLayout, "TeamKillStats", UDim2.fromOffset(15, 74), UDim2.fromOffset(widthOfCard, 55), UI.Outline)
|
||||||
@@ -348,9 +401,7 @@ local function fitHud()
|
|||||||
badge.killSize.MaxTextSize = if packed then 17 else 23
|
badge.killSize.MaxTextSize = if packed then 17 else 23
|
||||||
end
|
end
|
||||||
local bottom = top + (if rowCount > 0 then height * scoreScale.Scale else 0)
|
local bottom = top + (if rowCount > 0 then height * scoreScale.Scale else 0)
|
||||||
local minimumTop = if countdown.Visible then 119 else 10
|
captureHud.Position = UDim2.new(.5, 0, 1, -83)
|
||||||
local captureTop = if width >= 1200 then minimumTop else math.max(minimumTop, bottom + 8)
|
|
||||||
captureHud.Position = UDim2.new(.5, 0, 0, captureTop)
|
|
||||||
captureHud.Size = UDim2.fromOffset(math.floor(math.min(384, width - 24)), 52)
|
captureHud.Size = UDim2.fromOffset(math.floor(math.min(384, width - 24)), 52)
|
||||||
gui:SetAttribute("ContentBottom", if width >= 700 then 4 else bottom)
|
gui:SetAttribute("ContentBottom", if width >= 700 then 4 else bottom)
|
||||||
end
|
end
|
||||||
@@ -379,14 +430,18 @@ local function refreshCapture()
|
|||||||
captureCueTeam, captureCuePhase = if phase == "Captured" then nil else side, phase
|
captureCueTeam, captureCuePhase = if phase == "Captured" then nil else side, phase
|
||||||
local accent = if not side then UI.Gold elseif allied then allyCapture else enemyCapture
|
local accent = if not side then UI.Gold elseif allied then allyCapture else enemyCapture
|
||||||
captureHud.Visible = true
|
captureHud.Visible = true
|
||||||
captureLabel.Text = if phase == "Captured" then "ТОЧКА ЗАХВАЧЕНА · +1"
|
captureLabel.Text = if phase == "Captured" then Text.tochkaZakhvachena
|
||||||
elseif phase == "Contested" then "ТОЧКА ОСПАРИВАЕТСЯ"
|
elseif phase == "Contested" then HunterStrings.hotHints.contest
|
||||||
elseif phase == "UnderFire" then (if allied then "ВАШ ЗАХВАТ ТЕРЯЕТСЯ" else "ЗАХВАТ СОПЕРНИКОВ ПАДАЕТ")
|
elseif phase == "UnderFire" then HunterStrings.hotHints.underFire
|
||||||
elseif allied then "ВАША КОМАНДА ЗАХВАТЫВАЕТ" else "СОПЕРНИКИ ЗАХВАТЫВАЮТ"
|
elseif allied then HunterStrings.hotHints.taking else Text.sopernikiZakhvatyvayut
|
||||||
local percent = math.clamp((match:GetAttribute("HotPointProgress") :: number?) or 0, 0, 100)
|
local percent = math.clamp((match:GetAttribute("HotPointProgress") :: number?) or 0, 0, 100)
|
||||||
captureValue.Text, captureValue.TextColor3 = string.format("%d%%", percent), accent
|
captureValue.Text, captureValue.TextColor3 = string.format("%d%%", percent), accent
|
||||||
captureArc:SetAttribute("Accent", accent)
|
captureArc:SetAttribute("Accent", accent)
|
||||||
captureFill.BackgroundColor3 = accent
|
captureFill.BackgroundColor3 = accent
|
||||||
|
for i, segment in hotSegments do
|
||||||
|
segment.BackgroundColor3 = accent
|
||||||
|
segment.BackgroundTransparency = if percent >= i * 10 then 0 else .85
|
||||||
|
end
|
||||||
if percent == capturePercent and side == captureTeam then return end
|
if percent == capturePercent and side == captureTeam then return end
|
||||||
if captureTween then captureTween:Cancel() end
|
if captureTween then captureTween:Cancel() end
|
||||||
local size = UDim2.fromScale(percent / 100, 1)
|
local size = UDim2.fromScale(percent / 100, 1)
|
||||||
@@ -404,7 +459,9 @@ local function refreshObjective()
|
|||||||
local visible = player:GetAttribute("InArena") == true and match:GetAttribute("Phase") == "Round"
|
local visible = player:GetAttribute("InArena") == true and match:GetAttribute("Phase") == "Round"
|
||||||
local needsLayout = visible ~= objective.Visible
|
local needsLayout = visible ~= objective.Visible
|
||||||
objective.Visible = visible
|
objective.Visible = visible
|
||||||
siegeBar.Visible = false
|
siegeBar.Visible, siegeSteps.Visible, siegeChip.Visible = false, false, false
|
||||||
|
dominationChips.Visible = false
|
||||||
|
lifeBoard.Visible = false
|
||||||
if visible then
|
if visible then
|
||||||
local rule = Rules.get(match:GetAttribute("Ruleset"))
|
local rule = Rules.get(match:GetAttribute("Ruleset"))
|
||||||
local accent = if player:GetAttribute("ArenaTeam") == "Orange" then orange else blue
|
local accent = if player:GetAttribute("ArenaTeam") == "Orange" then orange else blue
|
||||||
@@ -419,32 +476,85 @@ local function refreshObjective()
|
|||||||
local attacker = siege:GetAttribute("Attacker")
|
local attacker = siege:GetAttribute("Attacker")
|
||||||
local seconds = (siege:GetAttribute("Seconds") :: number?) or 0
|
local seconds = (siege:GetAttribute("Seconds") :: number?) or 0
|
||||||
local zone = player:GetAttribute("CitadelZone")
|
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 ""
|
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(Text.atakaDDD,
|
||||||
if phase == "Attack2" then 2 else 1, math.floor(seconds / 60), seconds % 60)
|
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 phase ~= "RoleSwap" and siege:GetAttribute("Point") then
|
||||||
if zone == "Height" then text = "Найдите нужный этаж"
|
siegeBar.Visible, siegeSteps.Visible = true, true
|
||||||
elseif zone == "Blocked" then text = "Нет прямой видимости центра"
|
|
||||||
elseif zone == "Inside" and role == "Вы защищаете" then text = "Вы блокируете захват. Оставайтесь в круге!" end
|
|
||||||
siegeBar.Visible = true
|
|
||||||
local progress = (siege:GetAttribute("Progress") :: number?) or 0
|
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
|
for i, segment in siegeSegments do
|
||||||
segment.Visible = progress + 1e-8 >= i / #siegeSegments
|
segment.Visible = i <= filled
|
||||||
segment.BackgroundColor3 = if siege:GetAttribute("Status") == "Contested" then orange else blue
|
segment.BackgroundColor3 = segmentColor
|
||||||
|
if i == filled and filled > siegeSegmentCount then
|
||||||
|
segment.BackgroundTransparency = .55
|
||||||
|
TweenService:Create(segment, TweenInfo.new(.2), {BackgroundTransparency = 0}):Play()
|
||||||
end
|
end
|
||||||
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
|
||||||
|
end
|
||||||
|
if rule.id == "OneLife" then
|
||||||
|
local function dots(points: number): string
|
||||||
|
local n=math.clamp(math.floor(points),0,3)
|
||||||
|
return string.rep("●",n)..string.rep("○",3-n)
|
||||||
|
end
|
||||||
|
lifeBoard.Visible=true
|
||||||
|
lifeBoard.Text=string.format(HunterStrings.lifeHints.alive,(match:GetAttribute("MiniAliveBlue") :: number?) or 0,
|
||||||
|
(match:GetAttribute("MiniAliveOrange") :: number?) or 0)
|
||||||
|
.." "..dots((match:GetAttribute("BlueScore") :: number?) or 0).." / "..dots((match:GetAttribute("OrangeScore") :: number?) or 0)
|
||||||
|
end
|
||||||
|
if rule.id == "Domination" then
|
||||||
|
dominationChips.Visible = true
|
||||||
|
for key, slot in domSlots do
|
||||||
|
local owner = match:GetAttribute("ZoneOwner_" .. key)
|
||||||
|
local claimant = match:GetAttribute("ZoneClaim_" .. key)
|
||||||
|
local progress = (match:GetAttribute("ZoneProgress_" .. key) :: number?) or 0
|
||||||
|
local ownerTint = if owner == "Blue" then blue elseif owner == "Orange" then orange else muted
|
||||||
|
slot.text.TextColor3 = ownerTint
|
||||||
|
slot.chip.BackgroundColor3 = panelColor:Lerp(ownerTint, .28)
|
||||||
|
for i, tick in slot.ticks do
|
||||||
|
tick.Visible = typeof(claimant) == "string"
|
||||||
|
tick.BackgroundColor3 = if claimant == "Blue" then blue else orange
|
||||||
|
tick.BackgroundTransparency = if progress + 1e-7 >= i / 10 then 0 else .8
|
||||||
|
end
|
||||||
|
end
|
||||||
|
rateLabel.Text = string.format(Text.sinieDSOranzhevye,
|
||||||
|
(match:GetAttribute("ScoreRate_Blue") :: number?) or 0, (match:GetAttribute("ScoreRate_Orange") :: number?) or 0)
|
||||||
|
end
|
||||||
|
local modeHint = playerGui:GetAttribute("ModeHint")
|
||||||
|
if rule.id ~= "Siege" and typeof(modeHint) == "string" then text = modeHint end
|
||||||
local tokens = (player:GetAttribute("ArenaTokens") :: number?) or 0
|
local tokens = (player:GetAttribute("ArenaTokens") :: number?) or 0
|
||||||
if player:GetAttribute("ArenaFlag") then text = "У вас флаг · Несите его на свою базу"
|
if player:GetAttribute("ArenaFlag") and typeof(modeHint) ~= "string" then text = Text.uVasFlagNesite
|
||||||
elseif tokens > 0 then text = "Жетонов у вас: " .. tokens .. " · Вернитесь на базу"
|
elseif tokens > 0 and typeof(modeHint) ~= "string" then text = Text.zhetonovUVas .. tokens .. Text.vernitesNaBazu
|
||||||
elseif player:GetAttribute("ArenaLeader") then text = "Вы лидер · За вас дают 3 очка"
|
elseif player:GetAttribute("ArenaLeader") and typeof(modeHint) ~= "string" then text = Text.vyLiderZaVas
|
||||||
elseif rule.id == "TrophyHunt" then text = "" end
|
elseif rule.id == "TrophyHunt" and typeof(modeHint) ~= "string" then text = "" end
|
||||||
objectiveStatus.Visible = text ~= ""
|
objectiveStatus.Visible = text ~= ""
|
||||||
objectiveStatus.Text = text
|
objectiveStatus.Text = text
|
||||||
objectiveStatus.TextColor3 = accent:Lerp(ink, .3)
|
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 dominationChips.Visible then 133 elseif lifeBoard.Visible then 120 elseif objectiveStatus.Visible then 88 else 62
|
||||||
if height ~= objective.Size.Y.Offset then
|
if height ~= objective.Size.Y.Offset then
|
||||||
objective.Size = UDim2.fromOffset(widthOfCard, height)
|
objective.Size = UDim2.fromOffset(widthOfCard, height)
|
||||||
needsLayout = true
|
needsLayout = true
|
||||||
@@ -455,7 +565,9 @@ end
|
|||||||
|
|
||||||
type ResultPlayer = {userId: number, displayName: string, kills: number, deaths: number}
|
type ResultPlayer = {userId: number, displayName: string, kills: number, deaths: number}
|
||||||
type RoundResult = {mode: string, ruleset: string, winner: string, endsAt: number, duration: number, blueScore: number, orangeScore: number,
|
type RoundResult = {mode: string, ruleset: string, winner: string, endsAt: number, duration: number, blueScore: number, orangeScore: number,
|
||||||
blue: {ResultPlayer}, orange: {ResultPlayer}, allowModeChange: boolean?, siegeReason: string?}
|
blue: {ResultPlayer}, orange: {ResultPlayer}, allowModeChange: boolean?, siegeReason: string?, reason: string?,
|
||||||
|
highlights: {mvpUserId: number?, mvpName: string?, lines: {{title: string, name: string, value: number}}}?,
|
||||||
|
contributions: {[string]: {[string]: number}}?}
|
||||||
type ResultRow = {body: Frame, avatar: ImageLabel, name: TextLabel, kills: TextLabel, deaths: TextLabel}
|
type ResultRow = {body: Frame, avatar: ImageLabel, name: TextLabel, kills: TextLabel, deaths: TextLabel}
|
||||||
type ResultTeam = {card: Frame, score: TextLabel, empty: TextLabel, accent: Color3, rows: {ResultRow}}
|
type ResultTeam = {card: Frame, score: TextLabel, empty: TextLabel, accent: Color3, rows: {ResultRow}}
|
||||||
type SummaryView = "Live" | "Final"
|
type SummaryView = "Live" | "Final"
|
||||||
@@ -480,11 +592,13 @@ end
|
|||||||
resultsShade:GetPropertyChangedSignal("AbsoluteSize"):Connect(fitResults)
|
resultsShade:GetPropertyChangedSignal("AbsoluteSize"):Connect(fitResults)
|
||||||
fitResults()
|
fitResults()
|
||||||
local resultArc = UI.contour(resultsPanel, blue)
|
local resultArc = UI.contour(resultsPanel, blue)
|
||||||
local resultTitle = UI.label(resultsPanel, "Title", "ИТОГИ РАУНДА", UDim2.fromOffset(26, 17), UDim2.fromOffset(510, 42), 31, ink)
|
local resultTitle = UI.label(resultsPanel, "Title", Text.itogiRaunda, UDim2.fromOffset(26, 17), UDim2.fromOffset(510, 42), 31, ink)
|
||||||
resultTitle.FontFace = UI.Display
|
resultTitle.FontFace = UI.Display
|
||||||
resultTitle.TextXAlignment = Enum.TextXAlignment.Left
|
resultTitle.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
local resultWinner = UI.label(resultsPanel, "Winner", "", UDim2.fromOffset(27, 60), UDim2.fromOffset(510, 25), 17, UI.Gold)
|
local resultWinner = UI.label(resultsPanel, "Winner", "", UDim2.fromOffset(27, 60), UDim2.fromOffset(510, 25), 17, UI.Gold)
|
||||||
resultWinner.TextXAlignment = Enum.TextXAlignment.Left
|
resultWinner.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
|
local resultReason = UI.label(resultsPanel, "Reason", "", UDim2.fromOffset(27, 83), UDim2.fromOffset(900, 22), 15, muted)
|
||||||
|
resultReason.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
local resultMode = UI.label(resultsPanel, "Mode", "", UDim2.fromOffset(566, 30), UDim2.fromOffset(368, 31), 15, muted)
|
local resultMode = UI.label(resultsPanel, "Mode", "", UDim2.fromOffset(566, 30), UDim2.fromOffset(368, 31), 15, muted)
|
||||||
resultMode.TextXAlignment = Enum.TextXAlignment.Right
|
resultMode.TextXAlignment = Enum.TextXAlignment.Right
|
||||||
|
|
||||||
@@ -497,7 +611,7 @@ lobbyButton.BorderSizePixel = 0
|
|||||||
lobbyButton.FontFace = UI.Display
|
lobbyButton.FontFace = UI.Display
|
||||||
lobbyButton.TextSize = 14
|
lobbyButton.TextSize = 14
|
||||||
lobbyButton.TextColor3 = ink
|
lobbyButton.TextColor3 = ink
|
||||||
lobbyButton.Text = "ВЫЙТИ В ЛОББИ"
|
lobbyButton.Text = Text.vyytiVLobbi
|
||||||
lobbyButton.Visible = false
|
lobbyButton.Visible = false
|
||||||
corners(lobbyButton, 5)
|
corners(lobbyButton, 5)
|
||||||
lobbyButton.Parent = resultsPanel
|
lobbyButton.Parent = resultsPanel
|
||||||
@@ -569,10 +683,10 @@ local function resultTeam(id: string, x: number, name: string, color: Color3, da
|
|||||||
score.FontFace = UI.Display
|
score.FontFace = UI.Display
|
||||||
local head = frame("Columns", card, UDim2.fromOffset(12, 73), UDim2.fromOffset(422, 25), panelColor)
|
local head = frame("Columns", card, UDim2.fromOffset(12, 73), UDim2.fromOffset(422, 25), panelColor)
|
||||||
head.BackgroundTransparency = 1
|
head.BackgroundTransparency = 1
|
||||||
local playerHeader = UI.label(head, "Player", "ИГРОК", UDim2.fromOffset(8, 0), UDim2.fromOffset(200, 25), 12, muted)
|
local playerHeader = UI.label(head, "Player", Text.igrok, UDim2.fromOffset(8, 0), UDim2.fromOffset(200, 25), 12, muted)
|
||||||
playerHeader.TextXAlignment = Enum.TextXAlignment.Left
|
playerHeader.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
UI.label(head, "Kills", "УБИЙСТВА", UDim2.fromOffset(241, 0), UDim2.fromOffset(93, 25), 12, muted)
|
UI.label(head, "Kills", Text.ubiystva, UDim2.fromOffset(241, 0), UDim2.fromOffset(93, 25), 12, muted)
|
||||||
UI.label(head, "Deaths", "СМЕРТИ", UDim2.fromOffset(334, 0), UDim2.fromOffset(86, 25), 12, muted)
|
UI.label(head, "Deaths", Text.smerti, UDim2.fromOffset(334, 0), UDim2.fromOffset(86, 25), 12, muted)
|
||||||
local rows: {ResultRow} = {}
|
local rows: {ResultRow} = {}
|
||||||
for i = 1, limit do
|
for i = 1, limit do
|
||||||
local row = UI.element("PlayerRow", card, UDim2.fromOffset(12, 102 + (i - 1) * 35), UDim2.fromOffset(422, 32))
|
local row = UI.element("PlayerRow", card, UDim2.fromOffset(12, 102 + (i - 1) * 35), UDim2.fromOffset(422, 32))
|
||||||
@@ -587,19 +701,33 @@ local function resultTeam(id: string, x: number, name: string, color: Color3, da
|
|||||||
kills.FontFace = UI.Display
|
kills.FontFace = UI.Display
|
||||||
rows[i] = {body = row, avatar = avatar, name = nameLabel, kills = kills, deaths = deaths}
|
rows[i] = {body = row, avatar = avatar, name = nameLabel, kills = kills, deaths = deaths}
|
||||||
end
|
end
|
||||||
local empty = UI.label(card, "Empty", "В команде не было игроков", UDim2.fromOffset(12, 105), UDim2.fromOffset(422, 54), 15, muted)
|
local empty = UI.label(card, "Empty", Text.vKomandeNeBylo, UDim2.fromOffset(12, 105), UDim2.fromOffset(422, 54), 15, muted)
|
||||||
return {card = card, score = score, empty = empty, accent = color, rows = rows}
|
return {card = card, score = score, empty = empty, accent = color, rows = rows}
|
||||||
end
|
end
|
||||||
|
|
||||||
local blueResult = resultTeam("Blue", 23, "СИНИЕ", blue, blueDark)
|
local blueResult = resultTeam("Blue", 23, Text.sinie, blue, blueDark)
|
||||||
local orangeResult = resultTeam("Orange", 491, "ОРАНЖЕВЫЕ", orange, orangeDark)
|
local orangeResult = resultTeam("Orange", 491, Text.oranzhevye, 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
|
||||||
|
mvpChip.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
|
local contribution = UI.label(resultsExtra, "Contribution", "", UDim2.fromOffset(15, 32), UDim2.fromOffset(865, 25), 16, ink)
|
||||||
|
contribution.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
|
local highlights = UI.label(resultsExtra, "Highlights", "", UDim2.fromOffset(15, 60), UDim2.fromOffset(865, 31), 15, muted)
|
||||||
|
highlights.TextWrapped = true
|
||||||
|
highlights.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
|
resultsExtra.Visible = false
|
||||||
local nextRound = UI.label(resultsPanel, "NextRound", "", UDim2.fromOffset(25, 573), UDim2.fromOffset(910, 31), 16, ink)
|
local nextRound = UI.label(resultsPanel, "NextRound", "", UDim2.fromOffset(25, 573), UDim2.fromOffset(910, 31), 16, ink)
|
||||||
local resultTrack = UI.element("ProgressBar", resultsPanel, UDim2.fromOffset(25, 609), UDim2.fromOffset(910, 3))
|
local resultTrack = UI.element("ProgressBar", resultsPanel, UDim2.fromOffset(25, 609), UDim2.fromOffset(910, 3))
|
||||||
local resultFill = resultTrack:WaitForChild("Fill") :: Frame
|
local resultFill = resultTrack:WaitForChild("Fill") :: Frame
|
||||||
UI.sheen(resultFill)
|
UI.sheen(resultFill)
|
||||||
local resultEndsAt = 0
|
local resultEndsAt = 0
|
||||||
local lastResultSecond = -1
|
local lastResultSecond = -1
|
||||||
local resultsCountdown = "ГОЛОСОВАНИЕ ЧЕРЕЗ %d С"
|
local resultsCountdown = Text.golosovanieCherezDS
|
||||||
local summaryView: SummaryView? = nil
|
local summaryView: SummaryView? = nil
|
||||||
local resultSlide: Tween? = nil
|
local resultSlide: Tween? = nil
|
||||||
local resultFade: Tween? = nil
|
local resultFade: Tween? = nil
|
||||||
@@ -608,7 +736,7 @@ local resultDrain: Tween? = nil
|
|||||||
local function populateResults(team: ResultTeam, score: number, players: {ResultPlayer})
|
local function populateResults(team: ResultTeam, score: number, players: {ResultPlayer})
|
||||||
team.score.Text = tostring(score)
|
team.score.Text = tostring(score)
|
||||||
team.empty.Visible = #players == 0
|
team.empty.Visible = #players == 0
|
||||||
team.empty.Text = if summaryView == "Live" then "В команде пока нет игроков" else "В команде не было игроков"
|
team.empty.Text = if summaryView == "Live" then Text.vKomandePokaNet else Text.vKomandeNeBylo
|
||||||
for i, row in team.rows do
|
for i, row in team.rows do
|
||||||
local member = players[i]
|
local member = players[i]
|
||||||
row.body.Visible = member ~= nil
|
row.body.Visible = member ~= nil
|
||||||
@@ -616,7 +744,7 @@ local function populateResults(team: ResultTeam, score: number, players: {Result
|
|||||||
setPortrait(row.avatar, member and member.userId, member and member.displayName)
|
setPortrait(row.avatar, member and member.userId, member and member.displayName)
|
||||||
if member then
|
if member then
|
||||||
local self = member.userId == player.UserId
|
local self = member.userId == player.UserId
|
||||||
row.name.Text = (if self then "Вы · " else "") .. member.displayName
|
row.name.Text = (if self then Text.vy else "") .. member.displayName
|
||||||
row.kills.Text = tostring(member.kills)
|
row.kills.Text = tostring(member.kills)
|
||||||
row.deaths.Text = tostring(member.deaths)
|
row.deaths.Text = tostring(member.deaths)
|
||||||
row.body.BackgroundColor3 = panelColor:Lerp(team.accent, if self then .34 elseif i % 2 == 0 then .08 else .15)
|
row.body.BackgroundColor3 = panelColor:Lerp(team.accent, if self then .34 elseif i % 2 == 0 then .08 else .15)
|
||||||
@@ -628,7 +756,12 @@ local function setSummaryTeams(bluePlayers: {ResultPlayer}, orangePlayers: {Resu
|
|||||||
populateResults(blueResult, blueTotal, bluePlayers)
|
populateResults(blueResult, blueTotal, bluePlayers)
|
||||||
populateResults(orangeResult, orangeTotal, orangePlayers)
|
populateResults(orangeResult, orangeTotal, orangePlayers)
|
||||||
local rowSpace = 35 * math.max(3, #bluePlayers, #orangePlayers)
|
local rowSpace = 35 * math.max(3, #bluePlayers, #orangePlayers)
|
||||||
local height = 280 + rowSpace
|
local final = summaryView == "Final"
|
||||||
|
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
|
if resultsPanel.Size.Y.Offset == height then return end
|
||||||
resultsPanel.Size = UDim2.fromOffset(960, height)
|
resultsPanel.Size = UDim2.fromOffset(960, height)
|
||||||
blueResult.card.Size = UDim2.fromOffset(446, 117 + rowSpace)
|
blueResult.card.Size = UDim2.fromOffset(446, 117 + rowSpace)
|
||||||
@@ -640,13 +773,16 @@ end
|
|||||||
|
|
||||||
local function startSummary(view: SummaryView, ruleId: unknown)
|
local function startSummary(view: SummaryView, ruleId: unknown)
|
||||||
summaryView = view
|
summaryView = view
|
||||||
|
siegeRecap.Visible = false
|
||||||
|
resultReason.Visible = view == "Final"
|
||||||
|
resultsExtra.Visible = view == "Final"
|
||||||
lobbyButton.Visible = view == "Live" and player:GetAttribute("InArena") == true
|
lobbyButton.Visible = view == "Live" and player:GetAttribute("InArena") == true
|
||||||
resultsGui:SetAttribute("LiveScoreboardOpen", view == "Live")
|
resultsGui:SetAttribute("LiveScoreboardOpen", view == "Live")
|
||||||
resultTitle.Text = if view == "Live" then "СТАТИСТИКА МАТЧА" else "ИТОГИ РАУНДА"
|
resultTitle.Text = if view == "Live" then Text.statistikaMatcha else Text.itogiRaunda
|
||||||
local rule = Rules.get(ruleId)
|
local rule = Rules.get(ruleId)
|
||||||
resultMode.Text = rule.title .. " · Динамическая арена"
|
resultMode.Text = rule.title .. Text.dinamicheskayaArena
|
||||||
if view == "Live" then
|
if view == "Live" then
|
||||||
resultWinner.Text = "СЧЁТ · " .. rule.score
|
resultWinner.Text = Text.schyot .. rule.score
|
||||||
resultWinner.TextColor3 = muted
|
resultWinner.TextColor3 = muted
|
||||||
end
|
end
|
||||||
resultsPanel.Position = UDim2.fromScale(.5, .53)
|
resultsPanel.Position = UDim2.fromScale(.5, .53)
|
||||||
@@ -733,8 +869,8 @@ local function remaining(): number
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function updateLiveClock(seconds: number, phase: string, duration: number)
|
local function updateLiveClock(seconds: number, phase: string, duration: number)
|
||||||
local remainingText = if phase == "Round" then "ДО КОНЦА РАУНДА" else "ДО СЛЕДУЮЩЕГО РАУНДА"
|
local remainingText = if phase == "Round" then Text.doKontsaRaunda else Text.doSleduyuschegoRaunda
|
||||||
nextRound.Text = string.format("%s %02d:%02d · ОТПУСТИТЕ TAB, ЧТОБЫ ЗАКРЫТЬ", remainingText, seconds // 60, seconds % 60)
|
nextRound.Text = string.format(Text.sDDOtpustite, remainingText, seconds // 60, seconds % 60)
|
||||||
if resultDrain then resultDrain:Cancel() end
|
if resultDrain then resultDrain:Cancel() end
|
||||||
resultDrain = TweenService:Create(resultFill, TweenInfo.new(.22, Enum.EasingStyle.Linear), {
|
resultDrain = TweenService:Create(resultFill, TweenInfo.new(.22, Enum.EasingStyle.Linear), {
|
||||||
Size = UDim2.fromScale(math.clamp(seconds / math.max(duration, 1), 0, 1), 1),
|
Size = UDim2.fromScale(math.clamp(seconds / math.max(duration, 1), 0, 1), 1),
|
||||||
@@ -817,18 +953,40 @@ results.OnClientEvent:Connect(function(result: RoundResult, participantSide: str
|
|||||||
if left <= 0 then return end
|
if left <= 0 then return end
|
||||||
if resultsShade.Visible then hideResults() end
|
if resultsShade.Visible then hideResults() end
|
||||||
startSummary("Final", result.ruleset)
|
startSummary("Final", result.ruleset)
|
||||||
|
Sounds.sound("Results")
|
||||||
|
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)
|
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
|
local winnerColor = if result.winner == "Blue" then blue elseif result.winner == "Orange" then orange else UI.Gold
|
||||||
resultWinner.Text = if result.winner == "Blue" then "СИНИЕ ПОБЕДИЛИ"
|
resultWinner.Text = if result.winner == "Blue" then Text.siniePobedili
|
||||||
elseif result.winner == "Orange" then "ОРАНЖЕВЫЕ ПОБЕДИЛИ" else "НИЧЬЯ"
|
elseif result.winner == "Orange" then Text.oranzhevyePobedili else Text.nichYa
|
||||||
if result.siegeReason then resultWinner.Text = result.siegeReason end
|
resultReason.Text = result.reason or result.siegeReason or ""
|
||||||
|
local personal = result.contributions and result.contributions[tostring(player.UserId)] or {}
|
||||||
|
local entries: {string} = {}
|
||||||
|
local keys = RoundStrings.contributionKeys[result.ruleset] or RoundStrings.contributionKeys.TeamDeathmatch
|
||||||
|
for _, key in keys do
|
||||||
|
table.insert(entries, RoundStrings.stats[key] .. " " .. tostring(math.floor(personal[key] or 0)))
|
||||||
|
end
|
||||||
|
contribution.Text = string.format(RoundStrings.contribution, table.concat(entries, " · "))
|
||||||
|
local recap = result.highlights
|
||||||
|
mvpChip.Visible = recap ~= nil and recap.mvpName ~= nil
|
||||||
|
mvpChip.Text = if recap and recap.mvpName then string.format(RoundStrings.mvp, recap.mvpName) else ""
|
||||||
|
table.clear(entries)
|
||||||
|
if recap then
|
||||||
|
for _, line in recap.lines do table.insert(entries, string.format("%s · %s (%d)", line.title, line.name, math.floor(line.value))) end
|
||||||
|
end
|
||||||
|
highlights.Text = table.concat(entries, " / ")
|
||||||
if result.ruleset == "Siege" and (participantSide == "Blue" or participantSide == "Orange") then
|
if result.ruleset == "Siege" and (participantSide == "Blue" or participantSide == "Orange") then
|
||||||
if result.winner == "Draw" then
|
if result.winner == "Draw" then
|
||||||
showOutcome("НИЧЬЯ", ink)
|
showOutcome(Text.nichYa, ink)
|
||||||
elseif result.winner == participantSide then
|
elseif result.winner == participantSide then
|
||||||
showOutcome("ПОБЕДА", UI.Gold)
|
showOutcome(Text.pobeda, UI.Gold)
|
||||||
else
|
else
|
||||||
showOutcome("ПОРАЖЕНИЕ", Color3.fromRGB(255, 105, 111))
|
showOutcome(Text.porazhenie, Color3.fromRGB(255, 105, 111))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resultWinner.TextColor3 = winnerColor
|
resultWinner.TextColor3 = winnerColor
|
||||||
@@ -837,7 +995,7 @@ results.OnClientEvent:Connect(function(result: RoundResult, participantSide: str
|
|||||||
resultFill.Size = UDim2.fromScale(math.clamp(left / result.duration, 0, 1), 1)
|
resultFill.Size = UDim2.fromScale(math.clamp(left / result.duration, 0, 1), 1)
|
||||||
resultEndsAt = result.endsAt
|
resultEndsAt = result.endsAt
|
||||||
lastResultSecond = math.ceil(left)
|
lastResultSecond = math.ceil(left)
|
||||||
resultsCountdown = if result.allowModeChange == false then "СЛЕДУЮЩИЙ РАУНД ЧЕРЕЗ %d С" else "ГОЛОСОВАНИЕ ЧЕРЕЗ %d С"
|
resultsCountdown = if result.allowModeChange == false then Text.sleduyuschiyRaundCherezD else Text.golosovanieCherezDS
|
||||||
nextRound.Text = string.format(resultsCountdown, lastResultSecond)
|
nextRound.Text = string.format(resultsCountdown, lastResultSecond)
|
||||||
resultDrain = TweenService:Create(resultFill, TweenInfo.new(left, Enum.EasingStyle.Linear), {Size = UDim2.fromScale(0, 1)})
|
resultDrain = TweenService:Create(resultFill, TweenInfo.new(left, Enum.EasingStyle.Linear), {Size = UDim2.fromScale(0, 1)})
|
||||||
resultDrain:Play()
|
resultDrain:Play()
|
||||||
@@ -906,6 +1064,10 @@ ContextActionService:BindActionAtPriority(scoreboardAction, function(_, inputSta
|
|||||||
end, false, Enum.ContextActionPriority.High.Value, Enum.KeyCode.Tab)
|
end, false, Enum.ContextActionPriority.High.Value, Enum.KeyCode.Tab)
|
||||||
|
|
||||||
local lastSecond = -1
|
local lastSecond = -1
|
||||||
|
local lastStage: string? = nil
|
||||||
|
local priorClockStage: string? = nil
|
||||||
|
local finalClockPulse: Tween? = nil
|
||||||
|
local lastIntroBeat = -1
|
||||||
local lastPhase = ""
|
local lastPhase = ""
|
||||||
local lastTeam: string? = nil
|
local lastTeam: string? = nil
|
||||||
local lastMode = ""
|
local lastMode = ""
|
||||||
@@ -923,32 +1085,52 @@ local function updateClock()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local seconds = remaining()
|
local seconds = remaining()
|
||||||
local phase = activeState():GetAttribute("Phase") :: string
|
local match = activeState()
|
||||||
|
local phase = match:GetAttribute("Phase") :: string
|
||||||
|
local stage = match:GetAttribute("RoundStage") :: string?
|
||||||
|
local untilLive = match:GetAttribute("LiveAt")
|
||||||
|
local intro = stage == "Briefing" or stage == "Countdown"
|
||||||
|
local introSeconds = if intro and typeof(untilLive) == "number" then math.max(0, math.ceil(untilLive - workspace:GetServerTimeNow())) else 0
|
||||||
|
if intro then seconds = introSeconds end
|
||||||
local team = player:GetAttribute("ArenaTeam") :: string?
|
local team = player:GetAttribute("ArenaTeam") :: string?
|
||||||
local arenaMode = currentMode()
|
local arenaMode = currentMode()
|
||||||
local inArena = player:GetAttribute("InArena") == true
|
local inArena = player:GetAttribute("InArena") == true
|
||||||
if seconds == lastSecond and phase == lastPhase and team == lastTeam and arenaMode == lastMode and inArena == lastInArena then return end
|
if seconds == lastSecond and phase == lastPhase and stage == lastStage and team == lastTeam and arenaMode == lastMode and inArena == lastInArena then return end
|
||||||
local finishing = inArena and phase == "Round" and seconds > 0 and seconds <= 5
|
local nextMini = match:GetAttribute("MiniRoundNextAt")
|
||||||
|
local miniBeat = if typeof(nextMini)=="number" then math.ceil(nextMini-workspace:GetServerTimeNow()) else 0
|
||||||
|
local beat = if stage=="Countdown" then introSeconds elseif miniBeat>0 and miniBeat<=3 then miniBeat else 0
|
||||||
|
local counting = inArena and beat > 0
|
||||||
local hadCountdown = countdown.Visible
|
local hadCountdown = countdown.Visible
|
||||||
if finishing then
|
if counting then
|
||||||
if not countdown.Visible or seconds ~= lastSecond or arenaMode ~= lastMode then showCountdownBeat(seconds) end
|
if not hadCountdown or beat ~= lastIntroBeat then showCountdownBeat(beat) end
|
||||||
|
lastIntroBeat = beat
|
||||||
elseif countdown.Visible then
|
elseif countdown.Visible then
|
||||||
countdown.Visible = false
|
countdown.Visible = false
|
||||||
clearCountdownBeat()
|
clearCountdownBeat()
|
||||||
end
|
end
|
||||||
if captureHud.Visible and hadCountdown ~= countdown.Visible then fitHud() end
|
if captureHud.Visible and hadCountdown ~= countdown.Visible then fitHud() end
|
||||||
lastSecond, lastPhase, lastTeam, lastMode, lastInArena = seconds, phase, team, arenaMode, inArena
|
lastSecond, lastPhase, lastTeam, lastMode, lastInArena = seconds, phase, team, arenaMode, inArena
|
||||||
|
lastStage = stage
|
||||||
local rule = Rules.get(activeState():GetAttribute("Ruleset"))
|
local rule = Rules.get(activeState():GetAttribute("Ruleset"))
|
||||||
if rule.id == "Siege" and inArena then refreshObjective() end
|
if inArena and (rule.id == "Siege" or rule.id == "Domination" or rule.id == "OneLife") then refreshObjective() end
|
||||||
mode.Visible = true
|
mode.Visible = true
|
||||||
mode.Text = if phase == "Vote" then "ГОЛОСОВАНИЕ" elseif phase == "Reveal" then "ДО НАЧАЛА РАУНДА"
|
mode.Text = if intro then RoundStrings.untilStart elseif stage == "RoleSwap" then RoundStrings.swap elseif phase == "Vote" then Text.golosovanie elseif phase == "Reveal" then Text.doNachalaRaunda
|
||||||
elseif phase == "Break" then (if activeState():GetAttribute("AllowModeChange") == false then "ДО НАЧАЛА РАУНДА" else "ДО ГОЛОСОВАНИЯ")
|
elseif phase == "Break" then (if activeState():GetAttribute("AllowModeChange") == false then Text.doNachalaRaunda else Text.doGolosovaniya)
|
||||||
elseif phase == "Round" then (if inArena then "ДО КОНЦА РАУНДА" else rule.title)
|
elseif phase == "Round" then (if inArena then Text.doKontsaRaunda else rule.title)
|
||||||
else "ПОДГОТОВКА АРЕНЫ"
|
else Text.podgotovkaAreny
|
||||||
clock.Position = UDim2.fromOffset(0, 14)
|
clock.Position = UDim2.fromOffset(0, 14)
|
||||||
clock.TextSize = 32
|
clock.TextSize = 32
|
||||||
clock.Text = string.format("%02d:%02d", seconds // 60, seconds % 60)
|
clock.Text = string.format("%02d:%02d", seconds // 60, seconds % 60)
|
||||||
clock.TextColor3 = if seconds <= 15 and phase == "Round" then Color3.fromRGB(255, 218, 148) else ink
|
if stage ~= priorClockStage then
|
||||||
|
priorClockStage = stage
|
||||||
|
if finalClockPulse then finalClockPulse:Cancel(); finalClockPulse = nil end
|
||||||
|
clock.TextColor3 = if stage == "FinalPush" then Color3.fromRGB(255, 106, 107) else ink
|
||||||
|
if stage == "FinalPush" then
|
||||||
|
finalClockPulse = TweenService:Create(clock, TweenInfo.new(.72, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true),
|
||||||
|
{TextColor3 = Color3.fromRGB(255, 193, 175)})
|
||||||
|
finalClockPulse:Play()
|
||||||
|
end
|
||||||
|
end
|
||||||
mode.TextColor3 = if team == "Blue" then blue elseif team == "Orange" then orange else muted
|
mode.TextColor3 = if team == "Blue" then blue elseif team == "Orange" then orange else muted
|
||||||
roundFill.BackgroundColor3 = if seconds <= 15 and phase == "Round" then orange else mode.TextColor3:Lerp(blue, .32)
|
roundFill.BackgroundColor3 = if seconds <= 15 and phase == "Round" then orange else mode.TextColor3:Lerp(blue, .32)
|
||||||
if clockMotion then clockMotion:Cancel() end
|
if clockMotion then clockMotion:Cancel() end
|
||||||
@@ -960,9 +1142,21 @@ local function updateClock()
|
|||||||
clockMotion:Play()
|
clockMotion:Play()
|
||||||
refreshControls()
|
refreshControls()
|
||||||
end
|
end
|
||||||
|
local domConnections: {RBXScriptConnection} = {}
|
||||||
|
for _, key in {"A", "B", "C"} do
|
||||||
|
for _, attr in {"ZoneProgress_", "ZoneOwner_", "ZoneClaim_"} do
|
||||||
|
table.insert(domConnections, activeState():GetAttributeChangedSignal(attr .. key):Connect(refreshObjective))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local modeHintConnection = playerGui:GetAttributeChangedSignal("ModeHint"):Connect(refreshObjective)
|
||||||
|
local siegeHintConnection = playerGui:GetAttributeChangedSignal("SiegeHint"):Connect(refreshObjective)
|
||||||
local timerConnection = RunService.Heartbeat:Connect(updateClock)
|
local timerConnection = RunService.Heartbeat:Connect(updateClock)
|
||||||
script.Destroying:Once(function()
|
script.Destroying:Once(function()
|
||||||
timerConnection:Disconnect()
|
timerConnection:Disconnect()
|
||||||
|
siegeHintConnection:Disconnect()
|
||||||
|
modeHintConnection:Disconnect()
|
||||||
|
for _, connection in domConnections do connection:Disconnect() end
|
||||||
|
if finalClockPulse then finalClockPulse:Cancel() end
|
||||||
votingChanged:Disconnect()
|
votingChanged:Disconnect()
|
||||||
scoreboardFocus:Disconnect()
|
scoreboardFocus:Disconnect()
|
||||||
ContextActionService:UnbindAction(scoreboardAction)
|
ContextActionService:UnbindAction(scoreboardAction)
|
||||||
|
|||||||
+175
-16
@@ -7,13 +7,23 @@ local Rules = require(ReplicatedStorage:WaitForChild("MatchRules") :: ModuleScri
|
|||||||
local Hosting = require(ReplicatedStorage:WaitForChild("HostedArena") :: ModuleScript)
|
local Hosting = require(ReplicatedStorage:WaitForChild("HostedArena") :: ModuleScript)
|
||||||
local Objectives = require(script.Parent:WaitForChild("ArenaObjectives") :: ModuleScript)
|
local Objectives = require(script.Parent:WaitForChild("ArenaObjectives") :: ModuleScript)
|
||||||
local SiegeConfig = require(ReplicatedStorage:WaitForChild("CitadelAssaultConfig") :: ModuleScript)
|
local SiegeConfig = require(ReplicatedStorage:WaitForChild("CitadelAssaultConfig") :: ModuleScript)
|
||||||
|
local Hunter = ReplicatedStorage:WaitForChild("Hunter")
|
||||||
|
local Profiles = require(Hunter:WaitForChild("ModeProfiles") :: ModuleScript)
|
||||||
|
local Timeline = require(Hunter:WaitForChild("Timeline") :: ModuleScript)
|
||||||
|
local Stage = require(Hunter:WaitForChild("Stage") :: ModuleScript)
|
||||||
|
local RoundConfig = require(Hunter:WaitForChild("RoundConfig") :: ModuleScript)
|
||||||
|
local Strings = require(Hunter:WaitForChild("Strings") :: ModuleScript)
|
||||||
|
local Text = Strings.interface.ArenaRounds
|
||||||
|
local Runtime = script.Parent:WaitForChild("ModeRuntime")
|
||||||
|
local RoundPlayer = require(Runtime:WaitForChild("PlayerRoundState") :: ModuleScript)
|
||||||
|
local Stats = require(Runtime:WaitForChild("Stats") :: ModuleScript)
|
||||||
|
|
||||||
local ArenaSpawns = require(script.Parent:WaitForChild("ArenaSpawns"))
|
local ArenaSpawns = require(script.Parent:WaitForChild("ArenaSpawns"))
|
||||||
|
local SiegeSpawn = require(script.Parent:WaitForChild("CitadelSpawnService") :: ModuleScript)
|
||||||
local SkinCatalog = require(ReplicatedStorage:WaitForChild("RifleSkinCatalog") :: ModuleScript)
|
local SkinCatalog = require(ReplicatedStorage:WaitForChild("RifleSkinCatalog") :: ModuleScript)
|
||||||
local lobbySpawn = workspace:WaitForChild("HunterLobby"):WaitForChild("Arrival Spawn") :: SpawnLocation
|
local lobbySpawn = workspace:WaitForChild("HunterLobby"):WaitForChild("Arrival Spawn") :: SpawnLocation
|
||||||
local rifleTemplate = ReplicatedStorage:WaitForChild("ArenaEquipment"):WaitForChild("SniperRifle") :: Tool
|
local rifleTemplate = ReplicatedStorage:WaitForChild("ArenaEquipment"):WaitForChild("SniperRifle") :: Tool
|
||||||
|
|
||||||
local ROUND_SECONDS = 300
|
|
||||||
local BREAK_SECONDS = 15
|
local BREAK_SECONDS = 15
|
||||||
local VOTE_SECONDS = 15
|
local VOTE_SECONDS = 15
|
||||||
local TEAM_REVEAL_SECONDS = 1.05
|
local TEAM_REVEAL_SECONDS = 1.05
|
||||||
@@ -55,14 +65,14 @@ randomState.Parent = state
|
|||||||
|
|
||||||
type Side = Hosting.Side
|
type Side = Hosting.Side
|
||||||
type Match = {id: string, state: Folder, blue: Team, orange: Team, phase: string, endsAt: number, order: number,
|
type Match = {id: string, state: Folder, blue: Team, orange: Team, phase: string, endsAt: number, order: number,
|
||||||
rule: string, allowModeChange: boolean, engine: Objectives.Match?, eligible: {[Player]: Side}, ballots: {[Player]: string}}
|
rule: string, startedAt: number?, liveAt: number?, allowModeChange: boolean, engine: Objectives.Match?, eligible: {[Player]: Side}, ballots: {[Player]: string}}
|
||||||
type PendingJoin = {match: Match, side: Side, endsAt: number}
|
type PendingJoin = {match: Match, side: Side, endsAt: number}
|
||||||
local pendingJoins: {[Player]: PendingJoin} = {}
|
local pendingJoins: {[Player]: PendingJoin} = {}
|
||||||
local matches: {[string]: Match} = {
|
local matches: {[string]: Match} = {
|
||||||
[Modes.Procedural] = {
|
[Modes.Procedural] = {
|
||||||
id = Modes.Procedural, state = randomState,
|
id = Modes.Procedural, state = randomState,
|
||||||
blue = makeTeam("Синие", BrickColor.new("Cyan")),
|
blue = makeTeam(Text.sinie, BrickColor.new("Cyan")),
|
||||||
orange = makeTeam("Оранжевые", BrickColor.new("Deep orange")),
|
orange = makeTeam(Text.oranzhevye, BrickColor.new("Deep orange")),
|
||||||
phase = "Setup", endsAt = 0, order = 0, rule = Rules.Default, allowModeChange = true, eligible = {}, ballots = {},
|
phase = "Setup", endsAt = 0, order = 0, rule = Rules.Default, allowModeChange = true, eligible = {}, ballots = {},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -161,6 +171,7 @@ local function guardInventory(player: Player, container: Instance)
|
|||||||
local function disarmed(): boolean
|
local function disarmed(): boolean
|
||||||
return player:GetAttribute("InArena") ~= true or player:GetAttribute("ArenaWaiting") == true
|
return player:GetAttribute("InArena") ~= true or player:GetAttribute("ArenaWaiting") == true
|
||||||
or player:GetAttribute("ArenaIntermission") == true
|
or player:GetAttribute("ArenaIntermission") == true
|
||||||
|
or not Stage.combatAllowed(randomState)
|
||||||
end
|
end
|
||||||
container.ChildAdded:Connect(function(child)
|
container.ChildAdded:Connect(function(child)
|
||||||
if child:IsA("Tool") and disarmed() then child:Destroy() end
|
if child:IsA("Tool") and disarmed() then child:Destroy() end
|
||||||
@@ -176,10 +187,14 @@ end
|
|||||||
local function recordDeath(player: Player, character: Model)
|
local function recordDeath(player: Player, character: Model)
|
||||||
if not roster[player] or placedCharacter[player] ~= character or lastCountedDeath[player] == character then return end
|
if not roster[player] or placedCharacter[player] ~= character or lastCountedDeath[player] == character then return end
|
||||||
lastCountedDeath[player] = character
|
lastCountedDeath[player] = character
|
||||||
|
Stats.add(player, "deaths", 1)
|
||||||
player:SetAttribute("RoundDeaths", ((player:GetAttribute("RoundDeaths") :: number?) or 0) + 1)
|
player:SetAttribute("RoundDeaths", ((player:GetAttribute("RoundDeaths") :: number?) or 0) + 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function moveToLobby(player: Player)
|
local function moveToLobby(player: Player)
|
||||||
|
RoundPlayer.thaw(player)
|
||||||
|
RoundPlayer.clearShield(player)
|
||||||
|
player:SetAttribute("RoundRespawnAt", nil)
|
||||||
placedCharacter[player] = nil
|
placedCharacter[player] = nil
|
||||||
player:SetAttribute("InArena", false)
|
player:SetAttribute("InArena", false)
|
||||||
player.RespawnLocation = lobbySpawn
|
player.RespawnLocation = lobbySpawn
|
||||||
@@ -198,6 +213,7 @@ local function sendToLobby(player: Player)
|
|||||||
roster[player] = nil
|
roster[player] = nil
|
||||||
joinOrder[player] = nil
|
joinOrder[player] = nil
|
||||||
lastCountedDeath[player] = nil
|
lastCountedDeath[player] = nil
|
||||||
|
Stats.remove(player)
|
||||||
moveToLobby(player)
|
moveToLobby(player)
|
||||||
player:SetAttribute("ArenaWaiting", nil)
|
player:SetAttribute("ArenaWaiting", nil)
|
||||||
player:SetAttribute("ArenaIntermission", nil)
|
player:SetAttribute("ArenaIntermission", nil)
|
||||||
@@ -221,7 +237,24 @@ local function enterArena(player: Player, character: Model, humanoid: Humanoid)
|
|||||||
local destination = destinationFor(player)
|
local destination = destinationFor(player)
|
||||||
player.RespawnLocation = destination
|
player.RespawnLocation = destination
|
||||||
ArenaSpawns.place(character, destination)
|
ArenaSpawns.place(character, destination)
|
||||||
|
local siege = randomState:FindFirstChild("CitadelMatchState")
|
||||||
|
local side = player:GetAttribute("ArenaTeam")
|
||||||
|
local attacker = siege and siege:GetAttribute("Attacker")
|
||||||
|
local base = siege and typeof(side) == "string" and siege:GetAttribute(side .. "Base")
|
||||||
|
if siege and typeof(base) == "Vector3" and typeof(attacker) == "string"
|
||||||
|
and randomState:GetAttribute("RoundStage") ~= "RoleSwap" then
|
||||||
|
local at = SiegeSpawn.position(Modes.geometry(Modes.of(player)), attacker == side, base, joinOrder[player] or 1)
|
||||||
|
character:PivotTo(CFrame.new(at + Vector3.yAxis * 4))
|
||||||
|
end
|
||||||
|
if Stage.combatAllowed(randomState) then
|
||||||
|
RoundPlayer.thaw(player)
|
||||||
arm(player, character, humanoid)
|
arm(player, character, humanoid)
|
||||||
|
else
|
||||||
|
clearTools(character)
|
||||||
|
clearTools(player:FindFirstChildOfClass("Backpack"))
|
||||||
|
RoundPlayer.clearShield(player)
|
||||||
|
RoundPlayer.freeze(player, character, humanoid)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function deploy(player: Player)
|
local function deploy(player: Player)
|
||||||
@@ -239,6 +272,7 @@ local function deploy(player: Player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function stageOnArena(player: Player)
|
local function stageOnArena(player: Player)
|
||||||
|
RoundPlayer.clearShield(player)
|
||||||
placedCharacter[player] = nil
|
placedCharacter[player] = nil
|
||||||
player:SetAttribute("InArena", true)
|
player:SetAttribute("InArena", true)
|
||||||
local destination = destinationFor(player)
|
local destination = destinationFor(player)
|
||||||
@@ -258,6 +292,7 @@ local function bench(player: Player)
|
|||||||
if character and humanoid and humanoid.Health > 0 then
|
if character and humanoid and humanoid.Health > 0 then
|
||||||
humanoid.Health = humanoid.MaxHealth
|
humanoid.Health = humanoid.MaxHealth
|
||||||
ArenaSpawns.place(character, destination)
|
ArenaSpawns.place(character, destination)
|
||||||
|
if not Stage.combatAllowed(randomState) then RoundPlayer.freeze(player, character, humanoid) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -265,6 +300,17 @@ local function enterRound(player: Player, match: Match)
|
|||||||
if match.rule == "OneLife" then bench(player) else deploy(player) end
|
if match.rule == "OneLife" then bench(player) else deploy(player) end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function spawnCharacter(player: Player, previous: Model?)
|
||||||
|
-- Загружаем персонажа только пока действителен конкретный запрос на возрождение.
|
||||||
|
for attempt = 1, 2 do
|
||||||
|
if player.Parent ~= Players or player.Character ~= previous then return end
|
||||||
|
local ok, issue = pcall(player.LoadCharacterAsync, player)
|
||||||
|
if ok then return end
|
||||||
|
warn(Text.neUdalosVozroditIgroka, issue)
|
||||||
|
if attempt == 1 then task.wait(1) end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function onCharacter(player: Player, character: Model)
|
local function onCharacter(player: Player, character: Model)
|
||||||
local root = character:WaitForChild("HumanoidRootPart", 10)
|
local root = character:WaitForChild("HumanoidRootPart", 10)
|
||||||
local humanoid = character:WaitForChild("Humanoid", 10)
|
local humanoid = character:WaitForChild("Humanoid", 10)
|
||||||
@@ -278,26 +324,42 @@ local function onCharacter(player: Player, character: Model)
|
|||||||
humanoid.HealthChanged:Connect(replicateHealth)
|
humanoid.HealthChanged:Connect(replicateHealth)
|
||||||
replicateHealth()
|
replicateHealth()
|
||||||
humanoid.Died:Once(function()
|
humanoid.Died:Once(function()
|
||||||
|
if player.Character ~= character then return end
|
||||||
|
RoundPlayer.thaw(player)
|
||||||
|
RoundPlayer.clearShield(player)
|
||||||
local match = matches[Modes.of(player)]
|
local match = matches[Modes.of(player)]
|
||||||
local engine = match.engine
|
local engine = match.engine
|
||||||
local wasFighting = roster[player] ~= nil and placedCharacter[player] == character
|
local fightingStage = match.phase == "Round" and Stage.combatAllowed(match.state)
|
||||||
recordDeath(player, character)
|
local wasFighting = roster[player] ~= nil and placedCharacter[player] == character and fightingStage
|
||||||
if player.Character == character then resetStreak(player) end
|
local roundRespawn = roster[player] ~= nil and match.phase == "Round" and match.rule ~= "OneLife"
|
||||||
if wasFighting and engine and match.phase == "Round" then
|
|
||||||
local position = if root:IsA("BasePart") then root.Position else nil
|
|
||||||
local now = workspace:GetServerTimeNow()
|
local now = workspace:GetServerTimeNow()
|
||||||
|
local delay = if roundRespawn then Profiles[match.rule].respawnDelay else Players.RespawnTime
|
||||||
|
if roundRespawn then player:SetAttribute("RoundRespawnAt", now + delay) end
|
||||||
|
task.delay(delay, spawnCharacter, player, character)
|
||||||
|
if fightingStage then recordDeath(player, character) end
|
||||||
|
resetStreak(player)
|
||||||
|
if wasFighting and engine then
|
||||||
|
local position = if root:IsA("BasePart") then root.Position else nil
|
||||||
task.defer(function()
|
task.defer(function()
|
||||||
if match.engine == engine and roster[player] and placedCharacter[player] == character then engine.death(player, position, now) end
|
if match.engine == engine and roster[player] and placedCharacter[player] == character then engine.death(player, position, now) end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
local respawning = player:GetAttribute("RoundRespawnAt") ~= nil
|
||||||
|
player:SetAttribute("RoundRespawnAt", nil)
|
||||||
if roster[player] and player:GetAttribute("InArena") == true then
|
if roster[player] and player:GetAttribute("InArena") == true then
|
||||||
if player:GetAttribute("ArenaIntermission") == true or player:GetAttribute("ArenaWaiting") == true then
|
if player:GetAttribute("ArenaIntermission") == true or player:GetAttribute("ArenaWaiting") == true then
|
||||||
local destination = player.RespawnLocation or destinationFor(player)
|
local destination = player.RespawnLocation or destinationFor(player)
|
||||||
player.RespawnLocation = destination
|
player.RespawnLocation = destination
|
||||||
ArenaSpawns.place(character, destination)
|
ArenaSpawns.place(character, destination)
|
||||||
|
if player:GetAttribute("ArenaIntermission") ~= true and not Stage.combatAllowed(randomState) then
|
||||||
|
RoundPlayer.freeze(player, character, humanoid)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
enterArena(player, character, humanoid)
|
enterArena(player, character, humanoid)
|
||||||
|
if respawning and Stage.combatAllowed(randomState) then
|
||||||
|
RoundPlayer.shield(player, character, Profiles[matches[Modes.of(player)].rule].spawnProtection)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
ArenaSpawns.place(character, lobbySpawn)
|
ArenaSpawns.place(character, lobbySpawn)
|
||||||
@@ -319,9 +381,12 @@ local function onPlayer(player: Player)
|
|||||||
if player.Character then
|
if player.Character then
|
||||||
guardInventory(player, player.Character)
|
guardInventory(player, player.Character)
|
||||||
task.spawn(onCharacter, player, player.Character)
|
task.spawn(onCharacter, player, player.Character)
|
||||||
|
else
|
||||||
|
task.defer(spawnCharacter, player, nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Players.CharacterAutoLoads = false
|
||||||
Players.PlayerAdded:Connect(onPlayer)
|
Players.PlayerAdded:Connect(onPlayer)
|
||||||
for _, player in Players:GetPlayers() do onPlayer(player) end
|
for _, player in Players:GetPlayers() do onPlayer(player) end
|
||||||
|
|
||||||
@@ -349,6 +414,9 @@ local function broadcastVotes(match: Match)
|
|||||||
end
|
end
|
||||||
|
|
||||||
Players.PlayerRemoving:Connect(function(player)
|
Players.PlayerRemoving:Connect(function(player)
|
||||||
|
RoundPlayer.thaw(player)
|
||||||
|
RoundPlayer.clearShield(player)
|
||||||
|
Stats.remove(player)
|
||||||
local wasPlaying = roster[player] ~= nil
|
local wasPlaying = roster[player] ~= nil
|
||||||
local match = matches[Modes.of(player)]
|
local match = matches[Modes.of(player)]
|
||||||
local engine = match.engine
|
local engine = match.engine
|
||||||
@@ -529,8 +597,13 @@ cycleSkin.OnServerEvent:Connect(function(player: Player)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
local function publish(match: Match)
|
local function publish(match: Match)
|
||||||
local duration = if match.phase == "Round" then ROUND_SECONDS elseif match.phase == "Vote" then VOTE_SECONDS
|
local duration = if match.phase == "Round" then match.endsAt - (match.startedAt or match.endsAt) elseif match.phase == "Vote" then VOTE_SECONDS
|
||||||
elseif match.phase == "Reveal" then Rules.VoteRevealSeconds else BREAK_SECONDS
|
elseif match.phase == "Reveal" then Rules.VoteRevealSeconds else BREAK_SECONDS
|
||||||
|
if match.phase ~= "Round" then
|
||||||
|
match.state:SetAttribute("RoundStage", nil)
|
||||||
|
match.state:SetAttribute("StageEndsAt", nil)
|
||||||
|
match.state:SetAttribute("LiveAt", nil)
|
||||||
|
end
|
||||||
match.state:SetAttribute("PhaseDuration", duration)
|
match.state:SetAttribute("PhaseDuration", duration)
|
||||||
match.state:SetAttribute("EndsAt", match.endsAt)
|
match.state:SetAttribute("EndsAt", match.endsAt)
|
||||||
match.state:SetAttribute("Phase", match.phase)
|
match.state:SetAttribute("Phase", match.phase)
|
||||||
@@ -592,8 +665,12 @@ local function startRound(match: Match)
|
|||||||
match.state:SetAttribute("MapGeneration", arena:GetAttribute("Generation"))
|
match.state:SetAttribute("MapGeneration", arena:GetAttribute("Generation"))
|
||||||
match.state:SetAttribute("MapLayout", arena:GetAttribute("LayoutVariant"))
|
match.state:SetAttribute("MapLayout", arena:GetAttribute("LayoutVariant"))
|
||||||
local now = workspace:GetServerTimeNow()
|
local now = workspace:GetServerTimeNow()
|
||||||
|
local profile = Profiles[match.rule]
|
||||||
|
local roundDuration = profile.roundSeconds + (if match.rule == "Siege" then SiegeConfig.SWAP_FREEZE else 0)
|
||||||
|
local liveAt = Timeline.liveAt(now, profile.briefingSeconds, profile.countdownSeconds)
|
||||||
|
Stats.reset()
|
||||||
local ok, engine = pcall(Objectives.start, {
|
local ok, engine = pcall(Objectives.start, {
|
||||||
arena = match.id, rule = match.rule, state = match.state, now = now, duration = ROUND_SECONDS,
|
arena = match.id, rule = match.rule, state = match.state, now = liveAt, duration = roundDuration,
|
||||||
bench = bench, deploy = deploy,
|
bench = bench, deploy = deploy,
|
||||||
balanceWaiting = function() balanceWaiting(match) end,
|
balanceWaiting = function() balanceWaiting(match) end,
|
||||||
members = function(): {Player}
|
members = function(): {Player}
|
||||||
@@ -609,8 +686,11 @@ local function startRound(match: Match)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
match.engine = engine
|
match.engine = engine
|
||||||
local roundDuration = if match.rule == "Siege" then SiegeConfig.MATCH_DURATION + SiegeConfig.SWAP_FREEZE else ROUND_SECONDS
|
match.startedAt, match.liveAt = now, liveAt
|
||||||
match.phase, match.endsAt = "Round", now + roundDuration
|
match.phase, match.endsAt = "Round", liveAt + roundDuration
|
||||||
|
match.state:SetAttribute("LiveAt", liveAt)
|
||||||
|
match.state:SetAttribute("StageEndsAt", now + profile.briefingSeconds)
|
||||||
|
match.state:SetAttribute("RoundStage", "Briefing")
|
||||||
match.state:SetAttribute("Ruleset", match.rule)
|
match.state:SetAttribute("Ruleset", match.rule)
|
||||||
match.state:SetAttribute("BlueKills", 0)
|
match.state:SetAttribute("BlueKills", 0)
|
||||||
match.state:SetAttribute("OrangeKills", 0)
|
match.state:SetAttribute("OrangeKills", 0)
|
||||||
@@ -629,7 +709,7 @@ local function finishRound(match: Match)
|
|||||||
if team ~= match.blue and team ~= match.orange then continue end
|
if team ~= match.blue and team ~= match.orange then continue end
|
||||||
local character = player.Character
|
local character = player.Character
|
||||||
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
|
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
|
||||||
if character and humanoid and humanoid.Health <= 0 then recordDeath(player, character) end
|
if character and humanoid and humanoid.Health <= 0 and Stage.combatAllowed(match.state) then recordDeath(player, character) end
|
||||||
table.insert(participants, {player = player, side = if team == match.blue then "Blue" else "Orange"})
|
table.insert(participants, {player = player, side = if team == match.blue then "Blue" else "Orange"})
|
||||||
table.insert(if team == match.blue then bluePlayers else orangePlayers, {
|
table.insert(if team == match.blue then bluePlayers else orangePlayers, {
|
||||||
userId = player.UserId,
|
userId = player.UserId,
|
||||||
@@ -655,11 +735,41 @@ local function finishRound(match: Match)
|
|||||||
local winner = if engine then engine.winner() else "Draw"
|
local winner = if engine then engine.winner() else "Draw"
|
||||||
local siegeState = match.state:FindFirstChild("CitadelMatchState")
|
local siegeState = match.state:FindFirstChild("CitadelMatchState")
|
||||||
local siegeTimes = if siegeState then siegeState:GetAttributes() else nil
|
local siegeTimes = if siegeState then siegeState:GetAttributes() else nil
|
||||||
|
local rows: {Stats.Row} = {}
|
||||||
|
local contributions: {[string]: {[string]: number}} = {}
|
||||||
|
local names: {[number]: string} = {}
|
||||||
|
for _, entry in participants do
|
||||||
|
local player = entry.player
|
||||||
|
if winner == entry.side then Stats.add(player, "wins", 1) end
|
||||||
|
local record = Stats.get(player)
|
||||||
|
contributions[tostring(player.UserId)] = record
|
||||||
|
names[player.UserId] = player.DisplayName
|
||||||
|
table.insert(rows, {userId = player.UserId, stats = record})
|
||||||
|
end
|
||||||
|
local mvp = Stats.mvp(rows, RoundConfig.mvpWeights)
|
||||||
|
local lines = {}
|
||||||
|
for _, key in Strings.round.highlightOrder do
|
||||||
|
local best: Stats.Row? = nil
|
||||||
|
for _, row in rows do
|
||||||
|
local value = row.stats[key] or 0
|
||||||
|
local bestValue = if best then best.stats[key] or 0 else 0
|
||||||
|
if value > 0 and (not best or value > bestValue or (value == bestValue and row.userId < best.userId)) then
|
||||||
|
best = row
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if best then
|
||||||
|
table.insert(lines, {title = Strings.round.stats[key], name = names[best.userId], value = best.stats[key]})
|
||||||
|
if #lines == 3 then break end
|
||||||
|
end
|
||||||
|
end
|
||||||
local snapshot = {
|
local snapshot = {
|
||||||
mode = match.id,
|
mode = match.id,
|
||||||
ruleset = match.rule,
|
ruleset = match.rule,
|
||||||
allowModeChange = match.allowModeChange,
|
allowModeChange = match.allowModeChange,
|
||||||
winner = winner,
|
winner = winner,
|
||||||
|
reason = match.state:GetAttribute("ResultReason") or (if winner == "Draw" then Strings.round.drawReason else Strings.round.scoreReason),
|
||||||
|
highlights = {mvpUserId = mvp, mvpName = if mvp then names[mvp] else nil, lines = lines},
|
||||||
|
contributions = contributions,
|
||||||
siegeReason = if siegeState then match.state:GetAttribute("CitadelResultReason") else nil,
|
siegeReason = if siegeState then match.state:GetAttribute("CitadelResultReason") else nil,
|
||||||
siegeTimes = siegeTimes,
|
siegeTimes = siegeTimes,
|
||||||
endsAt = match.endsAt,
|
endsAt = match.endsAt,
|
||||||
@@ -673,6 +783,9 @@ local function finishRound(match: Match)
|
|||||||
for _, entry in participants do
|
for _, entry in participants do
|
||||||
local player = entry.player
|
local player = entry.player
|
||||||
match.eligible[player] = entry.side
|
match.eligible[player] = entry.side
|
||||||
|
RoundPlayer.thaw(player)
|
||||||
|
RoundPlayer.clearShield(player)
|
||||||
|
player:SetAttribute("RoundRespawnAt", nil)
|
||||||
player:SetAttribute("ArenaIntermission", true)
|
player:SetAttribute("ArenaIntermission", true)
|
||||||
local wasInArena = player:GetAttribute("InArena") == true
|
local wasInArena = player:GetAttribute("InArena") == true
|
||||||
player:SetAttribute("ArenaWaiting", nil)
|
player:SetAttribute("ArenaWaiting", nil)
|
||||||
@@ -720,9 +833,40 @@ local function finishVote(match: Match, now: number)
|
|||||||
startRound(match)
|
startRound(match)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function advanceStage(match: Match, now: number): number
|
||||||
|
local profile = Profiles[match.rule]
|
||||||
|
local stage, boundary = Timeline.stage(match.startedAt or now, match.endsAt, profile.briefingSeconds,
|
||||||
|
profile.countdownSeconds, profile.finalPushSeconds, now)
|
||||||
|
local previous = match.state:GetAttribute("RoundStage")
|
||||||
|
if previous == "RoleSwap" then
|
||||||
|
return (match.state:GetAttribute("StageEndsAt") :: number?) or boundary
|
||||||
|
end
|
||||||
|
if previous ~= stage then
|
||||||
|
match.state:SetAttribute("StageEndsAt", boundary)
|
||||||
|
match.state:SetAttribute("RoundStage", stage)
|
||||||
|
if stage == "Live" or stage == "FinalPush" then
|
||||||
|
for player, team in roster do
|
||||||
|
if team ~= match.blue and team ~= match.orange then continue end
|
||||||
|
RoundPlayer.thaw(player)
|
||||||
|
local character = player.Character
|
||||||
|
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
|
||||||
|
if character and humanoid and humanoid.Health > 0 and player:GetAttribute("ArenaWaiting") ~= true then
|
||||||
|
arm(player, character, humanoid)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return boundary
|
||||||
|
end
|
||||||
|
|
||||||
local function runMatch(match: Match)
|
local function runMatch(match: Match)
|
||||||
while true do
|
while true do
|
||||||
local now = workspace:GetServerTimeNow()
|
local now = workspace:GetServerTimeNow()
|
||||||
|
local siegeDeadline = match.state:GetAttribute("SiegeEndsAt")
|
||||||
|
if match.phase == "Round" and typeof(siegeDeadline) == "number" and siegeDeadline < match.endsAt then
|
||||||
|
match.endsAt = siegeDeadline
|
||||||
|
publish(match)
|
||||||
|
end
|
||||||
local remaining = match.endsAt - now
|
local remaining = match.endsAt - now
|
||||||
if match.phase == "Round" then
|
if match.phase == "Round" then
|
||||||
local engine = match.engine
|
local engine = match.engine
|
||||||
@@ -737,8 +881,23 @@ local function runMatch(match: Match)
|
|||||||
match.rule = choices[modeRandom:NextInteger(1, #choices)]
|
match.rule = choices[modeRandom:NextInteger(1, #choices)]
|
||||||
end
|
end
|
||||||
startRound(match)
|
startRound(match)
|
||||||
elseif remaining <= 0 or (engine and engine.step(now)) then finishRound(match)
|
elseif remaining <= 0 then
|
||||||
else task.wait(math.min(remaining, if match.rule == "Siege" then SiegeConfig.CHECK_INTERVAL else .2)) end
|
finishRound(match)
|
||||||
|
else
|
||||||
|
local boundary = advanceStage(match, now)
|
||||||
|
local wasSwap = match.state:GetAttribute("RoundStage") == "RoleSwap"
|
||||||
|
if now >= (match.liveAt or now) and engine and engine.step(now) then
|
||||||
|
finishRound(match)
|
||||||
|
else
|
||||||
|
if wasSwap and match.state:GetAttribute("RoundStage") == "Live" then
|
||||||
|
-- Режим завершил паузу и разрешил боевой этап.
|
||||||
|
match.state:SetAttribute("RoundStage", nil)
|
||||||
|
boundary = advanceStage(match, now)
|
||||||
|
end
|
||||||
|
local interval = if match.rule == "Siege" then SiegeConfig.CHECK_INTERVAL else .2
|
||||||
|
task.wait(math.min(remaining, interval, math.max(.01, boundary - now)))
|
||||||
|
end
|
||||||
|
end
|
||||||
elseif remaining > 0 then
|
elseif remaining > 0 then
|
||||||
task.wait(remaining)
|
task.wait(remaining)
|
||||||
elseif match.phase == "Break" and match.allowModeChange then
|
elseif match.phase == "Break" and match.allowModeChange then
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
local Players = game:GetService("Players")
|
local Players = game:GetService("Players")
|
||||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
local Modes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScript)
|
local Modes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScript)
|
||||||
|
local RoundConfig = require(ReplicatedStorage:WaitForChild("Hunter"):WaitForChild("RoundConfig") :: ModuleScript)
|
||||||
local random = Random.new()
|
local random = Random.new()
|
||||||
local ArenaSpawns = {}
|
local ArenaSpawns = {}
|
||||||
|
|
||||||
@@ -20,24 +21,35 @@ function ArenaSpawns.choose(player: Player): SpawnLocation
|
|||||||
assert(#choices > 0, arena.Name .. " has no enabled spawns for this team")
|
assert(#choices > 0, arena.Name .. " has no enabled spawns for this team")
|
||||||
local best = choices[random:NextInteger(1, #choices)]
|
local best = choices[random:NextInteger(1, #choices)]
|
||||||
local bestDistance = -1
|
local bestDistance = -1
|
||||||
|
local bestSafe: SpawnLocation? = nil
|
||||||
|
local bestSafeScore = -1
|
||||||
for _, marker in choices do
|
for _, marker in choices do
|
||||||
local nearest = 1000
|
local nearest = 1000
|
||||||
|
local enemyDistance = math.huge
|
||||||
for _, other in Players:GetPlayers() do
|
for _, other in Players:GetPlayers() do
|
||||||
local character = other.Character
|
local character = other.Character
|
||||||
local root = character and character:FindFirstChild("HumanoidRootPart")
|
local root = character and character:FindFirstChild("HumanoidRootPart")
|
||||||
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
|
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
|
||||||
if other ~= player and other:GetAttribute("InArena") == true and Modes.same(player, other)
|
if other ~= player and other:GetAttribute("InArena") == true and Modes.same(player, other)
|
||||||
and root and root:IsA("BasePart") and humanoid and humanoid.Health > 0 then
|
and root and root:IsA("BasePart") and humanoid and humanoid.Health > 0 then
|
||||||
nearest = math.min(nearest, (root.Position - marker.Position).Magnitude)
|
local distance = (root.Position - marker.Position).Magnitude
|
||||||
|
nearest = math.min(nearest, distance)
|
||||||
|
local otherSide = other:GetAttribute("ArenaTeam")
|
||||||
|
if otherSide ~= nil and otherSide ~= side and other:GetAttribute("ArenaWaiting") ~= true then
|
||||||
|
enemyDistance = math.min(enemyDistance, distance)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local score = nearest + random:NextNumber(0, 24)
|
local score = nearest + random:NextNumber(0, 24)
|
||||||
|
if enemyDistance >= RoundConfig.safeSpawnDistance and score > bestSafeScore then
|
||||||
|
bestSafe, bestSafeScore = marker, score
|
||||||
|
end
|
||||||
if score > bestDistance then
|
if score > bestDistance then
|
||||||
bestDistance = score
|
bestDistance = score
|
||||||
best = marker
|
best = marker
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return best
|
return bestSafe or best
|
||||||
end
|
end
|
||||||
|
|
||||||
function ArenaSpawns.place(character: Model, marker: SpawnLocation)
|
function ArenaSpawns.place(character: Model, marker: SpawnLocation)
|
||||||
|
|||||||
@@ -3,6 +3,14 @@ return table.freeze({
|
|||||||
MATCH_DURATION = 300,
|
MATCH_DURATION = 300,
|
||||||
ATTACK_DURATION = 150,
|
ATTACK_DURATION = 150,
|
||||||
CAPTURE_TIME = 4,
|
CAPTURE_TIME = 4,
|
||||||
|
CAPTURE_RADIUS = 11,
|
||||||
|
EARLY_FINISH_WHEN_ALL_TAKEN = false,
|
||||||
|
SWAP_WARNING = 10,
|
||||||
|
LIGHT_HEIGHT = 46,
|
||||||
|
MATERIALIZE_SECONDS = .6,
|
||||||
|
CAPTURE_EFFECT_SECONDS = .55,
|
||||||
|
CONFETTI_COUNT = 24,
|
||||||
|
CONTESTED_COLOR = Color3.fromRGB(255, 81, 105),
|
||||||
DECAY_MULTIPLIER = 0.5,
|
DECAY_MULTIPLIER = 0.5,
|
||||||
HEIGHT_TOLERANCE = 7,
|
HEIGHT_TOLERANCE = 7,
|
||||||
POINTS_PER_OBJECTIVE = 1,
|
POINTS_PER_OBJECTIVE = 1,
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.CitadelScoreService
|
||||||
|
|
||||||
local Score = {}
|
local Score = {}
|
||||||
export type Side = "Blue" | "Orange"
|
export type Side = "Blue" | "Orange"
|
||||||
export type Ledger = {[Side]: {number}}
|
export type Ledger = {[Side]: {number}}
|
||||||
@@ -13,16 +15,16 @@ function Score.winner(ledger: Ledger, epsilon: number): (string, string)
|
|||||||
local b, o = #ledger.Blue, #ledger.Orange
|
local b, o = #ledger.Blue, #ledger.Orange
|
||||||
if b ~= o then
|
if b ~= o then
|
||||||
local side = if b > o then "Blue" else "Orange"
|
local side = if b > o then "Blue" else "Orange"
|
||||||
return side, side .. " взяли больше рубежей"
|
return side, side .. Text.vzyaliBolSheRubezhey
|
||||||
end
|
end
|
||||||
if b == 0 then return "Draw", "Ничья: обе команды без захватов" end
|
if b == 0 then return "Draw", Text.nichYaObeKomandy end
|
||||||
local blue, orange = ledger.Blue[b], ledger.Orange[o]
|
local blue, orange = ledger.Blue[b], ledger.Orange[o]
|
||||||
if math.abs(blue - orange) <= epsilon then return "Draw", "Ничья: время захвата совпало" end
|
if math.abs(blue - orange) <= epsilon then return "Draw", Text.nichYaVremyaZakhvata end
|
||||||
local side = if blue < orange then "Blue" else "Orange"
|
local side = if blue < orange then "Blue" else "Orange"
|
||||||
local function clock(t: number): string
|
local function clock(t: number): string
|
||||||
return string.format("%d:%05.2f", math.floor(t / 60), t % 60)
|
return string.format("%d:%05.2f", math.floor(t / 60), t % 60)
|
||||||
end
|
end
|
||||||
return side, string.format("Победа по скорости: %s, рубеж %d (Blue %s, Orange %s)", side, b, clock(blue), clock(orange))
|
return side, string.format(Text.pobedaPoSkorostiS, side, b, clock(blue), clock(orange))
|
||||||
end
|
end
|
||||||
|
|
||||||
return Score
|
return Score
|
||||||
@@ -111,7 +111,7 @@ RunService:BindToRenderStep(renderName, Enum.RenderPriority.Camera.Value + 2, fu
|
|||||||
local menuShown = menu ~= nil and menu.Enabled
|
local menuShown = menu ~= nil and menu.Enabled
|
||||||
local resultsGui = playerGui:FindFirstChild("ArenaResults")
|
local resultsGui = playerGui:FindFirstChild("ArenaResults")
|
||||||
local scoreboardShown = resultsGui ~= nil and resultsGui:GetAttribute("LiveScoreboardOpen") == true
|
local scoreboardShown = resultsGui ~= nil and resultsGui:GetAttribute("LiveScoreboardOpen") == true
|
||||||
local votingShown = playerGui:GetAttribute("HunterVoting") == true
|
local votingShown = playerGui:GetAttribute("HunterVoting") == true or playerGui:GetAttribute("HunterSpectating") == true
|
||||||
local inArena = player:GetAttribute("InArena") == true
|
local inArena = player:GetAttribute("InArena") == true
|
||||||
UserInputService.MouseIconEnabled = not inArena or tunerShown or menuShown or scoreboardShown or votingShown
|
UserInputService.MouseIconEnabled = not inArena or tunerShown or menuShown or scoreboardShown or votingShown
|
||||||
if scoreboardShown or votingShown or (not inArena and not UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2)) then
|
if scoreboardShown or votingShown or (not inArena and not UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2)) then
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.DamageNumbers
|
||||||
|
|
||||||
-- LocalScript in StarterPlayerScripts.
|
-- LocalScript in StarterPlayerScripts.
|
||||||
-- Floating damage numbers for the shooter: the server confirms each hit
|
-- Floating damage numbers for the shooter: the server confirms each hit
|
||||||
-- (ReplicatedStorage.SniperHit: position, damage, zone, killed) and the number pops out where the
|
-- (ReplicatedStorage.SniperHit: position, damage, zone, killed) and the number pops out where the
|
||||||
@@ -132,11 +134,11 @@ local function popup(position: Vector3, damage: number, zone: string, killed: bo
|
|||||||
else
|
else
|
||||||
skullIcon(group).LayoutOrder = 0
|
skullIcon(group).LayoutOrder = 0
|
||||||
end
|
end
|
||||||
local caption = textLabel(group, if zone == "Head" then "Хедшот!" else "Убит!", 22, Color3.new(1, 1, 1), Color3.fromRGB(20, 20, 28), 2.5)
|
local caption = textLabel(group, if zone == "Head" then Text.khedshot else Text.ubit, 22, Color3.new(1, 1, 1), Color3.fromRGB(20, 20, 28), 2.5)
|
||||||
caption.Font = Enum.Font.GothamBlack
|
caption.Font = Enum.Font.GothamBlack
|
||||||
caption.LayoutOrder = 1
|
caption.LayoutOrder = 1
|
||||||
elseif zone == "Head" then
|
elseif zone == "Head" then
|
||||||
local crit = textLabel(group, "КРИТ", 24, CRIT_COLOR, Color3.new(1, 1, 1), 2.5)
|
local crit = textLabel(group, Text.krit, 24, CRIT_COLOR, Color3.new(1, 1, 1), 2.5)
|
||||||
crit.Rotation = -8
|
crit.Rotation = -8
|
||||||
crit.LayoutOrder = 1
|
crit.LayoutOrder = 1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -44,6 +44,14 @@ gui:GetPropertyChangedSignal("AbsoluteSize"):Connect(fit)
|
|||||||
fit()
|
fit()
|
||||||
local shield = UI.element("Shield", plate, UDim2.fromOffset(14, 13), nil)
|
local shield = UI.element("Shield", plate, UDim2.fromOffset(14, 13), nil)
|
||||||
Instance.new("UIScale", shield).Scale = 1.13
|
Instance.new("UIScale", shield).Scale = 1.13
|
||||||
|
local protection = UI.element("Shield", plate, UDim2.new(1, -30, 0, -24), nil)
|
||||||
|
protection.Name = "SpawnProtection"
|
||||||
|
local function refreshProtection()
|
||||||
|
local deadline = player:GetAttribute("SpawnShield")
|
||||||
|
protection.Visible = typeof(deadline) == "number" and deadline > workspace:GetServerTimeNow()
|
||||||
|
end
|
||||||
|
player:GetAttributeChangedSignal("SpawnShield"):Connect(refreshProtection)
|
||||||
|
refreshProtection()
|
||||||
local text = UI.label(plate, "Value", "100", UDim2.fromOffset(46, 0), UDim2.fromOffset(55, 49), 24, UI.Ink)
|
local text = UI.label(plate, "Value", "100", UDim2.fromOffset(46, 0), UDim2.fromOffset(55, 49), 24, UI.Ink)
|
||||||
text.FontFace = UI.Display
|
text.FontFace = UI.Display
|
||||||
text.TextXAlignment = Enum.TextXAlignment.Left
|
text.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.HostedArenaHud
|
||||||
|
|
||||||
local GuiService = game:GetService("GuiService")
|
local GuiService = game:GetService("GuiService")
|
||||||
local Players = game:GetService("Players")
|
local Players = game:GetService("Players")
|
||||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
@@ -87,18 +89,18 @@ local function makeList(parent: Instance, name: string, position: UDim2, size: U
|
|||||||
return scroll
|
return scroll
|
||||||
end
|
end
|
||||||
|
|
||||||
local launch = button(gui, "OpenArenaCreator", if hosted then "‹ В ОБЩЕЕ ЛОББИ" else "+ СОЗДАТЬ АРЕНУ",
|
local launch = button(gui, "OpenArenaCreator", if hosted then Text.vObscheeLobbi else Text.sozdatArenu,
|
||||||
UDim2.new(1, -24, 1, -42), UDim2.fromOffset(264, 52), violet, true)
|
UDim2.new(1, -24, 1, -42), UDim2.fromOffset(264, 52), violet, true)
|
||||||
launch.AnchorPoint = Vector2.new(1, 1)
|
launch.AnchorPoint = Vector2.new(1, 1)
|
||||||
launch.Modal = true
|
launch.Modal = true
|
||||||
|
|
||||||
local browser = UI.plate(gui, "PublicArenas", UDim2.new(1, -24, 1, -104), UDim2.fromOffset(264, 432), UI.Blue, dark)
|
local browser = UI.plate(gui, "PublicArenas", UDim2.new(1, -24, 1, -104), UDim2.fromOffset(264, 432), UI.Blue, dark)
|
||||||
browser.AnchorPoint = Vector2.new(1, 1)
|
browser.AnchorPoint = Vector2.new(1, 1)
|
||||||
local browserTitle = leftLabel(browser, "Heading", if hosted then "АРЕНА СЕССИИ" else "ПУБЛИЧНЫЕ АРЕНЫ", 13, 7, 173, 34, 16, UI.Ink)
|
local browserTitle = leftLabel(browser, "Heading", if hosted then Text.arenaSessii else Text.publichnyeAreny, 13, 7, 173, 34, 16, UI.Ink)
|
||||||
browserTitle.FontFace = UI.Display
|
browserTitle.FontFace = UI.Display
|
||||||
local ownerLabel = leftLabel(browser, "Owner", "", 13, 38, 237, 21, 12, UI.Muted)
|
local ownerLabel = leftLabel(browser, "Owner", "", 13, 38, 237, 21, 12, UI.Muted)
|
||||||
ownerLabel.Visible = hosted
|
ownerLabel.Visible = hosted
|
||||||
local refreshDirectory = button(browser, "Refresh", "ОБНОВИТЬ", UDim2.fromOffset(191, 9), UDim2.fromOffset(61, 31), UI.Blue)
|
local refreshDirectory = button(browser, "Refresh", Text.obnovit, UDim2.fromOffset(191, 9), UDim2.fromOffset(61, 31), UI.Blue)
|
||||||
refreshDirectory.TextSize = 10
|
refreshDirectory.TextSize = 10
|
||||||
refreshDirectory.Visible = not hosted and not localPreview
|
refreshDirectory.Visible = not hosted and not localPreview
|
||||||
local listTop = if hosted then 64 else 47
|
local listTop = if hosted then 64 else 47
|
||||||
@@ -106,7 +108,7 @@ local cardHeight, moreHeight = 184, 37
|
|||||||
local browserChrome = listTop + 10
|
local browserChrome = listTop + 10
|
||||||
local contentHeight = cardHeight
|
local contentHeight = cardHeight
|
||||||
local arenaList = makeList(browser, "List", UDim2.fromOffset(10, listTop), UDim2.new(0, 244, 1, -browserChrome), UI.Blue)
|
local arenaList = makeList(browser, "List", UDim2.fromOffset(10, listTop), UDim2.new(0, 244, 1, -browserChrome), UI.Blue)
|
||||||
local moreArenas = button(arenaList, "More", "ПОКАЗАТЬ ЕЩЁ", UDim2.new(), UDim2.new(1, -13, 0, moreHeight), UI.Blue)
|
local moreArenas = button(arenaList, "More", Text.pokazatEschyo, UDim2.new(), UDim2.new(1, -13, 0, moreHeight), UI.Blue)
|
||||||
moreArenas.Visible = false
|
moreArenas.Visible = false
|
||||||
|
|
||||||
local shade = UI.frame("CreatorShade", gui, UDim2.fromScale(0, 0), UDim2.fromScale(1, 1), Color3.fromRGB(5, 10, 20))
|
local shade = UI.frame("CreatorShade", gui, UDim2.fromScale(0, 0), UDim2.fromScale(1, 1), Color3.fromRGB(5, 10, 20))
|
||||||
@@ -131,14 +133,14 @@ end
|
|||||||
shade:GetPropertyChangedSignal("AbsoluteSize"):Connect(fit)
|
shade:GetPropertyChangedSignal("AbsoluteSize"):Connect(fit)
|
||||||
fit()
|
fit()
|
||||||
|
|
||||||
local header = leftLabel(panel, "Title", "СОЗДАНИЕ АРЕНЫ", 26, 15, 520, 45, 31, UI.Ink)
|
local header = leftLabel(panel, "Title", Text.sozdanieAreny, 26, 15, 520, 45, 31, UI.Ink)
|
||||||
header.FontFace = UI.Display
|
header.FontFace = UI.Display
|
||||||
local close = button(panel, "Close", "×", UDim2.fromOffset(568, 19), UDim2.fromOffset(48, 37), UI.Orange)
|
local close = button(panel, "Close", "×", UDim2.fromOffset(568, 19), UDim2.fromOffset(48, 37), UI.Orange)
|
||||||
close.TextSize, close.Modal = 23, true
|
close.TextSize, close.Modal = 23, true
|
||||||
local public = button(panel, "Public", "ПУБЛИЧНАЯ", UDim2.fromOffset(26, 74), UDim2.fromOffset(284, 44), UI.Blue)
|
local public = button(panel, "Public", Text.publichnaya, UDim2.fromOffset(26, 74), UDim2.fromOffset(284, 44), UI.Blue)
|
||||||
local private = button(panel, "Private", "ПРИВАТНАЯ", UDim2.fromOffset(322, 74), UDim2.fromOffset(294, 44), violet)
|
local private = button(panel, "Private", Text.privatnaya, UDim2.fromOffset(322, 74), UDim2.fromOffset(294, 44), violet)
|
||||||
local explanation = leftLabel(panel, "Description", "", 26, 129, 590, 28, 14, UI.Muted)
|
local explanation = leftLabel(panel, "Description", "", 26, 129, 590, 28, 14, UI.Muted)
|
||||||
local modesHeading = leftLabel(panel, "ModesHeading", "СТАРТОВЫЙ РЕЖИМ", 26, 154, 590, 25, 15, UI.Ink)
|
local modesHeading = leftLabel(panel, "ModesHeading", Text.startovyyRezhim, 26, 154, 590, 25, 15, UI.Ink)
|
||||||
modesHeading.FontFace = UI.Display
|
modesHeading.FontFace = UI.Display
|
||||||
local modeChoices = UI.frame("InitialModeChoices", panel, UDim2.fromOffset(26, 184), UDim2.fromOffset(590, 174), dark)
|
local modeChoices = UI.frame("InitialModeChoices", panel, UDim2.fromOffset(26, 184), UDim2.fromOffset(590, 174), dark)
|
||||||
modeChoices.BackgroundTransparency = 1
|
modeChoices.BackgroundTransparency = 1
|
||||||
@@ -153,7 +155,7 @@ for index, rule in Rules.All do
|
|||||||
modeCards[rule.id] = card
|
modeCards[rule.id] = card
|
||||||
end
|
end
|
||||||
local modeDescription = leftLabel(panel, "ModeDescription", "", 26, 361, 590, 24, 13, UI.Muted)
|
local modeDescription = leftLabel(panel, "ModeDescription", "", 26, 361, 590, 24, 13, UI.Muted)
|
||||||
local changeLabel = leftLabel(panel, "ModeChangeHeading", "Разрешить смену режимов", 26, 391, 375, 22, 16, UI.Ink)
|
local changeLabel = leftLabel(panel, "ModeChangeHeading", Text.razreshitSmenuRezhimov, 26, 391, 375, 22, 16, UI.Ink)
|
||||||
changeLabel.FontFace = UI.Display
|
changeLabel.FontFace = UI.Display
|
||||||
local changeHint = leftLabel(panel, "ModeChangeHint", "", 26, 413, 375, 20, 12, UI.Muted)
|
local changeHint = leftLabel(panel, "ModeChangeHint", "", 26, 413, 375, 20, 12, UI.Muted)
|
||||||
local changeToggle = button(panel, "AllowModeChange", "", UDim2.fromOffset(430, 391), UDim2.fromOffset(186, 41), UI.Mint, true)
|
local changeToggle = button(panel, "AllowModeChange", "", UDim2.fromOffset(430, 391), UDim2.fromOffset(186, 41), UI.Mint, true)
|
||||||
@@ -171,7 +173,7 @@ detailsTitle.FontFace = UI.Display
|
|||||||
local detailsClose = button(detailsPanel, "Close", "×", UDim2.fromOffset(568, 19), UDim2.fromOffset(48, 37), UI.Orange)
|
local detailsClose = button(detailsPanel, "Close", "×", UDim2.fromOffset(568, 19), UDim2.fromOffset(48, 37), UI.Orange)
|
||||||
detailsClose.TextSize, detailsClose.Modal = 23, true
|
detailsClose.TextSize, detailsClose.Modal = 23, true
|
||||||
local detailsStatus = leftLabel(detailsPanel, "Status", "", 26, 357, 590, 32, 14, UI.Muted)
|
local detailsStatus = leftLabel(detailsPanel, "Status", "", 26, 357, 590, 32, 14, UI.Muted)
|
||||||
local connect = button(detailsPanel, "Connect", "ПОДКЛЮЧИТЬСЯ ›", UDim2.fromOffset(26, 397), UDim2.fromOffset(590, 43), UI.Blue, true)
|
local connect = button(detailsPanel, "Connect", Text.podklyuchitSya, UDim2.fromOffset(26, 397), UDim2.fromOffset(590, 43), UI.Blue, true)
|
||||||
|
|
||||||
local function teamColumn(name: string, text: string, x: number, accent: Color3)
|
local function teamColumn(name: string, text: string, x: number, accent: Color3)
|
||||||
local body = UI.plate(detailsPanel, name, UDim2.fromOffset(x + 144.5, 212), UDim2.fromOffset(289, 274), accent, dark:Lerp(accent, .08))
|
local body = UI.plate(detailsPanel, name, UDim2.fromOffset(x + 144.5, 212), UDim2.fromOffset(289, 274), accent, dark:Lerp(accent, .08))
|
||||||
@@ -191,7 +193,7 @@ local function teamColumn(name: string, text: string, x: number, accent: Color3)
|
|||||||
heading.FontFace = UI.Display
|
heading.FontFace = UI.Display
|
||||||
local count = UI.label(body, "Count", "", UDim2.fromOffset(188, 8), UDim2.fromOffset(86, 31), 14, UI.Ink)
|
local count = UI.label(body, "Count", "", UDim2.fromOffset(188, 8), UDim2.fromOffset(86, 31), 14, UI.Ink)
|
||||||
local scroll = makeList(body, "Players", UDim2.fromOffset(9, 47), UDim2.fromOffset(271, 177), accent)
|
local scroll = makeList(body, "Players", UDim2.fromOffset(9, 47), UDim2.fromOffset(271, 177), accent)
|
||||||
local marker = UI.label(body, "ChoiceLabel", "ВЫБРАТЬ", UDim2.fromOffset(9, 232), UDim2.fromOffset(271, 32), 13, accent)
|
local marker = UI.label(body, "ChoiceLabel", Text.vybrat, UDim2.fromOffset(9, 232), UDim2.fromOffset(271, 32), 13, accent)
|
||||||
marker.FontFace = UI.Display
|
marker.FontFace = UI.Display
|
||||||
local dimmer = UI.frame("SelectionDimmer", body, UDim2.fromScale(0, 0), UDim2.fromScale(1, 1), dark)
|
local dimmer = UI.frame("SelectionDimmer", body, UDim2.fromScale(0, 0), UDim2.fromScale(1, 1), dark)
|
||||||
dimmer.BackgroundTransparency, dimmer.ZIndex = 1, 3
|
dimmer.BackgroundTransparency, dimmer.ZIndex = 1, 3
|
||||||
@@ -204,8 +206,8 @@ local function teamColumn(name: string, text: string, x: number, accent: Color3)
|
|||||||
zoom = zoom, glow = glow, shine = shine, border = border, dimmer = dimmer, hit = hit, marker = marker,
|
zoom = zoom, glow = glow, shine = shine, border = border, dimmer = dimmer, hit = hit, marker = marker,
|
||||||
hovered = false, focused = false, pressed = false, feedbackTween = nil :: Tween?}
|
hovered = false, focused = false, pressed = false, feedbackTween = nil :: Tween?}
|
||||||
end
|
end
|
||||||
local blueTeam = teamColumn("Blue", "СИНИЕ", 26, UI.Blue)
|
local blueTeam = teamColumn("Blue", Text.sinie, 26, UI.Blue)
|
||||||
local orangeTeam = teamColumn("Orange", "ОРАНЖЕВЫЕ", 327, UI.Orange)
|
local orangeTeam = teamColumn("Orange", Text.oranzhevye, 327, UI.Orange)
|
||||||
type TeamColumn = typeof(blueTeam)
|
type TeamColumn = typeof(blueTeam)
|
||||||
local teamColumns: {[Side]: TeamColumn} = {Blue = blueTeam, Orange = orangeTeam}
|
local teamColumns: {[Side]: TeamColumn} = {Blue = blueTeam, Orange = orangeTeam}
|
||||||
shade:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
|
shade:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
|
||||||
@@ -220,15 +222,15 @@ noticeText.TextWrapped = true
|
|||||||
local invitation = UI.plate(gui, "ArenaInvitation", UDim2.fromOffset(24, 163), UDim2.fromOffset(354, 166), violet, dark)
|
local invitation = UI.plate(gui, "ArenaInvitation", UDim2.fromOffset(24, 163), UDim2.fromOffset(354, 166), violet, dark)
|
||||||
invitation.Visible = false
|
invitation.Visible = false
|
||||||
UI.contour(invitation, violet)
|
UI.contour(invitation, violet)
|
||||||
local inviteTitle = leftLabel(invitation, "Title", "ПРИГЛАШЕНИЕ НА АРЕНУ", 14, 7, 282, 27, 17, UI.Ink)
|
local inviteTitle = leftLabel(invitation, "Title", Text.priglashenieNaArenu, 14, 7, 282, 27, 17, UI.Ink)
|
||||||
inviteTitle.FontFace = UI.Display
|
inviteTitle.FontFace = UI.Display
|
||||||
local inviteTimer = UI.label(invitation, "Timer", "", UDim2.fromOffset(297, 7), UDim2.fromOffset(44, 27), 14, violet)
|
local inviteTimer = UI.label(invitation, "Timer", "", UDim2.fromOffset(297, 7), UDim2.fromOffset(44, 27), 14, violet)
|
||||||
local portrait = UI.portrait(invitation, UDim2.fromOffset(15, 43), 51, violet)
|
local portrait = UI.portrait(invitation, UDim2.fromOffset(15, 43), 51, violet)
|
||||||
portrait.Name = "CreatorPortrait"
|
portrait.Name = "CreatorPortrait"
|
||||||
local hostLabel = leftLabel(invitation, "CreatorName", "", 78, 42, 261, 24, 17, UI.Ink)
|
local hostLabel = leftLabel(invitation, "CreatorName", "", 78, 42, 261, 24, 17, UI.Ink)
|
||||||
local hostAccount = leftLabel(invitation, "CreatorAccount", "", 78, 67, 261, 22, 13, UI.Muted)
|
local hostAccount = leftLabel(invitation, "CreatorAccount", "", 78, 67, 261, 22, 13, UI.Muted)
|
||||||
local accept = button(invitation, "Accept", "ПРИНЯТЬ [Y]", UDim2.fromOffset(14, 109), UDim2.fromOffset(156, 41), UI.Mint, true)
|
local accept = button(invitation, "Accept", Text.prinyatY, UDim2.fromOffset(14, 109), UDim2.fromOffset(156, 41), UI.Mint, true)
|
||||||
local decline = button(invitation, "Decline", "ОТКЛОНИТЬ [U]", UDim2.fromOffset(181, 109), UDim2.fromOffset(159, 41), violet)
|
local decline = button(invitation, "Decline", Text.otklonitU, UDim2.fromOffset(181, 109), UDim2.fromOffset(159, 41), violet)
|
||||||
|
|
||||||
local isPrivate = false
|
local isPrivate = false
|
||||||
local roundOptions: Hosting.RoundOptions = {initialMode = Rules.Default, allowModeChange = true}
|
local roundOptions: Hosting.RoundOptions = {initialMode = Rules.Default, allowModeChange = true}
|
||||||
@@ -339,7 +341,7 @@ local function refreshSelection()
|
|||||||
changeToggle.Interactable = not busy
|
changeToggle.Interactable = not busy
|
||||||
local count = 0
|
local count = 0
|
||||||
for _ in selected do count += 1 end
|
for _ in selected do count += 1 end
|
||||||
selectionCount.Text = string.format("ВЫБРАНО %d / %d", count, Hosting.MaxPlayers - 1)
|
selectionCount.Text = string.format(Text.vybranoDD, count, Hosting.MaxPlayers - 1)
|
||||||
for id, row in rows do
|
for id, row in rows do
|
||||||
local active = selected[id] == true
|
local active = selected[id] == true
|
||||||
row.button.BackgroundColor3 = dark:Lerp(violet, if active then .45 else .15)
|
row.button.BackgroundColor3 = dark:Lerp(violet, if active then .45 else .15)
|
||||||
@@ -374,9 +376,9 @@ local function request(actionName: string, data: any?, extra: (Side | Hosting.Ro
|
|||||||
detailsClose.Interactable = true
|
detailsClose.Interactable = true
|
||||||
resetTeamReveal()
|
resetTeamReveal()
|
||||||
if shade.Visible then
|
if shade.Visible then
|
||||||
local message = "Ответ задержался. Попробуйте снова."
|
local message = Text.otvetZaderzhalsyaPoprobuyteSnova
|
||||||
if arena then joinNote, detailsStatus.Text = message, message else status.Text = message end
|
if arena then joinNote, detailsStatus.Text = message, message else status.Text = message end
|
||||||
else showNotice("Ответ задержался. Попробуйте снова.") end
|
else showNotice(Text.otvetZaderzhalsyaPoprobuyteSnova) end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -424,16 +426,16 @@ local function updatePanel()
|
|||||||
private.BackgroundColor3 = dark:Lerp(violet, if isPrivate then .58 else .17)
|
private.BackgroundColor3 = dark:Lerp(violet, if isPrivate then .58 else .17)
|
||||||
selectionCount.Visible, list.Visible = showPlayers, showPlayers
|
selectionCount.Visible, list.Visible = showPlayers, showPlayers
|
||||||
modeDescription.Text = Rules.get(roundOptions.initialMode).detail
|
modeDescription.Text = Rules.get(roundOptions.initialMode).detail
|
||||||
changeToggle.Text = if roundOptions.allowModeChange then "ВКЛЮЧЕНО" else "ВЫКЛЮЧЕНО"
|
changeToggle.Text = if roundOptions.allowModeChange then Text.vklyucheno else Text.vyklyucheno
|
||||||
changeToggle.BackgroundColor3 = if roundOptions.allowModeChange then UI.Mint else dark:Lerp(UI.Muted, .23)
|
changeToggle.BackgroundColor3 = if roundOptions.allowModeChange then UI.Mint else dark:Lerp(UI.Muted, .23)
|
||||||
changeToggle.TextColor3 = if roundOptions.allowModeChange then dark else UI.Ink
|
changeToggle.TextColor3 = if roundOptions.allowModeChange then dark else UI.Ink
|
||||||
changeHint.Text = if roundOptions.allowModeChange then "Голосование после раунда" else "Один режим на все раунды"
|
changeHint.Text = if roundOptions.allowModeChange then Text.golosovaniePosleRaunda else Text.odinRezhimNaVse
|
||||||
explanation.Text = if showPlayers then "Выберите игроков с этого сервера и отправьте приглашения."
|
explanation.Text = if showPlayers then Text.vyberiteIgrokovSEtogo
|
||||||
elseif isPrivate then "На сервере пока нет других игроков."
|
elseif isPrivate then Text.naServerePokaNet
|
||||||
elseif localPreview then "В локальном тесте публичная арена доступна игрокам этого сеанса Studio."
|
elseif localPreview then Text.vLokalNomTeste
|
||||||
else "Любой игрок сможет подключиться через список публичных арен."
|
else Text.lyuboyIgrokSmozhetPodklyuchit
|
||||||
action.Text = if party then "ОТМЕНИТЬ ПРИГЛАШЕНИЯ"
|
action.Text = if party then Text.otmenitPriglasheniya
|
||||||
elseif isPrivate then "ОТПРАВИТЬ ПРИГЛАШЕНИЯ" else "СОЗДАТЬ АРЕНУ"
|
elseif isPrivate then Text.otpravitPriglasheniya else Text.sozdatArenu2
|
||||||
refreshSelection()
|
refreshSelection()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -522,7 +524,7 @@ local function renderTeam(column: TeamColumn, members: {Hosting.Member})
|
|||||||
column.count.Text = string.format("%d / %d", #members, Hosting.MaxPlayers // 2)
|
column.count.Text = string.format("%d / %d", #members, Hosting.MaxPlayers // 2)
|
||||||
clearList(column.scroll)
|
clearList(column.scroll)
|
||||||
if #members == 0 then
|
if #members == 0 then
|
||||||
leftLabel(column.scroll, "Empty", "Пока никого", 8, 0, 249, 34, 14, UI.Muted)
|
leftLabel(column.scroll, "Empty", Text.pokaNikogo, 8, 0, 249, 34, 14, UI.Muted)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
for index, member in members do
|
for index, member in members do
|
||||||
@@ -553,28 +555,28 @@ local function redrawDetails(now: number)
|
|||||||
local teamIssue = if side == "Blue" then blueIssue else orangeIssue
|
local teamIssue = if side == "Blue" then blueIssue else orangeIssue
|
||||||
team.hit.Interactable = ready and teamIssue == nil
|
team.hit.Interactable = ready and teamIssue == nil
|
||||||
if not team.hit.Interactable then team.pressed = false end
|
if not team.hit.Interactable then team.pressed = false end
|
||||||
team.marker.Text = if confirmedSide == side then "ВАША КОМАНДА"
|
team.marker.Text = if confirmedSide == side then Text.vashaKomanda
|
||||||
elseif teamIssue == "Full" then "НЕТ МЕСТ" elseif teamIssue == "Balance" then "БАЛАНС КОМАНД"
|
elseif teamIssue == "Full" then Text.netMest elseif teamIssue == "Balance" then Text.balansKomand
|
||||||
elseif preferredSide == side then "ВЫБРАНО" else "ВЫБРАТЬ"
|
elseif preferredSide == side then Text.vybrano else Text.vybrat
|
||||||
team.marker.TextColor3 = if teamIssue then UI.Muted else team.accent
|
team.marker.TextColor3 = if teamIssue then UI.Muted else team.accent
|
||||||
showTeamFeedback(team, side)
|
showTeamFeedback(team, side)
|
||||||
end
|
end
|
||||||
connect.Interactable = ready and preferredSide ~= nil and issue == nil
|
connect.Interactable = ready and preferredSide ~= nil and issue == nil
|
||||||
detailsClose.Interactable = not sending
|
detailsClose.Interactable = not sending
|
||||||
connect.Text = if confirmedSide then "ВХОД НА АРЕНУ…"
|
connect.Text = if confirmedSide then Text.vkhodNaArenu
|
||||||
elseif sending and localMode then "ПРОВЕРЯЕМ КОМАНДУ…"
|
elseif sending and localMode then Text.proveryaemKomandu
|
||||||
elseif preferredSide == "Blue" then "ПОДКЛЮЧИТЬСЯ ЗА СИНИХ ›"
|
elseif preferredSide == "Blue" then Text.podklyuchitSyaZaSinikh
|
||||||
elseif preferredSide == "Orange" then "ПОДКЛЮЧИТЬСЯ ЗА ОРАНЖЕВЫХ ›" else "ПОДКЛЮЧИТЬСЯ ›"
|
elseif preferredSide == "Orange" then Text.podklyuchitSyaZaOranzhevykh else Text.podklyuchitSya
|
||||||
local accent = if preferredSide == "Orange" then UI.Orange else UI.Blue
|
local accent = if preferredSide == "Orange" then UI.Orange else UI.Blue
|
||||||
connect.BackgroundColor3 = if connect.Interactable then accent else dark:Lerp(UI.Muted, .18)
|
connect.BackgroundColor3 = if connect.Interactable then accent else dark:Lerp(UI.Muted, .18)
|
||||||
connect.TextColor3 = if connect.Interactable then dark else UI.Muted
|
connect.TextColor3 = if connect.Interactable then dark else UI.Muted
|
||||||
detailsStatus.Text = joinNote or (if confirmedSide == "Blue" then "ВЫ В КОМАНДЕ СИНИХ"
|
detailsStatus.Text = joinNote or (if confirmedSide == "Blue" then Text.vyVKomandeSinikh
|
||||||
elseif confirmedSide == "Orange" then "ВЫ В КОМАНДЕ ОРАНЖЕВЫХ"
|
elseif confirmedSide == "Orange" then Text.vyVKomandeOranzhevykh
|
||||||
elseif sending then "Подключаемся…"
|
elseif sending then Text.podklyuchaemsya
|
||||||
elseif not data then "Загружаем составы…" elseif full then "Арена заполнена."
|
elseif not data then Text.zagruzhaemSostavy elseif full then Text.arenaZapolnena
|
||||||
elseif not isOpen then "Подключение откроется с началом раунда."
|
elseif not isOpen then Text.podklyuchenieOtkroetsyaSNachalom
|
||||||
elseif preferredSide and issue then "Выбранная команда пока недоступна."
|
elseif preferredSide and issue then Text.vybrannayaKomandaPokaNedostupna
|
||||||
elseif not preferredSide then "Выберите команду." else "")
|
elseif not preferredSide then Text.vyberiteKomandu else "")
|
||||||
end
|
end
|
||||||
|
|
||||||
for side, team in teamColumns do
|
for side, team in teamColumns do
|
||||||
@@ -648,7 +650,7 @@ local function localChoice(ownerOverride: Player?): Choice
|
|||||||
local mode = Modes.Procedural
|
local mode = Modes.Procedural
|
||||||
local ownerId = remote:GetAttribute("LocalPublicOwnerUserId")
|
local ownerId = remote:GetAttribute("LocalPublicOwnerUserId")
|
||||||
local owner = ownerOverride or (if typeof(ownerId) == "number" then Players:GetPlayerByUserId(ownerId) else nil)
|
local owner = ownerOverride or (if typeof(ownerId) == "number" then Players:GetPlayerByUserId(ownerId) else nil)
|
||||||
return {id = mode, name = if owner then owner.DisplayName else "Динамическая арена",
|
return {id = mode, name = if owner then owner.DisplayName else Text.dinamicheskayaArena,
|
||||||
mode = mode, hostId = if owner then owner.UserId else nil, players = localTeams(mode).players,
|
mode = mode, hostId = if owner then owner.UserId else nil, players = localTeams(mode).players,
|
||||||
ruleset = Rules.get(Modes.state(roundState, mode):GetAttribute("Ruleset")).id}
|
ruleset = Rules.get(Modes.state(roundState, mode):GetAttribute("Ruleset")).id}
|
||||||
end
|
end
|
||||||
@@ -729,9 +731,9 @@ local function showInvite()
|
|||||||
local invite = currentInvite
|
local invite = currentInvite
|
||||||
invitation.Visible = invite ~= nil and not transferring
|
invitation.Visible = invite ~= nil and not transferring
|
||||||
if not invite then return end
|
if not invite then return end
|
||||||
inviteTitle.Text = if accepted then "ПРИГЛАШЕНИЕ ПРИНЯТО" else "ПРИГЛАШЕНИЕ НА АРЕНУ"
|
inviteTitle.Text = if accepted then Text.priglasheniePrinyato else Text.priglashenieNaArenu
|
||||||
accept.Visible = not accepted
|
accept.Visible = not accepted
|
||||||
decline.Text = if accepted then "ОТМЕНИТЬ [U]" else "ОТКЛОНИТЬ [U]"
|
decline.Text = if accepted then Text.otmenitU else Text.otklonitU
|
||||||
end
|
end
|
||||||
|
|
||||||
local function respond(agree: boolean)
|
local function respond(agree: boolean)
|
||||||
@@ -751,7 +753,7 @@ local messageConnection = remote.OnClientEvent:Connect(function(event: string, d
|
|||||||
if event == "Invite" then
|
if event == "Invite" then
|
||||||
local invite: Invite = data
|
local invite: Invite = data
|
||||||
currentInvite, accepted = invite, false
|
currentInvite, accepted = invite, false
|
||||||
hostLabel.Text, hostAccount.Text = invite.hostName, "Создатель · @" .. invite.hostUsername
|
hostLabel.Text, hostAccount.Text = invite.hostName, Text.sozdatel .. invite.hostUsername
|
||||||
showAvatar(portrait, invite.hostId, invite.hostName)
|
showAvatar(portrait, invite.hostId, invite.hostName)
|
||||||
showInvite()
|
showInvite()
|
||||||
elseif event == "Accepted" and currentInvite and currentInvite.id == data then
|
elseif event == "Accepted" and currentInvite and currentInvite.id == data then
|
||||||
@@ -781,14 +783,14 @@ local messageConnection = remote.OnClientEvent:Connect(function(event: string, d
|
|||||||
renderDirectory()
|
renderDirectory()
|
||||||
elseif event == "ListUnavailable" then
|
elseif event == "ListUnavailable" then
|
||||||
listingPending = false
|
listingPending = false
|
||||||
if browser.Visible then showNotice("Список публичных арен временно недоступен.") end
|
if browser.Visible then showNotice(Text.spisokPublichnykhArenVremenno) end
|
||||||
elseif event == "PublicDetails" and arena and data.id == arena.id then
|
elseif event == "PublicDetails" and arena and data.id == arena.id then
|
||||||
if not arenaDetails then joinNote = nil end
|
if not arenaDetails then joinNote = nil end
|
||||||
arenaDetails = data
|
arenaDetails = data
|
||||||
redrawDetails(workspace:GetServerTimeNow())
|
redrawDetails(workspace:GetServerTimeNow())
|
||||||
elseif event == "DetailsUnavailable" and arena and data == arena.id then
|
elseif event == "DetailsUnavailable" and arena and data == arena.id then
|
||||||
arenaDetails = nil
|
arenaDetails = nil
|
||||||
joinNote = "Арена закрылась или составы временно недоступны."
|
joinNote = Text.arenaZakrylasIliSostavy
|
||||||
redrawDetails(workspace:GetServerTimeNow())
|
redrawDetails(workspace:GetServerTimeNow())
|
||||||
elseif event == "LocalPublicReady" then
|
elseif event == "LocalPublicReady" then
|
||||||
sending = false
|
sending = false
|
||||||
@@ -812,11 +814,11 @@ local messageConnection = remote.OnClientEvent:Connect(function(event: string, d
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
local joinErrors: {[string]: string} = {
|
local joinErrors: {[string]: string} = {
|
||||||
Full = "В выбранной команде нет мест.",
|
Full = Text.vVybrannoyKomandeNet,
|
||||||
Balance = "Составы изменились. Подключитесь ещё раз.",
|
Balance = Text.sostavyIzmenilisPodklyuchitesEschyo,
|
||||||
BetweenRounds = "Дождитесь начала следующего раунда.",
|
BetweenRounds = Text.dozhditesNachalaSleduyuschegoRaunda,
|
||||||
Spawning = "Персонаж ещё загружается. Попробуйте снова.",
|
Spawning = Text.personazhEschyoZagruzhaetsyaPoprobuyte,
|
||||||
AwaitingAdmission = "Проверяем доступ к арене. Попробуйте через секунду.",
|
AwaitingAdmission = Text.proveryaemDostupKArene,
|
||||||
}
|
}
|
||||||
local joinConnection = join.OnClientEvent:Connect(function(result: string, side: Side?)
|
local joinConnection = join.OnClientEvent:Connect(function(result: string, side: Side?)
|
||||||
if not sending or not arena or not arena.mode then return end
|
if not sending or not arena or not arena.mode then return end
|
||||||
@@ -830,14 +832,14 @@ local joinConnection = join.OnClientEvent:Connect(function(result: string, side:
|
|||||||
setOpen(false)
|
setOpen(false)
|
||||||
else
|
else
|
||||||
resetTeamReveal()
|
resetTeamReveal()
|
||||||
joinNote = joinErrors[result] or "Не удалось подключиться."
|
joinNote = joinErrors[result] or Text.neUdalosPodklyuchitSya
|
||||||
redrawDetails(workspace:GetServerTimeNow())
|
redrawDetails(workspace:GetServerTimeNow())
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
local launcherConnection = roundHud:GetAttributeChangedSignal("LobbyAvailable"):Connect(refreshLaunch)
|
local launcherConnection = roundHud:GetAttributeChangedSignal("LobbyAvailable"):Connect(refreshLaunch)
|
||||||
local function refreshOwner()
|
local function refreshOwner()
|
||||||
local name = remote:GetAttribute("OwnerName")
|
local name = remote:GetAttribute("OwnerName")
|
||||||
ownerLabel.Text = if typeof(name) == "string" then "Владелец · " .. name else ""
|
ownerLabel.Text = if typeof(name) == "string" then Text.vladelets .. name else ""
|
||||||
end
|
end
|
||||||
local ownerConnection = remote:GetAttributeChangedSignal("OwnerName"):Connect(refreshOwner)
|
local ownerConnection = remote:GetAttributeChangedSignal("OwnerName"):Connect(refreshOwner)
|
||||||
local votingConnection = pg:GetAttributeChangedSignal("HunterVoting"):Connect(function()
|
local votingConnection = pg:GetAttributeChangedSignal("HunterVoting"):Connect(function()
|
||||||
@@ -850,13 +852,13 @@ local teamConnection = player:GetAttributeChangedSignal("ArenaTeam"):Connect(fun
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
local function showFull()
|
local function showFull()
|
||||||
if player:GetAttribute("HostedArenaFull") then showNotice("Арена заполнена. Можно вернуться в общее лобби.", true) end
|
if player:GetAttribute("HostedArenaFull") then showNotice(Text.arenaZapolnenaMozhnoVernut, true) end
|
||||||
end
|
end
|
||||||
local fullConnection = player:GetAttributeChangedSignal("HostedArenaFull"):Connect(showFull)
|
local fullConnection = player:GetAttributeChangedSignal("HostedArenaFull"):Connect(showFull)
|
||||||
showFull()
|
showFull()
|
||||||
local function showTeamNotice()
|
local function showTeamNotice()
|
||||||
local issue = player:GetAttribute("HostedArenaTeamNotice")
|
local issue = player:GetAttribute("HostedArenaTeamNotice")
|
||||||
if typeof(issue) == "string" then showNotice(joinErrors[issue] or "Выбранная команда недоступна.") end
|
if typeof(issue) == "string" then showNotice(joinErrors[issue] or Text.vybrannayaKomandaNedostupna) end
|
||||||
end
|
end
|
||||||
local arrivalTeamConnection = player:GetAttributeChangedSignal("HostedArenaTeamNotice"):Connect(showTeamNotice)
|
local arrivalTeamConnection = player:GetAttributeChangedSignal("HostedArenaTeamNotice"):Connect(showTeamNotice)
|
||||||
showTeamNotice()
|
showTeamNotice()
|
||||||
@@ -900,7 +902,7 @@ local clock = RunService.Heartbeat:Connect(function()
|
|||||||
local pending = party
|
local pending = party
|
||||||
if pending then
|
if pending then
|
||||||
local left = math.max(0, math.ceil(pending.expires - now))
|
local left = math.max(0, math.ceil(pending.expires - now))
|
||||||
status.Text = string.format("Приняли %d · Ждём %d · %02d с", pending.accepted, pending.pending, left)
|
status.Text = string.format(Text.prinyaliDZhdyomD, pending.accepted, pending.pending, left)
|
||||||
if not shade.Visible then showNotice(status.Text, true) end
|
if not shade.Visible then showNotice(status.Text, true) end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.HostedArenaService
|
||||||
|
|
||||||
local HttpService = game:GetService("HttpService")
|
local HttpService = game:GetService("HttpService")
|
||||||
local MemoryStoreService = game:GetService("MemoryStoreService")
|
local MemoryStoreService = game:GetService("MemoryStoreService")
|
||||||
local Players = game:GetService("Players")
|
local Players = game:GetService("Players")
|
||||||
@@ -81,18 +83,18 @@ end
|
|||||||
|
|
||||||
local function createLocalPublic(player: Player, options: RoundOptions)
|
local function createLocalPublic(player: Player, options: RoundOptions)
|
||||||
if previewOwner and previewOwner ~= player then
|
if previewOwner and previewOwner ~= player then
|
||||||
fail(player, "На этом тестовом сервере уже есть публичная арена. Откройте её карточку.")
|
fail(player, Text.naEtomTestovomServere)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if configuringPreview then
|
if configuringPreview then
|
||||||
fail(player, "Тестовая арена уже готовится.")
|
fail(player, Text.testovayaArenaUzheGotovitsya)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
configuringPreview = true
|
configuringPreview = true
|
||||||
local ok, configured = pcall(configureRound, options)
|
local ok, configured = pcall(configureRound, options)
|
||||||
configuringPreview = false
|
configuringPreview = false
|
||||||
if not ok or not configured then
|
if not ok or not configured then
|
||||||
fail(player, "Дождитесь, пока тестовая арена освободится.")
|
fail(player, Text.dozhditesPokaTestovayaArena)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not inLobby(player) then return end
|
if not inLobby(player) then return end
|
||||||
@@ -103,7 +105,7 @@ end
|
|||||||
local function transferFailed(player: Player)
|
local function transferFailed(player: Player)
|
||||||
if not transfers[player] then return end
|
if not transfers[player] then return end
|
||||||
transfers[player] = nil
|
transfers[player] = nil
|
||||||
fail(player, "Переход не удался. Попробуйте снова.")
|
fail(player, Text.perekhodNeUdalsyaPoprobuyte)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function teleport(group: {Player}, destination: string?, side: Side?): boolean
|
local function teleport(group: {Player}, destination: string?, side: Side?): boolean
|
||||||
@@ -119,7 +121,7 @@ local function transfer(group: {Player}, destination: string?, side: Side?)
|
|||||||
for _, player in group do
|
for _, player in group do
|
||||||
local pending = {destination = destination, side = side, attempts = 1}
|
local pending = {destination = destination, side = side, attempts = 1}
|
||||||
transfers[player] = pending
|
transfers[player] = pending
|
||||||
send(player, "Transfer", if destination then "Загружаем арену…" else "Возвращаем в общее лобби…")
|
send(player, "Transfer", if destination then Text.zagruzhaemArenu else Text.vozvraschaemVObscheeLobbi)
|
||||||
task.delay(25, function()
|
task.delay(25, function()
|
||||||
if transfers[player] == pending and present(player) then transferFailed(player) end
|
if transfers[player] == pending and present(player) then transferFailed(player) end
|
||||||
end)
|
end)
|
||||||
@@ -180,7 +182,7 @@ local function launch(host: Player, guests: {Player}?, access: "Public" | "Priva
|
|||||||
end
|
end
|
||||||
for _, player in members do
|
for _, player in members do
|
||||||
transfers[player] = {destination = destination, attempts = 1}
|
transfers[player] = {destination = destination, attempts = 1}
|
||||||
if access == "Private" then send(player, "Transfer", "Готовим арену…") end
|
if access == "Private" then send(player, "Transfer", Text.gotovimArenu) end
|
||||||
end
|
end
|
||||||
local record: Session = {
|
local record: Session = {
|
||||||
hostId = host.UserId, hostName = host.DisplayName, access = access,
|
hostId = host.UserId, hostName = host.DisplayName, access = access,
|
||||||
@@ -195,9 +197,9 @@ local function launch(host: Player, guests: {Player}?, access: "Public" | "Priva
|
|||||||
if not saved or not hostHere or (access == "Private" and #members < 2) then
|
if not saved or not hostHere or (access == "Private" and #members < 2) then
|
||||||
for _, player in members do
|
for _, player in members do
|
||||||
transfers[player] = nil
|
transfers[player] = nil
|
||||||
fail(player, if not hostHere then "Создатель вышел с сервера."
|
fail(player, if not hostHere then Text.sozdatelVyshelSServera
|
||||||
elseif not saved then "Сервис арен Roblox временно недоступен. Попробуйте позже."
|
elseif not saved then Text.servisArenRobloxVremenno
|
||||||
else "Подтвердившие игроки вышли с сервера.")
|
else Text.podtverdivshieIgrokiVyshliS)
|
||||||
end
|
end
|
||||||
if saved and sessions then
|
if saved and sessions then
|
||||||
pcall(sessions.RemoveAsync, sessions, destination)
|
pcall(sessions.RemoveAsync, sessions, destination)
|
||||||
@@ -232,7 +234,7 @@ local function updateParty(party: Party, expired: boolean?)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
if #accepted == 0 or not inLobby(party.host) then
|
if #accepted == 0 or not inLobby(party.host) then
|
||||||
closeParty(party, if #accepted == 0 then "Никто не подтвердил приглашение." else "Создатель покинул лобби.")
|
closeParty(party, if #accepted == 0 then Text.niktoNePodtverdilPriglashenie else Text.sozdatelPokinulLobbi)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
closeParty(party)
|
closeParty(party)
|
||||||
@@ -246,18 +248,18 @@ local function invite(host: Player, selection: unknown, options: RoundOptions)
|
|||||||
for _, userId in selection do
|
for _, userId in selection do
|
||||||
checked += 1
|
checked += 1
|
||||||
if checked >= Hosting.MaxPlayers or typeof(userId) ~= "number" or userId % 1 ~= 0 or math.abs(userId) >= 2^53 then
|
if checked >= Hosting.MaxPlayers or typeof(userId) ~= "number" or userId % 1 ~= 0 or math.abs(userId) >= 2^53 then
|
||||||
fail(host, "Выберите до 19 игроков.")
|
fail(host, Text.vyberiteDoIgrokov)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local player = Players:GetPlayerByUserId(userId)
|
local player = Players:GetPlayerByUserId(userId)
|
||||||
if player == host or not player or not present(player) or invitations[player] or parties[player] or transfers[player] then
|
if player == host or not player or not present(player) or invitations[player] or parties[player] or transfers[player] then
|
||||||
fail(host, "Кто-то из выбранных уже недоступен. Проверьте список игроков.")
|
fail(host, Text.ktoToIzVybrannykh)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
answers[player] = "Pending"
|
answers[player] = "Pending"
|
||||||
end
|
end
|
||||||
if not next(answers) then
|
if not next(answers) then
|
||||||
fail(host, "Выберите хотя бы одного игрока.")
|
fail(host, Text.vyberiteKhotyaByOdnogo)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local party = {id = HttpService:GenerateGUID(false), host = host, answers = answers, roundOptions = options,
|
local party = {id = HttpService:GenerateGUID(false), host = host, answers = answers, roundOptions = options,
|
||||||
@@ -350,7 +352,7 @@ local function joinPublic(player: Player, id: unknown, preference: unknown)
|
|||||||
if not inLobby(player) then transfers[player] = nil return end
|
if not inLobby(player) then transfers[player] = nil return end
|
||||||
if not ok or not row or row.players >= Hosting.MaxPlayers then
|
if not ok or not row or row.players >= Hosting.MaxPlayers then
|
||||||
transfers[player] = nil
|
transfers[player] = nil
|
||||||
fail(player, "Арена закрылась или уже заполнена.")
|
fail(player, Text.arenaZakrylasIliUzhe)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if preference then
|
if preference then
|
||||||
@@ -358,7 +360,7 @@ local function joinPublic(player: Player, id: unknown, preference: unknown)
|
|||||||
local issue = if preference == "Blue" then Hosting.teamJoinError(blue, orange) else Hosting.teamJoinError(orange, blue)
|
local issue = if preference == "Blue" then Hosting.teamJoinError(blue, orange) else Hosting.teamJoinError(orange, blue)
|
||||||
if issue then
|
if issue then
|
||||||
transfers[player] = nil
|
transfers[player] = nil
|
||||||
fail(player, if issue == "Full" then "В этой команде нет мест." else "Составы изменились. Выберите другую команду.")
|
fail(player, if issue == "Full" then Text.vEtoyKomandeNet else Text.sostavyIzmenilisVyberiteDruguyu)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -382,29 +384,29 @@ remote.OnServerEvent:Connect(function(player: Player, action: unknown, value: un
|
|||||||
if action == "Answer" then answer(player, value, extra) return end
|
if action == "Answer" then answer(player, value, extra) return end
|
||||||
if action == "Cancel" then
|
if action == "Cancel" then
|
||||||
local party = parties[player]
|
local party = parties[player]
|
||||||
if party then closeParty(party, "Приглашения отменены.") end
|
if party then closeParty(party, Text.priglasheniyaOtmeneny) end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not inLobby(player) then return end
|
if not inLobby(player) then return end
|
||||||
if parties[player] or invitations[player] then
|
if parties[player] or invitations[player] then
|
||||||
fail(player, "Сначала завершите текущее приглашение.")
|
fail(player, Text.snachalaZavershiteTekuscheePriglashenie)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if action == "JoinPublic" then joinPublic(player, value, extra) return end
|
if action == "JoinPublic" then joinPublic(player, value, extra) return end
|
||||||
if action ~= "CreatePublic" and action ~= "InvitePrivate" then return end
|
if action ~= "CreatePublic" and action ~= "InvitePrivate" then return end
|
||||||
local options = Hosting.readRoundOptions(if action == "CreatePublic" then value else extra)
|
local options = Hosting.readRoundOptions(if action == "CreatePublic" then value else extra)
|
||||||
if not options then
|
if not options then
|
||||||
fail(player, "Проверьте выбранный режим и настройки арены.")
|
fail(player, Text.proverTeVybrannyyRezhim)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if now - (lastCreate[player] or -math.huge) < 3 then
|
if now - (lastCreate[player] or -math.huge) < 3 then
|
||||||
fail(player, "Подождите несколько секунд перед повторной попыткой.")
|
fail(player, Text.podozhditeNeskolKoSekund)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
lastCreate[player] = now
|
lastCreate[player] = now
|
||||||
if localPreview then
|
if localPreview then
|
||||||
if action == "CreatePublic" then createLocalPublic(player, options)
|
if action == "CreatePublic" then createLocalPublic(player, options)
|
||||||
else fail(player, "Для приватной арены нужен плейс, сохранённый в Roblox.") end
|
else fail(player, Text.dlyaPrivatnoyArenyNuzhen) end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if action == "CreatePublic" then launch(player, nil, "Public", options) else invite(player, value, options) end
|
if action == "CreatePublic" then launch(player, nil, "Public", options) else invite(player, value, options) end
|
||||||
@@ -442,7 +444,7 @@ Players.PlayerRemoving:Connect(function(player)
|
|||||||
lastAction[player], lastCreate[player], lastList[player], transfers[player] = nil, nil, nil, nil
|
lastAction[player], lastCreate[player], lastList[player], transfers[player] = nil, nil, nil, nil
|
||||||
lastDetails[player], moreFrom[player] = nil, nil
|
lastDetails[player], moreFrom[player] = nil, nil
|
||||||
local sent = parties[player]
|
local sent = parties[player]
|
||||||
if sent then closeParty(sent, "Создатель вышел с сервера.") end
|
if sent then closeParty(sent, Text.sozdatelVyshelSServera) end
|
||||||
local received = invitations[player]
|
local received = invitations[player]
|
||||||
if received then
|
if received then
|
||||||
invitations[player], received.answers[player] = nil, nil
|
invitations[player], received.answers[player] = nil, nil
|
||||||
@@ -563,11 +565,11 @@ if hosted then
|
|||||||
if not present(player) or admitted[player] then return end
|
if not present(player) or admitted[player] then return end
|
||||||
local record = session
|
local record = session
|
||||||
if not record or closing then
|
if not record or closing then
|
||||||
player:Kick("Эта арена больше недоступна.")
|
player:Kick(Text.etaArenaBolShe)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if not allowed(record, player) then
|
if not allowed(record, player) then
|
||||||
player:Kick("Эта арена доступна только участникам с подтверждённым приглашением.")
|
player:Kick(Text.etaArenaDostupnaTol)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local count = 0
|
local count = 0
|
||||||
|
|||||||
+24
-73
@@ -1,5 +1,8 @@
|
|||||||
--!strict
|
--!strict
|
||||||
local TweenService = game:GetService("TweenService")
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.HotPoint
|
||||||
|
|
||||||
|
local Diagnostics = require(script.Parent.ModeRuntime.ZoneDiagnostics)
|
||||||
|
local Credit = require(script.Parent.ModeRuntime.HotPointCredit)
|
||||||
local Sites = require(script.Parent:WaitForChild("ArenaObjectiveSites") :: ModuleScript)
|
local Sites = require(script.Parent:WaitForChild("ArenaObjectiveSites") :: ModuleScript)
|
||||||
|
|
||||||
type Side = "Blue" | "Orange"
|
type Side = "Blue" | "Orange"
|
||||||
@@ -8,6 +11,7 @@ export type Marker = {body: Part, label: TextLabel, origin: Vector3}
|
|||||||
type Config = {
|
type Config = {
|
||||||
state: Instance, geometry: RaycastParams, sites: {Sites.Site}, startedAt: number,
|
state: Instance, geometry: RaycastParams, sites: {Sites.Site}, startedAt: number,
|
||||||
marker: (Sites.Site) -> Marker, score: (Side, number) -> (), status: (string) -> (),
|
marker: (Sites.Site) -> Marker, score: (Side, number) -> (), status: (string) -> (),
|
||||||
|
contribute: ((Player, string, number) -> ())?,
|
||||||
}
|
}
|
||||||
type Capture = {
|
type Capture = {
|
||||||
step: ({Fighter}, number, number) -> (), hit: (Player, number, boolean) -> (),
|
step: ({Fighter}, number, number) -> (), hit: (Player, number, boolean) -> (),
|
||||||
@@ -24,20 +28,20 @@ local TEAM_SPEED = 1.5
|
|||||||
local HIT_WINDOW = 1.2
|
local HIT_WINDOW = 1.2
|
||||||
local HIT_DECAY = .8
|
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 contested = Color3.fromRGB(255, 211, 124)
|
||||||
local teamColor: {[Side]: Color3} = {Blue = Color3.fromRGB(76, 228, 255), Orange = Color3.fromRGB(255, 81, 105)}
|
local teamColor: {[Side]: Color3} = {Blue = Color3.fromRGB(76, 228, 255), Orange = Color3.fromRGB(255, 81, 105)}
|
||||||
|
|
||||||
function HotPoint.attachRing(mark: Marker): (Color3) -> ()
|
function HotPoint.attachRing(mark: Marker, radius: number?): (Color3) -> ()
|
||||||
|
local r = radius or HotPoint.Radius
|
||||||
local body = mark.body
|
local body = mark.body
|
||||||
body.Transparency = .92
|
body.Transparency = .92
|
||||||
local beams: {Beam} = {}
|
local beams: {Beam} = {}
|
||||||
local sparks: {ParticleEmitter} = {}
|
|
||||||
local function anchor(angle: number, height: number): Attachment
|
local function anchor(angle: number, height: number): Attachment
|
||||||
local radial = Vector3.new(math.cos(angle), 0, math.sin(angle))
|
local radial = Vector3.new(math.cos(angle), 0, math.sin(angle))
|
||||||
local tangent = Vector3.new(-radial.Z, 0, radial.X)
|
local tangent = Vector3.new(-radial.Z, 0, radial.X)
|
||||||
local item = Instance.new("Attachment")
|
local item = Instance.new("Attachment")
|
||||||
local world = CFrame.fromMatrix(mark.origin + radial * HotPoint.Radius + Vector3.yAxis * height, tangent, Vector3.yAxis)
|
local world = CFrame.fromMatrix(mark.origin + radial * r + Vector3.yAxis * height, tangent, Vector3.yAxis)
|
||||||
item.CFrame = body.CFrame:ToObjectSpace(world)
|
item.CFrame = body.CFrame:ToObjectSpace(world)
|
||||||
item.Parent = body
|
item.Parent = body
|
||||||
return item
|
return item
|
||||||
@@ -47,7 +51,7 @@ function HotPoint.attachRing(mark: Marker): (Color3) -> ()
|
|||||||
for index = 0, 3 do
|
for index = 0, 3 do
|
||||||
table.insert(corners, anchor(index * math.pi / 2, height))
|
table.insert(corners, anchor(index * math.pi / 2, height))
|
||||||
end
|
end
|
||||||
local handle = 4 * (math.sqrt(2) - 1) / 3 * HotPoint.Radius
|
local handle = 4 * (math.sqrt(2) - 1) / 3 * r
|
||||||
for index, start in corners do
|
for index, start in corners do
|
||||||
local beam = Instance.new("Beam")
|
local beam = Instance.new("Beam")
|
||||||
beam.Name = name
|
beam.Name = name
|
||||||
@@ -78,22 +82,6 @@ function HotPoint.attachRing(mark: Marker): (Color3) -> ()
|
|||||||
veil.Parent = body
|
veil.Parent = body
|
||||||
table.insert(beams, veil)
|
table.insert(beams, veil)
|
||||||
end
|
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
|
end
|
||||||
return function(tint: Color3)
|
return function(tint: Color3)
|
||||||
body.Color, mark.label.TextColor3 = tint, tint
|
body.Color, mark.label.TextColor3 = tint, tint
|
||||||
@@ -104,50 +92,12 @@ function HotPoint.attachRing(mark: Marker): (Color3) -> ()
|
|||||||
ColorSequenceKeypoint.new(1, tint),
|
ColorSequenceKeypoint.new(1, tint),
|
||||||
})
|
})
|
||||||
for _, beam in beams do beam.Color = spectrum end
|
for _, beam in beams do beam.Color = spectrum end
|
||||||
for _, emitter in sparks do emitter.Color = spectrum end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function collapse(mark: Marker)
|
local function closeMarker(mark: Marker)
|
||||||
local body = mark.body
|
mark.body:SetAttribute("ObjectiveArrowHidden", true)
|
||||||
local motion = TweenInfo.new(COLLAPSE_SECONDS, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
|
mark.body.Parent = nil
|
||||||
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)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function HotPoint.start(config: Config): Capture
|
function HotPoint.start(config: Config): Capture
|
||||||
@@ -182,11 +132,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 < -.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
|
if delta.Y > 8 then
|
||||||
-- A jump over the point still counts when the first floor below is the capture floor.
|
-- 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
|
return floor ~= nil and math.abs(floor.Position.Y - origin.Y) < .65
|
||||||
end
|
end
|
||||||
local to = origin + Vector3.yAxis * 2.7 - fighter.root.Position
|
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
|
end
|
||||||
|
|
||||||
local function step(fighters: {Fighter}, now: number, dt: number)
|
local function step(fighters: {Fighter}, now: number, dt: number)
|
||||||
@@ -207,10 +157,10 @@ function HotPoint.start(config: Config): Capture
|
|||||||
local since = now - capturedAt
|
local since = now - capturedAt
|
||||||
if since >= COLLAPSE_SECONDS + CAPTURE_NOTICE_SECONDS then
|
if since >= COLLAPSE_SECONDS + CAPTURE_NOTICE_SECONDS then
|
||||||
publish(nil, 0, nil)
|
publish(nil, 0, nil)
|
||||||
config.status("Скоро появится новая точка")
|
config.status(Text.skoroPoyavitsyaNovayaTochka)
|
||||||
elseif since >= COLLAPSE_SECONDS then
|
elseif since >= COLLAPSE_SECONDS then
|
||||||
publish(capturedSide, 100, "Captured")
|
publish(capturedSide, 100, "Captured")
|
||||||
config.status("Точка захвачена")
|
config.status(Text.tochkaZakhvachena)
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -221,10 +171,11 @@ function HotPoint.start(config: Config): Capture
|
|||||||
for _, fighter in fighters do
|
for _, fighter in fighters do
|
||||||
if not isInside(fighter, site.position) then continue end
|
if not isInside(fighter, site.position) then continue end
|
||||||
table.insert(inside, fighter)
|
table.insert(inside, fighter)
|
||||||
|
if config.contribute then config.contribute(fighter.player, "holdSeconds", dt) end
|
||||||
if fighter.side == "Blue" then blue += 1 else orange += 1 end
|
if fighter.side == "Blue" then blue += 1 else orange += 1 end
|
||||||
end
|
end
|
||||||
local remaining = math.ceil(movesAt - now)
|
local remaining = math.ceil(movesAt - now)
|
||||||
config.status(site.name .. " · Смена точки через " .. remaining .. " с")
|
config.status(site.name .. Text.smenaTochkiCherez .. remaining .. Text.s)
|
||||||
local soleSide: Side? = if blue > 0 and orange == 0 then "Blue" elseif orange > 0 and blue == 0 then "Orange" else nil
|
local soleSide: Side? = if blue > 0 and orange == 0 then "Blue" elseif orange > 0 and blue == 0 then "Orange" else nil
|
||||||
local isContested = blue > 0 and orange > 0
|
local isContested = blue > 0 and orange > 0
|
||||||
if soleSide then
|
if soleSide then
|
||||||
@@ -245,22 +196,22 @@ function HotPoint.start(config: Config): Capture
|
|||||||
end
|
end
|
||||||
local underFire = now < hitUntil
|
local underFire = now < hitUntil
|
||||||
local damageTime = math.max(0, math.min(now, hitUntil) - math.max(now - dt, hitSince))
|
local damageTime = math.max(0, math.min(now, hitUntil) - math.max(now - dt, hitSince))
|
||||||
if damageTime > 0 then credit = math.max(0, credit - damageTime * HIT_DECAY) end
|
|
||||||
if not isContested then
|
|
||||||
local count = if side == "Blue" then blue else orange
|
local count = if side == "Blue" then blue else orange
|
||||||
credit += (dt - damageTime) * (if count >= 2 then TEAM_SPEED else 1)
|
credit = Credit.advance(credit, dt, damageTime, HIT_DECAY, if count >= 2 then TEAM_SPEED else 1, isContested)
|
||||||
end
|
|
||||||
if credit >= CAPTURE_SECONDS then
|
if credit >= CAPTURE_SECONDS then
|
||||||
capturedSide, capturedAt = side, now
|
capturedSide, capturedAt = side, now
|
||||||
movesAt = now + COLLAPSE_SECONDS + CAPTURE_NOTICE_SECONDS + NEXT_POINT_WARNING_SECONDS
|
movesAt = now + COLLAPSE_SECONDS + CAPTURE_NOTICE_SECONDS + NEXT_POINT_WARNING_SECONDS
|
||||||
config.score(side, 1)
|
config.score(side, 1)
|
||||||
|
if config.contribute then
|
||||||
|
for player in capturers do config.contribute(player, "captures", 1) end
|
||||||
|
end
|
||||||
clearCapture()
|
clearCapture()
|
||||||
publish(nil, 0, nil)
|
publish(nil, 0, nil)
|
||||||
config.status("")
|
config.status("")
|
||||||
state:SetAttribute("HotPointPosition", nil)
|
state:SetAttribute("HotPointPosition", nil)
|
||||||
state:SetAttribute("HotPointMovesAt", movesAt)
|
state:SetAttribute("HotPointMovesAt", movesAt)
|
||||||
paintRing(teamColor[side])
|
paintRing(teamColor[side])
|
||||||
if mark then collapse(mark) end
|
if mark then closeMarker(mark) end
|
||||||
else
|
else
|
||||||
local phase = if isContested then "Contested" elseif underFire then "UnderFire" else "Capturing"
|
local phase = if isContested then "Contested" elseif underFire then "UnderFire" else "Capturing"
|
||||||
publish(side, math.floor(100 * credit / CAPTURE_SECONDS), phase)
|
publish(side, math.floor(100 * credit / CAPTURE_SECONDS), phase)
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.HotPointGuide
|
||||||
|
|
||||||
local Players = game:GetService("Players")
|
local Players = game:GetService("Players")
|
||||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
local RunService = game:GetService("RunService")
|
local RunService = game:GetService("RunService")
|
||||||
@@ -19,14 +21,14 @@ gui.DisplayOrder = 25
|
|||||||
gui.Enabled = false
|
gui.Enabled = false
|
||||||
gui.Parent = playerGui
|
gui.Parent = playerGui
|
||||||
|
|
||||||
local panel = UI.plate(gui, "Direction", UDim2.fromScale(.5, .78), UDim2.new(.85, 0, 0, 60), UI.Outline)
|
local panel = UI.plate(gui, "Direction", UDim2.fromScale(.5, .68), UDim2.new(.85, 0, 0, 60), UI.Outline)
|
||||||
panel.AnchorPoint = Vector2.new(.5, .5)
|
panel.AnchorPoint = Vector2.new(.5, .5)
|
||||||
local sizeLimit = Instance.new("UISizeConstraint")
|
local sizeLimit = Instance.new("UISizeConstraint")
|
||||||
sizeLimit.MaxSize = Vector2.new(326, 60)
|
sizeLimit.MaxSize = Vector2.new(326, 60)
|
||||||
sizeLimit.Parent = panel
|
sizeLimit.Parent = panel
|
||||||
local contour = UI.contour(panel, UI.Blue)
|
local contour = UI.contour(panel, UI.Blue)
|
||||||
local arrow = UI.label(panel, "Arrow", "▲", UDim2.fromOffset(12, 8), UDim2.fromOffset(44, 44), 29, UI.Blue)
|
local arrow = UI.label(panel, "Arrow", "▲", UDim2.fromOffset(12, 8), UDim2.fromOffset(44, 44), 29, UI.Blue)
|
||||||
local title = UI.label(panel, "Title", "К ГОРЯЧЕЙ ТОЧКЕ", UDim2.fromOffset(63, 7), UDim2.new(1, -72, 0, 23), 18, UI.Ink)
|
local title = UI.label(panel, "Title", Text.kGoryacheyTochke, UDim2.fromOffset(63, 7), UDim2.new(1, -72, 0, 23), 18, UI.Ink)
|
||||||
title.TextXAlignment = Enum.TextXAlignment.Left
|
title.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
local detail = UI.label(panel, "Detail", "", UDim2.fromOffset(63, 31), UDim2.new(1, -72, 0, 20), 15, UI.Muted)
|
local detail = UI.label(panel, "Detail", "", UDim2.fromOffset(63, 31), UDim2.new(1, -72, 0, 20), 15, UI.Muted)
|
||||||
detail.TextXAlignment = Enum.TextXAlignment.Left
|
detail.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
@@ -81,9 +83,9 @@ local function update()
|
|||||||
arrow.TextColor3 = tint
|
arrow.TextColor3 = tint
|
||||||
local localDirection = camera.CFrame:VectorToObjectSpace(flat)
|
local localDirection = camera.CFrame:VectorToObjectSpace(flat)
|
||||||
arrow.Rotation = math.deg(math.atan2(localDirection.X, -localDirection.Z))
|
arrow.Rotation = math.deg(math.atan2(localDirection.X, -localDirection.Z))
|
||||||
title.Text = if moving then ("НОВАЯ ТОЧКА · %d С"):format(math.ceil(remaining)) else "К ГОРЯЧЕЙ ТОЧКЕ"
|
title.Text = if moving then (Text.novayaTochkaDS):format(math.ceil(remaining)) else Text.kGoryacheyTochke
|
||||||
local floor = if delta.Y > 8 then " · ВЫШЕ" elseif delta.Y < -8 then " · НИЖЕ" else ""
|
local floor = if delta.Y > 8 then Text.vyshe elseif delta.Y < -8 then Text.nizhe else ""
|
||||||
detail.Text = ("%d СТУДОВ%s"):format(math.floor(delta.Magnitude + .5), floor)
|
detail.Text = (Text.dStudovS):format(math.floor(delta.Magnitude + .5), floor)
|
||||||
end
|
end
|
||||||
|
|
||||||
local connection = RunService.RenderStepped:Connect(update)
|
local connection = RunService.RenderStepped:Connect(update)
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
--!strict
|
||||||
|
local Config = require(script.Parent.EffectsConfig)
|
||||||
|
local Budget = {}
|
||||||
|
function Budget.profile(touch: boolean, keyboard: boolean)
|
||||||
|
return if touch and not keyboard then Config.Mobile else Config.Desktop
|
||||||
|
end
|
||||||
|
function Budget.particles(requested: number, scale: number): number
|
||||||
|
return if requested <= 0 then 0 else math.max(1, math.floor(requested * scale))
|
||||||
|
end
|
||||||
|
return table.freeze(Budget)
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
--!strict
|
||||||
|
local tick = "rbxassetid://113416294133952"
|
||||||
|
local ready = "rbxassetid://2789428506"
|
||||||
|
local success = "rbxassetid://4612374036"
|
||||||
|
export type Cue = {id: string, volume: number, speed: number}
|
||||||
|
local function cue(id: string, volume: number, speed: number): Cue
|
||||||
|
return table.freeze({id = id, volume = volume, speed = speed})
|
||||||
|
end
|
||||||
|
return table.freeze({
|
||||||
|
Debug = false, SoundLimit = 6, HintLimit = 60,
|
||||||
|
Danger = Color3.fromRGB(255, 81, 105),
|
||||||
|
FeedbackSeconds = .55, BannerMotionSeconds = .22,
|
||||||
|
Desktop = table.freeze({scale = 1, maxEmitters = 200, burstSlots = 10, worldSlots = 8}),
|
||||||
|
Mobile = table.freeze({scale = .4, maxEmitters = 80, burstSlots = 4, worldSlots = 4}),
|
||||||
|
Cues = table.freeze({
|
||||||
|
RoundStart = cue(success,.27,1.15), Countdown = cue(tick,.25,1), Tick = cue(tick,.22,1.12),
|
||||||
|
FinalPush = cue(ready,.25,.9), ZoneEnter = cue(tick,.23,1.30), ZoneCharge = cue(ready,.22,1),
|
||||||
|
ZoneBlocked = cue(ready,.25,.70), ZoneDecay = cue(ready,.20,.58), ZoneCaptured = cue(success,.28,1),
|
||||||
|
AllTaken = cue(success,.27,1.18), FlagPicked = cue(ready,.25,1), FlagDropped = cue(ready,.23,.72),
|
||||||
|
FlagScored = cue(success,.28,1.06), TokenPick = cue(tick,.22,1.21), TokensBanked = cue(success,.27,1.2),
|
||||||
|
LeaderDown = cue(success,.28,.94), RoleSwap = cue(ready,.25,1.18),
|
||||||
|
MiniRoundStart = cue(success,.26,1.24), Results = cue(success,.25,.92),
|
||||||
|
}),
|
||||||
|
Aliases = table.freeze({
|
||||||
|
RoundCountdown = "Countdown", SiegeEnter = "ZoneEnter", SiegeCharge = "ZoneCharge",
|
||||||
|
SiegeTick = "Tick", SiegeBlocked = "ZoneBlocked", SiegeDecay = "ZoneDecay",
|
||||||
|
HotPointStart = "ZoneCharge", HotPointCaptured = "ZoneCaptured", HotPointMove = "Countdown",
|
||||||
|
}),
|
||||||
|
})
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
--!strict
|
||||||
|
return table.freeze({
|
||||||
|
ZoneStarted = "ZoneStarted", ZoneCaptured = "ZoneCaptured", ZoneContested = "ZoneContested", ZoneLost = "ZoneLost",
|
||||||
|
FullControl = "FullControl", AllObjectivesTaken = "AllObjectivesTaken", FlagPicked = "FlagPicked", FlagDropped = "FlagDropped",
|
||||||
|
FlagReturned = "FlagReturned", FlagScored = "FlagScored", TokenPicked = "TokenPicked", TokenDropped = "TokenDropped", TokensBanked = "TokensBanked", TokensLost = "TokensLost",
|
||||||
|
LeaderAssigned = "LeaderAssigned", LeaderDown = "LeaderDown", MiniRoundStarted = "MiniRoundStarted",
|
||||||
|
MiniRoundEnded = "MiniRoundEnded", RoleSwap = "RoleSwap", Streak = "Streak",
|
||||||
|
})
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
--!strict
|
||||||
|
export type Hint = {key: string, text: string, priority: number, cooldown: number?, ttl: number?}
|
||||||
|
export type State = {shownAt: {[string]: number}, current: Hint?, currentUntil: number}
|
||||||
|
local Config = require(script.Parent.EffectsConfig)
|
||||||
|
local Hints = {DEFAULT_COOLDOWN = 3, DEFAULT_TTL = 3}
|
||||||
|
function Hints.new(): State return {shownAt = {}, current = nil, currentUntil = 0} end
|
||||||
|
function Hints.pick(state: State, candidates: {Hint}, now: number): Hint?
|
||||||
|
local current = state.current
|
||||||
|
if current and now >= state.currentUntil then state.current, current = nil, nil end
|
||||||
|
local best: Hint? = nil
|
||||||
|
for _, hint in candidates do
|
||||||
|
local active = current ~= nil and current.key == hint.key
|
||||||
|
local last = state.shownAt[hint.key]
|
||||||
|
if (active or last == nil or now - last >= (hint.cooldown or Hints.DEFAULT_COOLDOWN))
|
||||||
|
and (best == nil or hint.priority > best.priority) then best = hint end
|
||||||
|
end
|
||||||
|
if best and (not current or best.key == current.key or best.priority > current.priority) then
|
||||||
|
state.current = best
|
||||||
|
state.currentUntil = now + (best.ttl or Hints.DEFAULT_TTL)
|
||||||
|
state.shownAt[best.key] = now
|
||||||
|
return best
|
||||||
|
end
|
||||||
|
return current
|
||||||
|
end
|
||||||
|
function Hints.compact(text: string): string
|
||||||
|
local line = text:gsub("[\r\n]+", " ")
|
||||||
|
local cut = utf8.offset(line, Config.HintLimit)
|
||||||
|
if cut and utf8.offset(line, Config.HintLimit + 1) then return line:sub(1, cut - 1) .. "…" end
|
||||||
|
return line
|
||||||
|
end
|
||||||
|
return Hints
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
--!strict
|
||||||
|
local Siege = require(script.Parent.Parent:WaitForChild("CitadelAssaultConfig") :: ModuleScript)
|
||||||
|
export type ModeProfile = {
|
||||||
|
id: string, roundSeconds: number, briefingSeconds: number, countdownSeconds: number,
|
||||||
|
finalPushSeconds: number, respawnDelay: number, spawnProtection: number,
|
||||||
|
goal: string, rules: {string}, scoreMultiplierInFinalPush: number,
|
||||||
|
}
|
||||||
|
local ROUND_SECONDS = 300
|
||||||
|
local function profile(id: string, goal: string, rules: {string}, roundSeconds: number?, finalPush: number?): ModeProfile
|
||||||
|
assert(#rules == 3, id .. ": нужно ровно три правила")
|
||||||
|
return table.freeze({
|
||||||
|
id = id, roundSeconds = roundSeconds or ROUND_SECONDS, briefingSeconds = 5, countdownSeconds = 3,
|
||||||
|
finalPushSeconds = finalPush or 30, respawnDelay = 2, spawnProtection = 2,
|
||||||
|
goal = goal, rules = table.freeze(rules), scoreMultiplierInFinalPush = 1,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
local profiles: {[string]: ModeProfile} = {
|
||||||
|
TeamDeathmatch = profile("TeamDeathmatch", "Устраните больше соперников, чем они вас.",
|
||||||
|
{"Каждое устранение — 1 очко", "После гибели вы возрождаетесь", "При равном счёте — ничья"}),
|
||||||
|
HotPoint = profile("HotPoint", "Захватите активную зону раньше соперников.",
|
||||||
|
{"Оставайтесь в круге 10 секунд", "С союзником захват в 1,5 раза быстрее", "Соперник оспаривает захват"}),
|
||||||
|
Domination = profile("Domination", "Удерживайте больше точек, чем соперники.",
|
||||||
|
{"Точка берётся за 3 секунды без соперников", "Каждая ваша точка — 1 очко в секунду", "Соперники в круге прерывают захват"}),
|
||||||
|
CaptureFlag = profile("CaptureFlag", "Принесите флаг с крыши на свою базу.",
|
||||||
|
{"Флаг может взять любой игрок", "Упавший флаг лежит 20 секунд", "Доставка — 1 очко"}),
|
||||||
|
TrophyHunt = profile("TrophyHunt", "Соберите жетоны и сдайте их на базе.",
|
||||||
|
{"Жетон выпадает после устранения", "При гибели ваши жетоны выпадают", "Каждый сданный жетон — 1 очко"}),
|
||||||
|
Siege = profile("Siege", "В атаке берите рубежи, в защите удерживайте их.",
|
||||||
|
{"Рубежи берутся по очереди", "Удерживайте круг 4 секунды", "В середине матча команды меняются ролями"}, Siege.MATCH_DURATION),
|
||||||
|
OneLife = profile("OneLife", "Выиграйте три мини-раунда.",
|
||||||
|
{"В мини-раунде одна жизнь", "Выигрывает команда с большим числом живых", "Мини-раунд длится до 45 секунд"}, nil, 0),
|
||||||
|
HuntLeader = profile("HuntLeader", "Устраните лидера соперников и защитите своего.",
|
||||||
|
{"Обычное устранение — 1 очко", "Лидер соперников — 3 очка", "После гибели лидера назначается новый"}),
|
||||||
|
}
|
||||||
|
return table.freeze(profiles)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
--!strict
|
||||||
|
return table.freeze({
|
||||||
|
safeSpawnDistance = 32,
|
||||||
|
CameraShake = false,
|
||||||
|
lateBriefingSeconds = 2,
|
||||||
|
startBannerSeconds = 1.15,
|
||||||
|
finalBannerSeconds = 3,
|
||||||
|
finalTickSeconds = 10,
|
||||||
|
mvpWeights = table.freeze({kills = 1, captures = 3, holdSeconds = .1, deliveries = 4, tokensBanked = 1, leaderKills = 3, deaths = -.25}),
|
||||||
|
})
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.SiegeResults
|
||||||
|
|
||||||
|
local Results = {}
|
||||||
|
|
||||||
|
function Results.clockPrecise(t: number): string
|
||||||
|
return string.format("%d:%05.2f", math.floor(t / 60), t % 60)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Results.rows(times: {[string]: any}, total: number): {string}
|
||||||
|
local rows = {}
|
||||||
|
for i = 1, total do
|
||||||
|
local b, o = times["BlueTime" .. i], times["OrangeTime" .. i]
|
||||||
|
rows[i] = string.format(Text.rubezhDSinieS, i,
|
||||||
|
if typeof(b) == "number" then Results.clockPrecise(b) else "—",
|
||||||
|
if typeof(o) == "number" then Results.clockPrecise(o) else "—")
|
||||||
|
end
|
||||||
|
return rows
|
||||||
|
end
|
||||||
|
|
||||||
|
Results.tiebreak = Text.priRavenstveRubezheyPobezhdaet
|
||||||
|
return table.freeze(Results)
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
--!strict
|
||||||
|
local Stage = {}
|
||||||
|
|
||||||
|
function Stage.combatAllowed(state: Instance): boolean
|
||||||
|
local stage = state:GetAttribute("RoundStage")
|
||||||
|
return stage == nil or stage == "Live" or stage == "FinalPush"
|
||||||
|
end
|
||||||
|
|
||||||
|
return table.freeze(Stage)
|
||||||
@@ -0,0 +1,542 @@
|
|||||||
|
--!strict
|
||||||
|
local function team(side: string?): string
|
||||||
|
return if side == "Blue" then "Синие" elseif side == "Orange" then "Оранжевые" else "Команда"
|
||||||
|
end
|
||||||
|
local function clock(seconds: number): string
|
||||||
|
return string.format("%d:%02d", math.floor(seconds / 60), math.floor(seconds % 60))
|
||||||
|
end
|
||||||
|
local function studs(distance: number): string
|
||||||
|
local n = math.floor(distance + .5)
|
||||||
|
local m10, m100 = n % 10, n % 100
|
||||||
|
local unit = if m10 == 1 and m100 ~= 11 then "студ"
|
||||||
|
elseif m10 >= 2 and m10 <= 4 and (m100 < 12 or m100 > 14) then "студа" else "студов"
|
||||||
|
return string.format("%d %s", n, unit)
|
||||||
|
end
|
||||||
|
local siegeHints = {
|
||||||
|
far = function(n: number) return "Двигайтесь к кругу — " .. studs(n) end,
|
||||||
|
height = function(dy: number) return if dy > 0 then "Круг выше вас — найдите нужный этаж" else "Круг ниже вас — найдите нужный этаж" end,
|
||||||
|
capturing = function(percent: number) return string.format("Стойте в круге — захват %d%%", percent) end,
|
||||||
|
swap = function(seconds: number) return string.format("Смена ролей через %d с. Незавершённый захват сбросится.", seconds) end,
|
||||||
|
captured = function(index: number) return string.format("Рубеж %d взят! Следуйте к новой цели.", index) end,
|
||||||
|
defNew = function(index: number) return string.format("Не дайте взять рубеж %d!", index) end,
|
||||||
|
defLost = function(index: number, total: number) return if index <= total then string.format("Рубеж потерян! Защитите рубеж %d.", index) else "Соперники взяли последний рубеж." end,
|
||||||
|
all = "Все рубежи взяты! Держите позиции до конца атаки.",
|
||||||
|
tutorial = "Стойте в круге до заполнения полосы. Число атакующих не ускоряет захват. Защитник в круге останавливает его.",
|
||||||
|
newAttack = "Теперь вы атакуете. Возьмите первый рубеж.",
|
||||||
|
newDefense = "Теперь вы защищаете. Удерживайте первый рубеж.",
|
||||||
|
point = function(index: number, name: string) return string.format("РУБЕЖ %d · %s", index, name) end,
|
||||||
|
next = function(index: number, distance: string) return string.format("ДАЛЕЕ %d · %s", index, distance) end,
|
||||||
|
defend = "ЗАЩИТИТЕ РУБЕЖ", above = " · ВЫШЕ", below = " · НИЖЕ",
|
||||||
|
inside = "В ЗОНЕ", wrongFloor = "ДРУГОЙ ЭТАЖ", noSight = "НЕТ ВИДИМОСТИ",
|
||||||
|
blocked = "Нет прямой видимости центра — выйдите на открытое место.",
|
||||||
|
defHeight = "Вы на другом этаже и не блокируете захват.",
|
||||||
|
defBlocked = "Центр закрыт стеной. Смените позицию, чтобы блокировать захват.",
|
||||||
|
contested = "Зона оспаривается — устраните защитника.",
|
||||||
|
decay = "Захват откатывается — вернитесь в круг.",
|
||||||
|
defBlock = "Вы блокируете захват — оставайтесь в круге.",
|
||||||
|
defFar = "Враг на рубеже! Зайдите в круг, чтобы остановить захват.",
|
||||||
|
short = {
|
||||||
|
blocked = "Откройте обзор центра.", defHeight = "Смените этаж.", defBlocked = "Центр за стеной.",
|
||||||
|
contested = "Устраните защитника.", decay = "Вернитесь в круг.", defBlock = "Удерживайте круг.", defFar = "Остановите захват.",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
local domination = table.freeze({
|
||||||
|
height = "Точка на другом этаже.", blocked = "Из этой позиции не видно центр точки.",
|
||||||
|
contested = function(id: string) return "Точка " .. id .. " оспаривается — захват стоит." end,
|
||||||
|
free = function(id: string) return "Точка " .. id .. " свободна — займите её." end,
|
||||||
|
lost = function(id: string) return "Точка " .. id .. " потеряна — отбейте её!" end,
|
||||||
|
hold = function(n: number) return string.format("Держите точки — +%d очков в секунду.", n) end,
|
||||||
|
control = "ПОЛНЫЙ КОНТРОЛЬ",
|
||||||
|
})
|
||||||
|
local hotHints = table.freeze({
|
||||||
|
enter = "Зайдите в круг — захват занимает 10 секунд.",
|
||||||
|
team = "С союзником захват быстрее в 1,5 раза.",
|
||||||
|
fire = "Вас обстреливают — прогресс откатывается.",
|
||||||
|
next = "Новая точка через %d с — приготовьтесь.",
|
||||||
|
captured = "Точка захвачена — следующая через %d с.",
|
||||||
|
contest = "ОСПАРИВАЕТСЯ", underFire = "ПОД ОГНЁМ", taking = "ЗАХВАТ · С СОЮЗНИКОМ ×1,5",
|
||||||
|
})
|
||||||
|
local flagHints = table.freeze({
|
||||||
|
roof="Флаг на крыше цитадели.", deliver="Несите флаг на свою базу.",
|
||||||
|
enemy="Флаг у соперника — остановите его!", escort="Сопроводите союзника с флагом.",
|
||||||
|
dropped="Флаг упал — подберите его (%d с).", dropLabel="ФЛАГ УПАЛ · %d с",
|
||||||
|
base="НА СВОЮ БАЗУ",title="ФЛАГ",escortTitle="СОПРОВОДИТЕ НОСИТЕЛЯ",
|
||||||
|
picked="ФЛАГ ВЗЯТ!", enemyPicked="СОПЕРНИКИ ВЗЯЛИ ФЛАГ!", scored="ФЛАГ ДОСТАВЛЕН! +1",
|
||||||
|
})
|
||||||
|
local trophyHints = table.freeze({
|
||||||
|
carry="У вас %d жетонов — сдайте их на базе!", near="Рядом жетоны — подберите их.",
|
||||||
|
banked="СДАНО ЖЕТОНОВ ×%d", lost="Вы погибли — жетоны выпали.",
|
||||||
|
})
|
||||||
|
local lifeHints = table.freeze({
|
||||||
|
wait = "Вы выбыли до следующего мини-раунда. Наблюдайте за союзниками.",
|
||||||
|
spectate = "Наблюдаете: %s", begin = "ВПЕРЁД! · МИНИ-РАУНД %d · %d:%d",
|
||||||
|
win = "%s выиграли мини-раунд (%d против %d)", draw = "МИНИ-РАУНД ВНИЧЬЮ",
|
||||||
|
alive = "ЖИВЫ %d · %d",
|
||||||
|
})
|
||||||
|
local leaderHints = table.freeze({
|
||||||
|
self="Вы лидер — за вас дают 3 очка.", ally="Прикройте лидера: %s", enemy="Лидер соперников: %s",
|
||||||
|
new="НОВЫЙ ЛИДЕР · %s", down="ЛИДЕР УСТРАНЁН +3",
|
||||||
|
})
|
||||||
|
local teamDeathmatch = table.freeze({
|
||||||
|
chase="Отставание %d — время рисковать!",
|
||||||
|
streak="%s · СЕРИЯ %d",
|
||||||
|
})
|
||||||
|
local function flagCarrier(name: string): string return name .. " несёт флаг" end
|
||||||
|
local round = table.freeze({
|
||||||
|
mode = "РЕЖИМ", fight = "В БОЙ!", final = "ФИНАЛЬНЫЙ РЫВОК", swap = "СМЕНА РОЛЕЙ",
|
||||||
|
attack = "Вы атакуете", defend = "Вы защищаете", respawn = "ВОЗРОЖДЕНИЕ · %d",
|
||||||
|
untilStart = "ДО НАЧАЛА БОЯ", scoreReason = "Победа по командному счёту", drawReason = "Команды набрали поровну очков",
|
||||||
|
mvp = "MVP · %s", contribution = "ВАШ ВКЛАД · %s",
|
||||||
|
highlightOrder = {"captures", "deliveries", "tokensBanked", "leaderKills", "holdSeconds", "kills"},
|
||||||
|
stats = {kills = "Устранения", deaths = "Смерти", captures = "Захваты", holdSeconds = "В зоне, с",
|
||||||
|
carries = "Подборы флага", deliveries = "Доставки", tokensBanked = "Сдано жетонов", leaderKills = "Устранено лидеров", wins = "Победы"},
|
||||||
|
contributionKeys = {
|
||||||
|
TeamDeathmatch = {"kills", "deaths"}, HotPoint = {"captures", "holdSeconds"}, Domination = {"captures", "holdSeconds"},
|
||||||
|
CaptureFlag = {"carries", "deliveries"}, TrophyHunt = {"tokensBanked", "kills"}, Siege = {"captures", "holdSeconds"},
|
||||||
|
OneLife = {"kills", "deaths"}, HuntLeader = {"leaderKills", "kills"},
|
||||||
|
},
|
||||||
|
tutorial = {
|
||||||
|
TeamDeathmatch = "Держитесь рядом с союзниками.", HotPoint = "Шевроны укажут путь к активной зоне.",
|
||||||
|
Domination = "Цвет круга показывает, кто держит точку.", CaptureFlag = "Сопровождайте своего носителя.",
|
||||||
|
TrophyHunt = "Сдавайте жетоны, пока их не потеряли.", Siege = "Сверяйте этаж и видимость центра.",
|
||||||
|
OneLife = "Выходите на бой вместе с командой.", HuntLeader = "Ищите метку над лидером соперников.",
|
||||||
|
},
|
||||||
|
finalPush = {
|
||||||
|
TeamDeathmatch = "Последний шанс изменить счёт!", HotPoint = "Боритесь за последний захват!",
|
||||||
|
Domination = "Каждая секунда на счету!", CaptureFlag = "Последний рывок к своей базе!",
|
||||||
|
TrophyHunt = "Сдайте собранные жетоны!", Siege = "Время решающего штурма!",
|
||||||
|
OneLife = "Сохраните бойцов до конца!", HuntLeader = "Защитите своего лидера!",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
return table.freeze({
|
||||||
|
interface = table.freeze({
|
||||||
|
ArenaObjectiveSites = table.freeze({
|
||||||
|
bazaSinikh = "База синих",
|
||||||
|
bazaOranzhevykh = "База оранжевых",
|
||||||
|
nizhniyProkhod = "Нижний проход",
|
||||||
|
srednyayaGalereya = "Средняя галерея",
|
||||||
|
kryshaTsitadeli = "Крыша цитадели",
|
||||||
|
zapadnyyFlang = "Западный фланг",
|
||||||
|
vostochnyyFlang = "Восточный фланг",
|
||||||
|
}),
|
||||||
|
ArenaRoundHud = table.freeze({
|
||||||
|
tochkaZakhvachena = "ТОЧКА ЗАХВАЧЕНА · +1",
|
||||||
|
sopernikiZakhvatyvayut = "СОПЕРНИКИ ЗАХВАТЫВАЮТ",
|
||||||
|
atakaDDD = "АТАКА %d/2 · %d:%02d",
|
||||||
|
sinieDSOranzhevye = "СИНИЕ +%d/с ОРАНЖЕВЫЕ +%d/с",
|
||||||
|
uVasFlagNesite = "У вас флаг · Несите его на свою базу",
|
||||||
|
zhetonovUVas = "Жетонов у вас: ",
|
||||||
|
vernitesNaBazu = " · Вернитесь на базу",
|
||||||
|
vyLiderZaVas = "Вы лидер · За вас дают 3 очка",
|
||||||
|
itogiRaunda = "ИТОГИ РАУНДА",
|
||||||
|
vyytiVLobbi = "ВЫЙТИ В ЛОББИ",
|
||||||
|
igrok = "ИГРОК",
|
||||||
|
ubiystva = "УБИЙСТВА",
|
||||||
|
smerti = "СМЕРТИ",
|
||||||
|
vKomandeNeBylo = "В команде не было игроков",
|
||||||
|
sinie = "СИНИЕ",
|
||||||
|
oranzhevye = "ОРАНЖЕВЫЕ",
|
||||||
|
golosovanieCherezDS = "ГОЛОСОВАНИЕ ЧЕРЕЗ %d С",
|
||||||
|
vKomandePokaNet = "В команде пока нет игроков",
|
||||||
|
vy = "Вы · ",
|
||||||
|
statistikaMatcha = "СТАТИСТИКА МАТЧА",
|
||||||
|
dinamicheskayaArena = " · Динамическая арена",
|
||||||
|
schyot = "СЧЁТ · ",
|
||||||
|
doKontsaRaunda = "ДО КОНЦА РАУНДА",
|
||||||
|
doSleduyuschegoRaunda = "ДО СЛЕДУЮЩЕГО РАУНДА",
|
||||||
|
sDDOtpustite = "%s %02d:%02d · ОТПУСТИТЕ TAB, ЧТОБЫ ЗАКРЫТЬ",
|
||||||
|
siniePobedili = "СИНИЕ ПОБЕДИЛИ",
|
||||||
|
oranzhevyePobedili = "ОРАНЖЕВЫЕ ПОБЕДИЛИ",
|
||||||
|
nichYa = "НИЧЬЯ",
|
||||||
|
pobeda = "ПОБЕДА",
|
||||||
|
porazhenie = "ПОРАЖЕНИЕ",
|
||||||
|
sleduyuschiyRaundCherezD = "СЛЕДУЮЩИЙ РАУНД ЧЕРЕЗ %d С",
|
||||||
|
golosovanie = "ГОЛОСОВАНИЕ",
|
||||||
|
doNachalaRaunda = "ДО НАЧАЛА РАУНДА",
|
||||||
|
doGolosovaniya = "ДО ГОЛОСОВАНИЯ",
|
||||||
|
podgotovkaAreny = "ПОДГОТОВКА АРЕНЫ",
|
||||||
|
}),
|
||||||
|
ArenaRounds = table.freeze({
|
||||||
|
sinie = "Синие",
|
||||||
|
oranzhevye = "Оранжевые",
|
||||||
|
neUdalosVozroditIgroka = "Не удалось возродить игрока:",
|
||||||
|
}),
|
||||||
|
CitadelScoreService = table.freeze({
|
||||||
|
vzyaliBolSheRubezhey = " взяли больше рубежей",
|
||||||
|
nichYaObeKomandy = "Ничья: обе команды без захватов",
|
||||||
|
nichYaVremyaZakhvata = "Ничья: время захвата совпало",
|
||||||
|
pobedaPoSkorostiS = "Победа по скорости: %s, рубеж %d (Blue %s, Orange %s)",
|
||||||
|
}),
|
||||||
|
HotPointGuide = table.freeze({
|
||||||
|
kGoryacheyTochke = "К ГОРЯЧЕЙ ТОЧКЕ",
|
||||||
|
novayaTochkaDS = "НОВАЯ ТОЧКА · %d С",
|
||||||
|
vyshe = " · ВЫШЕ",
|
||||||
|
nizhe = " · НИЖЕ",
|
||||||
|
dStudovS = "%d СТУДОВ%s",
|
||||||
|
}),
|
||||||
|
ViewmodelTuner = table.freeze({
|
||||||
|
oruzhie = "Оружие",
|
||||||
|
vpravoVlevo = "Вправо / влево",
|
||||||
|
vverkhVniz = "Вверх / вниз",
|
||||||
|
vperyodNazad = "Вперёд / назад",
|
||||||
|
povorotYaw = "Поворот (yaw)",
|
||||||
|
naklonPitch = "Наклон (pitch)",
|
||||||
|
krenRoll = "Крен (roll)",
|
||||||
|
inertsiya = "Инерция",
|
||||||
|
pokachivanie = "Покачивание",
|
||||||
|
kistVpravoVlevo = "Кисть: вправо/влево",
|
||||||
|
kistVverkhVniz = "Кисть: вверх/вниз",
|
||||||
|
kistVperyodNazad = "Кисть: вперёд/назад",
|
||||||
|
rukaPovorot = "Рука: поворот",
|
||||||
|
rukaNaklon = "Рука: наклон",
|
||||||
|
rukaKren = "Рука: крен",
|
||||||
|
dlinaRuki = "Длина руки",
|
||||||
|
tolschinaRuki = "Толщина руки",
|
||||||
|
dlinaKisti = "Длина кисти",
|
||||||
|
tolschinaKisti = "Толщина кисти",
|
||||||
|
levayaRuka = "Левая рука",
|
||||||
|
pravayaRuka = "Правая рука",
|
||||||
|
osmotr = "Осмотр",
|
||||||
|
dreyfPriUderzhanii = "Дрейф при удержании",
|
||||||
|
vykhodVPozuS = "Выход в позу, с",
|
||||||
|
uderzhanieS = "Удержание, с",
|
||||||
|
vozvratS = "Возврат, с",
|
||||||
|
perezaryadka = "Перезарядка",
|
||||||
|
dlitelNostS = "Длительность, с",
|
||||||
|
kadr = "Кадр (0–1)",
|
||||||
|
magazinVpravoVlevo = "Магазин: вправо/влево",
|
||||||
|
magazinVverkhVniz = "Магазин: вверх/вниз",
|
||||||
|
magazinVperyodNazad = "Магазин: вперёд/назад",
|
||||||
|
magazinPovorot = "Магазин: поворот",
|
||||||
|
magazinNaklon = "Магазин: наклон",
|
||||||
|
magazinKren = "Магазин: крен",
|
||||||
|
perezaryadkaZatvor = "Перезарядка: затвор",
|
||||||
|
zatvorVpravoVlevo = "Затвор: вправо/влево",
|
||||||
|
zatvorVverkhVniz = "Затвор: вверх/вниз",
|
||||||
|
zatvorVperyodNazad = "Затвор: вперёд/назад",
|
||||||
|
zatvorPovorot = "Затвор: поворот",
|
||||||
|
zatvorNaklon = "Затвор: наклон",
|
||||||
|
zatvorKren = "Затвор: крен",
|
||||||
|
magazinVynutVniz = "Магазин: вынуть вниз",
|
||||||
|
zatvorPodYom = "Затвор: подъём",
|
||||||
|
zatvorKhodNazad = "Затвор: ход назад",
|
||||||
|
magazinTolschina = "Магазин: толщина",
|
||||||
|
magazinVysota = "Магазин: высота",
|
||||||
|
magazinShirina = "Магазин: ширина",
|
||||||
|
perezaryadkaRuki = "Перезарядка: руки",
|
||||||
|
dvizhenie = "Движение",
|
||||||
|
skorostIgrokaStudS = "Скорость игрока, студ/с",
|
||||||
|
gravitatsiyaStudS = "Гравитация, студ/с²",
|
||||||
|
obzorFov = "Обзор (FOV)",
|
||||||
|
obzorNaBegu = "Обзор: + на бегу",
|
||||||
|
skorostDlyaMaksFov = "Скорость для макс. FOV",
|
||||||
|
oruzhieVnizNaBegu = "Оружие: вниз на бегу",
|
||||||
|
oruzhieNazadNaBegu = "Оружие: назад на бегу",
|
||||||
|
oruzhieKrenNaBegu = "Оружие: крен на бегу",
|
||||||
|
zapazdyvanie = "Запаздывание",
|
||||||
|
oruzhiePryzhokPadenie = "Оружие: прыжок / падение",
|
||||||
|
vystrel = "Выстрел",
|
||||||
|
mezhduVystrelamiS = "Между выстрелами, с",
|
||||||
|
patronovVMagazine = "Патронов в магазине",
|
||||||
|
zumPriOcheredi = "Зум при очереди, %",
|
||||||
|
spreyNachalNyyUvod = "Спрей: начальный увод, °",
|
||||||
|
spreyRostZaVystrel = "Спрей: рост за выстрел, °",
|
||||||
|
spreyPredelRosta = "Спрей: предел роста, °",
|
||||||
|
spreySkorostSbrosa = "Спрей: скорость сброса",
|
||||||
|
spreyVPritsele = "Спрей в прицеле, ×",
|
||||||
|
zatvorPauzaS = "Затвор: пауза, с",
|
||||||
|
zatvorSAvtomat = "Затвор, с (0 = автомат)",
|
||||||
|
zatvorNaklon2 = "Затвор: наклон (0–1)",
|
||||||
|
kadrSPosleVystrela = "Кадр, с после выстрела",
|
||||||
|
vystrelStvol = "Выстрел: ствол",
|
||||||
|
duloVpravoVlevo = "Дуло: вправо/влево",
|
||||||
|
duloVverkhVniz = "Дуло: вверх/вниз",
|
||||||
|
duloVperyodNazad = "Дуло: вперёд/назад",
|
||||||
|
vspyshkaRazmer = "Вспышка: размер",
|
||||||
|
lDuloVpravoVlevo = "3л дуло: вправо/влево",
|
||||||
|
lDuloVverkhVniz = "3л дуло: вверх/вниз",
|
||||||
|
lDuloVperyodNazad = "3л дуло: вперёд/назад",
|
||||||
|
lVspyshkaRazmer = "3л вспышка: размер",
|
||||||
|
lOtdachaNazad = "3л отдача: назад",
|
||||||
|
lOtdachaVverkh = "3л отдача: вверх",
|
||||||
|
mushka = "Мушка",
|
||||||
|
kollimator = "Коллиматор",
|
||||||
|
optika = "Оптика",
|
||||||
|
pritsel = "Прицел",
|
||||||
|
fovZumMenShe = "FOV / зум (меньше = ближе)",
|
||||||
|
chuvstvitelNostMyshi = "Чувствительность мыши",
|
||||||
|
vremyaPritselivaniyaS = "Время прицеливания, с",
|
||||||
|
pokachivanieVPritsele = "Покачивание в прицеле",
|
||||||
|
zamedlenieVPritsele = "Замедление в прицеле (0–1)",
|
||||||
|
chuvstvitelNost = "Чувствительность",
|
||||||
|
otBedra = "От бедра",
|
||||||
|
zvukIPopadaniya = "Звук и попадания",
|
||||||
|
gromkostObschaya = "Громкость: общая",
|
||||||
|
gromkostVystrel = "Громкость: выстрел",
|
||||||
|
gromkostPerezaryadkaZatvor = "Громкость: перезарядка/затвор",
|
||||||
|
gromkostPopadanie = "Громкость: попадание",
|
||||||
|
gromkostRazrushenie = "Громкость: разрушение",
|
||||||
|
razmerVzryvaPriPopadanii = "Размер взрыва при попадании",
|
||||||
|
tsifryUronaRazlyotV = "Цифры урона: разлёт в стороны",
|
||||||
|
tsifryUronaPodYom = "Цифры урона: подъём вверх",
|
||||||
|
ubiystvoVysotaVyleta = "Убийство: высота вылета",
|
||||||
|
vpravoVlevo2 = ": вправо/влево",
|
||||||
|
vverkhVniz2 = ": вверх/вниз",
|
||||||
|
vperyodNazad2 = ": вперёд/назад",
|
||||||
|
povorot = ": поворот",
|
||||||
|
naklon = ": наклон",
|
||||||
|
kren = ": крен",
|
||||||
|
lOruzhie = "3л: оружие",
|
||||||
|
lPravayaRuka = "3л: правая рука",
|
||||||
|
lLevayaRuka = "3л: левая рука",
|
||||||
|
kist = "Кисть",
|
||||||
|
lokotVpravoVlevo = "Локоть: вправо/влево",
|
||||||
|
lokotVverkhVniz = "Локоть: вверх/вниз",
|
||||||
|
lokotVperyodNazad = "Локоть: вперёд/назад",
|
||||||
|
lPerezaryadka = "3л: перезарядка",
|
||||||
|
nastroykaPZakryt = "Настройка (P — закрыть)",
|
||||||
|
vidELitso = "Вид: 3-е лицо",
|
||||||
|
vidELitso2 = "Вид: 1-е лицо",
|
||||||
|
menSheGravitatsiyaVyshe = "Меньше гравитация — выше прыжок",
|
||||||
|
pritselitSya = "▶ Прицелиться",
|
||||||
|
proigrat = "▶ Проиграть",
|
||||||
|
derzhatPozu = "Держать позу",
|
||||||
|
derzhatPritsel = "Держать прицел",
|
||||||
|
derzhatKadr = "Держать кадр",
|
||||||
|
shag = "Шаг: ",
|
||||||
|
sbros = "Сброс",
|
||||||
|
sokhranit = "Сохранить",
|
||||||
|
sokhraneno = "Сохранено ✓",
|
||||||
|
}),
|
||||||
|
HotPoint = table.freeze({
|
||||||
|
skoroPoyavitsyaNovayaTochka = "Скоро появится новая точка",
|
||||||
|
tochkaZakhvachena = "Точка захвачена",
|
||||||
|
smenaTochkiCherez = " · Смена точки через ",
|
||||||
|
s = " с",
|
||||||
|
}),
|
||||||
|
HostedArenaService = table.freeze({
|
||||||
|
naEtomTestovomServere = "На этом тестовом сервере уже есть публичная арена. Откройте её карточку.",
|
||||||
|
testovayaArenaUzheGotovitsya = "Тестовая арена уже готовится.",
|
||||||
|
dozhditesPokaTestovayaArena = "Дождитесь, пока тестовая арена освободится.",
|
||||||
|
perekhodNeUdalsyaPoprobuyte = "Переход не удался. Попробуйте снова.",
|
||||||
|
zagruzhaemArenu = "Загружаем арену…",
|
||||||
|
vozvraschaemVObscheeLobbi = "Возвращаем в общее лобби…",
|
||||||
|
gotovimArenu = "Готовим арену…",
|
||||||
|
sozdatelVyshelSServera = "Создатель вышел с сервера.",
|
||||||
|
servisArenRobloxVremenno = "Сервис арен Roblox временно недоступен. Попробуйте позже.",
|
||||||
|
podtverdivshieIgrokiVyshliS = "Подтвердившие игроки вышли с сервера.",
|
||||||
|
niktoNePodtverdilPriglashenie = "Никто не подтвердил приглашение.",
|
||||||
|
sozdatelPokinulLobbi = "Создатель покинул лобби.",
|
||||||
|
vyberiteDoIgrokov = "Выберите до 19 игроков.",
|
||||||
|
ktoToIzVybrannykh = "Кто-то из выбранных уже недоступен. Проверьте список игроков.",
|
||||||
|
vyberiteKhotyaByOdnogo = "Выберите хотя бы одного игрока.",
|
||||||
|
arenaZakrylasIliUzhe = "Арена закрылась или уже заполнена.",
|
||||||
|
vEtoyKomandeNet = "В этой команде нет мест.",
|
||||||
|
sostavyIzmenilisVyberiteDruguyu = "Составы изменились. Выберите другую команду.",
|
||||||
|
priglasheniyaOtmeneny = "Приглашения отменены.",
|
||||||
|
snachalaZavershiteTekuscheePriglashenie = "Сначала завершите текущее приглашение.",
|
||||||
|
proverTeVybrannyyRezhim = "Проверьте выбранный режим и настройки арены.",
|
||||||
|
podozhditeNeskolKoSekund = "Подождите несколько секунд перед повторной попыткой.",
|
||||||
|
dlyaPrivatnoyArenyNuzhen = "Для приватной арены нужен плейс, сохранённый в Roblox.",
|
||||||
|
etaArenaBolShe = "Эта арена больше недоступна.",
|
||||||
|
etaArenaDostupnaTol = "Эта арена доступна только участникам с подтверждённым приглашением.",
|
||||||
|
}),
|
||||||
|
DamageNumbers = table.freeze({
|
||||||
|
khedshot = "Хедшот!",
|
||||||
|
ubit = "Убит!",
|
||||||
|
krit = "КРИТ",
|
||||||
|
}),
|
||||||
|
HostedArenaHud = table.freeze({
|
||||||
|
vObscheeLobbi = "‹ В ОБЩЕЕ ЛОББИ",
|
||||||
|
sozdatArenu = "+ СОЗДАТЬ АРЕНУ",
|
||||||
|
arenaSessii = "АРЕНА СЕССИИ",
|
||||||
|
publichnyeAreny = "ПУБЛИЧНЫЕ АРЕНЫ",
|
||||||
|
obnovit = "ОБНОВИТЬ",
|
||||||
|
pokazatEschyo = "ПОКАЗАТЬ ЕЩЁ",
|
||||||
|
sozdanieAreny = "СОЗДАНИЕ АРЕНЫ",
|
||||||
|
publichnaya = "ПУБЛИЧНАЯ",
|
||||||
|
privatnaya = "ПРИВАТНАЯ",
|
||||||
|
startovyyRezhim = "СТАРТОВЫЙ РЕЖИМ",
|
||||||
|
razreshitSmenuRezhimov = "Разрешить смену режимов",
|
||||||
|
podklyuchitSya = "ПОДКЛЮЧИТЬСЯ ›",
|
||||||
|
vybrat = "ВЫБРАТЬ",
|
||||||
|
sinie = "СИНИЕ",
|
||||||
|
oranzhevye = "ОРАНЖЕВЫЕ",
|
||||||
|
priglashenieNaArenu = "ПРИГЛАШЕНИЕ НА АРЕНУ",
|
||||||
|
prinyatY = "ПРИНЯТЬ [Y]",
|
||||||
|
otklonitU = "ОТКЛОНИТЬ [U]",
|
||||||
|
vybranoDD = "ВЫБРАНО %d / %d",
|
||||||
|
otvetZaderzhalsyaPoprobuyteSnova = "Ответ задержался. Попробуйте снова.",
|
||||||
|
vklyucheno = "ВКЛЮЧЕНО",
|
||||||
|
vyklyucheno = "ВЫКЛЮЧЕНО",
|
||||||
|
golosovaniePosleRaunda = "Голосование после раунда",
|
||||||
|
odinRezhimNaVse = "Один режим на все раунды",
|
||||||
|
vyberiteIgrokovSEtogo = "Выберите игроков с этого сервера и отправьте приглашения.",
|
||||||
|
naServerePokaNet = "На сервере пока нет других игроков.",
|
||||||
|
vLokalNomTeste = "В локальном тесте публичная арена доступна игрокам этого сеанса Studio.",
|
||||||
|
lyuboyIgrokSmozhetPodklyuchit = "Любой игрок сможет подключиться через список публичных арен.",
|
||||||
|
otmenitPriglasheniya = "ОТМЕНИТЬ ПРИГЛАШЕНИЯ",
|
||||||
|
otpravitPriglasheniya = "ОТПРАВИТЬ ПРИГЛАШЕНИЯ",
|
||||||
|
sozdatArenu2 = "СОЗДАТЬ АРЕНУ",
|
||||||
|
pokaNikogo = "Пока никого",
|
||||||
|
vashaKomanda = "ВАША КОМАНДА",
|
||||||
|
netMest = "НЕТ МЕСТ",
|
||||||
|
balansKomand = "БАЛАНС КОМАНД",
|
||||||
|
vybrano = "ВЫБРАНО",
|
||||||
|
vkhodNaArenu = "ВХОД НА АРЕНУ…",
|
||||||
|
proveryaemKomandu = "ПРОВЕРЯЕМ КОМАНДУ…",
|
||||||
|
podklyuchitSyaZaSinikh = "ПОДКЛЮЧИТЬСЯ ЗА СИНИХ ›",
|
||||||
|
podklyuchitSyaZaOranzhevykh = "ПОДКЛЮЧИТЬСЯ ЗА ОРАНЖЕВЫХ ›",
|
||||||
|
vyVKomandeSinikh = "ВЫ В КОМАНДЕ СИНИХ",
|
||||||
|
vyVKomandeOranzhevykh = "ВЫ В КОМАНДЕ ОРАНЖЕВЫХ",
|
||||||
|
podklyuchaemsya = "Подключаемся…",
|
||||||
|
zagruzhaemSostavy = "Загружаем составы…",
|
||||||
|
arenaZapolnena = "Арена заполнена.",
|
||||||
|
podklyuchenieOtkroetsyaSNachalom = "Подключение откроется с началом раунда.",
|
||||||
|
vybrannayaKomandaPokaNedostupna = "Выбранная команда пока недоступна.",
|
||||||
|
vyberiteKomandu = "Выберите команду.",
|
||||||
|
dinamicheskayaArena = "Динамическая арена",
|
||||||
|
priglasheniePrinyato = "ПРИГЛАШЕНИЕ ПРИНЯТО",
|
||||||
|
otmenitU = "ОТМЕНИТЬ [U]",
|
||||||
|
sozdatel = "Создатель · @",
|
||||||
|
spisokPublichnykhArenVremenno = "Список публичных арен временно недоступен.",
|
||||||
|
arenaZakrylasIliSostavy = "Арена закрылась или составы временно недоступны.",
|
||||||
|
vVybrannoyKomandeNet = "В выбранной команде нет мест.",
|
||||||
|
sostavyIzmenilisPodklyuchitesEschyo = "Составы изменились. Подключитесь ещё раз.",
|
||||||
|
dozhditesNachalaSleduyuschegoRaunda = "Дождитесь начала следующего раунда.",
|
||||||
|
personazhEschyoZagruzhaetsyaPoprobuyte = "Персонаж ещё загружается. Попробуйте снова.",
|
||||||
|
proveryaemDostupKArene = "Проверяем доступ к арене. Попробуйте через секунду.",
|
||||||
|
neUdalosPodklyuchitSya = "Не удалось подключиться.",
|
||||||
|
vladelets = "Владелец · ",
|
||||||
|
arenaZapolnenaMozhnoVernut = "Арена заполнена. Можно вернуться в общее лобби.",
|
||||||
|
vybrannayaKomandaNedostupna = "Выбранная команда недоступна.",
|
||||||
|
prinyaliDZhdyomD = "Приняли %d · Ждём %d · %02d с",
|
||||||
|
}),
|
||||||
|
TrophyBalance = table.freeze({
|
||||||
|
trofei = "ТРОФЕИ",
|
||||||
|
}),
|
||||||
|
MatchVoteHud = table.freeze({
|
||||||
|
sleduyuschiyRezhim = "СЛЕДУЮЩИЙ РЕЖИМ",
|
||||||
|
vashGolos = "Ваш голос · ",
|
||||||
|
navediteNaRezhimChtoby = "Наведите на режим, чтобы увидеть его правила.",
|
||||||
|
dinamicheskayaArena = "ДИНАМИЧЕСКАЯ АРЕНА",
|
||||||
|
golosovanieZakryto = "ГОЛОСОВАНИЕ ЗАКРЫТО",
|
||||||
|
rezhimVybran = "РЕЖИМ ВЫБРАН",
|
||||||
|
sleduyuschiyRaund = "СЛЕДУЮЩИЙ РАУНД",
|
||||||
|
vyVozvraschaetesVLobbi = "ВЫ ВОЗВРАЩАЕТЕСЬ В ЛОББИ",
|
||||||
|
vsego = " / Всего ",
|
||||||
|
vyberiteRezhimVsegoGolosov = "Выберите режим · Всего голосов ",
|
||||||
|
}),
|
||||||
|
PowerUpCatalog = table.freeze({
|
||||||
|
turboiskra = "Турбоискра",
|
||||||
|
kSkorostiNaSek = "+30% к скорости на 4 сек.",
|
||||||
|
lunnayaPruzhina = "Лунная пружина",
|
||||||
|
sleduyuschiyPryzhokVysheNa = "Следующий прыжок выше на 80% · 18 сек.",
|
||||||
|
vtoroyImpulS = "Второй импульс",
|
||||||
|
odinPryzhokVVozdukhe = "Один прыжок в воздухе · 8 сек.",
|
||||||
|
peroBuri = "Перо бури",
|
||||||
|
uderzhivayProbelDlyaPlavnogo = "Удерживай пробел для плавного падения · 5 сек.",
|
||||||
|
khrustalNyySchit = "Хрустальный щит",
|
||||||
|
pogloschaetUronaSek = "Поглощает 25 урона · 7 сек.",
|
||||||
|
iskraZhizni = "Искра жизни",
|
||||||
|
vosstanavlivaetHp = "Восстанавливает 25 HP",
|
||||||
|
zolotoyMagnit = "Золотой магнит",
|
||||||
|
prityagivanieMonetSStudov = "Притягивание монет с 20 студов · 8 сек.",
|
||||||
|
zolotayaZhila = "Золотая жила",
|
||||||
|
kTsennostiSleduyuschikhPyati = "+25% к ценности следующих пяти монет",
|
||||||
|
bystryeRuki = "Быстрые руки",
|
||||||
|
sleduyuschayaPerezaryadkaVdvoeBystree = "Следующая перезарядка вдвое быстрее",
|
||||||
|
zapasnoyMagazin = "Запасной магазин",
|
||||||
|
mgnovennoPopolnyaetMagazin = "Мгновенно пополняет магазин",
|
||||||
|
stalNayaKhvatka = "Стальная хватка",
|
||||||
|
menSheOtdachiI = "Меньше отдачи и разброса · 5 сек.",
|
||||||
|
shyopot = "Шёпот",
|
||||||
|
priglushaetShagiNaSek = "Приглушает шаги на 6 сек.",
|
||||||
|
fantom = "Фантом",
|
||||||
|
sozdayotDvizhuschuyusyaKopiyuNa = "Создаёт движущуюся копию на 2 сек.",
|
||||||
|
grozovayaPechat = "Грозовая печать",
|
||||||
|
sleduyuscheePrizemlenieZamedlyaetVragov = "Следующее приземление замедляет врагов",
|
||||||
|
iskraOtryada = "Искра отряда",
|
||||||
|
kSkorostiTebeI = "+20% к скорости тебе и ближайшим союзникам · 3 сек.",
|
||||||
|
}),
|
||||||
|
LobbyCamera = table.freeze({
|
||||||
|
vozrozhdenie = "Возрождение…",
|
||||||
|
}),
|
||||||
|
SiegeResults = table.freeze({
|
||||||
|
rubezhDSinieS = "Рубеж %d · Синие %s · Оранжевые %s",
|
||||||
|
priRavenstveRubezheyPobezhdaet = "При равенстве рубежей побеждает команда, быстрее дошедшая до последнего взятого.",
|
||||||
|
}),
|
||||||
|
Common = table.freeze({
|
||||||
|
netSvobodnogoMestaDlya = "Нет свободного места для рубежа:",
|
||||||
|
}),
|
||||||
|
RifleSkinCatalog = table.freeze({
|
||||||
|
goluboePlamya = "Голубое пламя",
|
||||||
|
grozovoyKlinok = "Грозовой клинок",
|
||||||
|
alayaPechat = "Алая печать",
|
||||||
|
sakura = "Сакура",
|
||||||
|
neonovyySboy = "Неоновый сбой",
|
||||||
|
lunnayaOrbita = "Лунная орбита",
|
||||||
|
}),
|
||||||
|
ProceduralArena = table.freeze({
|
||||||
|
bastiony = "Бастионы",
|
||||||
|
galerei = "Галереи",
|
||||||
|
terrasy = "Террасы",
|
||||||
|
parnyeTonneli = "Парные тоннели",
|
||||||
|
tonnelSoSmescheniem = "Тоннель со смещением",
|
||||||
|
triProkhoda = "Три прохода",
|
||||||
|
bokovyePodYomy = "Боковые подъёмы",
|
||||||
|
tortsevyePodYomy = "Торцевые подъёмы",
|
||||||
|
uglovyePodYomy = "Угловые подъёмы",
|
||||||
|
bazaSinikh = "БАЗА СИНИХ",
|
||||||
|
bazaOranzhevykh = "БАЗА ОРАНЖЕВЫХ",
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
round = round,
|
||||||
|
studs = studs,
|
||||||
|
domination = domination,
|
||||||
|
hotHints = hotHints,
|
||||||
|
flagHints = flagHints,
|
||||||
|
trophyHints = trophyHints,
|
||||||
|
lifeHints = lifeHints,
|
||||||
|
leaderHints = leaderHints,
|
||||||
|
teamDeathmatch = teamDeathmatch,
|
||||||
|
hint = table.freeze({Siege = siegeHints}),
|
||||||
|
team = team, clock = clock,
|
||||||
|
bases = table.freeze({Blue = "БАЗА СИНИХ", Orange = "БАЗА ОРАНЖЕВЫХ"}),
|
||||||
|
hotPoint = "ГОРЯЧАЯ ТОЧКА",
|
||||||
|
leaderLabel = "ЛИДЕР",
|
||||||
|
leaders = function(blue: string?, orange: string?) return "Лидеры · " .. (blue or "—") .. " / " .. (orange or "—") end,
|
||||||
|
tokens = function(n: number) return "ЖЕТОНЫ ×" .. n end,
|
||||||
|
trophyStatus = "Сдавайте собранные жетоны на своей базе",
|
||||||
|
flagRoofLabel = "ФЛАГ · КРЫША", flagDropLabel = "ФЛАГ УПАЛ",
|
||||||
|
flagCarrierLabel = function(name: string) return name .. " · НЕСЁТ ФЛАГ" end,
|
||||||
|
flagCarrier = flagCarrier, flagReturned = "Флаг вернулся на крышу цитадели",
|
||||||
|
flagOnGround = "Флаг на земле · Подберите его", flagOnRoof = "Флаг на крыше цитадели",
|
||||||
|
dominationStatus = function(b: number, o: number) return string.format("Точки под контролем · %d / %d", b, o) end,
|
||||||
|
lifeActive = function(n: number, b: number, o: number, seconds: number)
|
||||||
|
return string.format("Мини-раунд %d · Живы %d / %d · %d с", n, b, o, seconds)
|
||||||
|
end,
|
||||||
|
lifeStart = function(n: number) return "Мини-раунд " .. n end,
|
||||||
|
lifeWaiting = "Ждём игроков в обеих командах",
|
||||||
|
lifeNext = function(s: number) return "Следующий мини-раунд через " .. s .. " с" end,
|
||||||
|
siegeSwap = "СМЕНА РОЛЕЙ", siegeComplete = "Все рубежи взяты!",
|
||||||
|
siegeStatus = function(attacker: string, index: number, total: number, percent: number, phase: string)
|
||||||
|
local reason = if phase == "Contested" then "Зона оспаривается!" elseif phase == "Decaying" then "Захват откатывается"
|
||||||
|
elseif phase == "Capturing" then "Захват идёт" else "Двигайтесь к кругу"
|
||||||
|
return string.format("%s · Рубеж %d/%d · %d%% · %s", attacker, index, total, percent, reason)
|
||||||
|
end,
|
||||||
|
feed = table.freeze({
|
||||||
|
ZoneCaptured = function(p: any)
|
||||||
|
return string.format("%s взяли %s%s", team(p.side), p.text or "точку", if p.value then " (" .. clock(p.value) .. ")" else "")
|
||||||
|
end,
|
||||||
|
ZoneLost = function(p: any) return team(p.side) .. " потеряли " .. (p.text or "точку") end,
|
||||||
|
FlagPicked = function(p: any) return flagCarrier(p.text or "Игрок") end,
|
||||||
|
FlagDropped = function(_: any) return "Флаг упал на землю" end,
|
||||||
|
FlagScored = function(p: any) return team(p.side) .. " доставили флаг" end,
|
||||||
|
TokensBanked = function(p: any) return string.format("%s сдали жетоны ×%d", team(p.side), p.value or 0) end,
|
||||||
|
LeaderDown = function(p: any) return team(p.side) .. " устранили лидера (+3)" end,
|
||||||
|
RoleSwap = function(_: any) return "Команды меняются ролями" end,
|
||||||
|
Streak = function(p: any) return string.format(teamDeathmatch.streak,p.text or "Игрок",p.value or 0) end,
|
||||||
|
}),
|
||||||
|
})
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
--!strict
|
||||||
|
local Rules={}
|
||||||
|
local STREAK={[3]=true,[5]=true,[7]=true}
|
||||||
|
local CHASE_GAP=5
|
||||||
|
function Rules.announce(kills: number): boolean
|
||||||
|
return STREAK[kills]==true
|
||||||
|
end
|
||||||
|
function Rules.chaseGap(own: number, rival: number): number?
|
||||||
|
local gap=rival-own
|
||||||
|
return if gap>=CHASE_GAP then gap else nil
|
||||||
|
end
|
||||||
|
return table.freeze(Rules)
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
--!strict
|
||||||
|
export type Stage = "Briefing" | "Countdown" | "Live" | "FinalPush" | "Ended"
|
||||||
|
local Timeline = {}
|
||||||
|
function Timeline.liveAt(startedAt: number, briefing: number, countdown: number): number
|
||||||
|
return startedAt + briefing + countdown
|
||||||
|
end
|
||||||
|
function Timeline.stage(startedAt: number, endsAt: number, briefing: number, countdown: number,
|
||||||
|
finalPush: number, now: number): (Stage, number)
|
||||||
|
local liveAt = Timeline.liveAt(startedAt, briefing, countdown)
|
||||||
|
if now < startedAt + briefing then return "Briefing", startedAt + briefing end
|
||||||
|
if now < liveAt then return "Countdown", liveAt end
|
||||||
|
if now >= endsAt then return "Ended", endsAt end
|
||||||
|
if now >= endsAt - finalPush then return "FinalPush", endsAt end
|
||||||
|
return "Live", math.max(liveAt, endsAt - finalPush)
|
||||||
|
end
|
||||||
|
return table.freeze(Timeline)
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.LobbyCamera
|
||||||
|
|
||||||
-- V toggles the lobby camera. Arena entry always selects first person.
|
-- V toggles the lobby camera. Arena entry always selects first person.
|
||||||
|
|
||||||
local Players = game:GetService("Players")
|
local Players = game:GetService("Players")
|
||||||
@@ -32,7 +34,7 @@ message.Position = UDim2.fromScale(.5, .5)
|
|||||||
message.Size = UDim2.new(1, -32, 0, 38)
|
message.Size = UDim2.new(1, -32, 0, 38)
|
||||||
message.BackgroundTransparency = 1
|
message.BackgroundTransparency = 1
|
||||||
message.Font = Enum.Font.GothamBold
|
message.Font = Enum.Font.GothamBold
|
||||||
message.Text = "Возрождение…"
|
message.Text = Text.vozrozhdenie
|
||||||
message.TextSize = 24
|
message.TextSize = 24
|
||||||
message.TextColor3 = Color3.fromRGB(240, 244, 255)
|
message.TextColor3 = Color3.fromRGB(240, 244, 255)
|
||||||
message.Parent = cover
|
message.Parent = cover
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ MatchRules.All = table.freeze({
|
|||||||
{id = "Domination", title = "Три точки", detail = "Захватывайте и удерживайте зоны, чтобы получать очки.", score = "Очки контроля"},
|
{id = "Domination", title = "Три точки", detail = "Захватывайте и удерживайте зоны, чтобы получать очки.", score = "Очки контроля"},
|
||||||
{id = "CaptureFlag", title = "Захват флага", detail = "Заберите флаг с крыши цитадели и принесите его на свою базу.", score = "Флаги"},
|
{id = "CaptureFlag", title = "Захват флага", detail = "Заберите флаг с крыши цитадели и принесите его на свою базу.", score = "Флаги"},
|
||||||
{id = "TrophyHunt", title = "Охота за трофеями", detail = "Собирайте выпавшие жетоны и сдавайте их на своей базе.", score = "Сданные жетоны"},
|
{id = "TrophyHunt", title = "Охота за трофеями", detail = "Собирайте выпавшие жетоны и сдавайте их на своей базе.", score = "Сданные жетоны"},
|
||||||
{id = "Siege", title = "Штурм цитадели", detail = "В атаке берите рубежи, в защите удерживайте их. Затем смена ролей.", score = "Захваченные рубежи"},
|
{id = "Siege", title = "Штурм цитадели", detail = "Обе команды по очереди атакуют три рубежа. При равенстве решает время последнего захвата.", score = "Захваченные рубежи"},
|
||||||
{id = "OneLife", title = "Одна жизнь", detail = "Выиграйте 3 мини-раунда. В каждом у вас одна жизнь.", score = "Победы в мини-раундах"},
|
{id = "OneLife", title = "Одна жизнь", detail = "Выиграйте 3 мини-раунда. В каждом у вас одна жизнь.", score = "Победы в мини-раундах"},
|
||||||
{id = "HuntLeader", title = "Охота на лидера", detail = "Устраняйте отмеченного лидера соперников. За него дают 3 очка.", score = "Очки за убийства"},
|
{id = "HuntLeader", title = "Охота на лидера", detail = "Устраняйте отмеченного лидера соперников. За него дают 3 очка.", score = "Очки за убийства"},
|
||||||
} :: {Rule})
|
} :: {Rule})
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.MatchVoteHud
|
||||||
|
|
||||||
local Players = game:GetService("Players")
|
local Players = game:GetService("Players")
|
||||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
local RunService = game:GetService("RunService")
|
local RunService = game:GetService("RunService")
|
||||||
@@ -38,7 +40,7 @@ local function leftLabel(parent: Instance, name: string, text: string, x: number
|
|||||||
item.TextXAlignment = Enum.TextXAlignment.Left
|
item.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
return item
|
return item
|
||||||
end
|
end
|
||||||
local title = leftLabel(panel, "Title", "СЛЕДУЮЩИЙ РЕЖИМ", 25, 16, 625, 43, 33, UI.Ink)
|
local title = leftLabel(panel, "Title", Text.sleduyuschiyRezhim, 25, 16, 625, 43, 33, UI.Ink)
|
||||||
title.FontFace = UI.Display
|
title.FontFace = UI.Display
|
||||||
local arenaText = leftLabel(panel, "Arena", "", 26, 57, 620, 21, 14, UI.Muted)
|
local arenaText = leftLabel(panel, "Arena", "", 26, 57, 620, 21, 14, UI.Muted)
|
||||||
local clock = UI.label(panel, "Countdown", "", UDim2.fromOffset(775, 19), UDim2.fromOffset(139, 44), 30, UI.Blue)
|
local clock = UI.label(panel, "Countdown", "", UDim2.fromOffset(775, 19), UDim2.fromOffset(139, 44), 30, UI.Blue)
|
||||||
@@ -76,9 +78,9 @@ end
|
|||||||
local function refreshDetail()
|
local function refreshDetail()
|
||||||
local rule = Rules.find(if locked then selectedRule else hoveredRule or selectedRule)
|
local rule = Rules.find(if locked then selectedRule else hoveredRule or selectedRule)
|
||||||
if locked then
|
if locked then
|
||||||
detail.Text = if rule then "Ваш голос · " .. rule.title else ""
|
detail.Text = if rule then Text.vashGolos .. rule.title else ""
|
||||||
else
|
else
|
||||||
detail.Text = if rule then rule.detail else "Наведите на режим, чтобы увидеть его правила."
|
detail.Text = if rule then rule.detail else Text.navediteNaRezhimChtoby
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -133,8 +135,8 @@ local function startBallot(id: string, endsAt: number, timeLeft: number)
|
|||||||
locked, revealEndsAt = false, nil
|
locked, revealEndsAt = false, nil
|
||||||
local match = Modes.state(state, id)
|
local match = Modes.state(state, id)
|
||||||
duration = (match:GetAttribute("PhaseDuration") :: number?) or timeLeft
|
duration = (match:GetAttribute("PhaseDuration") :: number?) or timeLeft
|
||||||
title.Text = "СЛЕДУЮЩИЙ РЕЖИМ"
|
title.Text = Text.sleduyuschiyRezhim
|
||||||
arenaText.Text = "ДИНАМИЧЕСКАЯ АРЕНА"
|
arenaText.Text = Text.dinamicheskayaArena
|
||||||
clock.Visible, line.Visible = true, true
|
clock.Visible, line.Visible = true, true
|
||||||
clock.TextColor3, fill.BackgroundColor3 = UI.Blue, UI.Blue
|
clock.TextColor3, fill.BackgroundColor3 = UI.Blue, UI.Blue
|
||||||
caption.TextXAlignment, detail.TextXAlignment = Enum.TextXAlignment.Left, Enum.TextXAlignment.Left
|
caption.TextXAlignment, detail.TextXAlignment = Enum.TextXAlignment.Left, Enum.TextXAlignment.Left
|
||||||
@@ -157,7 +159,7 @@ local function lockBallot()
|
|||||||
hoveredRule = nil
|
hoveredRule = nil
|
||||||
clock.TextColor3 = Color3.fromRGB(212, 212, 212)
|
clock.TextColor3 = Color3.fromRGB(212, 212, 212)
|
||||||
fill.BackgroundColor3 = Color3.fromRGB(145, 145, 145)
|
fill.BackgroundColor3 = Color3.fromRGB(145, 145, 145)
|
||||||
caption.Text = "ГОЛОСОВАНИЕ ЗАКРЫТО"
|
caption.Text = Text.golosovanieZakryto
|
||||||
refreshDetail()
|
refreshDetail()
|
||||||
for _, slot in cards do
|
for _, slot in cards do
|
||||||
assert(slot.card.button).Interactable = false
|
assert(slot.card.button).Interactable = false
|
||||||
@@ -171,10 +173,10 @@ local function reveal(outcome: Outcome, now: number)
|
|||||||
if revealEndsAt or not winner then return end
|
if revealEndsAt or not winner then return end
|
||||||
lockBallot()
|
lockBallot()
|
||||||
revealEndsAt = math.max(outcome.endsAt, now + 1.35)
|
revealEndsAt = math.max(outcome.endsAt, now + 1.35)
|
||||||
title.Text = "РЕЖИМ ВЫБРАН"
|
title.Text = Text.rezhimVybran
|
||||||
clock.Visible, line.Visible = false, false
|
clock.Visible, line.Visible = false, false
|
||||||
caption.TextXAlignment, detail.TextXAlignment = Enum.TextXAlignment.Center, Enum.TextXAlignment.Center
|
caption.TextXAlignment, detail.TextXAlignment = Enum.TextXAlignment.Center, Enum.TextXAlignment.Center
|
||||||
caption.Text = if selectedRule then "СЛЕДУЮЩИЙ РАУНД" else "ВЫ ВОЗВРАЩАЕТЕСЬ В ЛОББИ"
|
caption.Text = if selectedRule then Text.sleduyuschiyRaund else Text.vyVozvraschaetesVLobbi
|
||||||
detail.Text = Rules.get(outcome.winner).detail
|
detail.Text = Rules.get(outcome.winner).detail
|
||||||
local center = Vector2.new(panelWidth / 2, panelHeight / 2)
|
local center = Vector2.new(panelWidth / 2, panelHeight / 2)
|
||||||
for _, slot in cards do
|
for _, slot in cards do
|
||||||
@@ -219,7 +221,7 @@ local received = vote.OnClientEvent:Connect(function(id: string, endsAt: number,
|
|||||||
refreshDetail()
|
refreshDetail()
|
||||||
if not locked then
|
if not locked then
|
||||||
local own = Rules.find(selection)
|
local own = Rules.find(selection)
|
||||||
caption.Text = if own then "Ваш голос · " .. own.title .. " / Всего " .. total else "Выберите режим · Всего голосов " .. total
|
caption.Text = if own then Text.vashGolos .. own.title .. Text.vsego .. total else Text.vyberiteRezhimVsegoGolosov .. total
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,125 @@
|
|||||||
|
--!strict
|
||||||
|
local Diagnostics = require(script.Parent.ZoneDiagnostics)
|
||||||
|
local Types = require(script.Parent.Types)
|
||||||
|
local HotPoint = require(script.Parent.Parent.HotPoint)
|
||||||
|
local Sites = require(script.Parent.Parent.ArenaObjectiveSites)
|
||||||
|
local Strings = require(game.ReplicatedStorage.Hunter.Strings)
|
||||||
|
local Text = Strings.interface.Common
|
||||||
|
type Side = Types.Side
|
||||||
|
type Fighter = Types.Fighter
|
||||||
|
export type Marker = HotPoint.Marker & {recolor: ((Color3) -> ())?}
|
||||||
|
export type Zone = {site: Sites.Site, marker: Marker, owner: Side?, claiming: Side?, progress: number}
|
||||||
|
local sides: {Side} = {"Blue", "Orange"}
|
||||||
|
local blue = Color3.fromRGB(67, 216, 255)
|
||||||
|
local orange = Color3.fromRGB(255, 150, 68)
|
||||||
|
local gold = Color3.fromRGB(255, 220, 96)
|
||||||
|
local neutral = Color3.fromRGB(255, 220, 96)
|
||||||
|
local function opposite(side: Side): Side
|
||||||
|
return if side == "Blue" then "Orange" else "Blue"
|
||||||
|
end
|
||||||
|
|
||||||
|
local function color(side: Side?): Color3
|
||||||
|
return if side == "Blue" then blue elseif side == "Orange" then orange else neutral
|
||||||
|
end
|
||||||
|
|
||||||
|
local function sideOf(player: Player): Side?
|
||||||
|
local side = player:GetAttribute("ArenaTeam")
|
||||||
|
return if side == "Blue" then "Blue" elseif side == "Orange" then "Orange" else nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local function boundsAt(position: Vector3, target: Vector3, radius: number, height: number): boolean
|
||||||
|
local delta = position - target
|
||||||
|
return math.abs(delta.Y) < height and delta.X * delta.X + delta.Z * delta.Z <= radius * radius
|
||||||
|
end
|
||||||
|
|
||||||
|
local function label(adornee: BasePart, name: string, tint: Color3, offset: number, waypoint: boolean?): TextLabel
|
||||||
|
local gui = Instance.new("BillboardGui")
|
||||||
|
gui.Name = "ObjectiveLabel"
|
||||||
|
gui.Size = UDim2.fromOffset(220, 26)
|
||||||
|
gui.StudsOffsetWorldSpace = Vector3.yAxis * offset
|
||||||
|
gui.MaxDistance = if waypoint then 710 else 170
|
||||||
|
gui.AlwaysOnTop = waypoint == true
|
||||||
|
gui.LightInfluence = 0
|
||||||
|
gui.Parent = adornee
|
||||||
|
local text = Instance.new("TextLabel")
|
||||||
|
text.Size = UDim2.fromScale(1, 1)
|
||||||
|
text.BackgroundTransparency = 1
|
||||||
|
text.Font = Enum.Font.GothamBlack
|
||||||
|
text.TextSize = 15
|
||||||
|
text.Text, text.TextColor3 = name, tint
|
||||||
|
text.TextStrokeColor3, text.TextStrokeTransparency = Color3.fromRGB(9, 13, 25), .14
|
||||||
|
text.Parent = gui
|
||||||
|
return text
|
||||||
|
end
|
||||||
|
|
||||||
|
local function marker(parent: Instance, id: string, name: string, at: Vector3, tint: Color3, diameter: number, tall: boolean?): Marker
|
||||||
|
local part = Instance.new("Part")
|
||||||
|
part.Name = id
|
||||||
|
if not tall then part:SetAttribute("ObjectiveArrow", true) end
|
||||||
|
part.Shape = if tall then Enum.PartType.Ball else Enum.PartType.Cylinder
|
||||||
|
part.Size = if tall then Vector3.new(diameter, diameter, diameter) else Vector3.new(.16, diameter, diameter)
|
||||||
|
part.CFrame = CFrame.new(at + Vector3.yAxis * (if tall then 2.4 else .12)) * CFrame.Angles(0, 0, math.pi / 2)
|
||||||
|
part.Anchored, part.CanCollide, part.CanQuery, part.CanTouch, part.CastShadow = true, false, false, false, false
|
||||||
|
part.Material, part.Color = Enum.Material.Neon, tint
|
||||||
|
part.Transparency = if tall then .04 else .76
|
||||||
|
local aura = Instance.new("PointLight")
|
||||||
|
aura.Range, aura.Brightness, aura.Color = if tall then 13 else 9, .7, tint
|
||||||
|
aura.Parent = part
|
||||||
|
part.Parent = parent
|
||||||
|
return {body = part, label = label(part, name, tint, if tall then 2.1 else 4, id ~= "Tokens"), origin = at}
|
||||||
|
end
|
||||||
|
|
||||||
|
local function ring(parent: Instance, id: string, name: string, at: Vector3, tint: Color3, radius: number?): Marker
|
||||||
|
local r = radius or HotPoint.Radius
|
||||||
|
local mark = marker(parent, id, name, at, tint, r * 2)
|
||||||
|
local recolor = HotPoint.attachRing(mark, r)
|
||||||
|
mark.recolor = recolor
|
||||||
|
recolor(tint)
|
||||||
|
return mark
|
||||||
|
end
|
||||||
|
|
||||||
|
local function paint(mark: Marker, tint: Color3)
|
||||||
|
if mark.body.Color == tint then return end
|
||||||
|
if mark.recolor then
|
||||||
|
mark.recolor(tint)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
mark.body.Color = tint
|
||||||
|
mark.label.TextColor3 = tint
|
||||||
|
local aura = mark.body:FindFirstChildOfClass("PointLight")
|
||||||
|
if aura then aura.Color = tint end
|
||||||
|
end
|
||||||
|
local function visibleAt(fighter: Fighter, at: Vector3, geometry: RaycastParams): boolean
|
||||||
|
return Diagnostics.raycast(fighter.root.Position, at - fighter.root.Position, geometry) == nil
|
||||||
|
end
|
||||||
|
local function makeZone(folder: Folder, geometry: RaycastParams, site: Sites.Site, name: string, radius: number?, tint: Color3?): Zone
|
||||||
|
local r = radius or HotPoint.Radius
|
||||||
|
local center, fits = Sites.clearCircle(site.position, geometry, r)
|
||||||
|
if radius and not fits then warn(Text.netSvobodnogoMestaDlya, site.name) end
|
||||||
|
site = {name = site.name, position = center}
|
||||||
|
return {site = site, marker = ring(folder, name, site.name, center, tint or neutral, r), owner = nil, claiming = nil, progress = 0}
|
||||||
|
end
|
||||||
|
local function bases(folder: Folder, geometry: RaycastParams, map: Sites.Map)
|
||||||
|
map.blue = Sites.clearCircle(map.blue, geometry, HotPoint.Radius)
|
||||||
|
map.orange = Sites.clearCircle(map.orange, geometry, HotPoint.Radius)
|
||||||
|
for _, side in sides do
|
||||||
|
local at = if side == "Blue" then map.blue else map.orange
|
||||||
|
ring(folder, side .. "Base", Strings.bases[side], at, color(side))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local function winner(scoring: Types.Scoring): (string, string?)
|
||||||
|
local b, o = scoring.get("Blue"), scoring.get("Orange")
|
||||||
|
local side = if b == o then "Draw" elseif b > o then "Blue" else "Orange"
|
||||||
|
return side, nil
|
||||||
|
end
|
||||||
|
local function instance(ctx: Types.ModeContext, callbacks: {[string]: any}): Types.ModeInstance
|
||||||
|
local function noop() end
|
||||||
|
return {
|
||||||
|
step = callbacks.step or function() return false end, kill = callbacks.kill or noop,
|
||||||
|
hit = callbacks.hit, death = callbacks.death or noop, leaving = callbacks.leaving or noop,
|
||||||
|
winner = callbacks.winner or function() return winner(ctx.scoring) end, destroy = callbacks.destroy or noop,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return {sides = sides, blue = blue, orange = orange, gold = gold, neutral = neutral, opposite = opposite,
|
||||||
|
color = color, sideOf = sideOf, boundsAt = boundsAt, label = label, marker = marker, ring = ring,
|
||||||
|
paint = paint, visibleAt = visibleAt, makeZone = makeZone, bases = bases, instance = instance}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
--!strict
|
||||||
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
|
local ArenaModes = require(ReplicatedStorage.ArenaModes)
|
||||||
|
local Sites = require(script.Parent.Parent.ArenaObjectiveSites)
|
||||||
|
local Types = require(script.Parent.Types)
|
||||||
|
local Common = require(script.Parent.Common)
|
||||||
|
local Scoring = require(script.Parent.Scoring)
|
||||||
|
local Events = require(script.Parent.Events)
|
||||||
|
local Janitor = require(script.Parent.Janitor)
|
||||||
|
local Stats = require(script.Parent.Stats)
|
||||||
|
local Profiles = require(ReplicatedStorage.Hunter.ModeProfiles)
|
||||||
|
local Context = {}
|
||||||
|
|
||||||
|
function Context.collect(members: {Player}): {Types.Fighter}
|
||||||
|
local found: {Types.Fighter} = {}
|
||||||
|
for _, p in members do
|
||||||
|
local side = Common.sideOf(p)
|
||||||
|
local c = p.Character
|
||||||
|
local h = c and c:FindFirstChildOfClass("Humanoid")
|
||||||
|
local r = c and c:FindFirstChild("HumanoidRootPart")
|
||||||
|
if side and h and h.Health > 0 and r and r:IsA("BasePart") and p:GetAttribute("InArena") == true
|
||||||
|
and p:GetAttribute("ArenaWaiting") ~= true then
|
||||||
|
table.insert(found, {player = p, side = side, root = r})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return found
|
||||||
|
end
|
||||||
|
|
||||||
|
function Context.create(config: Types.Config, mode: Types.Mode, legacy: RemoteEvent): Types.ModeContext
|
||||||
|
local state = config.state
|
||||||
|
local world = ArenaModes.geometry(config.arena)
|
||||||
|
local geometry = ArenaModes.collision(config.arena)
|
||||||
|
local map = if mode.usesMap then Sites.resolve(config.arena) else nil
|
||||||
|
local folder = Instance.new("Folder")
|
||||||
|
folder.Name = "MatchObjectives"
|
||||||
|
folder.Parent = world
|
||||||
|
local janitor = Janitor.new()
|
||||||
|
state:SetAttribute("ObjectiveStatus", "")
|
||||||
|
state:SetAttribute("ResultReason", nil)
|
||||||
|
return {
|
||||||
|
arena = config.arena, rule = config.rule, state = state, liveAt = config.now, duration = config.duration,
|
||||||
|
world = world, geometry = geometry, map = map, folder = folder, janitor = janitor,
|
||||||
|
members = config.members, bench = config.bench, deploy = config.deploy, balanceWaiting = config.balanceWaiting,
|
||||||
|
scoring = Scoring.new(state, nil, Profiles[config.rule].scoreMultiplierInFinalPush),
|
||||||
|
contribute = Stats.add,
|
||||||
|
events = Events.new(config.members),
|
||||||
|
status = function(value)
|
||||||
|
if state:GetAttribute("ObjectiveStatus") ~= value then state:SetAttribute("ObjectiveStatus", value) end
|
||||||
|
end,
|
||||||
|
setStage = function(stage, stageEndsAt)
|
||||||
|
if stageEndsAt then state:SetAttribute("StageEndsAt", stageEndsAt) end
|
||||||
|
state:SetAttribute("RoundStage", stage)
|
||||||
|
end,
|
||||||
|
cue = function(fighters, captured, side)
|
||||||
|
for _, fighter in fighters do
|
||||||
|
if captured or fighter.side == side then legacy:FireClient(fighter.player, captured) end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
legacy = function(player, name) legacy:FireClient(player, name) end,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return Context
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
--!strict
|
||||||
|
local Rules = {CAPTURE_SECONDS = 3}
|
||||||
|
function Rules.claimSide(blue: boolean, orange: boolean): ("Blue" | "Orange")?
|
||||||
|
return if blue == orange then nil elseif blue then "Blue" else "Orange"
|
||||||
|
end
|
||||||
|
function Rules.tick(now: number, nextAt: number): (boolean, number)
|
||||||
|
if now < nextAt then return false, nextAt end
|
||||||
|
return true, now + 1
|
||||||
|
end
|
||||||
|
return table.freeze(Rules)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
--!strict
|
||||||
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
|
local Players = game:GetService("Players")
|
||||||
|
local Types = require(script.Parent.Types)
|
||||||
|
local existing = ReplicatedStorage:FindFirstChild("ArenaObjectiveEvent")
|
||||||
|
local remote = if existing and existing:IsA("RemoteEvent") then existing else Instance.new("RemoteEvent")
|
||||||
|
remote.Name = "ArenaObjectiveEvent"
|
||||||
|
remote.Parent = ReplicatedStorage
|
||||||
|
local Events = {}
|
||||||
|
local Diagnostics = require(script.Parent.ZoneDiagnostics)
|
||||||
|
|
||||||
|
function Events.new(members: () -> {Player}): Types.Events
|
||||||
|
return {fire = function(kind, payload, audience)
|
||||||
|
Diagnostics.event()
|
||||||
|
local packet = table.clone(payload or {}) :: {[string]: any}
|
||||||
|
packet.t = workspace:GetServerTimeNow()
|
||||||
|
for _, player in members() do
|
||||||
|
if player.Parent ~= Players then continue end
|
||||||
|
local side = player:GetAttribute("ArenaTeam")
|
||||||
|
local want = audience == nil or audience == "All" or audience == side
|
||||||
|
if not want and typeof(audience) == "table" then want = table.find(audience, player) ~= nil end
|
||||||
|
if want then remote:FireClient(player, kind, packet) end
|
||||||
|
end
|
||||||
|
end}
|
||||||
|
end
|
||||||
|
return Events
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
--!strict
|
||||||
|
local Rules = {RETURN_SECONDS = 20}
|
||||||
|
function Rules.remaining(deadline: number, now: number): number
|
||||||
|
return math.max(0, math.ceil(deadline - now))
|
||||||
|
end
|
||||||
|
return table.freeze(Rules)
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
--!strict
|
||||||
|
local Credit = {}
|
||||||
|
function Credit.advance(value: number, elapsed: number, underFire: number, decay: number, speed: number, contested: boolean): number
|
||||||
|
if underFire > 0 then value = math.max(0, value - underFire * decay) end
|
||||||
|
if not contested then value += (elapsed - underFire) * speed end
|
||||||
|
return value
|
||||||
|
end
|
||||||
|
return table.freeze(Credit)
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
--!strict
|
||||||
|
local Types = require(script.Parent.Types)
|
||||||
|
local Janitor = {}
|
||||||
|
function Janitor.new(): Types.Janitor
|
||||||
|
local items: {(() -> ()) | Instance | RBXScriptConnection} = {}
|
||||||
|
return {
|
||||||
|
give = function(item) table.insert(items, item) end,
|
||||||
|
clean = function()
|
||||||
|
for i = #items, 1, -1 do
|
||||||
|
local item = table.remove(items, i)
|
||||||
|
if typeof(item) == "Instance" then item:Destroy()
|
||||||
|
elseif typeof(item) == "RBXScriptConnection" then item:Disconnect()
|
||||||
|
else item() end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return Janitor
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
--!strict
|
||||||
|
local Rules = {}
|
||||||
|
function Rules.points(isLeader: boolean): number
|
||||||
|
return if isLeader then 3 else 1
|
||||||
|
end
|
||||||
|
function Rules.nextIndex(index: number, count: number, sameAsPrevious: boolean): number
|
||||||
|
return if count > 1 and sameAsPrevious then index%count+1 else index
|
||||||
|
end
|
||||||
|
return table.freeze(Rules)
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
--!strict
|
||||||
|
local Runtime = script.Parent.Parent
|
||||||
|
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, light: PointLight, banner: BasePart,
|
||||||
|
carrier: Player?, tether: WeldConstraint?, droppedUntil: number,
|
||||||
|
}
|
||||||
|
local function makeFlag(parent: Instance, roof: Vector3): Flag
|
||||||
|
local mark = Common.marker(parent, "CitadelFlag", Strings.flagRoofLabel, roof, Common.gold, 2.6, true)
|
||||||
|
local body = mark.body
|
||||||
|
body.Transparency = 1
|
||||||
|
body.CFrame = CFrame.new(body.Position)
|
||||||
|
local light = assert(body:FindFirstChildOfClass("PointLight"))
|
||||||
|
light.Range, light.Brightness = 21, 1.6
|
||||||
|
|
||||||
|
local function attach(name: string, size: Vector3, offset: Vector3, tint: Color3): Part
|
||||||
|
local part = Instance.new("Part")
|
||||||
|
part.Name, part.Size, part.Color = name, size, tint
|
||||||
|
part.CFrame = body.CFrame + offset
|
||||||
|
part.Material = Enum.Material.Neon
|
||||||
|
part.Massless, part.CanCollide, part.CanTouch, part.CanQuery = true, false, false, false
|
||||||
|
part.Parent = body
|
||||||
|
local weld = Instance.new("WeldConstraint")
|
||||||
|
weld.Part0, weld.Part1, weld.Parent = body, part, part
|
||||||
|
return part
|
||||||
|
end
|
||||||
|
attach("Pole", Vector3.new(.17, 4.5, .17), Vector3.zero, Color3.fromRGB(235, 235, 255))
|
||||||
|
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
|
||||||
|
|
||||||
|
return {marker = mark, light = light, banner = banner,
|
||||||
|
carrier = nil, tether = nil, droppedUntil = 0}
|
||||||
|
end
|
||||||
|
|
||||||
|
local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||||
|
local map, geometry = assert(ctx.map), ctx.geometry
|
||||||
|
local flag = makeFlag(ctx.folder, map.roof.position)
|
||||||
|
Common.bases(ctx.folder, geometry, map)
|
||||||
|
local state = ctx.state
|
||||||
|
local lastSeconds = -1
|
||||||
|
state:SetAttribute("FlagPosition", flag.marker.origin)
|
||||||
|
state:SetAttribute("FlagBase_Blue", map.blue)
|
||||||
|
state:SetAttribute("FlagBase_Orange", map.orange)
|
||||||
|
|
||||||
|
local function putFlag(object: Flag, at: Vector3, droppedUntil: number)
|
||||||
|
if object.carrier then object.carrier:SetAttribute("ArenaFlag", nil) end
|
||||||
|
if object.tether then object.tether:Destroy() end
|
||||||
|
object.carrier, object.tether, object.droppedUntil = nil, nil, droppedUntil
|
||||||
|
state:SetAttribute("FlagCarrierSide", nil)
|
||||||
|
state:SetAttribute("FlagPosition", at)
|
||||||
|
state:SetAttribute("FlagReturnAt", if droppedUntil > 0 then droppedUntil else nil)
|
||||||
|
lastSeconds = -1
|
||||||
|
local mark = object.marker
|
||||||
|
mark.body.Anchored = true
|
||||||
|
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.light.Enabled = true
|
||||||
|
end
|
||||||
|
|
||||||
|
local function pickUpFlag(object: Flag, fighter: Fighter)
|
||||||
|
local body = object.marker.body
|
||||||
|
body.CFrame = fighter.root.CFrame * CFrame.new(0, 3.15, .65)
|
||||||
|
body.Massless = true
|
||||||
|
local tether = Instance.new("WeldConstraint")
|
||||||
|
tether.Part0, tether.Part1 = body, fighter.root
|
||||||
|
tether.Parent = body
|
||||||
|
body.Anchored = false
|
||||||
|
object.carrier, object.tether, object.droppedUntil = fighter.player, tether, 0
|
||||||
|
fighter.player:SetAttribute("ArenaFlag", true)
|
||||||
|
state:SetAttribute("FlagCarrierSide", fighter.side)
|
||||||
|
state:SetAttribute("FlagReturnAt", nil)
|
||||||
|
state:SetAttribute("FlagPosition", fighter.root.Position)
|
||||||
|
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.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 = 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
|
||||||
|
ctx.events.fire(Kinds.FlagDropped, {at = floor.Position})
|
||||||
|
else
|
||||||
|
putFlag(flag, flag.marker.origin, 0)
|
||||||
|
ctx.events.fire(Kinds.FlagReturned, {at = flag.marker.origin})
|
||||||
|
end
|
||||||
|
else
|
||||||
|
putFlag(flag, flag.marker.origin, 0)
|
||||||
|
ctx.events.fire(Kinds.FlagReturned, {at = flag.marker.origin})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local function runFlag(fighters: {Fighter}, now: number)
|
||||||
|
if flag.carrier then
|
||||||
|
for _, fighter in fighters do
|
||||||
|
if fighter.player ~= flag.carrier then continue end
|
||||||
|
state:SetAttribute("FlagPosition", fighter.root.Position)
|
||||||
|
state:SetAttribute("FlagCarrierSide", fighter.side)
|
||||||
|
local base = if fighter.side == "Blue" then map.blue else map.orange
|
||||||
|
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, at = base})
|
||||||
|
ctx.cue(fighters, true, nil)
|
||||||
|
putFlag(flag, flag.marker.origin, 0)
|
||||||
|
ctx.events.fire(Kinds.FlagReturned, {at = flag.marker.origin})
|
||||||
|
ctx.status(Strings.flagReturned)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local carrier = flag.carrier
|
||||||
|
local root = carrier.Character and carrier.Character.PrimaryPart
|
||||||
|
dropCarried(carrier, root and root.Position, now, fighters)
|
||||||
|
return
|
||||||
|
elseif flag.droppedUntil > 0 and now >= flag.droppedUntil then
|
||||||
|
putFlag(flag, flag.marker.origin, 0)
|
||||||
|
ctx.events.fire(Kinds.FlagReturned, {at = flag.marker.origin})
|
||||||
|
end
|
||||||
|
if flag.droppedUntil > 0 then
|
||||||
|
local seconds = Rules.remaining(flag.droppedUntil, now)
|
||||||
|
if seconds ~= lastSeconds then
|
||||||
|
lastSeconds = seconds
|
||||||
|
flag.marker.label.Text = string.format(Strings.flagHints.dropLabel, seconds)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local at = flag.marker.body.Position
|
||||||
|
for _, fighter in fighters do
|
||||||
|
if Common.boundsAt(fighter.root.Position, at, 5.5, 6.5) and Common.visibleAt(fighter, at, geometry) then
|
||||||
|
pickUpFlag(flag, fighter)
|
||||||
|
ctx.contribute(fighter.player, "carries", 1)
|
||||||
|
ctx.events.fire(Kinds.FlagPicked, {side = fighter.side, userId = fighter.player.UserId, text = fighter.player.DisplayName})
|
||||||
|
ctx.cue(fighters, false, fighter.side)
|
||||||
|
ctx.status(Strings.flagCarrier(fighter.player.DisplayName))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
ctx.status(if flag.droppedUntil > 0 then Strings.flagOnGround else Strings.flagOnRoof)
|
||||||
|
end
|
||||||
|
return Common.instance(ctx, {
|
||||||
|
step = function(now, _, fighters) runFlag(fighters, now); return false end,
|
||||||
|
death = dropCarried, leaving = dropCarried,
|
||||||
|
destroy = function()
|
||||||
|
if flag.carrier then flag.carrier:SetAttribute("ArenaFlag", nil) end
|
||||||
|
for _, name in {"FlagPosition","FlagCarrierSide","FlagReturnAt","FlagBase_Blue","FlagBase_Orange"} do state:SetAttribute(name,nil) end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return {id = "CaptureFlag", usesMap = true, start = start}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
--!strict
|
||||||
|
local Runtime = script.Parent.Parent
|
||||||
|
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 Zones = require(Runtime.Zones)
|
||||||
|
local HotPoint = require(Runtime.Parent.HotPoint)
|
||||||
|
type Fighter = Types.Fighter
|
||||||
|
type Side = Types.Side
|
||||||
|
local Run = require(Runtime.DominationRules)
|
||||||
|
local RADIUS = HotPoint.Radius -- Общий радиус зон до отдельного баланса режима.
|
||||||
|
local SPEC: Zones.Spec = {radius = RADIUS, height = 8, sightHeight = 2.7, exclusiveHeight = true}
|
||||||
|
|
||||||
|
local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||||
|
local map = assert(ctx.map)
|
||||||
|
local zones: {Common.Zone} = {}
|
||||||
|
local contested: {[number]: boolean} = {}
|
||||||
|
local affected: {[Player]: boolean} = {}
|
||||||
|
local state = ctx.state
|
||||||
|
local full: Side? = nil
|
||||||
|
for i, site in {map.west, map.gallery, map.east} do
|
||||||
|
local key = string.char(64 + i)
|
||||||
|
local zone = Common.makeZone(ctx.folder, ctx.geometry, site, key)
|
||||||
|
zone.marker.label.Text = key .. " · " .. site.name
|
||||||
|
table.insert(zones, zone)
|
||||||
|
end
|
||||||
|
local function presence(fighters: {Fighter}, zone: Common.Zone, geometry: RaycastParams, dt: number, reasons: {[Player]: string}): (boolean, boolean, {Fighter})
|
||||||
|
local blue, orange = false, false
|
||||||
|
local inside: {Fighter} = {}
|
||||||
|
for _, fighter in fighters do
|
||||||
|
local reason = Zones.classify(fighter.root.Position, zone.site.position, SPEC, geometry)
|
||||||
|
if reason ~= "Outside" and reasons[fighter.player] ~= "Inside" then reasons[fighter.player] = reason end
|
||||||
|
if reason == "Inside" then
|
||||||
|
table.insert(inside, fighter)
|
||||||
|
ctx.contribute(fighter.player, "holdSeconds", dt)
|
||||||
|
if fighter.side == "Blue" then blue = true else orange = true end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return blue, orange, inside
|
||||||
|
end
|
||||||
|
local geometry = ctx.geometry
|
||||||
|
local nextScore = ctx.liveAt + 1
|
||||||
|
return Common.instance(ctx, {step = function(now, dt, fighters)
|
||||||
|
local scoreNow, nextAt = Run.tick(now, nextScore)
|
||||||
|
nextScore = nextAt
|
||||||
|
local reasons: {[Player]: string} = {}
|
||||||
|
local ownedBlue, ownedOrange = 0, 0
|
||||||
|
for index, zone in zones do
|
||||||
|
local b, o, inside = presence(fighters, zone, geometry, dt, reasons)
|
||||||
|
local key = string.char(64 + index)
|
||||||
|
if b and o and not contested[index] then ctx.events.fire(Kinds.ZoneContested, {index = index, text = key}) end
|
||||||
|
contested[index] = b and o
|
||||||
|
local side = Run.claimSide(b, o)
|
||||||
|
if side and side ~= zone.owner then
|
||||||
|
if zone.claiming ~= side then
|
||||||
|
zone.claiming, zone.progress = side, 0
|
||||||
|
ctx.cue(fighters, false, side)
|
||||||
|
end
|
||||||
|
zone.progress += dt
|
||||||
|
if zone.progress >= Run.CAPTURE_SECONDS then
|
||||||
|
local previous = zone.owner
|
||||||
|
zone.owner, zone.progress = side, 0
|
||||||
|
for _, fighter in inside do ctx.contribute(fighter.player, "captures", 1) end
|
||||||
|
local payload = {side = side, index = index, text = zone.marker.label.Text, value = now - ctx.liveAt, at = zone.site.position}
|
||||||
|
ctx.events.fire(Kinds.ZoneCaptured, payload)
|
||||||
|
if previous then ctx.events.fire(Kinds.ZoneLost, {side = previous, index = index, text = payload.text}) end
|
||||||
|
ctx.cue(fighters, true, nil)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
zone.claiming, zone.progress = nil, 0
|
||||||
|
end
|
||||||
|
local shade = Common.color(zone.owner)
|
||||||
|
Common.paint(zone.marker, if contested[index] then shade:Lerp(Color3.fromRGB(80, 88, 103), .55) else shade)
|
||||||
|
state:SetAttribute("ZoneOwner_" .. key, zone.owner)
|
||||||
|
state:SetAttribute("ZoneClaim_" .. key, zone.claiming)
|
||||||
|
state:SetAttribute("ZoneProgress_" .. key, math.clamp(zone.progress / Run.CAPTURE_SECONDS, 0, 1))
|
||||||
|
state:SetAttribute("ZoneContested_" .. key, contested[index])
|
||||||
|
if zone.owner == "Blue" then ownedBlue += 1 elseif zone.owner == "Orange" then ownedOrange += 1 end
|
||||||
|
end
|
||||||
|
for player in affected do
|
||||||
|
if not reasons[player] then player:SetAttribute("DominationZone", nil); affected[player] = nil end
|
||||||
|
end
|
||||||
|
for player, reason in reasons do
|
||||||
|
affected[player] = true
|
||||||
|
player:SetAttribute("DominationZone", reason)
|
||||||
|
end
|
||||||
|
state:SetAttribute("ScoreRate_Blue", ownedBlue)
|
||||||
|
state:SetAttribute("ScoreRate_Orange", ownedOrange)
|
||||||
|
local owner: Side? = if ownedBlue == #zones then "Blue" elseif ownedOrange == #zones then "Orange" else nil
|
||||||
|
if owner ~= full then
|
||||||
|
full = owner
|
||||||
|
if owner then ctx.events.fire(Kinds.FullControl, {side = owner}) end
|
||||||
|
end
|
||||||
|
if scoreNow then
|
||||||
|
if ownedBlue > 0 then ctx.scoring.add("Blue", ownedBlue) end
|
||||||
|
if ownedOrange > 0 then ctx.scoring.add("Orange", ownedOrange) end
|
||||||
|
end
|
||||||
|
ctx.status(Strings.dominationStatus(ownedBlue, ownedOrange))
|
||||||
|
return false
|
||||||
|
end, destroy = function()
|
||||||
|
for player in affected do player:SetAttribute("DominationZone", nil) end
|
||||||
|
for _, id in {"A", "B", "C"} do
|
||||||
|
for _, name in {"ZoneOwner_", "ZoneClaim_", "ZoneProgress_", "ZoneContested_"} do state:SetAttribute(name .. id, nil) end
|
||||||
|
end
|
||||||
|
state:SetAttribute("ScoreRate_Blue", nil)
|
||||||
|
state:SetAttribute("ScoreRate_Orange", nil)
|
||||||
|
end})
|
||||||
|
end
|
||||||
|
|
||||||
|
return {id = "Domination", usesMap = true, start = start}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
--!strict
|
||||||
|
local Runtime = script.Parent.Parent
|
||||||
|
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 HotPoint = require(Runtime.Parent.HotPoint)
|
||||||
|
local Sites = require(Runtime.Parent.ArenaObjectiveSites)
|
||||||
|
|
||||||
|
local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||||
|
local path = Sites.hotPath(ctx.arena, assert(ctx.map), HotPoint.Radius)
|
||||||
|
local nowAt = ctx.liveAt
|
||||||
|
local wasContested = false
|
||||||
|
local capture = HotPoint.start({
|
||||||
|
state = ctx.state, geometry = ctx.geometry, sites = path, startedAt = ctx.liveAt,
|
||||||
|
marker = function(site)
|
||||||
|
ctx.events.fire(Kinds.ZoneStarted, {text = site.name, at = site.position})
|
||||||
|
return Common.marker(ctx.folder, "HotPoint", Strings.hotPoint, site.position, Common.neutral, HotPoint.Radius * 2)
|
||||||
|
end,
|
||||||
|
score = function(side, points)
|
||||||
|
ctx.scoring.add(side, points, Kinds.ZoneCaptured)
|
||||||
|
ctx.events.fire(Kinds.ZoneCaptured, {side = side, text = Strings.hotPoint, value = nowAt - ctx.liveAt, at = ctx.state:GetAttribute("HotPointPosition") :: Vector3?})
|
||||||
|
end,
|
||||||
|
status = ctx.status, contribute = ctx.contribute,
|
||||||
|
})
|
||||||
|
return Common.instance(ctx, {
|
||||||
|
step = function(now, dt, fighters, elapsed)
|
||||||
|
nowAt = now
|
||||||
|
capture.step(fighters, now, elapsed or dt)
|
||||||
|
local contested = ctx.state:GetAttribute("HotPointPhase") == "Contested"
|
||||||
|
if contested and not wasContested then
|
||||||
|
ctx.events.fire(Kinds.ZoneContested, {text = Strings.hotPoint, at = ctx.state:GetAttribute("HotPointPosition") :: Vector3?})
|
||||||
|
end
|
||||||
|
wasContested = contested
|
||||||
|
return false
|
||||||
|
end,
|
||||||
|
hit = capture.hit, death = capture.death, leaving = capture.death, destroy = capture.destroy,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return {id = "HotPoint", usesMap = true, start = start}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
--!strict
|
||||||
|
local Runtime = script.Parent.Parent
|
||||||
|
local Types = require(Runtime.Types)
|
||||||
|
local Common = require(Runtime.Common)
|
||||||
|
local Kinds = require(game.ReplicatedStorage.Hunter.EventKinds)
|
||||||
|
local Strings = require(game.ReplicatedStorage.Hunter.Strings)
|
||||||
|
type Fighter = Types.Fighter
|
||||||
|
type Side = Types.Side
|
||||||
|
local Rules = require(Runtime.LeaderRules)
|
||||||
|
local rng = Random.new()
|
||||||
|
|
||||||
|
local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||||
|
local leaders: {[Side]: Player} = {}
|
||||||
|
local state = ctx.state
|
||||||
|
local previousLeader: {[Side]: Player} = {}
|
||||||
|
local leaderLabels: {[Player]: BillboardGui} = {}
|
||||||
|
local function clearLeader(side: Side)
|
||||||
|
local p = leaders[side]
|
||||||
|
if not p then return end
|
||||||
|
previousLeader[side] = p
|
||||||
|
leaders[side] = nil
|
||||||
|
state:SetAttribute("LeaderName_"..side,nil)
|
||||||
|
state:SetAttribute("LeaderPosition_"..side,nil)
|
||||||
|
p:SetAttribute("ArenaLeader", nil)
|
||||||
|
local badge = leaderLabels[p]
|
||||||
|
if badge then badge:Destroy() end
|
||||||
|
leaderLabels[p] = nil
|
||||||
|
end
|
||||||
|
local function updateLeaders(fighters: {Fighter})
|
||||||
|
for _, side in Common.sides do
|
||||||
|
local roster: {Fighter} = {}
|
||||||
|
local present = false
|
||||||
|
for _, f in fighters do
|
||||||
|
if f.side ~= side then continue end
|
||||||
|
table.insert(roster, f)
|
||||||
|
if f.player == leaders[side] then
|
||||||
|
present = true
|
||||||
|
state:SetAttribute("LeaderPosition_"..side,f.root.Position)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if present then continue end
|
||||||
|
clearLeader(side)
|
||||||
|
if #roster == 0 then continue end
|
||||||
|
local pick = rng:NextInteger(1, #roster)
|
||||||
|
pick = Rules.nextIndex(pick,#roster,roster[pick].player == previousLeader[side])
|
||||||
|
local p = roster[pick].player
|
||||||
|
local head = p.Character and p.Character:FindFirstChild("Head")
|
||||||
|
if not head or not head:IsA("BasePart") then continue end
|
||||||
|
leaders[side] = p
|
||||||
|
state:SetAttribute("LeaderName_"..side,p.DisplayName)
|
||||||
|
state:SetAttribute("LeaderPosition_"..side,roster[pick].root.Position)
|
||||||
|
p:SetAttribute("ArenaLeader", true)
|
||||||
|
leaderLabels[p] = Common.label(head, Strings.leaderLabel, Common.gold, 2.7).Parent :: BillboardGui
|
||||||
|
ctx.events.fire(Kinds.LeaderAssigned, {side = side, userId = p.UserId, text = p.DisplayName})
|
||||||
|
end
|
||||||
|
local a, b = leaders.Blue, leaders.Orange
|
||||||
|
ctx.status(Strings.leaders(if a then a.DisplayName else nil, if b then b.DisplayName else nil))
|
||||||
|
end
|
||||||
|
return Common.instance(ctx, {
|
||||||
|
step = function(_, _, fighters) updateLeaders(fighters); return false end,
|
||||||
|
kill = function(player, victim, at)
|
||||||
|
local side = Common.sideOf(player)
|
||||||
|
if not side then return end
|
||||||
|
local target = Common.opposite(side)
|
||||||
|
local bonus = leaders[target] == victim
|
||||||
|
ctx.scoring.add(side, Rules.points(bonus), if bonus then Kinds.LeaderDown else "Elimination", player)
|
||||||
|
if bonus then
|
||||||
|
ctx.contribute(player, "leaderKills", 1)
|
||||||
|
clearLeader(target)
|
||||||
|
ctx.events.fire(Kinds.LeaderDown, {side = side, userId = player.UserId, text = victim.DisplayName, at = at})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
death = function(player)
|
||||||
|
for _, side in Common.sides do if leaders[side] == player then clearLeader(side) end end
|
||||||
|
end,
|
||||||
|
leaving = function(player)
|
||||||
|
for _, side in Common.sides do if leaders[side] == player then clearLeader(side) end end
|
||||||
|
end,
|
||||||
|
destroy = function() for _, side in Common.sides do clearLeader(side) end end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return {id = "HuntLeader", usesMap = false, start = start}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
--!strict
|
||||||
|
local Runtime = script.Parent.Parent
|
||||||
|
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 Rules = require(Runtime.OneLifeRules)
|
||||||
|
type Fighter = Types.Fighter
|
||||||
|
|
||||||
|
local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||||
|
local lifeActive, miniNumber = false, 0
|
||||||
|
local lifeEnds, nextMini = math.huge, ctx.liveAt
|
||||||
|
local state = ctx.state
|
||||||
|
local function runOneLife(members: {Player}, fighters: {Fighter}, now: number): boolean
|
||||||
|
if lifeActive then
|
||||||
|
local b, o = 0, 0
|
||||||
|
for _, f in fighters do if f.side == "Blue" then b += 1 else o += 1 end end
|
||||||
|
state:SetAttribute("MiniAliveBlue", b)
|
||||||
|
state:SetAttribute("MiniAliveOrange", o)
|
||||||
|
if (b > 0 and o > 0) and now < lifeEnds then
|
||||||
|
ctx.status(Strings.lifeActive(miniNumber, b, o, math.ceil(lifeEnds - now)))
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local side = Rules.winner(b,o)
|
||||||
|
if side then ctx.scoring.add(side, 1, Kinds.MiniRoundEnded) end
|
||||||
|
state:SetAttribute("MiniRoundActive", false)
|
||||||
|
ctx.events.fire(Kinds.MiniRoundEnded, {side = side, index = miniNumber, blue = b, orange = o})
|
||||||
|
if Rules.finished(ctx.scoring.get("Blue"),ctx.scoring.get("Orange")) then return true end
|
||||||
|
for _, p in members do ctx.bench(p) end
|
||||||
|
lifeActive, nextMini = false, now + Rules.INTERMISSION
|
||||||
|
end
|
||||||
|
if now >= nextMini then ctx.balanceWaiting() end
|
||||||
|
local ready: {Player} = {}
|
||||||
|
local b, o = false, false
|
||||||
|
for _, p in members do
|
||||||
|
local c = p.Character
|
||||||
|
local h = c and c:FindFirstChildOfClass("Humanoid")
|
||||||
|
if not c or not c.PrimaryPart or not h or h.Health <= 0 then continue end
|
||||||
|
table.insert(ready, p)
|
||||||
|
if Common.sideOf(p) == "Blue" then b = true else o = true end
|
||||||
|
end
|
||||||
|
if b and o and now >= nextMini then
|
||||||
|
for _, p in ready do ctx.deploy(p) end
|
||||||
|
miniNumber += 1
|
||||||
|
lifeActive, lifeEnds = true, now + Rules.DURATION
|
||||||
|
state:SetAttribute("MiniRoundActive",true)
|
||||||
|
state:SetAttribute("MiniRoundNextAt",nil)
|
||||||
|
ctx.status(Strings.lifeStart(miniNumber))
|
||||||
|
ctx.events.fire(Kinds.MiniRoundStarted, {index = miniNumber, blue = ctx.scoring.get("Blue"), orange = ctx.scoring.get("Orange")})
|
||||||
|
elseif not b or not o then
|
||||||
|
state:SetAttribute("MiniRoundNextAt",nil)
|
||||||
|
ctx.status(Strings.lifeWaiting)
|
||||||
|
else
|
||||||
|
state:SetAttribute("MiniRoundNextAt",nextMini)
|
||||||
|
ctx.status(Strings.lifeNext(math.ceil(nextMini - now)))
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return Common.instance(ctx, {
|
||||||
|
step = function(now, _, fighters) return runOneLife(ctx.members(), fighters, now) end,
|
||||||
|
death = function(player) ctx.bench(player) end,
|
||||||
|
destroy = function()
|
||||||
|
for _, name in {"MiniRoundActive","MiniRoundNextAt","MiniAliveBlue","MiniAliveOrange"} do state:SetAttribute(name,nil) end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return {id = "OneLife", usesMap = true, start = start}
|
||||||
@@ -0,0 +1,199 @@
|
|||||||
|
--!strict
|
||||||
|
local Runtime = script.Parent.Parent
|
||||||
|
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 CollectionService = game:GetService("CollectionService")
|
||||||
|
local Zones = require(Runtime.Zones)
|
||||||
|
local Effects = require(Runtime.SiegeEffects)
|
||||||
|
local Sites = require(Runtime.Parent.ArenaObjectiveSites)
|
||||||
|
local SiegeConfig = require(game.ReplicatedStorage.CitadelAssaultConfig)
|
||||||
|
local Capture = require(Runtime.Parent.CitadelCaptureService)
|
||||||
|
local Score = require(Runtime.Parent.CitadelScoreService)
|
||||||
|
local SiegeSpawn = require(Runtime.Parent.CitadelSpawnService)
|
||||||
|
type Fighter = Types.Fighter
|
||||||
|
type Side = Types.Side
|
||||||
|
local SPEC: Zones.Spec = {radius = SiegeConfig.CAPTURE_RADIUS, height = SiegeConfig.HEIGHT_TOLERANCE, sightHeight = SiegeConfig.SIGHT_HEIGHT}
|
||||||
|
|
||||||
|
local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||||
|
local map, world, geometry, folder, state = assert(ctx.map), ctx.world, ctx.geometry, ctx.folder, ctx.state
|
||||||
|
local zones: {Common.Zone} = {}
|
||||||
|
local visuals: {Effects.Rig} = {}
|
||||||
|
local visibleIndex = 0
|
||||||
|
local data = Instance.new("Folder")
|
||||||
|
data.Name = "CitadelMatchState"
|
||||||
|
data.Parent = state
|
||||||
|
ctx.janitor.give(data)
|
||||||
|
data:SetAttribute("Radius", SiegeConfig.CAPTURE_RADIUS)
|
||||||
|
data:SetAttribute("BlueBase", map.blue)
|
||||||
|
data:SetAttribute("OrangeBase", map.orange)
|
||||||
|
local sites: {Sites.Site} = {map.ground, map.gallery, map.roof}
|
||||||
|
for _, point in CollectionService:GetTagged("CitadelPoint") do
|
||||||
|
if not point:IsA("BasePart") or not point:IsDescendantOf(world) then continue end
|
||||||
|
local index = point:GetAttribute("Index")
|
||||||
|
if typeof(index) == "number" and index % 1 == 0 and sites[index] then
|
||||||
|
sites[index] = {name = sites[index].name, position = point.Position}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i, site in sites do
|
||||||
|
local zone = Common.makeZone(folder, geometry, site, "Checkpoint" .. i, SiegeConfig.CAPTURE_RADIUS, Common.gold)
|
||||||
|
zone.marker.body:SetAttribute("Index", i)
|
||||||
|
zone.marker.body.Parent = nil
|
||||||
|
ctx.janitor.give(zone.marker.body)
|
||||||
|
table.insert(zones, zone)
|
||||||
|
table.insert(visuals, Effects.new(zone.marker))
|
||||||
|
end
|
||||||
|
data:SetAttribute("Total", #zones)
|
||||||
|
local siegeTimes: Score.Ledger = {Blue = {}, Orange = {}}
|
||||||
|
local siegeSide: Side = if SiegeConfig.FIRST_ATTACKER == "Orange" then "Orange" else "Blue"
|
||||||
|
local siegeIndex, siegeProgress = 1, 0
|
||||||
|
local siegeCaptureStarted = false
|
||||||
|
local hadSiegeSwap = false
|
||||||
|
local swapAt = SiegeConfig.ATTACK_DURATION
|
||||||
|
local lastStatus: string? = nil
|
||||||
|
local marked: {[Player]: boolean} = {}
|
||||||
|
local function runSiege(members: {Player}, fighters: {Fighter}, now: number, dt: number): boolean
|
||||||
|
local half = SiegeConfig.ATTACK_DURATION
|
||||||
|
local elapsed = now - ctx.liveAt
|
||||||
|
if elapsed >= swapAt and not hadSiegeSwap then
|
||||||
|
ctx.setStage("RoleSwap", ctx.liveAt + swapAt + SiegeConfig.SWAP_FREEZE)
|
||||||
|
hadSiegeSwap = true
|
||||||
|
for i, z in zones do
|
||||||
|
visuals[i].hide()
|
||||||
|
z.marker.body.Parent = nil
|
||||||
|
end
|
||||||
|
visibleIndex, lastStatus = 0, nil
|
||||||
|
siegeSide, siegeIndex, siegeProgress = Common.opposite(siegeSide), 1, 0
|
||||||
|
siegeCaptureStarted = false
|
||||||
|
local arenaSites = map
|
||||||
|
ctx.events.fire(Kinds.RoleSwap, {side = siegeSide})
|
||||||
|
local ordinals = {Blue = 0, Orange = 0}
|
||||||
|
for _, p in members do
|
||||||
|
ctx.deploy(p)
|
||||||
|
local side, character = Common.sideOf(p), p.Character
|
||||||
|
if not side or not character or not character.PrimaryPart then continue end
|
||||||
|
local attack = side == siegeSide
|
||||||
|
ordinals[side] += 1
|
||||||
|
local at = SiegeSpawn.position(world, attack, if attack then arenaSites.blue else arenaSites.orange, ordinals[side])
|
||||||
|
character:PivotTo(CFrame.new(at + Vector3.yAxis * 4))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local swap = elapsed >= swapAt and elapsed < swapAt + SiegeConfig.SWAP_FREEZE
|
||||||
|
local attackStart = if hadSiegeSwap then swapAt + SiegeConfig.SWAP_FREEZE else 0
|
||||||
|
data:SetAttribute("Phase", if swap then "RoleSwap" elseif hadSiegeSwap then "Attack2" else "Attack1")
|
||||||
|
data:SetAttribute("Attacker", siegeSide)
|
||||||
|
data:SetAttribute("Seconds", math.clamp(math.ceil((if hadSiegeSwap then half else swapAt) - (elapsed - attackStart)), 0, half))
|
||||||
|
if swap then
|
||||||
|
data:SetAttribute("Progress", 0)
|
||||||
|
data:SetAttribute("Status", "Idle")
|
||||||
|
ctx.status(Strings.siegeSwap)
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if state:GetAttribute("RoundStage") == "RoleSwap" then ctx.setStage("Live") end
|
||||||
|
if hadSiegeSwap and elapsed >= attackStart + half then return true end
|
||||||
|
local attacker = Strings.team(siegeSide)
|
||||||
|
local zone = zones[siegeIndex]
|
||||||
|
data:SetAttribute("Index", siegeIndex)
|
||||||
|
for player in marked do
|
||||||
|
if not table.find(members, player) then
|
||||||
|
player:SetAttribute("CitadelZone", nil)
|
||||||
|
marked[player] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, player in members do marked[player] = true end
|
||||||
|
if not zone then
|
||||||
|
data:SetAttribute("Point", nil)
|
||||||
|
data:SetAttribute("NextPoint", nil)
|
||||||
|
data:SetAttribute("Status", "Complete")
|
||||||
|
for player in marked do player:SetAttribute("CitadelZone", nil) end
|
||||||
|
ctx.status(Strings.siegeComplete)
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local visual = visuals[siegeIndex]
|
||||||
|
if visibleIndex ~= siegeIndex then
|
||||||
|
visibleIndex, lastStatus = siegeIndex, nil
|
||||||
|
zone.marker.body.Parent = folder
|
||||||
|
visual.show()
|
||||||
|
ctx.events.fire(Kinds.ZoneStarted, {side = siegeSide, index = siegeIndex, text = zone.site.name, at = zone.site.position})
|
||||||
|
end
|
||||||
|
local updated: {[Player]: boolean} = {}
|
||||||
|
local attack, defense = false, false
|
||||||
|
local attackers: {Player} = {}
|
||||||
|
for _, fighter in fighters do
|
||||||
|
local reason = Zones.classify(fighter.root.Position, zone.site.position, SPEC, geometry)
|
||||||
|
if reason == "Inside" then
|
||||||
|
ctx.contribute(fighter.player, "holdSeconds", dt)
|
||||||
|
if fighter.side == siegeSide then
|
||||||
|
attack = true
|
||||||
|
table.insert(attackers, fighter.player)
|
||||||
|
else
|
||||||
|
defense = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
updated[fighter.player] = true
|
||||||
|
fighter.player:SetAttribute("CitadelZone", reason)
|
||||||
|
end
|
||||||
|
for player in marked do if not updated[player] then player:SetAttribute("CitadelZone", nil) end end
|
||||||
|
local progress, phase = Capture.advance(siegeProgress, math.min(dt, math.max(0, elapsed - attackStart)), attack, defense,
|
||||||
|
SiegeConfig.CAPTURE_TIME, SiegeConfig.DECAY_MULTIPLIER)
|
||||||
|
if phase == "Capturing" and not siegeCaptureStarted then
|
||||||
|
ctx.cue(fighters, false, siegeSide)
|
||||||
|
siegeCaptureStarted = true
|
||||||
|
elseif progress == 0 and phase ~= "Capturing" then
|
||||||
|
siegeCaptureStarted = false
|
||||||
|
end
|
||||||
|
siegeProgress = progress
|
||||||
|
data:SetAttribute("Progress", progress)
|
||||||
|
data:SetAttribute("Status", phase)
|
||||||
|
data:SetAttribute("Point", zone.site.position)
|
||||||
|
data:SetAttribute("PointName", zone.site.name)
|
||||||
|
local nextZone = zones[siegeIndex + 1]
|
||||||
|
data:SetAttribute("NextPoint", if nextZone then nextZone.site.position else nil)
|
||||||
|
local percent = math.floor(progress / SiegeConfig.HUD_PROGRESS_STEP + 1e-8) * SiegeConfig.HUD_PROGRESS_STEP * 100
|
||||||
|
ctx.status(Strings.siegeStatus(attacker, siegeIndex, #zones, percent, phase))
|
||||||
|
local teamTint = Common.color(siegeSide)
|
||||||
|
local tint = if phase == "Idle" then Common.gold elseif phase == "Contested" then SiegeConfig.CONTESTED_COLOR
|
||||||
|
elseif phase == "Decaying" then teamTint:Lerp(Color3.fromRGB(150, 162, 182), .45) else teamTint
|
||||||
|
Common.paint(zone.marker, tint)
|
||||||
|
if phase == "Contested" and lastStatus ~= phase then
|
||||||
|
ctx.events.fire(Kinds.ZoneContested, {side = siegeSide, index = siegeIndex, at = zone.site.position})
|
||||||
|
end
|
||||||
|
lastStatus = phase
|
||||||
|
if phase ~= "Captured" or not Score.record(siegeTimes, siegeSide, siegeIndex, elapsed - attackStart) then return false end
|
||||||
|
ctx.scoring.add(siegeSide, SiegeConfig.POINTS_PER_OBJECTIVE, Kinds.ZoneCaptured)
|
||||||
|
for _, player in attackers do ctx.contribute(player, "captures", 1) end
|
||||||
|
ctx.events.fire(Kinds.ZoneCaptured, {side = siegeSide, index = siegeIndex, text = zone.site.name, value = elapsed - attackStart, at = zone.site.position})
|
||||||
|
ctx.cue(fighters, true, nil)
|
||||||
|
siegeCaptureStarted = false
|
||||||
|
data:SetAttribute(siegeSide .. "Time" .. siegeIndex, elapsed - attackStart)
|
||||||
|
visual.capture()
|
||||||
|
siegeIndex += 1
|
||||||
|
siegeProgress = 0
|
||||||
|
if siegeIndex > #zones then
|
||||||
|
ctx.events.fire(Kinds.AllObjectivesTaken, {side = siegeSide})
|
||||||
|
if SiegeConfig.EARLY_FINISH_WHEN_ALL_TAKEN then
|
||||||
|
if hadSiegeSwap then return true end
|
||||||
|
swapAt = elapsed
|
||||||
|
state:SetAttribute("SiegeEndsAt", ctx.liveAt + swapAt + SiegeConfig.SWAP_FREEZE + half)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return Common.instance(ctx, {
|
||||||
|
step = function(now, dt, fighters) return runSiege(ctx.members(), fighters, now, dt) end,
|
||||||
|
winner = function()
|
||||||
|
local winner, reason = Score.winner(siegeTimes, SiegeConfig.TIE_EPSILON)
|
||||||
|
state:SetAttribute("CitadelResultReason", reason)
|
||||||
|
return winner, reason
|
||||||
|
end,
|
||||||
|
death = function(p) p:SetAttribute("CitadelZone", nil) end,
|
||||||
|
leaving = function(p) marked[p] = nil; p:SetAttribute("CitadelZone", nil) end,
|
||||||
|
destroy = function()
|
||||||
|
state:SetAttribute("SiegeEndsAt", nil)
|
||||||
|
for p in marked do p:SetAttribute("CitadelZone", nil) end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return {id = "Siege", usesMap = true, start = start}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
--!strict
|
||||||
|
local Types = require(script.Parent.Parent.Types)
|
||||||
|
local Common = require(script.Parent.Parent.Common)
|
||||||
|
local Hunter=game.ReplicatedStorage.Hunter
|
||||||
|
local Rules=require(Hunter.TeamDeathmatchRules)
|
||||||
|
local Kinds=require(Hunter.EventKinds)
|
||||||
|
|
||||||
|
local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||||
|
return Common.instance(ctx, {kill = function(player: Player)
|
||||||
|
local side = Common.sideOf(player)
|
||||||
|
if not side then return end
|
||||||
|
ctx.scoring.add(side, 1, "Elimination", player)
|
||||||
|
local streak=player:GetAttribute("StreakKills")
|
||||||
|
if typeof(streak)=="number" and Rules.announce(streak) then
|
||||||
|
ctx.events.fire(Kinds.Streak,{side=side,userId=player.UserId,text=player.DisplayName,value=streak})
|
||||||
|
end
|
||||||
|
end})
|
||||||
|
end
|
||||||
|
|
||||||
|
return {id = "TeamDeathmatch", usesMap = false, start = start}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
--!strict
|
||||||
|
local Runtime = script.Parent.Parent
|
||||||
|
local Types = require(Runtime.Types)
|
||||||
|
local Common = require(Runtime.Common)
|
||||||
|
local Kinds = require(game.ReplicatedStorage.Hunter.EventKinds)
|
||||||
|
local Strings = require(game.ReplicatedStorage.Hunter.Strings)
|
||||||
|
type Fighter = Types.Fighter
|
||||||
|
local HotPoint = require(Runtime.Parent.HotPoint)
|
||||||
|
local Rules = require(Runtime.TrophyRules)
|
||||||
|
local Diagnostics = require(Runtime.ZoneDiagnostics)
|
||||||
|
type Drop = {marker: Common.Marker, amount: number, expires: number}
|
||||||
|
|
||||||
|
local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||||
|
local map, geometry, folder = assert(ctx.map), ctx.geometry, ctx.folder
|
||||||
|
Common.bases(folder, geometry, map)
|
||||||
|
local tokens: {Drop} = {}
|
||||||
|
local carried: {[Player]: number} = {}
|
||||||
|
local function floorAt(at: Vector3): Vector3
|
||||||
|
local hit = Diagnostics.raycast(at + Vector3.yAxis * .3, -Vector3.yAxis * 50, geometry)
|
||||||
|
return if hit then hit.Position else map.ground.position
|
||||||
|
end
|
||||||
|
local function tokenDrop(at: Vector3, amount: number, now: number)
|
||||||
|
local floor = floorAt(at)
|
||||||
|
ctx.events.fire(Kinds.TokenDropped, {at = floor, value = amount})
|
||||||
|
for _, existing in tokens do
|
||||||
|
if Rules.canMerge(existing.marker.origin, floor) then
|
||||||
|
existing.amount += amount
|
||||||
|
existing.expires = now + Rules.LIFETIME
|
||||||
|
existing.marker.body:SetAttribute("TokenExpiresAt", existing.expires)
|
||||||
|
existing.marker.label.Text = Strings.tokens(existing.amount)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #tokens >= Rules.MAX_DROPS then
|
||||||
|
local old = table.remove(tokens, 1)
|
||||||
|
old.marker.body:Destroy()
|
||||||
|
end
|
||||||
|
local mark = Common.marker(folder, "Tokens", Strings.tokens(amount), floor, Common.gold, 1.55, true)
|
||||||
|
mark.body:SetAttribute("TokenExpiresAt", now + Rules.LIFETIME)
|
||||||
|
mark.body:SetAttribute("TokenFlashSeconds", Rules.FLASH_SECONDS)
|
||||||
|
table.insert(tokens, {marker = mark, amount = amount, expires = now + Rules.LIFETIME})
|
||||||
|
end
|
||||||
|
local function runTrophies(fighters: {Fighter}, now: number)
|
||||||
|
for i = #tokens, 1, -1 do
|
||||||
|
local token = tokens[i]
|
||||||
|
local collector: Fighter? = nil
|
||||||
|
if now < token.expires then
|
||||||
|
for _, f in fighters do
|
||||||
|
if Common.boundsAt(f.root.Position, token.marker.origin, 5, 6) and Common.visibleAt(f, token.marker.body.Position, geometry) then collector = f; break end
|
||||||
|
end
|
||||||
|
if not collector then continue end
|
||||||
|
local p = collector.player
|
||||||
|
if not carried[p] then ctx.events.fire(Kinds.TokenPicked, {userId = p.UserId}, {p}) end
|
||||||
|
carried[p] = (carried[p] or 0) + token.amount
|
||||||
|
p:SetAttribute("ArenaTokens", carried[p])
|
||||||
|
end
|
||||||
|
token.marker.body:Destroy()
|
||||||
|
table.remove(tokens, i)
|
||||||
|
end
|
||||||
|
for _, f in fighters do
|
||||||
|
local amount = carried[f.player]
|
||||||
|
if amount and Common.boundsAt(f.root.Position, if f.side == "Blue" then map.blue else map.orange, HotPoint.Radius, 7) then
|
||||||
|
ctx.scoring.add(f.side, amount, Kinds.TokensBanked, f.player)
|
||||||
|
ctx.contribute(f.player, "tokensBanked", amount)
|
||||||
|
ctx.events.fire(Kinds.TokensBanked, {side = f.side, userId = f.player.UserId, value = amount, at = if f.side == "Blue" then map.blue else map.orange})
|
||||||
|
ctx.cue(fighters, true, nil)
|
||||||
|
carried[f.player] = nil
|
||||||
|
f.player:SetAttribute("ArenaTokens", nil)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
ctx.status(Strings.trophyStatus)
|
||||||
|
end
|
||||||
|
local function drop(player: Player, at: Vector3?, now: number)
|
||||||
|
local amount = carried[player]
|
||||||
|
if not amount then return end
|
||||||
|
carried[player] = nil
|
||||||
|
player:SetAttribute("ArenaTokens", nil)
|
||||||
|
if at then
|
||||||
|
tokenDrop(at, amount, now)
|
||||||
|
ctx.events.fire(Kinds.TokensLost, {userId=player.UserId,value=amount})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return Common.instance(ctx, {
|
||||||
|
step = function(now, _, fighters) runTrophies(fighters, now); return false end,
|
||||||
|
kill = function(player, _, at, now)
|
||||||
|
if Common.sideOf(player) then tokenDrop(at, 1, now) end
|
||||||
|
end,
|
||||||
|
death = drop, leaving = drop,
|
||||||
|
destroy = function()
|
||||||
|
for p in carried do p:SetAttribute("ArenaTokens", nil) end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return {id = "TrophyHunt", usesMap = true, start = start}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
--!strict
|
||||||
|
local Rules = {WINS = 3, DURATION = 45, INTERMISSION = 4}
|
||||||
|
function Rules.winner(blue: number, orange: number): ("Blue" | "Orange")?
|
||||||
|
return if blue == orange then nil elseif blue > orange then "Blue" else "Orange"
|
||||||
|
end
|
||||||
|
function Rules.finished(blue: number, orange: number): boolean
|
||||||
|
return math.max(blue, orange) >= Rules.WINS
|
||||||
|
end
|
||||||
|
return table.freeze(Rules)
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
--!strict
|
||||||
|
local RoundState = {}
|
||||||
|
type Movement = {humanoid: Humanoid, root: BasePart, walk: number, jumpHeight: number, jumpPower: number, wasAnchored: boolean}
|
||||||
|
local frozen: {[Player]: Movement} = {}
|
||||||
|
|
||||||
|
function RoundState.thaw(player: Player)
|
||||||
|
local old = frozen[player]
|
||||||
|
if not old then return end
|
||||||
|
frozen[player] = nil
|
||||||
|
old.root.Anchored = old.wasAnchored
|
||||||
|
if old.humanoid.WalkSpeed == 0 then old.humanoid.WalkSpeed = old.walk end
|
||||||
|
if old.humanoid.JumpHeight == 0 then old.humanoid.JumpHeight = old.jumpHeight end
|
||||||
|
if old.humanoid.JumpPower == 0 then old.humanoid.JumpPower = old.jumpPower end
|
||||||
|
end
|
||||||
|
|
||||||
|
function RoundState.freeze(player: Player, character: Model, humanoid: Humanoid)
|
||||||
|
local root = character:FindFirstChild("HumanoidRootPart")
|
||||||
|
if not root or not root:IsA("BasePart") then return end
|
||||||
|
if frozen[player] and frozen[player].root == root then return end
|
||||||
|
RoundState.thaw(player)
|
||||||
|
frozen[player] = {humanoid = humanoid, root = root, walk = humanoid.WalkSpeed,
|
||||||
|
jumpHeight = humanoid.JumpHeight, jumpPower = humanoid.JumpPower, wasAnchored = root.Anchored}
|
||||||
|
root.AssemblyLinearVelocity = Vector3.zero
|
||||||
|
root.AssemblyAngularVelocity = Vector3.zero
|
||||||
|
root.Anchored = true
|
||||||
|
humanoid.WalkSpeed = 0
|
||||||
|
humanoid.JumpHeight = 0
|
||||||
|
humanoid.JumpPower = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function RoundState.clearShield(player: Player)
|
||||||
|
player:SetAttribute("SpawnShield", nil)
|
||||||
|
local character = player.Character
|
||||||
|
local old = character and character:FindFirstChild("RoundSpawnShield")
|
||||||
|
if old then old:Destroy() end
|
||||||
|
end
|
||||||
|
|
||||||
|
function RoundState.shield(player: Player, character: Model, seconds: number)
|
||||||
|
RoundState.clearShield(player)
|
||||||
|
if seconds <= 0 then return end
|
||||||
|
local untilAt = workspace:GetServerTimeNow() + seconds
|
||||||
|
local field = Instance.new("ForceField")
|
||||||
|
field.Name = "RoundSpawnShield"
|
||||||
|
field.Visible = false
|
||||||
|
field.Parent = character
|
||||||
|
player:SetAttribute("SpawnShield", untilAt)
|
||||||
|
task.delay(seconds, function()
|
||||||
|
field:Destroy()
|
||||||
|
if player:GetAttribute("SpawnShield") == untilAt then player:SetAttribute("SpawnShield", nil) end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
return RoundState
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
--!strict
|
||||||
|
local Types = require(script.Parent.Types)
|
||||||
|
local Scoring = {}
|
||||||
|
function Scoring.new(state: Instance, onAdd: ((Types.Side, number, string?, Player?) -> ())?, finalMultiplier: number?): Types.Scoring
|
||||||
|
local score: {[Types.Side]: number} = {Blue = 0, Orange = 0}
|
||||||
|
state:SetAttribute("BlueScore", 0)
|
||||||
|
state:SetAttribute("OrangeScore", 0)
|
||||||
|
return {
|
||||||
|
add = function(side, points, reason, credit)
|
||||||
|
if state:GetAttribute("RoundStage") == "FinalPush" then points *= finalMultiplier or 1 end
|
||||||
|
score[side] += points
|
||||||
|
state:SetAttribute(side .. "Score", score[side])
|
||||||
|
if onAdd then onAdd(side, points, reason, credit) end
|
||||||
|
end,
|
||||||
|
get = function(side) return score[side] end,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return Scoring
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
--!strict
|
||||||
|
local Common = require(script.Parent.Common)
|
||||||
|
export type Rig = {show: () -> (), hide: () -> (), capture: () -> ()}
|
||||||
|
local Effects = {}
|
||||||
|
function Effects.new(mark: Common.Marker): Rig
|
||||||
|
local function hide()
|
||||||
|
mark.body:SetAttribute("ObjectiveArrowHidden", true)
|
||||||
|
mark.body.Parent = nil
|
||||||
|
end
|
||||||
|
return {
|
||||||
|
hide = hide,
|
||||||
|
show = function()
|
||||||
|
mark.body:SetAttribute("ObjectiveArrowHidden", nil)
|
||||||
|
Common.paint(mark, Common.gold)
|
||||||
|
end,
|
||||||
|
capture = hide,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return Effects
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
--!strict
|
||||||
|
export type Row = {userId: number, stats: {[string]: number}}
|
||||||
|
local Stats = {}
|
||||||
|
local byPlayer: {[Player]: {[string]: number}} = {}
|
||||||
|
|
||||||
|
function Stats.reset()
|
||||||
|
table.clear(byPlayer)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Stats.add(player: Player, key: string, amount: number)
|
||||||
|
local record = byPlayer[player]
|
||||||
|
if not record then
|
||||||
|
record = {}
|
||||||
|
byPlayer[player] = record
|
||||||
|
end
|
||||||
|
record[key] = (record[key] or 0) + amount
|
||||||
|
end
|
||||||
|
|
||||||
|
function Stats.get(player: Player): {[string]: number}
|
||||||
|
return table.clone(byPlayer[player] or {})
|
||||||
|
end
|
||||||
|
|
||||||
|
function Stats.remove(player: Player)
|
||||||
|
byPlayer[player] = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
function Stats.mvp(rows: {Row}, weights: {[string]: number}): number?
|
||||||
|
local best: number? = nil
|
||||||
|
local bestScore = -math.huge
|
||||||
|
for _, row in rows do
|
||||||
|
local score = 0
|
||||||
|
for key, weight in weights do score += (row.stats[key] or 0) * weight end
|
||||||
|
if score > bestScore or (score == bestScore and best ~= nil and row.userId < best) then
|
||||||
|
best, bestScore = row.userId, score
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return best
|
||||||
|
end
|
||||||
|
|
||||||
|
return Stats
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
--!strict
|
||||||
|
local Rules = {LIFETIME = 42, FLASH_SECONDS = 8, MAX_DROPS = 60}
|
||||||
|
function Rules.canMerge(a: Vector3, b: Vector3): boolean
|
||||||
|
local d = a - b
|
||||||
|
return math.abs(d.Y) < 3 and d.X*d.X+d.Z*d.Z <= 3.5^2
|
||||||
|
end
|
||||||
|
return table.freeze(Rules)
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
--!strict
|
||||||
|
local Sites = require(script.Parent.Parent.ArenaObjectiveSites)
|
||||||
|
export type Side = "Blue" | "Orange"
|
||||||
|
export type Fighter = {player: Player, side: Side, root: BasePart}
|
||||||
|
export type Audience = "All" | Side | {Player}
|
||||||
|
export type EventPayload = {side: Side?, userId: number?, index: number?, value: number?, text: string?, at: Vector3?, blue: number?, orange: number?}
|
||||||
|
export type Janitor = {give: ((() -> ()) | Instance | RBXScriptConnection) -> (), clean: () -> ()}
|
||||||
|
export type Scoring = {add: (Side, number, string?, Player?) -> (), get: (Side) -> number}
|
||||||
|
export type Events = {fire: (string, EventPayload?, Audience?) -> ()}
|
||||||
|
export type Config = {arena: string, rule: string, state: Instance, now: number, duration: number,
|
||||||
|
members: () -> {Player}, bench: (Player) -> (), deploy: (Player) -> (), balanceWaiting: () -> ()}
|
||||||
|
export type ModeContext = {
|
||||||
|
arena: string, rule: string, state: Instance, liveAt: number, duration: number, world: Model,
|
||||||
|
geometry: RaycastParams, folder: Folder, map: Sites.Map?,
|
||||||
|
members: () -> {Player}, bench: (Player) -> (), deploy: (Player) -> (), balanceWaiting: () -> (),
|
||||||
|
scoring: Scoring, events: Events, status: (string) -> (), setStage: (string, number?) -> (), janitor: Janitor,
|
||||||
|
contribute: (Player, string, number) -> (),
|
||||||
|
cue: ({Fighter}, boolean, Side?) -> (), legacy: (Player, string) -> (),
|
||||||
|
}
|
||||||
|
export type ModeInstance = {
|
||||||
|
step: (number, number, {Fighter}, number?) -> boolean,
|
||||||
|
kill: (Player, Player, Vector3, number) -> (),
|
||||||
|
hit: ((Player, number, boolean) -> ())?,
|
||||||
|
death: (Player, Vector3?, number) -> (), leaving: (Player, Vector3?, number) -> (),
|
||||||
|
winner: () -> (string, string?), destroy: () -> (),
|
||||||
|
}
|
||||||
|
export type Mode = {id: string, usesMap: boolean, start: (ModeContext) -> ModeInstance}
|
||||||
|
return {}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
--!strict
|
||||||
|
local Config = require(game.ReplicatedStorage.Hunter.EffectsConfig)
|
||||||
|
local Diagnostics = {}
|
||||||
|
local stepping = false
|
||||||
|
local rays = 0
|
||||||
|
local events = 0
|
||||||
|
local window = 0
|
||||||
|
|
||||||
|
function Diagnostics.begin()
|
||||||
|
stepping = Config.Debug
|
||||||
|
rays = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
function Diagnostics.raycast(origin: Vector3, direction: Vector3, geometry: RaycastParams): RaycastResult?
|
||||||
|
if stepping then rays += 1 end
|
||||||
|
return workspace:Raycast(origin, direction, geometry)
|
||||||
|
end
|
||||||
|
|
||||||
|
function Diagnostics.event()
|
||||||
|
if Config.Debug then events += 1 end
|
||||||
|
end
|
||||||
|
|
||||||
|
function Diagnostics.finish(state: Instance, fighters: number, now: number)
|
||||||
|
stepping = false
|
||||||
|
if not Config.Debug then return end
|
||||||
|
state:SetAttribute("DebugRays", rays)
|
||||||
|
state:SetAttribute("DebugFighters", fighters)
|
||||||
|
if now - window >= 1 then
|
||||||
|
state:SetAttribute("DebugEvents", events)
|
||||||
|
window, events = now, 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return Diagnostics
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
--!strict
|
||||||
|
local Diagnostics = require(script.Parent.ZoneDiagnostics)
|
||||||
|
export type Spec = {radius: number, height: number, sightHeight: number, exclusiveHeight: boolean?}
|
||||||
|
export type Reason = "Outside" | "Height" | "Blocked" | "Inside"
|
||||||
|
local Zones = {}
|
||||||
|
|
||||||
|
function Zones.reason(delta: Vector3, spec: Spec, blocked: boolean): Reason
|
||||||
|
if delta.X * delta.X + delta.Z * delta.Z > spec.radius * spec.radius then return "Outside" end
|
||||||
|
local height = math.abs(delta.Y)
|
||||||
|
if height > spec.height or (height == spec.height and spec.exclusiveHeight) then return "Height" end
|
||||||
|
return if blocked then "Blocked" else "Inside"
|
||||||
|
end
|
||||||
|
|
||||||
|
function Zones.classify(position: Vector3, center: Vector3, spec: Spec, geometry: RaycastParams): Reason
|
||||||
|
local candidate = Zones.reason(position - center, spec, false)
|
||||||
|
if candidate ~= "Inside" then return candidate end
|
||||||
|
local target = center + Vector3.yAxis * spec.sightHeight
|
||||||
|
return if Diagnostics.raycast(position, target - position, geometry) then "Blocked" else "Inside"
|
||||||
|
end
|
||||||
|
return Zones
|
||||||
@@ -4,12 +4,15 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
|||||||
local RunService = game:GetService("RunService")
|
local RunService = game:GetService("RunService")
|
||||||
local Modes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScript)
|
local Modes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScript)
|
||||||
|
|
||||||
|
local Input = game:GetService("UserInputService")
|
||||||
|
local mobile = Input.TouchEnabled and not Input.KeyboardEnabled
|
||||||
local player = Players.LocalPlayer
|
local player = Players.LocalPlayer
|
||||||
local playerGui = player:WaitForChild("PlayerGui")
|
local playerGui = player:WaitForChild("PlayerGui")
|
||||||
local arena = Modes.geometry(Modes.Procedural)
|
local arena = Modes.geometry(Modes.Procedural)
|
||||||
type Arrow = {gui: Frame, chevrons: {Model}, faces: {BasePart}, edges: {BasePart}, glow: {BasePart}, color: Color3?, phase: number}
|
type Arrow = {gui: Frame, chevrons: {Model}, faces: {BasePart}, edges: {BasePart}, glow: {BasePart}, color: Color3?, phase: number}
|
||||||
local arrows: {[BasePart]: Arrow} = {}
|
local arrows: {[BasePart]: Arrow} = {}
|
||||||
local SIZE = 156
|
local flatArrows: {[BasePart]: {TextLabel}} = {}
|
||||||
|
local SIZE = if mobile then 125 else 156
|
||||||
local HEIGHT = 105
|
local HEIGHT = 105
|
||||||
local MAX_DISTANCE = 710
|
local MAX_DISTANCE = 710
|
||||||
local ANIMATION_RATE = 2 * math.pi / 4.5
|
local ANIMATION_RATE = 2 * math.pi / 4.5
|
||||||
@@ -31,6 +34,26 @@ local function build(marker: BasePart)
|
|||||||
gui.BackgroundTransparency = 1
|
gui.BackgroundTransparency = 1
|
||||||
gui.Visible = false
|
gui.Visible = false
|
||||||
|
|
||||||
|
if mobile then
|
||||||
|
local glyphs: {TextLabel} = {}
|
||||||
|
for index, size in {16, 25, 33} do
|
||||||
|
local glyph = Instance.new("TextLabel")
|
||||||
|
glyph.BackgroundTransparency = 1
|
||||||
|
glyph.AnchorPoint = Vector2.new(.5, .5)
|
||||||
|
glyph.Size = UDim2.fromOffset(90, 38)
|
||||||
|
glyph.Font = Enum.Font.GothamBlack
|
||||||
|
glyph.Text = "⌄"
|
||||||
|
glyph.TextSize = size
|
||||||
|
glyph.TextStrokeTransparency = .15
|
||||||
|
glyph.Parent = gui
|
||||||
|
glyphs[index] = glyph
|
||||||
|
end
|
||||||
|
flatArrows[marker] = glyphs
|
||||||
|
arrows[marker] = {gui = gui, chevrons = {}, faces = {}, edges = {}, glow = {}, color = nil, phase = marker.Position.X * .03}
|
||||||
|
gui.Parent = overlay
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local viewport = Instance.new("ViewportFrame")
|
local viewport = Instance.new("ViewportFrame")
|
||||||
viewport.Name = "ArrowViewport"
|
viewport.Name = "ArrowViewport"
|
||||||
viewport.BackgroundTransparency = 1
|
viewport.BackgroundTransparency = 1
|
||||||
@@ -87,6 +110,7 @@ local function remove(instance: Instance)
|
|||||||
local arrow = arrows[instance]
|
local arrow = arrows[instance]
|
||||||
if not arrow then return end
|
if not arrow then return end
|
||||||
arrows[instance] = nil
|
arrows[instance] = nil
|
||||||
|
flatArrows[instance] = nil
|
||||||
arrow.gui:Destroy()
|
arrow.gui:Destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -115,6 +139,13 @@ RunService:BindToRenderStep(renderName, Enum.RenderPriority.Camera.Value + 3, fu
|
|||||||
|
|
||||||
arrow.gui.Position = UDim2.fromOffset(projected.X, y)
|
arrow.gui.Position = UDim2.fromOffset(projected.X, y)
|
||||||
local spacing = 1.15 + math.sin(phase - .9) * .16
|
local spacing = 1.15 + math.sin(phase - .9) * .16
|
||||||
|
local flat = flatArrows[marker]
|
||||||
|
if flat then
|
||||||
|
for i, glyph in flat do
|
||||||
|
glyph.Position = UDim2.new(.5, 0, .5, (i - 2) * 18 * spacing)
|
||||||
|
glyph.TextColor3 = marker.Color:Lerp(Color3.new(1,1,1), .25)
|
||||||
|
end
|
||||||
|
end
|
||||||
for index, chevron in arrow.chevrons do
|
for index, chevron in arrow.chevrons do
|
||||||
chevron:PivotTo(CFrame.new(0, (2 - index) * spacing, 0))
|
chevron:PivotTo(CFrame.new(0, (2 - index) * spacing, 0))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
--!strict
|
||||||
|
local Players = game:GetService("Players")
|
||||||
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
|
local RunService = game:GetService("RunService")
|
||||||
|
local SoundService = game:GetService("SoundService")
|
||||||
|
local Sounds = require(ReplicatedStorage:WaitForChild("SniperEffects") :: ModuleScript)
|
||||||
|
local player = Players.LocalPlayer
|
||||||
|
|
||||||
|
local function cue(name: string, asset: string, looped: boolean): Sound
|
||||||
|
local sound = Instance.new("Sound")
|
||||||
|
sound.Name, sound.SoundId, sound.Looped = name, "rbxasset://sounds/" .. asset, looped
|
||||||
|
sound.Parent = SoundService
|
||||||
|
return sound
|
||||||
|
end
|
||||||
|
|
||||||
|
local steps = cue("HunterOwnSteps", "action_footsteps_plastic.mp3", true)
|
||||||
|
local jump = cue("HunterOwnJump", "action_jump.mp3", false)
|
||||||
|
local landing = cue("HunterOwnLanding", "action_jump_land.mp3", false)
|
||||||
|
local muted = Instance.new("SoundGroup")
|
||||||
|
muted.Name = "HunterOwnMovementSpatial"
|
||||||
|
muted.Volume = 0
|
||||||
|
muted.Parent = SoundService
|
||||||
|
local native = {Running = true, Jumping = true, Landing = true}
|
||||||
|
local groups: {[Sound]: SoundGroup?} = {}
|
||||||
|
local overridden: {Sound} = {}
|
||||||
|
local connections: {RBXScriptConnection} = {}
|
||||||
|
local humanoid: Humanoid? = nil
|
||||||
|
local root: BasePart? = nil
|
||||||
|
|
||||||
|
local function master(): number
|
||||||
|
return math.max(0, Sounds.setting("VolMaster", 1))
|
||||||
|
end
|
||||||
|
|
||||||
|
local function reset()
|
||||||
|
for _, connection in connections do connection:Disconnect() end
|
||||||
|
table.clear(connections)
|
||||||
|
for _, sound in overridden do
|
||||||
|
if sound.Parent and sound.SoundGroup == muted then sound.SoundGroup = groups[sound] end
|
||||||
|
end
|
||||||
|
table.clear(overridden)
|
||||||
|
table.clear(groups)
|
||||||
|
humanoid, root = nil, nil
|
||||||
|
steps:Stop()
|
||||||
|
jump:Stop()
|
||||||
|
landing:Stop()
|
||||||
|
end
|
||||||
|
|
||||||
|
local function watch(character: Model)
|
||||||
|
local human = character:WaitForChild("Humanoid", 10)
|
||||||
|
local part = character:WaitForChild("HumanoidRootPart", 10)
|
||||||
|
if player.Character ~= character or not human or not human:IsA("Humanoid") or not part or not part:IsA("BasePart") then return end
|
||||||
|
reset()
|
||||||
|
humanoid, root = human, part
|
||||||
|
local function muteDuplicate(child: Instance)
|
||||||
|
if child:IsA("Sound") and native[child.Name] and child.SoundGroup ~= muted then
|
||||||
|
groups[child] = child.SoundGroup
|
||||||
|
table.insert(overridden, child)
|
||||||
|
child.SoundGroup = muted
|
||||||
|
end
|
||||||
|
end
|
||||||
|
table.insert(connections, part.ChildAdded:Connect(muteDuplicate))
|
||||||
|
for _, child in part:GetChildren() do muteDuplicate(child) end
|
||||||
|
|
||||||
|
table.insert(connections, human.StateChanged:Connect(function(previous, current)
|
||||||
|
if part.Anchored or human.Health <= 0 then return end
|
||||||
|
local volume = master()
|
||||||
|
if volume <= 0 then return end
|
||||||
|
local sound = if current == Enum.HumanoidStateType.Jumping then jump
|
||||||
|
elseif current == Enum.HumanoidStateType.Landed and previous == Enum.HumanoidStateType.Freefall then landing else nil
|
||||||
|
if sound then
|
||||||
|
sound.Volume = volume * (if sound == jump then .26 else .21)
|
||||||
|
sound.TimePosition = 0
|
||||||
|
sound:Play()
|
||||||
|
end
|
||||||
|
end))
|
||||||
|
end
|
||||||
|
|
||||||
|
local added = player.CharacterAdded:Connect(watch)
|
||||||
|
local removing = player.CharacterRemoving:Connect(reset)
|
||||||
|
if player.Character then task.spawn(watch, player.Character) end
|
||||||
|
|
||||||
|
local update = RunService.Heartbeat:Connect(function()
|
||||||
|
local human, part = humanoid, root
|
||||||
|
local volume = master()
|
||||||
|
local speed = if part then Vector3.new(part.AssemblyLinearVelocity.X, 0, part.AssemblyLinearVelocity.Z).Magnitude else 0
|
||||||
|
local moving = human and part and not part.Anchored and human.Health > 0 and human.MoveDirection.Magnitude > .05
|
||||||
|
and human.FloorMaterial ~= Enum.Material.Air and speed > 1.5 and volume > 0
|
||||||
|
if moving then
|
||||||
|
steps.Volume = .25 * volume
|
||||||
|
steps.PlaybackSpeed = math.clamp(speed / 24, .75, 1.5)
|
||||||
|
if not steps.Playing then steps:Play() end
|
||||||
|
elseif steps.Playing then
|
||||||
|
steps:Stop()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
script.Destroying:Once(function()
|
||||||
|
added:Disconnect()
|
||||||
|
removing:Disconnect()
|
||||||
|
update:Disconnect()
|
||||||
|
reset()
|
||||||
|
steps:Destroy()
|
||||||
|
jump:Destroy()
|
||||||
|
landing:Destroy()
|
||||||
|
muted:Destroy()
|
||||||
|
end)
|
||||||
+17
-15
@@ -1,20 +1,22 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.PowerUpCatalog
|
||||||
|
|
||||||
local colors = Color3.fromRGB
|
local colors = Color3.fromRGB
|
||||||
|
|
||||||
return table.freeze({
|
return table.freeze({
|
||||||
{ id = "Turbo", title = "Турбоискра", detail = "+30% к скорости на 4 сек.", color = colors(255, 124, 56) },
|
{ id = "Turbo", title = Text.turboiskra, detail = Text.kSkorostiNaSek, color = colors(255, 124, 56) },
|
||||||
{ id = "Spring", title = "Лунная пружина", detail = "Следующий прыжок выше на 80% · 18 сек.", color = colors(181, 88, 255) },
|
{ id = "Spring", title = Text.lunnayaPruzhina, detail = Text.sleduyuschiyPryzhokVysheNa, color = colors(181, 88, 255) },
|
||||||
{ id = "Double", title = "Второй импульс", detail = "Один прыжок в воздухе · 8 сек.", color = colors(66, 216, 255) },
|
{ id = "Double", title = Text.vtoroyImpulS, detail = Text.odinPryzhokVVozdukhe, color = colors(66, 216, 255) },
|
||||||
{ id = "Feather", title = "Перо бури", detail = "Удерживай пробел для плавного падения · 5 сек.", color = colors(121, 241, 220) },
|
{ id = "Feather", title = Text.peroBuri, detail = Text.uderzhivayProbelDlyaPlavnogo, color = colors(121, 241, 220) },
|
||||||
{ id = "Shield", title = "Хрустальный щит", detail = "Поглощает 25 урона · 7 сек.", color = colors(79, 143, 255) },
|
{ id = "Shield", title = Text.khrustalNyySchit, detail = Text.pogloschaetUronaSek, color = colors(79, 143, 255) },
|
||||||
{ id = "Heal", title = "Искра жизни", detail = "Восстанавливает 25 HP", color = colors(112, 255, 112) },
|
{ id = "Heal", title = Text.iskraZhizni, detail = Text.vosstanavlivaetHp, color = colors(112, 255, 112) },
|
||||||
{ id = "Magnet", title = "Золотой магнит", detail = "Притягивание монет с 20 студов · 8 сек.", color = colors(255, 180, 66) },
|
{ id = "Magnet", title = Text.zolotoyMagnit, detail = Text.prityagivanieMonetSStudov, color = colors(255, 180, 66) },
|
||||||
{ id = "Lucky", title = "Золотая жила", detail = "+25% к ценности следующих пяти монет", color = colors(250, 241, 95) },
|
{ id = "Lucky", title = Text.zolotayaZhila, detail = Text.kTsennostiSleduyuschikhPyati, color = colors(250, 241, 95) },
|
||||||
{ id = "Reload", title = "Быстрые руки", detail = "Следующая перезарядка вдвое быстрее", color = colors(255, 103, 158) },
|
{ id = "Reload", title = Text.bystryeRuki, detail = Text.sleduyuschayaPerezaryadkaVdvoeBystree, color = colors(255, 103, 158) },
|
||||||
{ id = "Ammo", title = "Запасной магазин", detail = "Мгновенно пополняет магазин", color = colors(255, 82, 100) },
|
{ id = "Ammo", title = Text.zapasnoyMagazin, detail = Text.mgnovennoPopolnyaetMagazin, color = colors(255, 82, 100) },
|
||||||
{ id = "Steady", title = "Стальная хватка", detail = "Меньше отдачи и разброса · 5 сек.", color = colors(168, 181, 204) },
|
{ id = "Steady", title = Text.stalNayaKhvatka, detail = Text.menSheOtdachiI, color = colors(168, 181, 204) },
|
||||||
{ id = "Quiet", title = "Шёпот", detail = "Приглушает шаги на 6 сек.", color = colors(106, 98, 249) },
|
{ id = "Quiet", title = Text.shyopot, detail = Text.priglushaetShagiNaSek, color = colors(106, 98, 249) },
|
||||||
{ id = "Phantom", title = "Фантом", detail = "Создаёт движущуюся копию на 2 сек.", color = colors(213, 157, 255) },
|
{ id = "Phantom", title = Text.fantom, detail = Text.sozdayotDvizhuschuyusyaKopiyuNa, color = colors(213, 157, 255) },
|
||||||
{ id = "Storm", title = "Грозовая печать", detail = "Следующее приземление замедляет врагов", color = colors(233, 77, 237) },
|
{ id = "Storm", title = Text.grozovayaPechat, detail = Text.sleduyuscheePrizemlenieZamedlyaetVragov, color = colors(233, 77, 237) },
|
||||||
{ id = "Team", title = "Искра отряда", detail = "+20% к скорости тебе и ближайшим союзникам · 3 сек.", color = colors(42, 255, 171) },
|
{ id = "Team", title = Text.iskraOtryada, detail = Text.kSkorostiTebeI, color = colors(42, 255, 171) },
|
||||||
})
|
})
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.RifleSkinCatalog
|
||||||
|
|
||||||
local entries = table.freeze({
|
local entries = table.freeze({
|
||||||
table.freeze({ id = "BlueFlame", name = "Голубое пламя", accent = Color3.fromRGB(100, 223, 255) }),
|
table.freeze({ id = "BlueFlame", name = Text.goluboePlamya, accent = Color3.fromRGB(100, 223, 255) }),
|
||||||
table.freeze({ id = "ThunderBlade", name = "Грозовой клинок", accent = Color3.fromRGB(193, 142, 255) }),
|
table.freeze({ id = "ThunderBlade", name = Text.grozovoyKlinok, accent = Color3.fromRGB(193, 142, 255) }),
|
||||||
table.freeze({ id = "CrimsonSeal", name = "Алая печать", accent = Color3.fromRGB(255, 113, 81) }),
|
table.freeze({ id = "CrimsonSeal", name = Text.alayaPechat, accent = Color3.fromRGB(255, 113, 81) }),
|
||||||
table.freeze({ id = "Sakura", name = "Сакура", accent = Color3.fromRGB(255, 161, 209) }),
|
table.freeze({ id = "Sakura", name = Text.sakura, accent = Color3.fromRGB(255, 161, 209) }),
|
||||||
table.freeze({ id = "NeonGlitch", name = "Неоновый сбой", accent = Color3.fromRGB(138, 255, 80) }),
|
table.freeze({ id = "NeonGlitch", name = Text.neonovyySboy, accent = Color3.fromRGB(138, 255, 80) }),
|
||||||
table.freeze({ id = "LunarOrbit", name = "Лунная орбита", accent = Color3.fromRGB(255, 210, 120) }),
|
table.freeze({ id = "LunarOrbit", name = Text.lunnayaOrbita, accent = Color3.fromRGB(255, 210, 120) }),
|
||||||
})
|
})
|
||||||
|
|
||||||
local Catalog = {}
|
local Catalog = {}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ local RunService = game:GetService("RunService")
|
|||||||
local SoundService = game:GetService("SoundService")
|
local SoundService = game:GetService("SoundService")
|
||||||
|
|
||||||
local SniperEffects = {}
|
local SniperEffects = {}
|
||||||
|
local AudioConfig = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("EffectsConfig") :: ModuleScript)
|
||||||
|
local activeCues: {Sound} = {}
|
||||||
|
|
||||||
-- Free Creator Store sounds. volume, plus how far the sound carries when it is in the world.
|
-- Free Creator Store sounds. volume, plus how far the sound carries when it is in the world.
|
||||||
-- group: which volume setting scales it (attribute Vol<group> of the SniperViewmodel config
|
-- group: which volume setting scales it (attribute Vol<group> of the SniperViewmodel config
|
||||||
@@ -40,18 +42,20 @@ local SOUNDS: { [string]: SoundDef } = {
|
|||||||
Elimination = { id = "rbxassetid://15675043410", volume = 0.78, speed = 1.18, near = 0, far = 0, group = "Kill", cut = 0.52 },
|
Elimination = { id = "rbxassetid://15675043410", volume = 0.78, speed = 1.18, near = 0, far = 0, group = "Kill", cut = 0.52 },
|
||||||
StreakAccent = { id = "rbxassetid://3120909354", volume = 0.5, speed = 1, near = 0, far = 0, group = "Kill" }, -- Level_up
|
StreakAccent = { id = "rbxassetid://3120909354", volume = 0.5, speed = 1, near = 0, far = 0, group = "Kill" }, -- Level_up
|
||||||
ReloadReady = { id = "rbxassetid://15675085146", volume = 0.24, speed = 1.15, near = 0, far = 0, group = "Reload", cut = 0.19 },
|
ReloadReady = { id = "rbxassetid://15675085146", volume = 0.24, speed = 1.15, near = 0, far = 0, group = "Reload", cut = 0.19 },
|
||||||
RoundCountdown = { id = "rbxassetid://113416294133952", volume = 0.48, speed = 1, near = 0, far = 0, group = "HUD" }, -- timer tick
|
|
||||||
ButtonHover = { id = "rbxassetid://84648433095796", volume = 0.22, speed = 1, near = 0, far = 0, group = "HUD" },
|
ButtonHover = { id = "rbxassetid://84648433095796", volume = 0.22, speed = 1, near = 0, far = 0, group = "HUD" },
|
||||||
ButtonPress = { id = "rbxassetid://121882355123711", volume = 0.27, speed = 1, near = 0, far = 0, group = "HUD" },
|
ButtonPress = { id = "rbxassetid://121882355123711", volume = 0.27, speed = 1, near = 0, far = 0, group = "HUD" },
|
||||||
FlagDropped = { id = "rbxassetid://2789428506", volume = 0.23, speed = .72, near = 0, far = 0, group = "HUD" },
|
|
||||||
HotPointMove = { id = "rbxassetid://113416294133952", volume = 0.23, speed = 1.18, near = 0, far = 0, group = "HUD" },
|
|
||||||
HotPointStart = { id = "rbxassetid://2789428506", volume = 0.25, speed = 1, near = 0, far = 0, group = "HUD" }, -- Unlock_phoenix
|
|
||||||
HotPointCaptured = { id = "rbxassetid://4612374036", volume = 0.28, speed = 1, near = 0, far = 0, group = "HUD" }, -- bling_big_diamond_pickup
|
|
||||||
MoneyCollect1 = { id = "rbxassetid://84894146013271", volume = 0.15, speed = 1, near = 0, far = 0, group = "Pickup", cut = 0.16 },
|
MoneyCollect1 = { id = "rbxassetid://84894146013271", volume = 0.15, speed = 1, near = 0, far = 0, group = "Pickup", cut = 0.16 },
|
||||||
CupidKnife = { id = "rbxassetid://120151468640015", volume = 0.32, speed = 1, near = 0, far = 0, group = "Pickup" },
|
CupidKnife = { id = "rbxassetid://120151468640015", volume = 0.32, speed = 1, near = 0, far = 0, group = "Pickup" },
|
||||||
-- a player / bot destroyed: the body breaks apart like blocks (heard by everyone, from the body)
|
-- a player / bot destroyed: the body breaks apart like blocks (heard by everyone, from the body)
|
||||||
Break = { id = "rbxassetid://130215756597524", volume = 1, speed = 1, near = 25, far = 300, group = "Kill" }, -- blockbreak sfx
|
Break = { id = "rbxassetid://130215756597524", volume = 1, speed = 1, near = 25, far = 300, group = "Kill" }, -- blockbreak sfx
|
||||||
}
|
}
|
||||||
|
local arenaCues: {[string]: boolean} = {}
|
||||||
|
local function addCue(name: string, cue: AudioConfig.Cue)
|
||||||
|
SOUNDS[name] = {id = cue.id, volume = cue.volume, speed = cue.speed, near = 0, far = 0, group = "HUD"}
|
||||||
|
arenaCues[name] = true
|
||||||
|
end
|
||||||
|
for name, cue in AudioConfig.Cues do addCue(name, cue) end
|
||||||
|
for name, target in AudioConfig.Aliases do addCue(name, AudioConfig.Cues[target]) end
|
||||||
SniperEffects.SOUNDS = SOUNDS
|
SniperEffects.SOUNDS = SOUNDS
|
||||||
|
|
||||||
-- the settings live as attributes on the local player's SniperViewmodel script
|
-- the settings live as attributes on the local player's SniperViewmodel script
|
||||||
@@ -85,7 +89,10 @@ SniperEffects.BOLT_CUES = {
|
|||||||
task.spawn(function()
|
task.spawn(function()
|
||||||
-- Sound instances, not bare ids: a bare id string is preloaded as an image and fails
|
-- Sound instances, not bare ids: a bare id string is preloaded as an image and fails
|
||||||
local preload = {}
|
local preload = {}
|
||||||
|
local seen: {[string]: boolean} = {}
|
||||||
for _, def in SOUNDS do
|
for _, def in SOUNDS do
|
||||||
|
if def.id == "" or seen[def.id] then continue end
|
||||||
|
seen[def.id] = true
|
||||||
local s = Instance.new("Sound")
|
local s = Instance.new("Sound")
|
||||||
s.SoundId = def.id
|
s.SoundId = def.id
|
||||||
table.insert(preload, s)
|
table.insert(preload, s)
|
||||||
@@ -98,13 +105,28 @@ end)
|
|||||||
|
|
||||||
function SniperEffects.sound(name: string, at: Instance?, pitch: number?): Sound?
|
function SniperEffects.sound(name: string, at: Instance?, pitch: number?): Sound?
|
||||||
local def = SOUNDS[name]
|
local def = SOUNDS[name]
|
||||||
if not def then
|
if not def or def.id == "" then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
local volume = def.volume * math.max(setting("VolMaster", 1), 0) * math.max(setting("Vol" .. def.group, 1), 0)
|
local volume = def.volume * math.max(setting("VolMaster", 1), 0) * math.max(setting("Vol" .. def.group, 1), 0)
|
||||||
if volume <= 0 then
|
if volume <= 0 then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
local limited = arenaCues[name]
|
||||||
|
if limited then
|
||||||
|
for i = #activeCues, 1, -1 do
|
||||||
|
if not activeCues[i].Parent then table.remove(activeCues, i) end
|
||||||
|
end
|
||||||
|
if #activeCues >= AudioConfig.SoundLimit then
|
||||||
|
-- Убираем самый тихий сигнал. Если новый ещё тише, оставляем текущий микс.
|
||||||
|
local quietest = 1
|
||||||
|
for i = 2, #activeCues do
|
||||||
|
if activeCues[i].Volume < activeCues[quietest].Volume then quietest = i end
|
||||||
|
end
|
||||||
|
if activeCues[quietest].Volume > volume then return nil end
|
||||||
|
table.remove(activeCues, quietest):Destroy()
|
||||||
|
end
|
||||||
|
end
|
||||||
local s = Instance.new("Sound")
|
local s = Instance.new("Sound")
|
||||||
s.Name = "Sniper" .. name
|
s.Name = "Sniper" .. name
|
||||||
s.SoundId = def.id
|
s.SoundId = def.id
|
||||||
@@ -116,6 +138,7 @@ function SniperEffects.sound(name: string, at: Instance?, pitch: number?): Sound
|
|||||||
s.RollOffMaxDistance = def.far
|
s.RollOffMaxDistance = def.far
|
||||||
end
|
end
|
||||||
s.Parent = at or SoundService
|
s.Parent = at or SoundService
|
||||||
|
if limited then table.insert(activeCues, s) end
|
||||||
s:Play()
|
s:Play()
|
||||||
if def.cut then
|
if def.cut then
|
||||||
local fade = def.cut
|
local fade = def.cut
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ local SAMPLE_STEP = 1 / 30
|
|||||||
local round = ReplicatedStorage:WaitForChild("ArenaRound")
|
local round = ReplicatedStorage:WaitForChild("ArenaRound")
|
||||||
local ArenaModes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScript)
|
local ArenaModes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScript)
|
||||||
local Objectives = require(script.Parent:WaitForChild("ArenaObjectives") :: ModuleScript)
|
local Objectives = require(script.Parent:WaitForChild("ArenaObjectives") :: ModuleScript)
|
||||||
|
local Hunter = ReplicatedStorage:WaitForChild("Hunter")
|
||||||
|
local Stage = require(Hunter:WaitForChild("Stage") :: ModuleScript)
|
||||||
|
local Runtime = script.Parent:WaitForChild("ModeRuntime")
|
||||||
|
local Stats = require(Runtime:WaitForChild("Stats") :: ModuleScript)
|
||||||
|
local RoundPlayer = require(Runtime:WaitForChild("PlayerRoundState") :: ModuleScript)
|
||||||
local TrophyDrops = require(script.Parent:WaitForChild("TrophyDrops"))
|
local TrophyDrops = require(script.Parent:WaitForChild("TrophyDrops"))
|
||||||
local PowerDrops = require(script.Parent:WaitForChild("PowerUpDrops"))
|
local PowerDrops = require(script.Parent:WaitForChild("PowerUpDrops"))
|
||||||
local PowerEffects = require(script.Parent:WaitForChild("PowerUpEffects"))
|
local PowerEffects = require(script.Parent:WaitForChild("PowerUpEffects"))
|
||||||
@@ -67,15 +72,16 @@ local function recordArenaKill(player: Player, victim: Player, origin: Vector3,
|
|||||||
if side ~= "Blue" and side ~= "Orange" then return nil end
|
if side ~= "Blue" and side ~= "Orange" then return nil end
|
||||||
local scoreAttribute = side .. "Kills"
|
local scoreAttribute = side .. "Kills"
|
||||||
local state = ArenaModes.state(round, mode)
|
local state = ArenaModes.state(round, mode)
|
||||||
|
Stats.add(player, "kills", 1)
|
||||||
player:SetAttribute("RoundKills", ((player:GetAttribute("RoundKills") :: number?) or 0) + 1)
|
player:SetAttribute("RoundKills", ((player:GetAttribute("RoundKills") :: number?) or 0) + 1)
|
||||||
state:SetAttribute(scoreAttribute, ((state:GetAttribute(scoreAttribute) :: number?) or 0) + 1)
|
state:SetAttribute(scoreAttribute, ((state:GetAttribute(scoreAttribute) :: number?) or 0) + 1)
|
||||||
|
local streak = ((player:GetAttribute("StreakKills") :: number?) or 0) + 1
|
||||||
|
player:SetAttribute("StreakUntil", now + (round:GetAttribute("StreakWindow") :: number))
|
||||||
|
player:SetAttribute("StreakKills", streak)
|
||||||
local match = Objectives.current(mode)
|
local match = Objectives.current(mode)
|
||||||
if match then match.kill(player, victim, origin, now) end
|
if match then match.kill(player, victim, origin, now) end
|
||||||
TrophyDrops.spawn(player, origin)
|
TrophyDrops.spawn(player, origin)
|
||||||
PowerDrops.spawn(origin, nil, mode)
|
PowerDrops.spawn(origin, nil, mode)
|
||||||
local streak = ((player:GetAttribute("StreakKills") :: number?) or 0) + 1
|
|
||||||
player:SetAttribute("StreakUntil", now + (round:GetAttribute("StreakWindow") :: number))
|
|
||||||
player:SetAttribute("StreakKills", streak)
|
|
||||||
return streak
|
return streak
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -125,6 +131,8 @@ local function applyHit(
|
|||||||
player: Player, character: Model, shooter: Humanoid, model: Model, humanoid: Humanoid,
|
player: Player, character: Model, shooter: Humanoid, model: Model, humanoid: Humanoid,
|
||||||
victim: Player?, hit: ShotHistory.Hit, origin: Vector3, params: RaycastParams, mode: string
|
victim: Player?, hit: ShotHistory.Hit, origin: Vector3, params: RaycastParams, mode: string
|
||||||
)
|
)
|
||||||
|
local now = workspace:GetServerTimeNow()
|
||||||
|
if not Stage.combatAllowed(ArenaModes.state(round, mode)) then return end
|
||||||
local eye = headOf(character)
|
local eye = headOf(character)
|
||||||
if player.Character ~= character or not inMode(player, mode) or shooter.Health <= 0
|
if player.Character ~= character or not inMode(player, mode) or shooter.Health <= 0
|
||||||
or not model.Parent or humanoid.Health <= 0 or not hit.part:IsDescendantOf(model)
|
or not model.Parent or humanoid.Health <= 0 or not hit.part:IsDescendantOf(model)
|
||||||
@@ -139,6 +147,11 @@ local function applyHit(
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local shield = victim and victim:GetAttribute("SpawnShield")
|
||||||
|
if typeof(shield) == "number" and shield > now then
|
||||||
|
broadcast(mode, remote, character, hit.position)
|
||||||
|
return
|
||||||
|
end
|
||||||
local before = humanoid.Health
|
local before = humanoid.Health
|
||||||
PowerEffects.damage(model, humanoid, math.floor(damageFor(hit.zone) + .5), workspace:GetServerTimeNow())
|
PowerEffects.damage(model, humanoid, math.floor(damageFor(hit.zone) + .5), workspace:GetServerTimeNow())
|
||||||
local damage = before - humanoid.Health
|
local damage = before - humanoid.Health
|
||||||
@@ -173,7 +186,8 @@ remote.OnServerEvent:Connect(function(player: Player, direction: unknown, camera
|
|||||||
or timestamp ~= timestamp or math.abs(timestamp) == math.huge then return end
|
or timestamp ~= timestamp or math.abs(timestamp) == math.huge then return end
|
||||||
local received = workspace:GetServerTimeNow()
|
local received = workspace:GetServerTimeNow()
|
||||||
local mode = ArenaModes.of(player)
|
local mode = ArenaModes.of(player)
|
||||||
if player:GetAttribute("InArena") ~= true or not ArenaModes.open(round, mode, received) then return end
|
if player:GetAttribute("InArena") ~= true or not ArenaModes.open(round, mode, received)
|
||||||
|
or not Stage.combatAllowed(ArenaModes.state(round, mode)) then return end
|
||||||
local oneWay = math.clamp(player:GetNetworkPing() * .5, 0, .20)
|
local oneWay = math.clamp(player:GetNetworkPing() * .5, 0, .20)
|
||||||
local ageLimit = math.clamp(oneWay + .10, .12, .30)
|
local ageLimit = math.clamp(oneWay + .10, .12, .30)
|
||||||
if timestamp > received + .035 or timestamp < received - ageLimit then return end
|
if timestamp > received + .035 or timestamp < received - ageLimit then return end
|
||||||
@@ -198,6 +212,7 @@ remote.OnServerEvent:Connect(function(player: Player, direction: unknown, camera
|
|||||||
world.FilterDescendantsInstances = excluded
|
world.FilterDescendantsInstances = excluded
|
||||||
world.RespectCanCollide = true
|
world.RespectCanCollide = true
|
||||||
if obstruction(eye, cameraOrigin, world) then return end
|
if obstruction(eye, cameraOrigin, world) then return end
|
||||||
|
if player:GetAttribute("SpawnShield") ~= nil then RoundPlayer.clearShield(player) end
|
||||||
|
|
||||||
local origin, dir = cameraOrigin, direction.Unit
|
local origin, dir = cameraOrigin, direction.Unit
|
||||||
local worldHit = workspace:Raycast(origin, dir * RANGE, world)
|
local worldHit = workspace:Raycast(origin, dir * RANGE, world)
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
--!strict
|
||||||
|
return function(rules: any)
|
||||||
|
assert(rules.claimSide(true, true) == nil)
|
||||||
|
assert(rules.claimSide(true, false) == "Blue")
|
||||||
|
assert(rules.claimSide(false, true) == "Orange")
|
||||||
|
local due, nextAt = rules.tick(4.2, 1)
|
||||||
|
assert(due and nextAt == 5.2)
|
||||||
|
assert(not rules.tick(4.9, nextAt))
|
||||||
|
end
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
--!strict
|
||||||
|
return function(budget: any, config: any, hints: any)
|
||||||
|
assert(budget.profile(true, false) == config.Mobile)
|
||||||
|
assert(budget.profile(true, true) == config.Desktop)
|
||||||
|
assert(budget.particles(20, .4) == 8 and budget.particles(0, .4) == 0)
|
||||||
|
assert(config.Mobile.burstSlots <= config.Mobile.maxEmitters and config.Desktop.burstSlots <= config.Desktop.maxEmitters)
|
||||||
|
assert(utf8.len(hints.compact(string.rep("я", 100))) == config.HintLimit)
|
||||||
|
assert(hints.compact("Одна\nстрока") == "Одна строка")
|
||||||
|
end
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
--!strict
|
||||||
|
return function(rules: any)
|
||||||
|
assert(rules.remaining(30,10)==20)
|
||||||
|
assert(rules.remaining(30,29.99)==1)
|
||||||
|
assert(rules.remaining(30,30)==0 and rules.remaining(30,31)==0)
|
||||||
|
end
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
--!strict
|
||||||
|
return function(hints: any)
|
||||||
|
local s = hints.new()
|
||||||
|
local low = {key = "low", text = "Подсказка", priority = 1, ttl = .4}
|
||||||
|
local high = {key = "high", text = "Приоритет", priority = 2, ttl = 1, cooldown = 3}
|
||||||
|
assert(hints.pick(s, {low}, 0) == low)
|
||||||
|
assert(hints.pick(s, {low}, .25) == low)
|
||||||
|
assert(hints.pick(s, {high, low}, .5) == high)
|
||||||
|
assert(hints.pick(s, {low}, .6) == high)
|
||||||
|
assert(hints.pick(s, {}, 1.5) == nil)
|
||||||
|
assert(hints.pick(s, {high}, 2) == nil)
|
||||||
|
assert(hints.pick(s, {high}, 3.5) == high)
|
||||||
|
end
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
--!strict
|
||||||
|
return function(credit: any)
|
||||||
|
assert(credit.advance(0, 1, 0, .8, 1, false) == 1)
|
||||||
|
assert(credit.advance(0, 1, 0, .8, 1.5, false) == 1.5)
|
||||||
|
assert(credit.advance(4, 2, 0, .8, 1, true) == 4)
|
||||||
|
assert(credit.advance(.1, 1, .75, .8, 1, true) == 0)
|
||||||
|
assert(math.abs(credit.advance(1, 1, .5, .8, 1.5, false) - 1.35) < 1e-6)
|
||||||
|
end
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
--!strict
|
||||||
|
return function(rules: any)
|
||||||
|
assert(rules.points(false)==1 and rules.points(true)==3)
|
||||||
|
assert(rules.nextIndex(1,1,true)==1 and rules.nextIndex(2,2,true)==1 and rules.nextIndex(2,3,false)==2)
|
||||||
|
end
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
--!strict
|
||||||
|
return function(rules: any)
|
||||||
|
assert(rules.winner(2,1)=="Blue" and rules.winner(1,2)=="Orange")
|
||||||
|
assert(rules.winner(2,2)==nil and rules.winner(0,0)==nil)
|
||||||
|
assert(rules.finished(3,1) and rules.finished(0,3) and not rules.finished(2,2))
|
||||||
|
end
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
--!strict
|
||||||
|
return function(scoring: any)
|
||||||
|
local state = Instance.new("Folder")
|
||||||
|
local observed: number? = nil
|
||||||
|
local score = scoring.new(state, function(side: string, points: number, reason: string)
|
||||||
|
assert(side == "Blue" and reason == "Test")
|
||||||
|
observed = points
|
||||||
|
end)
|
||||||
|
assert(state:GetAttribute("BlueScore") == 0 and state:GetAttribute("OrangeScore") == 0)
|
||||||
|
score.add("Blue", 3, "Test")
|
||||||
|
assert(observed == 3 and score.get("Blue") == 3 and state:GetAttribute("BlueScore") == 3)
|
||||||
|
assert(score.get("Orange") == 0 and state:GetAttribute("OrangeScore") == 0)
|
||||||
|
state:Destroy()
|
||||||
|
end
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
--!strict
|
||||||
|
return function(capture: any, score: any, results: any)
|
||||||
|
assert(capture.advance(0, 4, true, false, 4, .5) == 1)
|
||||||
|
assert(capture.advance(1, 4, true, true, 4, .5) == .5)
|
||||||
|
assert(capture.advance(1, 8, true, true, 4, .5) == 0)
|
||||||
|
assert(capture.advance(0, 4, false, false, 4, .5) == 0)
|
||||||
|
for count = 1, 3 do
|
||||||
|
local a, b = {}, {}
|
||||||
|
for i = 1, count do a[i], b[i] = i * 12, i * 12 + .1 end
|
||||||
|
assert(score.winner({Blue = a, Orange = b}, .05) == "Blue")
|
||||||
|
assert(score.winner({Blue = b, Orange = a}, .05) == "Orange")
|
||||||
|
assert(score.winner({Blue = a, Orange = a}, .05) == "Draw")
|
||||||
|
end
|
||||||
|
assert(score.winner({Blue = {}, Orange = {}}, .05) == "Draw")
|
||||||
|
local ledger = {Blue = {}, Orange = {}}
|
||||||
|
assert(score.record(ledger, "Blue", 1, 8) and not score.record(ledger, "Blue", 1, 9))
|
||||||
|
assert(results.rows({BlueTime1 = 72.4}, 1)[1] == "Рубеж 1 · Синие 1:12.40 · Оранжевые —")
|
||||||
|
end
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
--!strict
|
||||||
|
return function(stats: any)
|
||||||
|
assert(stats.mvp({}, {kills = 1}) == nil)
|
||||||
|
local rows = {{userId = 9, stats = {kills = 2}}, {userId = 3, stats = {captures = 1}}, {userId = 2, stats = {kills = 2}}}
|
||||||
|
assert(stats.mvp(rows, {kills = 1, captures = 3}) == 3)
|
||||||
|
assert(stats.mvp(rows, {kills = 1}) == 2)
|
||||||
|
end
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
--!strict
|
||||||
|
return function(rules: any)
|
||||||
|
for i=0,9 do assert(rules.announce(i)==(i==3 or i==5 or i==7)) end
|
||||||
|
assert(rules.chaseGap(10,14)==nil and rules.chaseGap(10,15)==5)
|
||||||
|
assert(rules.chaseGap(0,17)==17 and rules.chaseGap(8,1)==nil)
|
||||||
|
end
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
--!strict
|
||||||
|
return function(timeline: any)
|
||||||
|
local expected = {{0,"Briefing",5},{5,"Countdown",8},{8,"Live",78},{77.99,"Live",78},{78,"FinalPush",108},{108,"Ended",108}}
|
||||||
|
for _, row in expected do
|
||||||
|
local stage, boundary = timeline.stage(0,108,5,3,30,row[1])
|
||||||
|
assert(stage == row[2] and boundary == row[3])
|
||||||
|
end
|
||||||
|
assert(timeline.stage(0,12,5,3,30,7) == "Countdown")
|
||||||
|
assert(timeline.stage(0,12,5,3,30,8) == "FinalPush")
|
||||||
|
end
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
--!strict
|
||||||
|
return function(rules: any)
|
||||||
|
assert(rules.canMerge(Vector3.zero,Vector3.new(3.5,2.99,0)))
|
||||||
|
assert(not rules.canMerge(Vector3.zero,Vector3.new(3.51,0,0)))
|
||||||
|
assert(not rules.canMerge(Vector3.zero,Vector3.new(0,3,0)))
|
||||||
|
end
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
--!strict
|
||||||
|
return function(zones: any)
|
||||||
|
local spec = {radius = 18, height = 7, sightHeight = 2}
|
||||||
|
assert(zones.reason(Vector3.new(18.01, 0, 0), spec, true) == "Outside")
|
||||||
|
assert(zones.reason(Vector3.new(18, 7, 0), spec, false) == "Inside")
|
||||||
|
assert(zones.reason(Vector3.new(0, -7.01, 0), spec, false) == "Height")
|
||||||
|
assert(zones.reason(Vector3.new(0, -7, 0), spec, true) == "Blocked")
|
||||||
|
assert(zones.reason(Vector3.new(0, 8, 0), {radius = 18, height = 8, sightHeight = 2.7, exclusiveHeight = true}, false) == "Height")
|
||||||
|
end
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.TrophyBalance
|
||||||
|
|
||||||
local Players = game:GetService("Players")
|
local Players = game:GetService("Players")
|
||||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
local RunService = game:GetService("RunService")
|
local RunService = game:GetService("RunService")
|
||||||
@@ -55,7 +57,7 @@ pill.AnchorPoint = Vector2.new(1, 0)
|
|||||||
local coin = UI.element("GoldCoin", pill, UDim2.fromOffset(13, 7), UDim2.fromOffset(36, 36))
|
local coin = UI.element("GoldCoin", pill, UDim2.fromOffset(13, 7), UDim2.fromOffset(36, 36))
|
||||||
local walletCoin = UI.bindCoin(coin)
|
local walletCoin = UI.bindCoin(coin)
|
||||||
|
|
||||||
local title = label("CurrencyName", pill, "ТРОФЕИ", UDim2.fromOffset(158, 8), UDim2.fromOffset(72, 35), 13, UI.Ink)
|
local title = label("CurrencyName", pill, Text.trofei, UDim2.fromOffset(158, 8), UDim2.fromOffset(72, 35), 13, UI.Ink)
|
||||||
title.FontFace = UI.Display
|
title.FontFace = UI.Display
|
||||||
title.TextXAlignment = Enum.TextXAlignment.Left
|
title.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
local divider = UI.frame("Divider", pill, UDim2.fromOffset(146, 12), UDim2.fromOffset(1, 26), UI.Outline)
|
local divider = UI.frame("Divider", pill, UDim2.fromOffset(146, 12), UDim2.fromOffset(1, 26), UI.Outline)
|
||||||
|
|||||||
+151
-149
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.ViewmodelTuner
|
||||||
|
|
||||||
-- Viewmodel tuning mode (Studio playtests only). Press P to open the panel and adjust the weapon's
|
-- Viewmodel tuning mode (Studio playtests only). Press P to open the panel and adjust the weapon's
|
||||||
-- position relative to the camera live: -/+ buttons (hold to repeat) or type a value.
|
-- position relative to the camera live: -/+ buttons (hold to repeat) or type a value.
|
||||||
-- "Сохранить" hands the values to the ViewmodelTuneSaver Studio plugin, which writes them into the
|
-- "Сохранить" hands the values to the ViewmodelTuneSaver Studio plugin, which writes them into the
|
||||||
@@ -31,16 +33,16 @@ type Param = { name: string, label: string, unit: number }
|
|||||||
type Tab = { title: string, params: { Param }, buttons: string?, sight: string?, group: string? }
|
type Tab = { title: string, params: { Param }, buttons: string?, sight: string?, group: string? }
|
||||||
local TABS: { Tab } = {
|
local TABS: { Tab } = {
|
||||||
{
|
{
|
||||||
title = "Оружие",
|
title = Text.oruzhie,
|
||||||
params = {
|
params = {
|
||||||
{ name = "OffsetX", label = "Вправо / влево", unit = 1 },
|
{ name = "OffsetX", label = Text.vpravoVlevo, unit = 1 },
|
||||||
{ name = "OffsetY", label = "Вверх / вниз", unit = 1 },
|
{ name = "OffsetY", label = Text.vverkhVniz, unit = 1 },
|
||||||
{ name = "OffsetZ", label = "Вперёд / назад", unit = 1 },
|
{ name = "OffsetZ", label = Text.vperyodNazad, unit = 1 },
|
||||||
{ name = "YawDeg", label = "Поворот (yaw)", unit = 20 },
|
{ name = "YawDeg", label = Text.povorotYaw, unit = 20 },
|
||||||
{ name = "PitchDeg", label = "Наклон (pitch)", unit = 20 },
|
{ name = "PitchDeg", label = Text.naklonPitch, unit = 20 },
|
||||||
{ name = "RollDeg", label = "Крен (roll)", unit = 20 },
|
{ name = "RollDeg", label = Text.krenRoll, unit = 20 },
|
||||||
{ name = "SwayAmount", label = "Инерция", unit = 4 },
|
{ name = "SwayAmount", label = Text.inertsiya, unit = 4 },
|
||||||
{ name = "BobAmount", label = "Покачивание", unit = 0.2 },
|
{ name = "BobAmount", label = Text.pokachivanie, unit = 0.2 },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -48,205 +50,205 @@ local function armTab(title: string, prefix: string): Tab
|
|||||||
return {
|
return {
|
||||||
title = title,
|
title = title,
|
||||||
params = {
|
params = {
|
||||||
{ name = prefix .. "HandX", label = "Кисть: вправо/влево", unit = 1 },
|
{ name = prefix .. "HandX", label = Text.kistVpravoVlevo, unit = 1 },
|
||||||
{ name = prefix .. "HandY", label = "Кисть: вверх/вниз", unit = 1 },
|
{ name = prefix .. "HandY", label = Text.kistVverkhVniz, unit = 1 },
|
||||||
{ name = prefix .. "HandZ", label = "Кисть: вперёд/назад", unit = 1 },
|
{ name = prefix .. "HandZ", label = Text.kistVperyodNazad, unit = 1 },
|
||||||
{ name = prefix .. "ArmYawDeg", label = "Рука: поворот", unit = 20 },
|
{ name = prefix .. "ArmYawDeg", label = Text.rukaPovorot, unit = 20 },
|
||||||
{ name = prefix .. "ArmPitchDeg", label = "Рука: наклон", unit = 20 },
|
{ name = prefix .. "ArmPitchDeg", label = Text.rukaNaklon, unit = 20 },
|
||||||
{ name = prefix .. "ArmRollDeg", label = "Рука: крен", unit = 20 },
|
{ name = prefix .. "ArmRollDeg", label = Text.rukaKren, unit = 20 },
|
||||||
{ name = prefix .. "ArmLength", label = "Длина руки", unit = 2 },
|
{ name = prefix .. "ArmLength", label = Text.dlinaRuki, unit = 2 },
|
||||||
{ name = prefix .. "ArmThickness", label = "Толщина руки", unit = 0.2 },
|
{ name = prefix .. "ArmThickness", label = Text.tolschinaRuki, unit = 0.2 },
|
||||||
{ name = prefix .. "HandLength", label = "Длина кисти", unit = 0.5 },
|
{ name = prefix .. "HandLength", label = Text.dlinaKisti, unit = 0.5 },
|
||||||
{ name = prefix .. "HandThickness", label = "Толщина кисти", unit = 0.2 },
|
{ name = prefix .. "HandThickness", label = Text.tolschinaKisti, unit = 0.2 },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
table.insert(TABS, armTab("Левая рука", ""))
|
table.insert(TABS, armTab(Text.levayaRuka, ""))
|
||||||
table.insert(TABS, armTab("Правая рука", "R"))
|
table.insert(TABS, armTab(Text.pravayaRuka, "R"))
|
||||||
table.insert(TABS, {
|
table.insert(TABS, {
|
||||||
title = "Осмотр",
|
title = Text.osmotr,
|
||||||
buttons = "Inspect",
|
buttons = "Inspect",
|
||||||
params = {
|
params = {
|
||||||
{ name = "InspX", label = "Вправо / влево", unit = 1 },
|
{ name = "InspX", label = Text.vpravoVlevo, unit = 1 },
|
||||||
{ name = "InspY", label = "Вверх / вниз", unit = 1 },
|
{ name = "InspY", label = Text.vverkhVniz, unit = 1 },
|
||||||
{ name = "InspZ", label = "Вперёд / назад", unit = 1 },
|
{ name = "InspZ", label = Text.vperyodNazad, unit = 1 },
|
||||||
{ name = "InspYawDeg", label = "Поворот (yaw)", unit = 20 },
|
{ name = "InspYawDeg", label = Text.povorotYaw, unit = 20 },
|
||||||
{ name = "InspPitchDeg", label = "Наклон (pitch)", unit = 20 },
|
{ name = "InspPitchDeg", label = Text.naklonPitch, unit = 20 },
|
||||||
{ name = "InspRollDeg", label = "Крен (roll)", unit = 20 },
|
{ name = "InspRollDeg", label = Text.krenRoll, unit = 20 },
|
||||||
{ name = "InspDriftDeg", label = "Дрейф при удержании", unit = 20 },
|
{ name = "InspDriftDeg", label = Text.dreyfPriUderzhanii, unit = 20 },
|
||||||
{ name = "InspBlendIn", label = "Выход в позу, с", unit = 2 },
|
{ name = "InspBlendIn", label = Text.vykhodVPozuS, unit = 2 },
|
||||||
{ name = "InspHold", label = "Удержание, с", unit = 2 },
|
{ name = "InspHold", label = Text.uderzhanieS, unit = 2 },
|
||||||
{ name = "InspBlendOut", label = "Возврат, с", unit = 2 },
|
{ name = "InspBlendOut", label = Text.vozvratS, unit = 2 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
table.insert(TABS, {
|
table.insert(TABS, {
|
||||||
title = "Перезарядка",
|
title = Text.perezaryadka,
|
||||||
buttons = "Reload",
|
buttons = "Reload",
|
||||||
params = {
|
params = {
|
||||||
{ name = "ReloadTime", label = "Длительность, с", unit = 2 },
|
{ name = "ReloadTime", label = Text.dlitelNostS, unit = 2 },
|
||||||
{ name = "ReloadPreviewU", label = "Кадр (0–1)", unit = 0.2 },
|
{ name = "ReloadPreviewU", label = Text.kadr, unit = 0.2 },
|
||||||
{ name = "RlX", label = "Магазин: вправо/влево", unit = 1 },
|
{ name = "RlX", label = Text.magazinVpravoVlevo, unit = 1 },
|
||||||
{ name = "RlY", label = "Магазин: вверх/вниз", unit = 1 },
|
{ name = "RlY", label = Text.magazinVverkhVniz, unit = 1 },
|
||||||
{ name = "RlZ", label = "Магазин: вперёд/назад", unit = 1 },
|
{ name = "RlZ", label = Text.magazinVperyodNazad, unit = 1 },
|
||||||
{ name = "RlYawDeg", label = "Магазин: поворот", unit = 20 },
|
{ name = "RlYawDeg", label = Text.magazinPovorot, unit = 20 },
|
||||||
{ name = "RlPitchDeg", label = "Магазин: наклон", unit = 20 },
|
{ name = "RlPitchDeg", label = Text.magazinNaklon, unit = 20 },
|
||||||
{ name = "RlRollDeg", label = "Магазин: крен", unit = 20 },
|
{ name = "RlRollDeg", label = Text.magazinKren, unit = 20 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
-- weapon pose while the bolt is worked (pose B)
|
-- weapon pose while the bolt is worked (pose B)
|
||||||
table.insert(TABS, {
|
table.insert(TABS, {
|
||||||
title = "Перезарядка: затвор",
|
title = Text.perezaryadkaZatvor,
|
||||||
buttons = "Reload",
|
buttons = "Reload",
|
||||||
params = {
|
params = {
|
||||||
{ name = "RlBX", label = "Затвор: вправо/влево", unit = 1 },
|
{ name = "RlBX", label = Text.zatvorVpravoVlevo, unit = 1 },
|
||||||
{ name = "RlBY", label = "Затвор: вверх/вниз", unit = 1 },
|
{ name = "RlBY", label = Text.zatvorVverkhVniz, unit = 1 },
|
||||||
{ name = "RlBZ", label = "Затвор: вперёд/назад", unit = 1 },
|
{ name = "RlBZ", label = Text.zatvorVperyodNazad, unit = 1 },
|
||||||
{ name = "RlBYawDeg", label = "Затвор: поворот", unit = 20 },
|
{ name = "RlBYawDeg", label = Text.zatvorPovorot, unit = 20 },
|
||||||
{ name = "RlBPitchDeg", label = "Затвор: наклон", unit = 20 },
|
{ name = "RlBPitchDeg", label = Text.zatvorNaklon, unit = 20 },
|
||||||
{ name = "RlBRollDeg", label = "Затвор: крен", unit = 20 },
|
{ name = "RlBRollDeg", label = Text.zatvorKren, unit = 20 },
|
||||||
{ name = "ReloadPreviewU", label = "Кадр (0–1)", unit = 0.2 },
|
{ name = "ReloadPreviewU", label = Text.kadr, unit = 0.2 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
local function reloadHandParams(prefix: string): { Param }
|
local function reloadHandParams(prefix: string): { Param }
|
||||||
return {
|
return {
|
||||||
{ name = prefix .. "MagX", label = "Магазин: вправо/влево", unit = 1 },
|
{ name = prefix .. "MagX", label = Text.magazinVpravoVlevo, unit = 1 },
|
||||||
{ name = prefix .. "MagY", label = "Магазин: вверх/вниз", unit = 1 },
|
{ name = prefix .. "MagY", label = Text.magazinVverkhVniz, unit = 1 },
|
||||||
{ name = prefix .. "MagZ", label = "Магазин: вперёд/назад", unit = 1 },
|
{ name = prefix .. "MagZ", label = Text.magazinVperyodNazad, unit = 1 },
|
||||||
{ name = prefix .. "MagDrop", label = "Магазин: вынуть вниз", unit = 1 },
|
{ name = prefix .. "MagDrop", label = Text.magazinVynutVniz, unit = 1 },
|
||||||
{ name = prefix .. "BoltX", label = "Затвор: вправо/влево", unit = 1 },
|
{ name = prefix .. "BoltX", label = Text.zatvorVpravoVlevo, unit = 1 },
|
||||||
{ name = prefix .. "BoltY", label = "Затвор: вверх/вниз", unit = 1 },
|
{ name = prefix .. "BoltY", label = Text.zatvorVverkhVniz, unit = 1 },
|
||||||
{ name = prefix .. "BoltZ", label = "Затвор: вперёд/назад", unit = 1 },
|
{ name = prefix .. "BoltZ", label = Text.zatvorVperyodNazad, unit = 1 },
|
||||||
{ name = prefix .. "BoltLift", label = "Затвор: подъём", unit = 0.5 },
|
{ name = prefix .. "BoltLift", label = Text.zatvorPodYom, unit = 0.5 },
|
||||||
{ name = prefix .. "BoltPull", label = "Затвор: ход назад", unit = 1 },
|
{ name = prefix .. "BoltPull", label = Text.zatvorKhodNazad, unit = 1 },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
local fpHands = reloadHandParams("")
|
local fpHands = reloadHandParams("")
|
||||||
table.insert(fpHands, { name = "MagSizeX", label = "Магазин: толщина", unit = 0.2 })
|
table.insert(fpHands, { name = "MagSizeX", label = Text.magazinTolschina, unit = 0.2 })
|
||||||
table.insert(fpHands, { name = "MagSizeY", label = "Магазин: высота", unit = 0.5 })
|
table.insert(fpHands, { name = "MagSizeY", label = Text.magazinVysota, unit = 0.5 })
|
||||||
table.insert(fpHands, { name = "MagSizeZ", label = "Магазин: ширина", unit = 0.5 })
|
table.insert(fpHands, { name = "MagSizeZ", label = Text.magazinShirina, unit = 0.5 })
|
||||||
table.insert(TABS, { title = "Перезарядка: руки", buttons = "Reload", params = fpHands })
|
table.insert(TABS, { title = Text.perezaryadkaRuki, buttons = "Reload", params = fpHands })
|
||||||
|
|
||||||
table.insert(TABS, {
|
table.insert(TABS, {
|
||||||
title = "Движение",
|
title = Text.dvizhenie,
|
||||||
params = {
|
params = {
|
||||||
{ name = "MovementWalkSpeed", label = "Скорость игрока, студ/с", unit = 20 },
|
{ name = "MovementWalkSpeed", label = Text.skorostIgrokaStudS, unit = 20 },
|
||||||
{ name = "MovementGravity", label = "Гравитация, студ/с²", unit = 100 },
|
{ name = "MovementGravity", label = Text.gravitatsiyaStudS, unit = 100 },
|
||||||
{ name = "FovBase", label = "Обзор (FOV)", unit = 20 },
|
{ name = "FovBase", label = Text.obzorFov, unit = 20 },
|
||||||
{ name = "FovBoost", label = "Обзор: + на бегу", unit = 20 },
|
{ name = "FovBoost", label = Text.obzorNaBegu, unit = 20 },
|
||||||
{ name = "FovSpeed", label = "Скорость для макс. FOV", unit = 20 },
|
{ name = "FovSpeed", label = Text.skorostDlyaMaksFov, unit = 20 },
|
||||||
{ name = "MoveDipY", label = "Оружие: вниз на бегу", unit = 1 },
|
{ name = "MoveDipY", label = Text.oruzhieVnizNaBegu, unit = 1 },
|
||||||
{ name = "MoveBack", label = "Оружие: назад на бегу", unit = 1 },
|
{ name = "MoveBack", label = Text.oruzhieNazadNaBegu, unit = 1 },
|
||||||
{ name = "MoveRollDeg", label = "Оружие: крен на бегу", unit = 20 },
|
{ name = "MoveRollDeg", label = Text.oruzhieKrenNaBegu, unit = 20 },
|
||||||
{ name = "MoveLag", label = "Запаздывание", unit = 0.2 },
|
{ name = "MoveLag", label = Text.zapazdyvanie, unit = 0.2 },
|
||||||
{ name = "FallLag", label = "Оружие: прыжок / падение", unit = 0.2 },
|
{ name = "FallLag", label = Text.oruzhiePryzhokPadenie, unit = 0.2 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
table.insert(TABS, {
|
table.insert(TABS, {
|
||||||
title = "Выстрел",
|
title = Text.vystrel,
|
||||||
buttons = "Shot",
|
buttons = "Shot",
|
||||||
params = {
|
params = {
|
||||||
{ name = "FireInterval", label = "Между выстрелами, с", unit = 2 },
|
{ name = "FireInterval", label = Text.mezhduVystrelamiS, unit = 2 },
|
||||||
{ name = "MagCapacity", label = "Патронов в магазине", unit = 20 },
|
{ name = "MagCapacity", label = Text.patronovVMagazine, unit = 20 },
|
||||||
{ name = "ShotZoomPct", label = "Зум при очереди, %", unit = 20 },
|
{ name = "ShotZoomPct", label = Text.zumPriOcheredi, unit = 20 },
|
||||||
{ name = "SpreadBase", label = "Спрей: начальный увод, °", unit = 4 },
|
{ name = "SpreadBase", label = Text.spreyNachalNyyUvod, unit = 4 },
|
||||||
{ name = "SpreadPerShot", label = "Спрей: рост за выстрел, °", unit = 4 },
|
{ name = "SpreadPerShot", label = Text.spreyRostZaVystrel, unit = 4 },
|
||||||
{ name = "SpreadMax", label = "Спрей: предел роста, °", unit = 4 },
|
{ name = "SpreadMax", label = Text.spreyPredelRosta, unit = 4 },
|
||||||
{ name = "SpreadRecover", label = "Спрей: скорость сброса", unit = 20 },
|
{ name = "SpreadRecover", label = Text.spreySkorostSbrosa, unit = 20 },
|
||||||
{ name = "SpreadAim", label = "Спрей в прицеле, ×", unit = 1 },
|
{ name = "SpreadAim", label = Text.spreyVPritsele, unit = 1 },
|
||||||
{ name = "ShotBoltDelay", label = "Затвор: пауза, с", unit = 1 },
|
{ name = "ShotBoltDelay", label = Text.zatvorPauzaS, unit = 1 },
|
||||||
{ name = "ShotBoltTime", label = "Затвор, с (0 = автомат)", unit = 1 },
|
{ name = "ShotBoltTime", label = Text.zatvorSAvtomat, unit = 1 },
|
||||||
{ name = "ShotBoltTilt", label = "Затвор: наклон (0–1)", unit = 1 },
|
{ name = "ShotBoltTilt", label = Text.zatvorNaklon2, unit = 1 },
|
||||||
{ name = "ShotPreviewT", label = "Кадр, с после выстрела", unit = 1 },
|
{ name = "ShotPreviewT", label = Text.kadrSPosleVystrela, unit = 1 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
table.insert(TABS, {
|
table.insert(TABS, {
|
||||||
title = "Выстрел: ствол",
|
title = Text.vystrelStvol,
|
||||||
buttons = "Shot",
|
buttons = "Shot",
|
||||||
params = {
|
params = {
|
||||||
{ name = "MuzzleX", label = "Дуло: вправо/влево", unit = 1 },
|
{ name = "MuzzleX", label = Text.duloVpravoVlevo, unit = 1 },
|
||||||
{ name = "MuzzleY", label = "Дуло: вверх/вниз", unit = 1 },
|
{ name = "MuzzleY", label = Text.duloVverkhVniz, unit = 1 },
|
||||||
{ name = "MuzzleZ", label = "Дуло: вперёд/назад", unit = 1 },
|
{ name = "MuzzleZ", label = Text.duloVperyodNazad, unit = 1 },
|
||||||
{ name = "FlashSize", label = "Вспышка: размер", unit = 1 },
|
{ name = "FlashSize", label = Text.vspyshkaRazmer, unit = 1 },
|
||||||
{ name = "TPMuzzleX", label = "3л дуло: вправо/влево", unit = 1 },
|
{ name = "TPMuzzleX", label = Text.lDuloVpravoVlevo, unit = 1 },
|
||||||
{ name = "TPMuzzleY", label = "3л дуло: вверх/вниз", unit = 1 },
|
{ name = "TPMuzzleY", label = Text.lDuloVverkhVniz, unit = 1 },
|
||||||
{ name = "TPMuzzleZ", label = "3л дуло: вперёд/назад", unit = 1 },
|
{ name = "TPMuzzleZ", label = Text.lDuloVperyodNazad, unit = 1 },
|
||||||
{ name = "TPFlashSize", label = "3л вспышка: размер", unit = 1 },
|
{ name = "TPFlashSize", label = Text.lVspyshkaRazmer, unit = 1 },
|
||||||
{ name = "TPRecoilBack", label = "3л отдача: назад", unit = 1 },
|
{ name = "TPRecoilBack", label = Text.lOtdachaNazad, unit = 1 },
|
||||||
{ name = "TPRecoilPitchDeg", label = "3л отдача: вверх", unit = 20 },
|
{ name = "TPRecoilPitchDeg", label = Text.lOtdachaVverkh, unit = 20 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- aiming down the sights: one tab "Прицеливание", a page per sight inside it (attributes Aim<Sight>...)
|
-- aiming down the sights: one tab "Прицеливание", a page per sight inside it (attributes Aim<Sight>...)
|
||||||
for _, s in { { "Iron", "Мушка" }, { "RedDot", "Коллиматор" }, { "Scope", "Оптика" } } do
|
for _, s in { { "Iron", Text.mushka }, { "RedDot", Text.kollimator }, { "Scope", Text.optika } } do
|
||||||
local p = "Aim" .. s[1]
|
local p = "Aim" .. s[1]
|
||||||
table.insert(TABS, {
|
table.insert(TABS, {
|
||||||
title = s[2],
|
title = s[2],
|
||||||
group = "Прицел",
|
group = Text.pritsel,
|
||||||
buttons = "Aim",
|
buttons = "Aim",
|
||||||
sight = s[1],
|
sight = s[1],
|
||||||
params = {
|
params = {
|
||||||
{ name = p .. "X", label = "Вправо / влево", unit = 1 },
|
{ name = p .. "X", label = Text.vpravoVlevo, unit = 1 },
|
||||||
{ name = p .. "Y", label = "Вверх / вниз", unit = 1 },
|
{ name = p .. "Y", label = Text.vverkhVniz, unit = 1 },
|
||||||
{ name = p .. "Z", label = "Вперёд / назад", unit = 1 },
|
{ name = p .. "Z", label = Text.vperyodNazad, unit = 1 },
|
||||||
{ name = p .. "YawDeg", label = "Поворот (yaw)", unit = 20 },
|
{ name = p .. "YawDeg", label = Text.povorotYaw, unit = 20 },
|
||||||
{ name = p .. "PitchDeg", label = "Наклон (pitch)", unit = 20 },
|
{ name = p .. "PitchDeg", label = Text.naklonPitch, unit = 20 },
|
||||||
{ name = p .. "RollDeg", label = "Крен (roll)", unit = 20 },
|
{ name = p .. "RollDeg", label = Text.krenRoll, unit = 20 },
|
||||||
{ name = p .. "Fov", label = "FOV / зум (меньше = ближе)", unit = 20 },
|
{ name = p .. "Fov", label = Text.fovZumMenShe, unit = 20 },
|
||||||
{ name = p .. "Sens", label = "Чувствительность мыши", unit = 1 },
|
{ name = p .. "Sens", label = Text.chuvstvitelNostMyshi, unit = 1 },
|
||||||
{ name = "AimTime", label = "Время прицеливания, с", unit = 1 },
|
{ name = "AimTime", label = Text.vremyaPritselivaniyaS, unit = 1 },
|
||||||
{ name = "AimSway", label = "Покачивание в прицеле", unit = 1 },
|
{ name = "AimSway", label = Text.pokachivanieVPritsele, unit = 1 },
|
||||||
{ name = "AimSlow", label = "Замедление в прицеле (0–1)", unit = 1 },
|
{ name = "AimSlow", label = Text.zamedlenieVPritsele, unit = 1 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- mouse sensitivity: from the hip and through each sight (1 = the player's own setting)
|
-- mouse sensitivity: from the hip and through each sight (1 = the player's own setting)
|
||||||
table.insert(TABS, {
|
table.insert(TABS, {
|
||||||
title = "Чувствительность",
|
title = Text.chuvstvitelNost,
|
||||||
params = {
|
params = {
|
||||||
{ name = "HipSens", label = "От бедра", unit = 1 },
|
{ name = "HipSens", label = Text.otBedra, unit = 1 },
|
||||||
{ name = "AimIronSens", label = "Мушка", unit = 1 },
|
{ name = "AimIronSens", label = Text.mushka, unit = 1 },
|
||||||
{ name = "AimRedDotSens", label = "Коллиматор", unit = 1 },
|
{ name = "AimRedDotSens", label = Text.kollimator, unit = 1 },
|
||||||
{ name = "AimScopeSens", label = "Оптика", unit = 1 },
|
{ name = "AimScopeSens", label = Text.optika, unit = 1 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- sound volumes, the blast on hits, the damage numbers
|
-- sound volumes, the blast on hits, the damage numbers
|
||||||
table.insert(TABS, {
|
table.insert(TABS, {
|
||||||
title = "Звук и попадания",
|
title = Text.zvukIPopadaniya,
|
||||||
params = {
|
params = {
|
||||||
{ name = "VolMaster", label = "Громкость: общая", unit = 1 },
|
{ name = "VolMaster", label = Text.gromkostObschaya, unit = 1 },
|
||||||
{ name = "VolShot", label = "Громкость: выстрел", unit = 1 },
|
{ name = "VolShot", label = Text.gromkostVystrel, unit = 1 },
|
||||||
{ name = "VolReload", label = "Громкость: перезарядка/затвор", unit = 1 },
|
{ name = "VolReload", label = Text.gromkostPerezaryadkaZatvor, unit = 1 },
|
||||||
{ name = "VolHit", label = "Громкость: попадание", unit = 1 },
|
{ name = "VolHit", label = Text.gromkostPopadanie, unit = 1 },
|
||||||
{ name = "VolKill", label = "Громкость: разрушение", unit = 1 },
|
{ name = "VolKill", label = Text.gromkostRazrushenie, unit = 1 },
|
||||||
{ name = "HitFxSize", label = "Размер взрыва при попадании", unit = 1 },
|
{ name = "HitFxSize", label = Text.razmerVzryvaPriPopadanii, unit = 1 },
|
||||||
{ name = "DmgNumSpread", label = "Цифры урона: разлёт в стороны", unit = 1 },
|
{ name = "DmgNumSpread", label = Text.tsifryUronaRazlyotV, unit = 1 },
|
||||||
{ name = "DmgNumRise", label = "Цифры урона: подъём вверх", unit = 1 },
|
{ name = "DmgNumRise", label = Text.tsifryUronaPodYom, unit = 1 },
|
||||||
{ name = "KillPopRise", label = "Убийство: высота вылета", unit = 1 },
|
{ name = "KillPopRise", label = Text.ubiystvoVysotaVyleta, unit = 1 },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- third person (what other players see): ThirdPersonRifle reads these
|
-- third person (what other players see): ThirdPersonRifle reads these
|
||||||
local function poseParams(prefix: string, what: string): { Param }
|
local function poseParams(prefix: string, what: string): { Param }
|
||||||
return {
|
return {
|
||||||
{ name = prefix .. "X", label = what .. ": вправо/влево", unit = 1 },
|
{ name = prefix .. "X", label = what .. Text.vpravoVlevo2, unit = 1 },
|
||||||
{ name = prefix .. "Y", label = what .. ": вверх/вниз", unit = 1 },
|
{ name = prefix .. "Y", label = what .. Text.vverkhVniz2, unit = 1 },
|
||||||
{ name = prefix .. "Z", label = what .. ": вперёд/назад", unit = 1 },
|
{ name = prefix .. "Z", label = what .. Text.vperyodNazad2, unit = 1 },
|
||||||
{ name = prefix .. "YawDeg", label = what .. ": поворот", unit = 20 },
|
{ name = prefix .. "YawDeg", label = what .. Text.povorot, unit = 20 },
|
||||||
{ name = prefix .. "PitchDeg", label = what .. ": наклон", unit = 20 },
|
{ name = prefix .. "PitchDeg", label = what .. Text.naklon, unit = 20 },
|
||||||
{ name = prefix .. "RollDeg", label = what .. ": крен", unit = 20 },
|
{ name = prefix .. "RollDeg", label = what .. Text.kren, unit = 20 },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
table.insert(TABS, { title = "3л: оружие", params = poseParams("TPGun", "Оружие") })
|
table.insert(TABS, { title = Text.lOruzhie, params = poseParams("TPGun", Text.oruzhie) })
|
||||||
for _, side in { { "R", "3л: правая рука" }, { "L", "3л: левая рука" } } do
|
for _, side in { { "R", Text.lPravayaRuka }, { "L", Text.lLevayaRuka } } do
|
||||||
local params = poseParams("TP" .. side[1] .. "Hand", "Кисть")
|
local params = poseParams("TP" .. side[1] .. "Hand", Text.kist)
|
||||||
table.insert(params, { name = "TP" .. side[1] .. "ElbowX", label = "Локоть: вправо/влево", unit = 1 })
|
table.insert(params, { name = "TP" .. side[1] .. "ElbowX", label = Text.lokotVpravoVlevo, unit = 1 })
|
||||||
table.insert(params, { name = "TP" .. side[1] .. "ElbowY", label = "Локоть: вверх/вниз", unit = 1 })
|
table.insert(params, { name = "TP" .. side[1] .. "ElbowY", label = Text.lokotVverkhVniz, unit = 1 })
|
||||||
table.insert(params, { name = "TP" .. side[1] .. "ElbowZ", label = "Локоть: вперёд/назад", unit = 1 })
|
table.insert(params, { name = "TP" .. side[1] .. "ElbowZ", label = Text.lokotVperyodNazad, unit = 1 })
|
||||||
table.insert(TABS, { title = side[2], params = params })
|
table.insert(TABS, { title = side[2], params = params })
|
||||||
end
|
end
|
||||||
table.insert(TABS, { title = "3л: перезарядка", buttons = "Reload", params = reloadHandParams("TP") })
|
table.insert(TABS, { title = Text.lPerezaryadka, buttons = "Reload", params = reloadHandParams("TP") })
|
||||||
local TABS_PER_ROW = 4
|
local TABS_PER_ROW = 4
|
||||||
local PARAMS: { Param } = {}
|
local PARAMS: { Param } = {}
|
||||||
local maxRows = 0
|
local maxRows = 0
|
||||||
@@ -341,14 +343,14 @@ local function button(parent: Instance, text: string, pos: UDim2, size: UDim2):
|
|||||||
return b
|
return b
|
||||||
end
|
end
|
||||||
|
|
||||||
label(panel, "Настройка (P — закрыть)", UDim2.fromOffset(12, 6), UDim2.new(1, -124, 0, 22))
|
label(panel, Text.nastroykaPZakryt, UDim2.fromOffset(12, 6), UDim2.new(1, -124, 0, 22))
|
||||||
|
|
||||||
-- switches the local camera between first person and a third-person view of the character
|
-- switches the local camera between first person and a third-person view of the character
|
||||||
local viewButton = button(panel, "", UDim2.fromOffset(214, 5), UDim2.fromOffset(96, 22))
|
local viewButton = button(panel, "", UDim2.fromOffset(214, 5), UDim2.fromOffset(96, 22))
|
||||||
viewButton.TextSize = 12
|
viewButton.TextSize = 12
|
||||||
local function refreshView()
|
local function refreshView()
|
||||||
local on = target:GetAttribute("ThirdPersonView") == true
|
local on = target:GetAttribute("ThirdPersonView") == true
|
||||||
viewButton.Text = if on then "Вид: 3-е лицо" else "Вид: 1-е лицо"
|
viewButton.Text = if on then Text.vidELitso else Text.vidELitso2
|
||||||
viewButton.BackgroundColor3 = if on then Color3.fromRGB(70, 110, 190) else Color3.fromRGB(55, 60, 75)
|
viewButton.BackgroundColor3 = if on then Color3.fromRGB(70, 110, 190) else Color3.fromRGB(55, 60, 75)
|
||||||
end
|
end
|
||||||
viewButton.MouseButton1Click:Connect(function()
|
viewButton.MouseButton1Click:Connect(function()
|
||||||
@@ -531,8 +533,8 @@ for i, tab in TABS do
|
|||||||
for r, p in tab.params do
|
for r, p in tab.params do
|
||||||
addRow(page, p, top + (r - 1) * 34)
|
addRow(page, p, top + (r - 1) * 34)
|
||||||
end
|
end
|
||||||
if tab.title == "Движение" then
|
if tab.title == Text.dvizhenie then
|
||||||
label(page, "Меньше гравитация — выше прыжок", UDim2.fromOffset(12, top + #tab.params * 34), UDim2.fromOffset(298, 24))
|
label(page, Text.menSheGravitatsiyaVyshe, UDim2.fromOffset(12, top + #tab.params * 34), UDim2.fromOffset(298, 24))
|
||||||
end
|
end
|
||||||
local kind = tab.buttons
|
local kind = tab.buttons
|
||||||
if kind then
|
if kind then
|
||||||
@@ -540,7 +542,7 @@ for i, tab in TABS do
|
|||||||
local previewAttr, triggerAttr = kind .. "Preview", kind .. "Trigger"
|
local previewAttr, triggerAttr = kind .. "Preview", kind .. "Trigger"
|
||||||
local y = top + #tab.params * 34
|
local y = top + #tab.params * 34
|
||||||
local sight = tab.sight
|
local sight = tab.sight
|
||||||
local play = button(page, if kind == "Aim" then "▶ Прицелиться" else "▶ Проиграть", UDim2.fromOffset(12, y), UDim2.fromOffset(145, 28))
|
local play = button(page, if kind == "Aim" then Text.pritselitSya else Text.proigrat, UDim2.fromOffset(12, y), UDim2.fromOffset(145, 28))
|
||||||
play.MouseButton1Click:Connect(function()
|
play.MouseButton1Click:Connect(function()
|
||||||
if sight then
|
if sight then
|
||||||
target:SetAttribute("AimPreviewSight", sight) -- SniperViewmodel puts this sight on the rifle
|
target:SetAttribute("AimPreviewSight", sight) -- SniperViewmodel puts this sight on the rifle
|
||||||
@@ -548,7 +550,7 @@ for i, tab in TABS do
|
|||||||
target:SetAttribute(previewAttr, false)
|
target:SetAttribute(previewAttr, false)
|
||||||
target:SetAttribute(triggerAttr, os.clock())
|
target:SetAttribute(triggerAttr, os.clock())
|
||||||
end)
|
end)
|
||||||
local holdText = if kind == "Inspect" then "Держать позу" elseif kind == "Aim" then "Держать прицел" else "Держать кадр"
|
local holdText = if kind == "Inspect" then Text.derzhatPozu elseif kind == "Aim" then Text.derzhatPritsel else Text.derzhatKadr
|
||||||
local holdPose = button(page, holdText, UDim2.fromOffset(165, y), UDim2.fromOffset(145, 28))
|
local holdPose = button(page, holdText, UDim2.fromOffset(165, y), UDim2.fromOffset(145, 28))
|
||||||
local function refreshHold()
|
local function refreshHold()
|
||||||
local on = target:GetAttribute(previewAttr) == true
|
local on = target:GetAttribute(previewAttr) == true
|
||||||
@@ -574,7 +576,7 @@ selectTab(1)
|
|||||||
local bottom = ROWS_TOP + maxRows * 34 + 6
|
local bottom = ROWS_TOP + maxRows * 34 + 6
|
||||||
local stepButton = button(panel, "", UDim2.fromOffset(12, bottom), UDim2.fromOffset(96, 30))
|
local stepButton = button(panel, "", UDim2.fromOffset(12, bottom), UDim2.fromOffset(96, 30))
|
||||||
local function refreshStep()
|
local function refreshStep()
|
||||||
stepButton.Text = "Шаг: " .. tostring(STEPS[stepIndex])
|
stepButton.Text = Text.shag .. tostring(STEPS[stepIndex])
|
||||||
end
|
end
|
||||||
refreshStep()
|
refreshStep()
|
||||||
stepButton.MouseButton1Click:Connect(function()
|
stepButton.MouseButton1Click:Connect(function()
|
||||||
@@ -582,14 +584,14 @@ stepButton.MouseButton1Click:Connect(function()
|
|||||||
refreshStep()
|
refreshStep()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local reset = button(panel, "Сброс", UDim2.fromOffset(114, bottom), UDim2.fromOffset(80, 30))
|
local reset = button(panel, Text.sbros, UDim2.fromOffset(114, bottom), UDim2.fromOffset(80, 30))
|
||||||
reset.MouseButton1Click:Connect(function()
|
reset.MouseButton1Click:Connect(function()
|
||||||
for _, p in PARAMS do
|
for _, p in PARAMS do
|
||||||
setValue(p.name, initial[p.name])
|
setValue(p.name, initial[p.name])
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local save = button(panel, "Сохранить", UDim2.fromOffset(200, bottom), UDim2.fromOffset(110, 30))
|
local save = button(panel, Text.sokhranit, UDim2.fromOffset(200, bottom), UDim2.fromOffset(110, 30))
|
||||||
save.BackgroundColor3 = Color3.fromRGB(40, 140, 80)
|
save.BackgroundColor3 = Color3.fromRGB(40, 140, 80)
|
||||||
save.MouseButton1Click:Connect(function()
|
save.MouseButton1Click:Connect(function()
|
||||||
local values = {}
|
local values = {}
|
||||||
@@ -600,9 +602,9 @@ save.MouseButton1Click:Connect(function()
|
|||||||
print("VIEWMODEL_TUNE " .. json)
|
print("VIEWMODEL_TUNE " .. json)
|
||||||
-- picked up by the ViewmodelTuneSaver Studio plugin and written into the place after the playtest
|
-- picked up by the ViewmodelTuneSaver Studio plugin and written into the place after the playtest
|
||||||
target:SetAttribute("SavedTune", HttpService:JSONEncode({ t = DateTime.now().UnixTimestampMillis, values = values }))
|
target:SetAttribute("SavedTune", HttpService:JSONEncode({ t = DateTime.now().UnixTimestampMillis, values = values }))
|
||||||
save.Text = "Сохранено ✓"
|
save.Text = Text.sokhraneno
|
||||||
task.delay(1.5, function()
|
task.delay(1.5, function()
|
||||||
save.Text = "Сохранить"
|
save.Text = Text.sokhranit
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
--!strict
|
--!strict
|
||||||
|
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.ProceduralArena
|
||||||
|
|
||||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||||
local ServerStorage = game:GetService("ServerStorage")
|
local ServerStorage = game:GetService("ServerStorage")
|
||||||
local Mobility = require(ReplicatedStorage:WaitForChild("ArenaMobility") :: ModuleScript)
|
local Mobility = require(ReplicatedStorage:WaitForChild("ArenaMobility") :: ModuleScript)
|
||||||
@@ -54,16 +56,16 @@ assert(jumpArt and #boostArt > 0, "Arena mobility templates are missing")
|
|||||||
table.sort(boostArt, function(a, b) return a.model.Name < b.model.Name end)
|
table.sort(boostArt, function(a, b) return a.model.Name < b.model.Name end)
|
||||||
|
|
||||||
local keeps = {
|
local keeps = {
|
||||||
{name = "Бастионы", roofHalfZ = 23, wingX = 12, width = 32, depth = 18, balconyX = -12},
|
{name = Text.bastiony, roofHalfZ = 23, wingX = 12, width = 32, depth = 18, balconyX = -12},
|
||||||
{name = "Галереи", roofHalfZ = 20, wingX = 0, width = 46, depth = 25, balconyX = 0},
|
{name = Text.galerei, roofHalfZ = 20, wingX = 0, width = 46, depth = 25, balconyX = 0},
|
||||||
{name = "Террасы", roofHalfZ = 27, wingX = -14, width = 24, depth = 13, balconyX = 17},
|
{name = Text.terrasy, roofHalfZ = 27, wingX = -14, width = 24, depth = 13, balconyX = 17},
|
||||||
}
|
}
|
||||||
local tunnels = {
|
local tunnels = {
|
||||||
{name = "Парные тоннели", openings = {{x = -37, width = 21}, {x = 37, width = 21}}},
|
{name = Text.parnyeTonneli, openings = {{x = -37, width = 21}, {x = 37, width = 21}}},
|
||||||
{name = "Тоннель со смещением", openings = {{x = -25, width = 27}}},
|
{name = Text.tonnelSoSmescheniem, openings = {{x = -25, width = 27}}},
|
||||||
{name = "Три прохода", openings = {{x = -49, width = 17}, {x = 0, width = 21}, {x = 49, width = 17}}},
|
{name = Text.triProkhoda, openings = {{x = -49, width = 17}, {x = 0, width = 21}, {x = 49, width = 17}}},
|
||||||
}
|
}
|
||||||
local rampPlans = {"Боковые подъёмы", "Торцевые подъёмы", "Угловые подъёмы"}
|
local rampPlans = {Text.bokovyePodYomy, Text.tortsevyePodYomy, Text.uglovyePodYomy}
|
||||||
local recentProfiles: {string} = {}
|
local recentProfiles: {string} = {}
|
||||||
|
|
||||||
local function profileKey(plan: Plan): string
|
local function profileKey(plan: Plan): string
|
||||||
@@ -199,7 +201,7 @@ local function base(layout: Layout, parent: Folder, side: string, rotation: CFra
|
|||||||
text.Size, text.BackgroundTransparency = UDim2.fromScale(1, 1), 1
|
text.Size, text.BackgroundTransparency = UDim2.fromScale(1, 1), 1
|
||||||
text.Font, text.TextSize = Enum.Font.GothamBlack, 19
|
text.Font, text.TextSize = Enum.Font.GothamBlack, 19
|
||||||
text.TextColor3, text.TextStrokeTransparency = color, .2
|
text.TextColor3, text.TextStrokeTransparency = color, .2
|
||||||
text.Text = if blue then "БАЗА СИНИХ" else "БАЗА ОРАНЖЕВЫХ"
|
text.Text = if blue then Text.bazaSinikh else Text.bazaOranzhevykh
|
||||||
text.Parent = sign
|
text.Parent = sign
|
||||||
|
|
||||||
local points: {Vector3} = {}
|
local points: {Vector3} = {}
|
||||||
|
|||||||
Reference in new issue
Block a user