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:
@@ -1,4 +1,5 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Server.GameTicking.Components;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server.Station.Components;
|
||||
using Robust.Shared.Collections;
|
||||
@@ -15,31 +16,6 @@ public abstract partial class GameRuleSystem<T> where T: IComponent
|
||||
return EntityQueryEnumerator<ActiveGameRuleComponent, T, GameRuleComponent>();
|
||||
}
|
||||
|
||||
protected bool TryRoundStartAttempt(RoundStartAttemptEvent ev, string localizedPresetName)
|
||||
{
|
||||
var query = EntityQueryEnumerator<ActiveGameRuleComponent, T, GameRuleComponent>();
|
||||
while (query.MoveNext(out _, out _, out _, out var gameRule))
|
||||
{
|
||||
var minPlayers = gameRule.MinPlayers;
|
||||
if (!ev.Forced && ev.Players.Length < minPlayers)
|
||||
{
|
||||
ChatManager.SendAdminAnnouncement(Loc.GetString("preset-not-enough-ready-players",
|
||||
("readyPlayersCount", ev.Players.Length), ("minimumPlayers", minPlayers),
|
||||
("presetName", localizedPresetName)));
|
||||
ev.Cancel();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ev.Players.Length == 0)
|
||||
{
|
||||
ChatManager.DispatchServerAnnouncement(Loc.GetString("preset-no-one-ready"));
|
||||
ev.Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Utility function for finding a random event-eligible station entity
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user