]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixes Borgs and Syndicats getting hurt by glass shards and other things + honkbot...
authorVerm <32827189+Vermidia@users.noreply.github.com>
Wed, 11 Sep 2024 02:12:08 +0000 (21:12 -0500)
committerGitHub <noreply@github.com>
Wed, 11 Sep 2024 02:12:08 +0000 (04:12 +0200)
* Lets do this again

* I noticed this way to late

15 files changed:
Content.Shared/StepTrigger/Components/PreventableStepTriggerComponent.cs [moved from Content.Shared/StepTrigger/Components/ClothingRequiredStepTriggerComponent.cs with 61% similarity]
Content.Shared/StepTrigger/Components/ProtectedFromStepTriggersComponent.cs [moved from Content.Shared/StepTrigger/Components/ClothingRequiredStepTriggerImmuneComponent.cs with 58% similarity]
Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs [deleted file]
Content.Shared/StepTrigger/Systems/StepTriggerImmuneSystem.cs
Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/base_clothingouter.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml
Resources/Prototypes/Entities/Clothing/Shoes/base_clothingshoes.yml
Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml
Resources/Prototypes/Entities/Mobs/NPCs/animals.yml
Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml
Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml
Resources/Prototypes/Entities/Objects/Devices/mousetrap.yml
Resources/Prototypes/Entities/Objects/Fun/dice.yml
Resources/Prototypes/Entities/Objects/Materials/shards.yml

similarity index 61%
rename from Content.Shared/StepTrigger/Components/ClothingRequiredStepTriggerComponent.cs
rename to Content.Shared/StepTrigger/Components/PreventableStepTriggerComponent.cs
index 9efd78d0825f68cec01c1abf0b5e421dc312dac8..166d4ae46ad48f26c89eadc900527627338a51c3 100644 (file)
@@ -4,7 +4,7 @@ using Robust.Shared.GameStates;
 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;
similarity index 58%
rename from Content.Shared/StepTrigger/Components/ClothingRequiredStepTriggerImmuneComponent.cs
rename to Content.Shared/StepTrigger/Components/ProtectedFromStepTriggersComponent.cs
index dc76207828c6a26c517419ff440a5b412a9df589..5aa4698610a6873a9e6b24095ee13f043bdf8a85 100644 (file)
@@ -5,11 +5,11 @@ using Robust.Shared.GameStates;
 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;
diff --git a/Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs b/Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs
deleted file mode 100644 (file)
index 74e10ba..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-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;
index ca72a20ae9cd9d1b93aad778d0d552a0d0501f95..5771de60cd66c1224bdae8bd303b379b1c181827 100644 (file)
@@ -1,7 +1,6 @@
 using Content.Shared.Examine;
 using Content.Shared.Inventory;
 using Content.Shared.StepTrigger.Components;
-using Content.Shared.Tag;
 
 namespace Content.Shared.StepTrigger.Systems;
 
@@ -12,25 +11,19 @@ public sealed class StepTriggerImmuneSystem : EntitySystem
     /// <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"));
     }
index 49dabaddaa3a0e33b4a36bec05eeae4a54d3ecd3..56da0c3718eb27a70a8cdf81945e03c74d993b85 100644 (file)
         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
 
index 66579f296b5201df4f3858fd484f766c154a06de..1ee9b765883a63a17ea78f32c36013f890024bc9 100644 (file)
     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:
index 334e87ebf6ed05effdb9290febd1138c7f5c3f71..c90e0c98f5b2b03ee72680faf72e7070af27a4f1 100644 (file)
@@ -25,7 +25,7 @@
     tags:
     - Hardsuit
     - WhitelistChameleon
-  - type: ClothingRequiredStepTriggerImmune
+  - type: ProtectedFromStepTriggers
     slots: WITHOUT_POCKET
 
 - type: entity
@@ -68,7 +68,7 @@
     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
index e9b8431707bc2bd77e369b6ee95973c66bffdaa9..e2733b2468b3b5884bd177fb23794fea6278510f 100644 (file)
@@ -23,7 +23,7 @@
     tags:
     - ClothMade
     - WhitelistChameleon
-  - type: ClothingRequiredStepTriggerImmune
+  - type: ProtectedFromStepTriggers
 
 - type: entity
   abstract: true
index dcaa853c287f5fa533dcdca57744967f7a2aa08f..955ddfd2e3e2cb89f68d7991f0ede1f2e31bd4c3 100644 (file)
     guides:
     - Cyborgs
     - Robotics
-  - type: StepTriggerImmune
+  - type: ProtectedFromStepTriggers
   - type: DamageOnInteractProtection
     damageProtection:
       flatReductions:
index b11c1a50c6e963c2b371c8a978a1fecc0aa9ec78..629f868d7e4f231ed27d6101cc0e1a9141bc49a0 100644 (file)
       - DoorBumpOpener
   - type: MovementAlwaysTouching
   - type: PressureImmunity
-  - type: StepTriggerImmune
+  - type: ProtectedFromStepTriggers
   - type: Insulated
   - type: InteractionPopup
     successChance: 0.7
index ad5d77f1c1e961e1e3535c8a9005dcdfbe4396de..b67e3b520ebd8afbc50d31162404e79a07ebdeaf 100644 (file)
@@ -72,8 +72,7 @@
   - type: InputMover
   - type: MobMover
   - type: ZombieImmune
-  - type: ClothingRequiredStepTriggerImmune
-    slots: All
+  - type: ProtectedFromStepTriggers
 
 - type: entity
   abstract: true
index 9aff9c59af17f5316252c8e80637efd3e2062ff1..857115e10f197fd70c257df2384eb115be8800c1 100644 (file)
   - type: TypingIndicator
     proto: robot
   - type: ZombieImmune
-  - type: StepTriggerImmune
+  - type: ProtectedFromStepTriggers
   - type: NoSlip
   - type: Insulated
 
index 1de503791897b64ea5aa1ed590db2ac8e13f9a9b..cde95fda6bda2fca934a5d172f0b30925e17b5f7 100644 (file)
@@ -15,7 +15,7 @@
       requiredTriggeredSpeed: 2
     - type: Mousetrap
     - type: TriggerOnStepTrigger
-    - type: ClothingRequiredStepTrigger
+    - type: PreventableStepTrigger
     - type: DamageUserOnTrigger
       damage:
         types:
index 0b534f087989f3e0ea019168ea5ed4ea901f13e5..433a4ebac35b0ff86689d25cdb03348b6fda88ee 100644 (file)
   - type: StepTrigger
     intersectRatio: 0.2
   - type: TriggerOnStepTrigger
-  - type: ClothingRequiredStepTrigger
+  - type: PreventableStepTrigger
   - type: Slippery
     slipSound:
       path: /Audio/Effects/glass_step.ogg
index 5668661e088c7c8d6c21fb6b67a02f8a11c6427f..718d1ad8e3f359d16fef0a548afecf4d0bda0e3a 100644 (file)
@@ -65,7 +65,7 @@
         acts: [ "Destruction" ]
   - type: StepTrigger
     intersectRatio: 0.2
-  - type: ClothingRequiredStepTrigger
+  - type: PreventableStepTrigger
   - type: Slippery
     slipSound:
       path: /Audio/Effects/glass_step.ogg