Files
crystall-punk-14/Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs

24 lines
722 B
C#
Raw Permalink Normal View History

using Content.Shared.Atmos;
using Content.Shared.Clothing.Components;
using Content.Shared.Inventory;
namespace Content.Shared.Clothing.EntitySystems;
/// <summary>
/// Handles reducing fire damage when wearing clothing with <see cref="FireProtectionComponent"/>.
/// </summary>
public sealed class FireProtectionSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<FireProtectionComponent, InventoryRelayedEvent<GetFireProtectionEvent>>(OnGetProtection);
}
private void OnGetProtection(Entity<FireProtectionComponent> ent, ref InventoryRelayedEvent<GetFireProtectionEvent> args)
{
args.Args.Reduce(ent.Comp.Reduction);
}
}