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
@@ -120,6 +120,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
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})
|
||||
ctx.cue(fighters, true, nil)
|
||||
putFlag(flag, flag.marker.origin, 0)
|
||||
@@ -140,6 +141,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
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))
|
||||
|
||||
@@ -19,14 +19,17 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
zone.marker.label.Text = key .. " · " .. site.name
|
||||
table.insert(zones, zone)
|
||||
end
|
||||
local function presence(fighters: {Fighter}, zone: Common.Zone, geometry: RaycastParams): (boolean, boolean)
|
||||
local function presence(fighters: {Fighter}, zone: Common.Zone, geometry: RaycastParams, dt: number): (boolean, boolean, {Fighter})
|
||||
local blue, orange = false, false
|
||||
local inside: {Fighter} = {}
|
||||
for _, fighter in fighters do
|
||||
if Zones.classify(fighter.root.Position, zone.site.position, SPEC, geometry) == "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
|
||||
return blue, orange, inside
|
||||
end
|
||||
local geometry = ctx.geometry
|
||||
local nextScore = ctx.liveAt + 1
|
||||
@@ -35,7 +38,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
if scoreNow then nextScore = now + 1 end
|
||||
local ownedBlue, ownedOrange = 0, 0
|
||||
for index, zone in zones do
|
||||
local b, o = presence(fighters, zone, geometry)
|
||||
local b, o, inside = presence(fighters, zone, geometry, dt)
|
||||
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
|
||||
@@ -46,6 +49,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
if zone.progress >= 3 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}
|
||||
ctx.events.fire(Kinds.ZoneCaptured, payload)
|
||||
if previous then ctx.events.fire(Kinds.ZoneLost, {side = previous, index = index, text = payload.text}) end
|
||||
|
||||
@@ -19,7 +19,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
ctx.scoring.add(side, points, Kinds.ZoneCaptured)
|
||||
ctx.events.fire(Kinds.ZoneCaptured, {side = side, text = Strings.hotPoint})
|
||||
end,
|
||||
status = ctx.status,
|
||||
status = ctx.status, contribute = ctx.contribute,
|
||||
})
|
||||
return Common.instance(ctx, {
|
||||
step = function(now, dt, fighters, elapsed) capture.step(fighters, now, elapsed or dt); return false end,
|
||||
|
||||
@@ -56,6 +56,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
local bonus = leaders[target] == victim
|
||||
ctx.scoring.add(side, if bonus then 3 else 1, 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})
|
||||
end
|
||||
|
||||
@@ -48,6 +48,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
local half = SiegeConfig.ATTACK_DURATION
|
||||
local elapsed = now - ctx.liveAt
|
||||
if elapsed >= half and not hadSiegeSwap then
|
||||
ctx.setStage("RoleSwap", ctx.liveAt + half + SiegeConfig.SWAP_FREEZE)
|
||||
hadSiegeSwap = true
|
||||
for _, z in zones do z.marker.body.Parent = nil end
|
||||
siegeSide, siegeIndex, siegeProgress = Common.opposite(siegeSide), 1, 0
|
||||
@@ -76,6 +77,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
ctx.status(Strings.siegeSwap)
|
||||
return false
|
||||
end
|
||||
if state:GetAttribute("RoundStage") == "RoleSwap" then ctx.setStage("Live") end
|
||||
local attacker = Strings.team(siegeSide)
|
||||
local zone = zones[siegeIndex]
|
||||
data:SetAttribute("Index", siegeIndex)
|
||||
@@ -87,10 +89,17 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
end
|
||||
zone.marker.body.Parent = folder
|
||||
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
|
||||
if fighter.side == siegeSide then attack = true else defense = true end
|
||||
ctx.contribute(fighter.player, "holdSeconds", dt)
|
||||
if fighter.side == siegeSide then
|
||||
attack = true
|
||||
table.insert(attackers, fighter.player)
|
||||
else
|
||||
defense = true
|
||||
end
|
||||
end
|
||||
fighter.player:SetAttribute("CitadelZone", reason)
|
||||
end
|
||||
@@ -114,6 +123,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
Common.paint(zone.marker, if phase == "Contested" then Common.orange else Common.blue)
|
||||
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})
|
||||
ctx.cue(fighters, true, nil)
|
||||
siegeCaptureStarted = false
|
||||
|
||||
@@ -55,6 +55,7 @@ local function start(ctx: Types.ModeContext): Types.ModeInstance
|
||||
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})
|
||||
ctx.cue(fighters, true, nil)
|
||||
carried[f.player] = nil
|
||||
|
||||
Reference in new issue
Block a user