namespace Content.Shared.StepTrigger.Components;
/// <summary>
-/// This is used for marking step trigger events that require the user to wear shoes, such as for glass shards.
+/// This is used for marking step trigger events that require the user to wear shoes or have protection of some sort, such as for glass shards.
/// </summary>
[RegisterComponent, NetworkedComponent]
-public sealed partial class ClothingRequiredStepTriggerComponent : Component;
+public sealed partial class PreventableStepTriggerComponent : Component;
namespace Content.Shared.StepTrigger.Components;
/// <summary>
-/// This is used for cancelling step trigger events if the user is wearing clothing in a valid slot.
+/// This is used for cancelling preventable step trigger events if the user is wearing clothing in a valid slot or if the user itself has the component.
/// </summary>
[RegisterComponent, NetworkedComponent]
[Access(typeof(StepTriggerImmuneSystem))]
-public sealed partial class ClothingRequiredStepTriggerImmuneComponent : Component, IClothingSlots
+public sealed partial class ProtectedFromStepTriggersComponent : Component, IClothingSlots
{
[DataField]
public SlotFlags Slots { get; set; } = SlotFlags.FEET;
+++ /dev/null
-using Robust.Shared.GameStates;
-
-namespace Content.Shared.StepTrigger.Components;
-
-/// <summary>
-/// Grants the attached entity to step triggers.
-/// </summary>
-[RegisterComponent, NetworkedComponent]
-public sealed partial class StepTriggerImmuneComponent : Component;
using Content.Shared.Examine;
using Content.Shared.Inventory;
using Content.Shared.StepTrigger.Components;
-using Content.Shared.Tag;
namespace Content.Shared.StepTrigger.Systems;
/// <inheritdoc/>
public override void Initialize()
{
- SubscribeLocalEvent<StepTriggerImmuneComponent, StepTriggerAttemptEvent>(OnStepTriggerAttempt);
- SubscribeLocalEvent<ClothingRequiredStepTriggerComponent, StepTriggerAttemptEvent>(OnStepTriggerClothingAttempt);
- SubscribeLocalEvent<ClothingRequiredStepTriggerComponent, ExaminedEvent>(OnExamined);
+ SubscribeLocalEvent<PreventableStepTriggerComponent, StepTriggerAttemptEvent>(OnStepTriggerClothingAttempt);
+ SubscribeLocalEvent<PreventableStepTriggerComponent, ExaminedEvent>(OnExamined);
}
- private void OnStepTriggerAttempt(Entity<StepTriggerImmuneComponent> ent, ref StepTriggerAttemptEvent args)
+ private void OnStepTriggerClothingAttempt(Entity<PreventableStepTriggerComponent> ent, ref StepTriggerAttemptEvent args)
{
- args.Cancelled = true;
- }
-
- private void OnStepTriggerClothingAttempt(EntityUid uid, ClothingRequiredStepTriggerComponent component, ref StepTriggerAttemptEvent args)
- {
- if (_inventory.TryGetInventoryEntity<ClothingRequiredStepTriggerImmuneComponent>(args.Tripper, out _))
+ if (HasComp<ProtectedFromStepTriggersComponent>(args.Tripper) || _inventory.TryGetInventoryEntity<ProtectedFromStepTriggersComponent>(args.Tripper, out _))
{
args.Cancelled = true;
}
}
- private void OnExamined(EntityUid uid, ClothingRequiredStepTriggerComponent component, ExaminedEvent args)
+ private void OnExamined(EntityUid uid, PreventableStepTriggerComponent component, ExaminedEvent args)
{
args.PushMarkup(Loc.GetString("clothing-required-step-trigger-examine"));
}
Radiation: 0
Caustic: 0.75
- type: GroupExamine
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: entity
- type: ExplosionResistance
damageCoefficient: 0.5
- type: GroupExamine
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: entity
- type: Construction
graph: BoneArmor
node: armor
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: entity
Piercing: 0.6
Heat: 0.5
- type: GroupExamine
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
tags:
- Hardsuit
- WhitelistChameleon
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: DamageOnInteractProtection
damageProtection:
- type: HeldSpeedModifier
- type: Item
size: Huge
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: DamageOnInteractProtection
damageProtection:
tags:
- Hardsuit
- WhitelistChameleon
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: entity
sprintModifier: 0.7
- type: HeldSpeedModifier
- type: GroupExamine
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: entity
sprintModifier: 0.8
- type: HeldSpeedModifier
- type: GroupExamine
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: entity
- type: ContainerContainer
containers:
toggleable-clothing: !type:ContainerSlot {}
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: entity
sprite: Clothing/OuterClothing/Suits/chicken.rsi
- type: Clothing
sprite: Clothing/OuterClothing/Suits/chicken.rsi
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: entity
- type: ContainerContainer
containers:
toggleable-clothing: !type:ContainerSlot {}
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: entity
- type: Construction
graph: ClothingOuterSuitIan
node: suit
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
slots: WITHOUT_POCKET
- type: entity
tags:
- ClothMade
- WhitelistChameleon
- - type: ClothingRequiredStepTriggerImmune
+ - type: ProtectedFromStepTriggers
- type: entity
abstract: true
guides:
- Cyborgs
- Robotics
- - type: StepTriggerImmune
+ - type: ProtectedFromStepTriggers
- type: DamageOnInteractProtection
damageProtection:
flatReductions:
- DoorBumpOpener
- type: MovementAlwaysTouching
- type: PressureImmunity
- - type: StepTriggerImmune
+ - type: ProtectedFromStepTriggers
- type: Insulated
- type: InteractionPopup
successChance: 0.7
- type: InputMover
- type: MobMover
- type: ZombieImmune
- - type: ClothingRequiredStepTriggerImmune
- slots: All
+ - type: ProtectedFromStepTriggers
- type: entity
abstract: true
- type: TypingIndicator
proto: robot
- type: ZombieImmune
- - type: StepTriggerImmune
+ - type: ProtectedFromStepTriggers
- type: NoSlip
- type: Insulated
requiredTriggeredSpeed: 2
- type: Mousetrap
- type: TriggerOnStepTrigger
- - type: ClothingRequiredStepTrigger
+ - type: PreventableStepTrigger
- type: DamageUserOnTrigger
damage:
types:
- type: StepTrigger
intersectRatio: 0.2
- type: TriggerOnStepTrigger
- - type: ClothingRequiredStepTrigger
+ - type: PreventableStepTrigger
- type: Slippery
slipSound:
path: /Audio/Effects/glass_step.ogg
acts: [ "Destruction" ]
- type: StepTrigger
intersectRatio: 0.2
- - type: ClothingRequiredStepTrigger
+ - type: PreventableStepTrigger
- type: Slippery
slipSound:
path: /Audio/Effects/glass_step.ogg