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.Ninja.Systems;
|
||||||
using Content.Server.Objectives.Systems;
|
using Content.Server.Objectives.Systems;
|
||||||
|
using Content.Shared.Whitelist;
|
||||||
|
|
||||||
namespace Content.Server.Objectives.Components;
|
namespace Content.Server.Objectives.Components;
|
||||||
|
|
||||||
@@ -14,4 +15,11 @@ public sealed partial class SpiderChargeConditionComponent : Component
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
public EntityUid? Target;
|
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.Server.Objectives.Components;
|
||||||
using Content.Shared.Objectives.Components;
|
using Content.Shared.Objectives.Components;
|
||||||
using Content.Shared.Ninja.Components;
|
|
||||||
using Content.Shared.Roles;
|
using Content.Shared.Roles;
|
||||||
using Content.Shared.Roles.Components;
|
using Content.Shared.Roles.Components;
|
||||||
using Content.Shared.Warps;
|
using Content.Shared.Warps;
|
||||||
|
using Content.Shared.Whitelist;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
namespace Content.Server.Objectives.Systems;
|
namespace Content.Server.Objectives.Systems;
|
||||||
@@ -14,6 +14,7 @@ namespace Content.Server.Objectives.Systems;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class NinjaConditionsSystem : EntitySystem
|
public sealed class NinjaConditionsSystem : EntitySystem
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
|
||||||
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
||||||
[Dependency] private readonly NumberObjectiveSystem _number = default!;
|
[Dependency] private readonly NumberObjectiveSystem _number = default!;
|
||||||
[Dependency] private readonly IRobustRandom _random = default!;
|
[Dependency] private readonly IRobustRandom _random = default!;
|
||||||
@@ -53,10 +54,13 @@ public sealed class NinjaConditionsSystem : EntitySystem
|
|||||||
|
|
||||||
// choose spider charge detonation point
|
// choose spider charge detonation point
|
||||||
var warps = new List<EntityUid>();
|
var warps = new List<EntityUid>();
|
||||||
var query = EntityQueryEnumerator<BombingTargetComponent, WarpPointComponent>();
|
var allEnts = EntityQueryEnumerator<WarpPointComponent>();
|
||||||
while (query.MoveNext(out var warpUid, out _, out var warp))
|
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);
|
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
|
- GhostOnlyWarp
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
state: pink
|
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:
|
components:
|
||||||
- type: NavMapBeacon
|
- type: NavMapBeacon
|
||||||
defaultText: station-beacon-solars
|
defaultText: station-beacon-solars
|
||||||
|
- type: Tag
|
||||||
|
tags:
|
||||||
|
- NinjaBombingTargetBlocker
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: DefaultStationBeaconEngineering
|
parent: DefaultStationBeaconEngineering
|
||||||
@@ -673,6 +676,9 @@
|
|||||||
components:
|
components:
|
||||||
- type: NavMapBeacon
|
- type: NavMapBeacon
|
||||||
defaultText: station-beacon-arrivals
|
defaultText: station-beacon-arrivals
|
||||||
|
- type: Tag
|
||||||
|
tags:
|
||||||
|
- NinjaBombingTargetBlocker
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: DefaultStationBeacon
|
parent: DefaultStationBeacon
|
||||||
@@ -761,6 +767,9 @@
|
|||||||
components:
|
components:
|
||||||
- type: NavMapBeacon
|
- type: NavMapBeacon
|
||||||
defaultText: station-beacon-cryosleep
|
defaultText: station-beacon-cryosleep
|
||||||
|
- type: Tag
|
||||||
|
tags:
|
||||||
|
- NinjaBombingTargetBlocker
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: DefaultStationBeacon
|
parent: DefaultStationBeacon
|
||||||
|
|||||||
@@ -51,6 +51,10 @@
|
|||||||
sprite: Objects/Weapons/Bombs/spidercharge.rsi
|
sprite: Objects/Weapons/Bombs/spidercharge.rsi
|
||||||
state: icon
|
state: icon
|
||||||
- type: SpiderChargeCondition
|
- type: SpiderChargeCondition
|
||||||
|
blacklist:
|
||||||
|
tags:
|
||||||
|
- GhostOnlyWarp
|
||||||
|
- NinjaBombingTargetBlocker
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: [BaseNinjaObjective, BaseSurviveObjective]
|
parent: [BaseNinjaObjective, BaseSurviveObjective]
|
||||||
|
|||||||
@@ -1024,6 +1024,8 @@
|
|||||||
id: Mushroom
|
id: Mushroom
|
||||||
|
|
||||||
## N ##
|
## N ##
|
||||||
|
- type: Tag
|
||||||
|
id: NinjaBombingTargetBlocker # Ninjas will not target this warp point
|
||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: NoBlockAnchoring
|
id: NoBlockAnchoring
|
||||||
|
|||||||
@@ -726,5 +726,7 @@ PrefilledSyringe: Syringe
|
|||||||
BibleTanakh: null
|
BibleTanakh: null
|
||||||
BibleSatanic: null
|
BibleSatanic: null
|
||||||
|
|
||||||
# 2025-10-8
|
|
||||||
|
# 2025-10-08
|
||||||
ClothingBeltAssault: ClothingBeltMilitaryWebbing
|
ClothingBeltAssault: ClothingBeltMilitaryWebbing
|
||||||
|
WarpPointBombing: null
|
||||||
|
|||||||
Reference in New Issue
Block a user