GetFireProtectionEvent.cs 822 B

123456789101112131415161718192021222324252627282930313233
  1. using Content.Shared.Inventory;
  2. namespace Content.Shared.Atmos;
  3. /// <summary>
  4. /// Raised on a burning entity to check its fire protection.
  5. /// Damage taken is multiplied by the final amount, but not temperature.
  6. /// TemperatureProtection is needed for that.
  7. /// </summary>
  8. [ByRefEvent]
  9. public sealed class GetFireProtectionEvent : EntityEventArgs, IInventoryRelayEvent
  10. {
  11. public SlotFlags TargetSlots { get; } = ~SlotFlags.POCKET;
  12. /// <summary>
  13. /// What to multiply the fire damage by.
  14. /// If this is 0 then it's ignored
  15. /// </summary>
  16. public float Multiplier;
  17. public GetFireProtectionEvent()
  18. {
  19. Multiplier = 1f;
  20. }
  21. /// <summary>
  22. /// Reduce fire damage taken by a percentage.
  23. /// </summary>
  24. public void Reduce(float by)
  25. {
  26. Multiplier -= by;
  27. }
  28. }