[Antag] Lone Ops (#14647)
* loneops event, prototype stuff, striker shuttle, and nukeops rule changes * newline * shuttle attributions * optimizations and tweaks * bugfix and mutually exclusive with nukeops * bugfix but better * fix nukie planet spawning when defaulting to extended * remove hypospray protection references * ghost_roles.yml edit thingy * remove .orig file
This commit is contained in:
@@ -234,6 +234,17 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadLoneOpsConfig()
|
||||
{
|
||||
_nukeopsRuleConfig.SpawnOutpost = false;
|
||||
_nukeopsRuleConfig.EndsRound = false;
|
||||
}
|
||||
|
||||
public bool CheckLoneOpsSpawn()
|
||||
{
|
||||
return _nukeopsRuleConfig.CanLoneOpsSpawn;
|
||||
}
|
||||
|
||||
private void OnRoundStart()
|
||||
{
|
||||
// TODO: This needs to try and target a Nanotrasen station. At the very least,
|
||||
@@ -383,7 +394,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
|
||||
|
||||
private void CheckRoundShouldEnd()
|
||||
{
|
||||
if (!RuleAdded || RuleWinType == WinType.CrewMajor || RuleWinType == WinType.OpsMajor)
|
||||
if (!RuleAdded || !_nukeopsRuleConfig.EndsRound || RuleWinType == WinType.CrewMajor || RuleWinType == WinType.OpsMajor)
|
||||
return;
|
||||
|
||||
// If there are any nuclear bombs that are active, immediately return. We're not over yet.
|
||||
@@ -456,6 +467,12 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
|
||||
if (!RuleAdded)
|
||||
return;
|
||||
|
||||
if (!SpawnMap())
|
||||
{
|
||||
Logger.InfoS("nukies", "Failed to load map for nukeops");
|
||||
return;
|
||||
}
|
||||
|
||||
// Basically copied verbatim from traitor code
|
||||
var playersPerOperative = _nukeopsRuleConfig.PlayersPerOperative;
|
||||
var maxOperatives = _nukeopsRuleConfig.MaxOperatives;
|
||||
@@ -608,6 +625,11 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
|
||||
if (_nukiePlanet != null)
|
||||
return true; // Map is already loaded.
|
||||
|
||||
if (!_nukeopsRuleConfig.SpawnOutpost)
|
||||
return true;
|
||||
|
||||
_nukeopsRuleConfig.CanLoneOpsSpawn = false;
|
||||
|
||||
var path = _nukeopsRuleConfig.NukieOutpostMap;
|
||||
var shuttlePath = _nukeopsRuleConfig.NukieShuttleMap;
|
||||
if (path == null)
|
||||
@@ -785,6 +807,11 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
|
||||
|
||||
private void SpawnOperativesForGhostRoles()
|
||||
{
|
||||
if (!SpawnMap())
|
||||
{
|
||||
Logger.InfoS("nukies", "Failed to load map for nukeops");
|
||||
return;
|
||||
}
|
||||
// Basically copied verbatim from traitor code
|
||||
var playersPerOperative = _nukeopsRuleConfig.PlayersPerOperative;
|
||||
var maxOperatives = _nukeopsRuleConfig.MaxOperatives;
|
||||
@@ -855,13 +882,6 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
|
||||
_operativeNames.Add(proto, new List<string>(_prototypeManager.Index<DatasetPrototype>(proto).Values));
|
||||
}
|
||||
|
||||
|
||||
if (!SpawnMap())
|
||||
{
|
||||
Logger.InfoS("nukies", "Failed to load map for nukeops");
|
||||
return;
|
||||
}
|
||||
|
||||
// Add pre-existing nuke operatives to the credit list.
|
||||
var query = EntityQuery<NukeOperativeComponent, MindComponent>(true);
|
||||
foreach (var (_, mindComp) in query)
|
||||
@@ -876,5 +896,10 @@ public sealed class NukeopsRuleSystem : GameRuleSystem
|
||||
SpawnOperativesForGhostRoles();
|
||||
}
|
||||
|
||||
public override void Ended() { }
|
||||
public override void Ended()
|
||||
{
|
||||
_nukeopsRuleConfig.EndsRound = true;
|
||||
_nukeopsRuleConfig.SpawnOutpost = true;
|
||||
_nukeopsRuleConfig.CanLoneOpsSpawn = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user