* 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>
24 lines
722 B
C#
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);
|
|
}
|
|
}
|