Add round stages, respawn protection and match highlights
This commit is contained in:
1 parent
b87a3770a1
commit
d1c42a36b8
28 files changed
+753
-45
No files matched your search
@@ -7,6 +7,8 @@ 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}
|
||||
@@ -33,24 +35,22 @@ function Context.create(config: Types.Config, mode: Types.Mode, legacy: RemoteEv
|
||||
folder.Name = "MatchObjectives"
|
||||
folder.Parent = world
|
||||
local janitor = Janitor.new()
|
||||
local contributions: {[number]: {[string]: number}} = {}
|
||||
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, function(_, points, reason, player)
|
||||
if not reason or not player then return end
|
||||
local stats = contributions[player.UserId] or {}
|
||||
stats[reason] = (stats[reason] or 0) + points
|
||||
contributions[player.UserId] = stats
|
||||
end),
|
||||
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) state:SetAttribute("RoundStage", stage) 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
|
||||
|
||||
Reference in new issue
Block a user