]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix masks with flash, eye, and damage protection working while being pulled down...
authorWinkarst-cpu <74284083+Winkarst-cpu@users.noreply.github.com>
Thu, 9 Oct 2025 14:07:58 +0000 (17:07 +0300)
committerGitHub <noreply@github.com>
Thu, 9 Oct 2025 14:07:58 +0000 (14:07 +0000)
Fix

Content.Shared/Armor/SharedArmorSystem.cs
Content.Shared/Eye/Blinding/Systems/EyeProtectionSystem.cs
Content.Shared/Flash/SharedFlashSystem.cs

index 1ff1bbc073375a42dac65eb80a4592c142c06761..972289460fe95e4907130302130d5520e74d152c 100644 (file)
@@ -1,4 +1,5 @@
-using Content.Shared.Damage;
+using Content.Shared.Clothing.Components;
+using Content.Shared.Damage;
 using Content.Shared.Examine;
 using Content.Shared.Inventory;
 using Content.Shared.Silicons.Borgs;
@@ -32,6 +33,9 @@ public abstract class SharedArmorSystem : EntitySystem
     /// <param name="args">The event, contains the running count of armor percentage as a coefficient</param>
     private void OnCoefficientQuery(Entity<ArmorComponent> ent, ref InventoryRelayedEvent<CoefficientQueryEvent> args)
     {
+        if (TryComp<MaskComponent>(ent, out var mask) && mask.IsToggled)
+            return;
+
         foreach (var armorCoefficient in ent.Comp.Modifiers.Coefficients)
         {
             args.Args.DamageModifiers.Coefficients[armorCoefficient.Key] = args.Args.DamageModifiers.Coefficients.TryGetValue(armorCoefficient.Key, out var coefficient) ? coefficient * armorCoefficient.Value : armorCoefficient.Value;
@@ -40,12 +44,18 @@ public abstract class SharedArmorSystem : EntitySystem
 
     private void OnDamageModify(EntityUid uid, ArmorComponent component, InventoryRelayedEvent<DamageModifyEvent> args)
     {
+        if (TryComp<MaskComponent>(uid, out var mask) && mask.IsToggled)
+            return;
+
         args.Args.Damage = DamageSpecifier.ApplyModifierSet(args.Args.Damage, component.Modifiers);
     }
 
     private void OnBorgDamageModify(EntityUid uid, ArmorComponent component,
         ref BorgModuleRelayedEvent<DamageModifyEvent> args)
     {
+        if (TryComp<MaskComponent>(uid, out var mask) && mask.IsToggled)
+            return;
+
         args.Args.Damage = DamageSpecifier.ApplyModifierSet(args.Args.Damage, component.Modifiers);
     }
 
index 0fc01f1b4e51e10a6c5087efa971e88a0fb562cd..0b4353eeda3b75a02cc5d92494377dea70b3aecc 100644 (file)
@@ -3,6 +3,7 @@ using Content.Shared.Inventory;
 using Content.Shared.Eye.Blinding.Components;
 using Content.Shared.Tools.Components;
 using Content.Shared.Item.ItemToggle.Components;
+using Content.Shared.Clothing.Components;
 
 namespace Content.Shared.Eye.Blinding.Systems
 {
@@ -29,6 +30,9 @@ namespace Content.Shared.Eye.Blinding.Systems
 
         private void OnGetProtection(EntityUid uid, EyeProtectionComponent component, GetEyeProtectionEvent args)
         {
+            if (TryComp<MaskComponent>(uid, out var mask) && mask.IsToggled)
+                return;
+
             args.Protection += component.ProtectionTime;
         }
 
index 7f69e860420d317e61a554595556703f52f2b091..02513aa91b9b6c0d9ec7bf3b97d78fe73b19db24 100644 (file)
@@ -22,6 +22,7 @@ using Robust.Shared.Timing;
 using System.Linq;
 using Content.Shared.Movement.Systems;
 using Content.Shared.Random.Helpers;
+using Content.Shared.Clothing.Components;
 
 namespace Content.Shared.Flash;
 
@@ -258,6 +259,9 @@ public abstract class SharedFlashSystem : EntitySystem
 
     private void OnFlashImmunityFlashAttempt(Entity<FlashImmunityComponent> ent, ref FlashAttemptEvent args)
     {
+        if (TryComp<MaskComponent>(ent, out var mask) && mask.IsToggled)
+            return;
+
         if (ent.Comp.Enabled)
             args.Cancelled = true;
     }