]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Ninja Bomb Blacklisting (#40726)
authorConnor Huffine <chuffine@gmail.com>
Fri, 10 Oct 2025 21:16:50 +0000 (17:16 -0400)
committerGitHub <noreply@github.com>
Fri, 10 Oct 2025 21:16:50 +0000 (21:16 +0000)
* 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>
Content.Server/Objectives/Components/SpiderChargeConditionComponent.cs
Content.Server/Objectives/Systems/NinjaConditionsSystem.cs
Content.Shared/Ninja/Components/BombingTargetComponent.cs [deleted file]
Resources/Prototypes/Entities/Markers/warp_point.yml
Resources/Prototypes/Entities/Objects/Devices/station_beacon.yml
Resources/Prototypes/Objectives/ninja.yml
Resources/Prototypes/tags.yml
Resources/migration.yml

index 9983b35969f6acb04ad219cc8af639be8cd4f8df..d6309ccdd34be91d61f8df0a4a76e42e5959e9bc 100644 (file)
@@ -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
     /// </summary>
     [DataField, ViewVariables(VVAccess.ReadWrite)]
     public EntityUid? Target;
+
+    /// <summary>
+    /// Tags that should be used to exclude Warp Points
+    /// from the list of valid bombing targets
+    /// </summary>
+    [DataField]
+    public EntityWhitelist? Blacklist;
 }
index db788165037a4f7d1fd2b2dccf7e2284da315f82..4c19a64ab1070388aca67618646981428a79fffe 100644 (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);
             }
diff --git a/Content.Shared/Ninja/Components/BombingTargetComponent.cs b/Content.Shared/Ninja/Components/BombingTargetComponent.cs
deleted file mode 100644 (file)
index c429eb6..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace Content.Shared.Ninja.Components;
-
-/// <summary>
-/// Makes this warp point a valid bombing target for ninja's spider charge.
-/// </summary>
-[RegisterComponent]
-public sealed partial class BombingTargetComponent : Component;
index 675938c09bc45e3503547812ca4008eff30f0db3..4616d1535a88158d9c05ede0f08d52df1f56ac63 100644 (file)
       - 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
index 870e66654fa6ea4982b462381f7e60a3df8c7482..ff6d5a6a4a94e3ad0d4d18f196be226dbd6c7c92 100644 (file)
   components:
   - type: NavMapBeacon
     defaultText: station-beacon-solars
+  - type: Tag
+    tags:
+    - NinjaBombingTargetBlocker
 
 - type: entity
   parent: DefaultStationBeaconEngineering
   components:
   - type: NavMapBeacon
     defaultText: station-beacon-arrivals
+  - type: Tag
+    tags:
+    - NinjaBombingTargetBlocker
 
 - type: entity
   parent: DefaultStationBeacon
   components:
   - type: NavMapBeacon
     defaultText: station-beacon-cryosleep
+  - type: Tag
+    tags:
+    - NinjaBombingTargetBlocker
 
 - type: entity
   parent: DefaultStationBeacon
index 76d74876b03d73a401f29d1051da3b521730c70e..f015dd8f723647629d9965a79e2e510a022cdc26 100644 (file)
       sprite: Objects/Weapons/Bombs/spidercharge.rsi
       state: icon
   - type: SpiderChargeCondition
+    blacklist:
+      tags:
+      - GhostOnlyWarp
+      - NinjaBombingTargetBlocker
 
 - type: entity
   parent: [BaseNinjaObjective, BaseSurviveObjective]
index 4f6c018f236212e3f17d2de48681dd5343674301..08539f50cfc5e1db0b07948af6bdfe0bd5151cde 100644 (file)
   id: Mushroom
 
 ## N ##
+- type: Tag
+  id: NinjaBombingTargetBlocker # Ninjas will not target this warp point
 
 - type: Tag
   id: NoBlockAnchoring
index d05795def43d9640dc792d6d667694e77302a49f..bbf331d5b6e9612731da015cef4b8192dcef88b8 100644 (file)
@@ -726,5 +726,7 @@ PrefilledSyringe: Syringe
 BibleTanakh: null
 BibleSatanic: null
 
-# 2025-10-8
+
+# 2025-10-08
 ClothingBeltAssault: ClothingBeltMilitaryWebbing
+WarpPointBombing: null