[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:
Scribbles0
2023-04-16 23:00:43 -07:00
committed by GitHub
parent 308a64a5c9
commit e24d0b4e44
8 changed files with 3865 additions and 9 deletions

View File

@@ -0,0 +1,44 @@
using Robust.Server.GameObjects;
using Robust.Server.Maps;
using Robust.Shared.Map;
using Content.Server.GameTicking;
using Robust.Shared.Prototypes;
using Content.Server.GameTicking.Rules;
namespace Content.Server.StationEvents.Events;
public sealed class LoneOpsSpawn : StationEventSystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly MapLoaderSystem _map = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly NukeopsRuleSystem _nukeopsRuleSystem = default!;
public override string Prototype => "LoneOps";
public const string LoneOpsShuttlePath = "Maps/Shuttles/striker.yml";
public const string GameRuleProto = "Nukeops";
public override void Started()
{
base.Started();
if (!_nukeopsRuleSystem.CheckLoneOpsSpawn())
return;
var shuttleMap = _mapManager.CreateMap();
var options = new MapLoadOptions()
{
LoadMap = true,
};
_map.TryLoad(shuttleMap, LoneOpsShuttlePath, out var grids, options);
if (!_prototypeManager.TryIndex<GameRulePrototype>(GameRuleProto, out var ruleProto))
return;
_nukeopsRuleSystem.LoadLoneOpsConfig();
_gameTicker.StartGameRule(ruleProto);
}
}