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,30 @@
|
||||
--!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 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})
|
||||
end,
|
||||
status = ctx.status,
|
||||
})
|
||||
return Common.instance(ctx, {
|
||||
step = function(now, dt, fighters, elapsed) capture.step(fighters, now, elapsed or dt); return false end,
|
||||
hit = capture.hit, death = capture.death, leaving = capture.death, destroy = capture.destroy,
|
||||
})
|
||||
end
|
||||
|
||||
return {id = "HotPoint", usesMap = true, start = start}
|
||||
Reference in new issue
Block a user