Refactor stations to properly use entity prototypes. (stationsv3) (#16570)
* Update StationSpawningSystem.cs Web-edit to allow feeding in an existing entity. * Update StationSpawningSystem.cs value type moment * Update StationSpawningSystem.cs * Oh goddamnit this is a refactor now. * awawawa * aaaaaaaaaaa * ee * forgot records. * no records? no records. * What's in a name? * Sloth forcing me to do the refactor properly smh. * e * optional evac in test. * tests pls work * awa --------- Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,7 @@ using Content.Server.Ghost.Roles.Components;
|
||||
using Content.Server.Ghost.Roles.Events;
|
||||
using Content.Server.Humanoid;
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Server.NPC.Components;
|
||||
using Content.Server.NPC.Systems;
|
||||
using Content.Server.Nuke;
|
||||
using Content.Server.Preferences.Managers;
|
||||
@@ -175,12 +176,16 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
||||
// we can only currently guarantee that NT stations are the only station to
|
||||
// exist in the base game.
|
||||
|
||||
component.TargetStation = _stationSystem.Stations.FirstOrNull();
|
||||
var eligible = EntityQuery<StationEventEligibleComponent, FactionComponent>()
|
||||
.Where(x =>
|
||||
_faction.IsFactionHostile(component.Faction, x.Item2.Owner, x.Item2))
|
||||
.Select(x => x.Item1.Owner)
|
||||
.ToList();
|
||||
|
||||
if (component.TargetStation == null)
|
||||
{
|
||||
if (!eligible.Any())
|
||||
return;
|
||||
}
|
||||
|
||||
component.TargetStation = _random.Pick(eligible);
|
||||
|
||||
var filter = Filter.Empty();
|
||||
var query = EntityQueryEnumerator<NukeOperativeComponent, ActorComponent>();
|
||||
|
||||
Reference in New Issue
Block a user