TakeStaminaDamageEvent.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // SPDX-FileCopyrightText: 2022 Rane <60792108+Elijahrane@users.noreply.github.com>
  2. // SPDX-FileCopyrightText: 2023 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
  3. // SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
  4. // SPDX-FileCopyrightText: 2024 username <113782077+whateverusername0@users.noreply.github.com>
  5. // SPDX-FileCopyrightText: 2024 whateverusername0 <whateveremail>
  6. // SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
  7. // SPDX-FileCopyrightText: 2025 Aiden <aiden@djkraz.com>
  8. // SPDX-FileCopyrightText: 2025 Aviu00 <93730715+Aviu00@users.noreply.github.com>
  9. //
  10. // SPDX-License-Identifier: AGPL-3.0-or-later
  11. using System.Numerics;
  12. using Content.Shared.Damage.Components;
  13. using Content.Shared.Inventory;
  14. namespace Content.Shared.Damage.Events;
  15. /// <summary>
  16. /// The entity is going to be hit,
  17. /// give opportunities to change the damage or other stuff.
  18. /// </summary>
  19. // goobstation - stun resistance. try not to modify this event allat much
  20. public sealed class TakeStaminaDamageEvent : HandledEntityEventArgs, IInventoryRelayEvent
  21. {
  22. public SlotFlags TargetSlots { get; } = SlotFlags.WITHOUT_POCKET;
  23. public Entity<StaminaComponent>? Target;
  24. /// <summary>
  25. /// The multiplier. Generally, try to use *= or /= instead of overwriting.
  26. /// </summary>
  27. public float Multiplier = 1;
  28. /// <summary>
  29. /// The flat modifier. Generally, try to use += or -= instead of overwriting.
  30. /// </summary>
  31. public float FlatModifier = 0;
  32. /// <summary>
  33. /// Initialises a new event for handling stamina damage about to be applied to a specific entity.
  34. /// </summary>
  35. /// <param name="target">The entity with a stamina component that will receive damage.</param>
  36. public TakeStaminaDamageEvent(Entity<StaminaComponent> target)
  37. {
  38. Target = target;
  39. }
  40. }
  41. public sealed class StaminaDamageMeleeHitEvent(List<(EntityUid Entity, StaminaComponent Component)> hitEntities, Vector2? direction) : EntityEventArgs
  42. {
  43. public List<(EntityUid Entity, StaminaComponent Component)> HitEntities = hitEntities;
  44. public Vector2? Direction = direction;
  45. }