Files
tbd-station-14/Content.Shared/Clothing/EntitySystems/FireProtectionSystem.cs
deltanedas cd92046966 make fire not burn through hardsuits (#27161)
* add FireProtection system and event

* minor optimisation + make flammable use fire protection event

* add fire protection values to some things, nerf firesuit heat resistance

* bruh

* unrevert laser nerfs, make elite hardsuit fully fireproof

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-05-09 00:12:48 -07:00

24 lines
722 B
C#

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);
}
}