Add a tag for immunity from shoe-required step triggers (#10660)
This commit is contained in:
@@ -1,12 +1,14 @@
|
|||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared.StepTrigger.Components;
|
using Content.Shared.StepTrigger.Components;
|
||||||
|
using Content.Shared.Tag;
|
||||||
|
|
||||||
namespace Content.Shared.StepTrigger.Systems;
|
namespace Content.Shared.StepTrigger.Systems;
|
||||||
|
|
||||||
public sealed class ShoesRequiredStepTriggerSystem : EntitySystem
|
public sealed class ShoesRequiredStepTriggerSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly InventorySystem _inventory = default!;
|
[Dependency] private readonly InventorySystem _inventory = default!;
|
||||||
|
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -17,6 +19,12 @@ public sealed class ShoesRequiredStepTriggerSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnStepTriggerAttempt(EntityUid uid, ShoesRequiredStepTriggerComponent component, ref StepTriggerAttemptEvent args)
|
private void OnStepTriggerAttempt(EntityUid uid, ShoesRequiredStepTriggerComponent component, ref StepTriggerAttemptEvent args)
|
||||||
{
|
{
|
||||||
|
if (_tagSystem.HasTag(args.Tripper, "ShoesRequiredStepTriggerImmune"))
|
||||||
|
{
|
||||||
|
args.Cancelled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!TryComp<InventoryComponent>(args.Tripper, out var inventory))
|
if (!TryComp<InventoryComponent>(args.Tripper, out var inventory))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
- DoorBumpOpener
|
- DoorBumpOpener
|
||||||
|
- ShoesRequiredStepTriggerImmune
|
||||||
- type: MobState
|
- type: MobState
|
||||||
thresholds:
|
thresholds:
|
||||||
0: Alive
|
0: Alive
|
||||||
|
|||||||
@@ -61,6 +61,9 @@
|
|||||||
safe: false
|
safe: false
|
||||||
- type: StandingState
|
- type: StandingState
|
||||||
- type: Alerts
|
- type: Alerts
|
||||||
|
- type: Tag
|
||||||
|
tags:
|
||||||
|
- ShoesRequiredStepTriggerImmune
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: drone
|
name: drone
|
||||||
@@ -162,6 +165,7 @@
|
|||||||
autoRot: true
|
autoRot: true
|
||||||
- type: Tag
|
- type: Tag
|
||||||
tags:
|
tags:
|
||||||
|
- ShoesRequiredStepTriggerImmune
|
||||||
- CannotSuicide
|
- CannotSuicide
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
|
|||||||
@@ -408,6 +408,9 @@
|
|||||||
- type: Tag
|
- type: Tag
|
||||||
id: SecwayKeys
|
id: SecwayKeys
|
||||||
|
|
||||||
|
- type: Tag
|
||||||
|
id: ShoesRequiredStepTriggerImmune
|
||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: Sheet
|
id: Sheet
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user