Ninja Bomb Blacklisting (#40726)

* Ninja Bombing moved to blacklist

* Added blocker to "Solars"

Solars is too generic for a named bombing target.

* Change to AllEntityQuery

More clear intent

* Update migration.yml

Add migration to 'null' for removed WarpPointBombing entity

* Update NinjaConditionsSystem.cs

Undo some tidying

* Changed to tag

Ninja blocking component is now a tag instead of a new component

* Update NinjaConditionsSystem.cs

detidying

* Update NinjaConditionsSystem.cs

Change to efficient enumerator

* Move blacklist to component

Moved blacklist to spidercharge component

* Update migration.yml

fixed component reference

* Update migration.yml

Fixes Saltern. Exo is more complicated.

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
This commit is contained in:
Connor Huffine
2025-10-10 17:16:50 -04:00
committed by GitHub
parent 52139b5cc5
commit ecc0aaaa9f
8 changed files with 34 additions and 33 deletions

View File

@@ -1,9 +1,9 @@
using Content.Server.Objectives.Components;
using Content.Shared.Objectives.Components;
using Content.Shared.Ninja.Components;
using Content.Shared.Roles;
using Content.Shared.Roles.Components;
using Content.Shared.Warps;
using Content.Shared.Whitelist;
using Robust.Shared.Random;
namespace Content.Server.Objectives.Systems;
@@ -14,6 +14,7 @@ namespace Content.Server.Objectives.Systems;
/// </summary>
public sealed class NinjaConditionsSystem : EntitySystem
{
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly NumberObjectiveSystem _number = default!;
[Dependency] private readonly IRobustRandom _random = default!;
@@ -53,10 +54,13 @@ public sealed class NinjaConditionsSystem : EntitySystem
// choose spider charge detonation point
var warps = new List<EntityUid>();
var query = EntityQueryEnumerator<BombingTargetComponent, WarpPointComponent>();
while (query.MoveNext(out var warpUid, out _, out var warp))
var allEnts = EntityQueryEnumerator<WarpPointComponent>();
var bombingBlacklist = comp.Blacklist;
while (allEnts.MoveNext(out var warpUid, out var warp))
{
if (warp.Location != null)
if (_whitelist.IsBlacklistFail(bombingBlacklist, warpUid)
&& !string.IsNullOrWhiteSpace(warp.Location))
{
warps.Add(warpUid);
}