From ecc0aaaa9fe22d8e1cf9d38748c8f8373540f1bc Mon Sep 17 00:00:00 2001 From: Connor Huffine Date: Fri, 10 Oct 2025 17:16:50 -0400 Subject: [PATCH] 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> --- .../SpiderChargeConditionComponent.cs | 8 +++++++ .../Systems/NinjaConditionsSystem.cs | 12 +++++++---- .../Components/BombingTargetComponent.cs | 7 ------- .../Entities/Markers/warp_point.yml | 21 ------------------- .../Objects/Devices/station_beacon.yml | 9 ++++++++ Resources/Prototypes/Objectives/ninja.yml | 4 ++++ Resources/Prototypes/tags.yml | 2 ++ Resources/migration.yml | 4 +++- 8 files changed, 34 insertions(+), 33 deletions(-) delete mode 100644 Content.Shared/Ninja/Components/BombingTargetComponent.cs diff --git a/Content.Server/Objectives/Components/SpiderChargeConditionComponent.cs b/Content.Server/Objectives/Components/SpiderChargeConditionComponent.cs index 9983b35969..d6309ccdd3 100644 --- a/Content.Server/Objectives/Components/SpiderChargeConditionComponent.cs +++ b/Content.Server/Objectives/Components/SpiderChargeConditionComponent.cs @@ -1,5 +1,6 @@ using Content.Server.Ninja.Systems; using Content.Server.Objectives.Systems; +using Content.Shared.Whitelist; namespace Content.Server.Objectives.Components; @@ -14,4 +15,11 @@ public sealed partial class SpiderChargeConditionComponent : Component /// [DataField, ViewVariables(VVAccess.ReadWrite)] public EntityUid? Target; + + /// + /// Tags that should be used to exclude Warp Points + /// from the list of valid bombing targets + /// + [DataField] + public EntityWhitelist? Blacklist; } diff --git a/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs b/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs index db78816503..4c19a64ab1 100644 --- a/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs +++ b/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs @@ -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; /// 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(); - var query = EntityQueryEnumerator(); - while (query.MoveNext(out var warpUid, out _, out var warp)) + var allEnts = EntityQueryEnumerator(); + 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); } diff --git a/Content.Shared/Ninja/Components/BombingTargetComponent.cs b/Content.Shared/Ninja/Components/BombingTargetComponent.cs deleted file mode 100644 index c429eb6880..0000000000 --- a/Content.Shared/Ninja/Components/BombingTargetComponent.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Content.Shared.Ninja.Components; - -/// -/// Makes this warp point a valid bombing target for ninja's spider charge. -/// -[RegisterComponent] -public sealed partial class BombingTargetComponent : Component; diff --git a/Resources/Prototypes/Entities/Markers/warp_point.yml b/Resources/Prototypes/Entities/Markers/warp_point.yml index 675938c09b..4616d1535a 100644 --- a/Resources/Prototypes/Entities/Markers/warp_point.yml +++ b/Resources/Prototypes/Entities/Markers/warp_point.yml @@ -31,24 +31,3 @@ - GhostOnlyWarp - type: Sprite state: pink - -- type: entity - parent: WarpPoint - id: WarpPointBombing - name: warp point - suffix: ninja bombing target - components: - - type: BombingTarget - - type: Tag - tags: - - GhostOnlyWarp - - type: WarpPoint - location: bombing target - blacklist: - tags: - - GhostOnlyWarp - - type: Sprite - layers: - - state: pink - - sprite: Objects/Weapons/Bombs/spidercharge.rsi - state: icon diff --git a/Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml b/Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml index 870e66654f..ff6d5a6a4a 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml @@ -455,6 +455,9 @@ components: - type: NavMapBeacon defaultText: station-beacon-solars + - type: Tag + tags: + - NinjaBombingTargetBlocker - type: entity parent: DefaultStationBeaconEngineering @@ -673,6 +676,9 @@ components: - type: NavMapBeacon defaultText: station-beacon-arrivals + - type: Tag + tags: + - NinjaBombingTargetBlocker - type: entity parent: DefaultStationBeacon @@ -761,6 +767,9 @@ components: - type: NavMapBeacon defaultText: station-beacon-cryosleep + - type: Tag + tags: + - NinjaBombingTargetBlocker - type: entity parent: DefaultStationBeacon diff --git a/Resources/Prototypes/Objectives/ninja.yml b/Resources/Prototypes/Objectives/ninja.yml index 76d74876b0..f015dd8f72 100644 --- a/Resources/Prototypes/Objectives/ninja.yml +++ b/Resources/Prototypes/Objectives/ninja.yml @@ -51,6 +51,10 @@ sprite: Objects/Weapons/Bombs/spidercharge.rsi state: icon - type: SpiderChargeCondition + blacklist: + tags: + - GhostOnlyWarp + - NinjaBombingTargetBlocker - type: entity parent: [BaseNinjaObjective, BaseSurviveObjective] diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 4f6c018f23..08539f50cf 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -1024,6 +1024,8 @@ id: Mushroom ## N ## +- type: Tag + id: NinjaBombingTargetBlocker # Ninjas will not target this warp point - type: Tag id: NoBlockAnchoring diff --git a/Resources/migration.yml b/Resources/migration.yml index d05795def4..bbf331d5b6 100644 --- a/Resources/migration.yml +++ b/Resources/migration.yml @@ -726,5 +726,7 @@ PrefilledSyringe: Syringe BibleTanakh: null BibleSatanic: null -# 2025-10-8 + +# 2025-10-08 ClothingBeltAssault: ClothingBeltMilitaryWebbing +WarpPointBombing: null -- 2.51.2