subfloor explosion resistance (#17816)

This commit is contained in:
Slava0135
2023-07-05 03:29:57 +03:00
committed by GitHub
parent 1b160b53c6
commit 96c804c3f1

View File

@@ -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<SubFloorHideComponent, AnchorStateChangedEvent>(HandleAnchorChanged);
SubscribeLocalEvent<SubFloorHideComponent, GettingInteractedWithAttemptEvent>(OnInteractionAttempt);
SubscribeLocalEvent<SubFloorHideComponent, GettingAttackedAttemptEvent>(OnAttackAttempt);
SubscribeLocalEvent<SubFloorHideComponent, GetExplosionResistanceEvent>(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)