Mega Antag Refactor (#25786)

* Mega Antag Refactor

* last minute delta save

* more workshopping

* more shit

* ok tested this for once

* okkkkk sure

* generic delays for starting rules

* well darn

* nukies partially

* ouagh

* ballin' faded and smonkin wed

* obliterated the diff

* Spread my arms and soak up congratulations

* I've got plenty of love, but nothing to show for it

* but there’s too much sunlight
Shining on my laptop monitor, so I
Can’t see anything with any amount of clarity

* ok this junk

* OOK!

* fubar

* most of sloth's review

* oh boy

* eek

* hell yea!

* ASDFJASDJFvsakcvjkzjnhhhyh
This commit is contained in:
Nemanja
2024-04-24 21:31:45 -04:00
committed by GitHub
parent 771661f478
commit 161fd6c83c
99 changed files with 1931 additions and 2310 deletions

View File

@@ -1,5 +1,6 @@
using System.Linq;
using Content.Server.Administration.Commands;
using Content.Server.GameTicking.Components;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.KillTracking;
using Content.Server.Mind;
@@ -33,7 +34,6 @@ public sealed class DeathMatchRuleSystem : GameRuleSystem<DeathMatchRuleComponen
SubscribeLocalEvent<PlayerSpawnCompleteEvent>(OnSpawnComplete);
SubscribeLocalEvent<KillReportedEvent>(OnKillReported);
SubscribeLocalEvent<DeathMatchRuleComponent, PlayerPointChangedEvent>(OnPointChanged);
SubscribeLocalEvent<RoundEndTextAppendEvent>(OnRoundEndTextAppend);
}
private void OnBeforeSpawn(PlayerBeforeSpawnEvent ev)
@@ -113,21 +113,17 @@ public sealed class DeathMatchRuleSystem : GameRuleSystem<DeathMatchRuleComponen
_roundEnd.EndRound(component.RestartDelay);
}
private void OnRoundEndTextAppend(RoundEndTextAppendEvent ev)
protected override void AppendRoundEndText(EntityUid uid, DeathMatchRuleComponent component, GameRuleComponent gameRule, ref RoundEndTextAppendEvent args)
{
var query = EntityQueryEnumerator<DeathMatchRuleComponent, PointManagerComponent, GameRuleComponent>();
while (query.MoveNext(out var uid, out var dm, out var point, out var rule))
{
if (!GameTicker.IsGameRuleAdded(uid, rule))
continue;
if (!TryComp<PointManagerComponent>(uid, out var point))
return;
if (dm.Victor != null && _player.TryGetPlayerData(dm.Victor.Value, out var data))
{
ev.AddLine(Loc.GetString("point-scoreboard-winner", ("player", data.UserName)));
ev.AddLine("");
}
ev.AddLine(Loc.GetString("point-scoreboard-header"));
ev.AddLine(new FormattedMessage(point.Scoreboard).ToMarkup());
if (component.Victor != null && _player.TryGetPlayerData(component.Victor.Value, out var data))
{
args.AddLine(Loc.GetString("point-scoreboard-winner", ("player", data.UserName)));
args.AddLine("");
}
args.AddLine(Loc.GetString("point-scoreboard-header"));
args.AddLine(new FormattedMessage(point.Scoreboard).ToMarkup());
}
}