Files
tbd-station-14/Content.Shared/Atmos/GetFireProtectionEvent.cs
UpAndLeaves 8cf6ca78cf Fire damage system fixes (#37241)
Fire fixes
2025-05-06 22:03:05 -04:00

35 lines
870 B
C#

using Content.Shared.Inventory;
namespace Content.Shared.Atmos;
/// <summary>
/// Raised on a burning entity to check its fire protection.
/// Damage taken is multiplied by the final amount, but not temperature.
/// TemperatureProtection is needed for that.
/// </summary>
[ByRefEvent]
public sealed class GetFireProtectionEvent : EntityEventArgs, IInventoryRelayEvent
{
public SlotFlags TargetSlots { get; } = ~SlotFlags.POCKET;
/// <summary>
/// What to multiply the fire damage by.
/// If this is 0 then it's ignored
/// </summary>
public float Multiplier;
public GetFireProtectionEvent()
{
Multiplier = 1f;
}
/// <summary>
/// Reduce fire damage taken by a percentage.
/// </summary>
public void Reduce(float by)
{
Multiplier -= by;
Multiplier = MathF.Max(Multiplier, 0f);
}
}