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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -51,6 +51,10 @@
|
||||
sprite: Objects/Weapons/Bombs/spidercharge.rsi
|
||||
state: icon
|
||||
- type: SpiderChargeCondition
|
||||
blacklist:
|
||||
tags:
|
||||
- GhostOnlyWarp
|
||||
- NinjaBombingTargetBlocker
|
||||
|
||||
- type: entity
|
||||
parent: [BaseNinjaObjective, BaseSurviveObjective]
|
||||
|
||||
@@ -1024,6 +1024,8 @@
|
||||
id: Mushroom
|
||||
|
||||
## N ##
|
||||
- type: Tag
|
||||
id: NinjaBombingTargetBlocker # Ninjas will not target this warp point
|
||||
|
||||
- type: Tag
|
||||
id: NoBlockAnchoring
|
||||
|
||||
@@ -726,5 +726,7 @@ PrefilledSyringe: Syringe
|
||||
BibleTanakh: null
|
||||
BibleSatanic: null
|
||||
|
||||
# 2025-10-8
|
||||
|
||||
# 2025-10-08
|
||||
ClothingBeltAssault: ClothingBeltMilitaryWebbing
|
||||
WarpPointBombing: null
|
||||
|
||||
Reference in New Issue
Block a user