From 96c804c3f1cc9d3bf72041d0649df71dbb063185 Mon Sep 17 00:00:00 2001 From: Slava0135 <40753025+Slava0135@users.noreply.github.com> Date: Wed, 5 Jul 2023 03:29:57 +0300 Subject: [PATCH] subfloor explosion resistance (#17816) --- Content.Shared/SubFloor/SharedSubFloorHideSystem.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs b/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs index 9d2eb3de69..ac7a608410 100644 --- a/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs +++ b/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Audio; +using Content.Shared.Explosion; using Content.Shared.Interaction.Events; using Content.Shared.Maps; using JetBrains.Annotations; @@ -31,6 +32,13 @@ namespace Content.Shared.SubFloor SubscribeLocalEvent(HandleAnchorChanged); SubscribeLocalEvent(OnInteractionAttempt); SubscribeLocalEvent(OnAttackAttempt); + SubscribeLocalEvent(OnGetExplosionResistance); + } + + private void OnGetExplosionResistance(EntityUid uid, SubFloorHideComponent component, GetExplosionResistanceEvent args) + { + if (component.BlockInteractions && component.IsUnderCover) + args.DamageCoefficient = 0; } private void OnAttackAttempt(EntityUid uid, SubFloorHideComponent component, ref GettingAttackedAttemptEvent args)