Refactor arena modes and add objective event feed
This commit is contained in:
1 parent
df6ab8efe1
commit
b87a3770a1
26 files changed
+1221
-654
No files matched your search
@@ -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,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,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
|
||||
Reference in new issue
Block a user