31 lines
1.7 KiB
Luau
31 lines
1.7 KiB
Luau
--!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
|