After killing all nuclear operatives, shuttle will be called instead of instant round end (#19850)
* ☢️🕵️💀🚫📄🚀 * 🚀📢❌📥📜 * 🔧🐛📢🚹🚉➡👑👑 * 😪 * 🧱 * 🚀🛬🕔➡️🕙 * ☢️⚙️🔵🔚🔨➡️🔵🔚⚙️ these commit names are literally evil who tf does this
This commit is contained in:
@@ -487,14 +487,14 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
||||
}
|
||||
}
|
||||
|
||||
private void SetWinType(EntityUid uid, WinType type, NukeopsRuleComponent? component = null)
|
||||
private void SetWinType(EntityUid uid, WinType type, NukeopsRuleComponent? component = null, bool endRound = true)
|
||||
{
|
||||
if (!Resolve(uid, ref component))
|
||||
return;
|
||||
|
||||
component.WinType = type;
|
||||
|
||||
if (type == WinType.CrewMajor || type == WinType.OpsMajor)
|
||||
if (endRound && (type == WinType.CrewMajor || type == WinType.OpsMajor))
|
||||
_roundEndSystem.EndRound();
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
||||
if (!GameTicker.IsGameRuleAdded(uid, gameRule))
|
||||
continue;
|
||||
|
||||
if (!nukeops.EndsRound || nukeops.WinType == WinType.CrewMajor || nukeops.WinType == WinType.OpsMajor)
|
||||
if (nukeops.RoundEndBehavior == RoundEndBehavior.Nothing || nukeops.WinType == WinType.CrewMajor || nukeops.WinType == WinType.OpsMajor)
|
||||
continue;
|
||||
|
||||
// If there are any nuclear bombs that are active, immediately return. We're not over yet.
|
||||
@@ -559,7 +559,12 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
||||
? WinCondition.NukiesAbandoned
|
||||
: WinCondition.AllNukiesDead);
|
||||
|
||||
SetWinType(uid, WinType.CrewMajor, nukeops);
|
||||
SetWinType(uid, WinType.CrewMajor, nukeops, false);
|
||||
_roundEndSystem.DoRoundEndBehavior(
|
||||
nukeops.RoundEndBehavior, nukeops.EvacShuttleTime, nukeops.RoundEndTextSender, nukeops.RoundEndTextShuttleCall, nukeops.RoundEndTextAnnouncement);
|
||||
|
||||
// prevent it called multiple times
|
||||
nukeops.RoundEndBehavior = RoundEndBehavior.Nothing;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -763,7 +768,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
||||
|
||||
foreach (var (nukeops, gameRule) in EntityQuery<NukeopsRuleComponent, GameRuleComponent>())
|
||||
{
|
||||
if (nukeops.OperativeMindPendingData.TryGetValue(uid, out var role) || !nukeops.SpawnOutpost || !nukeops.EndsRound)
|
||||
if (nukeops.OperativeMindPendingData.TryGetValue(uid, out var role) || !nukeops.SpawnOutpost || nukeops.RoundEndBehavior == RoundEndBehavior.Nothing)
|
||||
{
|
||||
role ??= nukeops.OperativeRoleProto;
|
||||
_roles.MindAddRole(mindId, new NukeopsRoleComponent { PrototypeId = role });
|
||||
|
||||
Reference in New Issue
Block a user