MechGrabberComponent.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System.Numerics;
  2. using System.Threading;
  3. using Content.Shared.DoAfter;
  4. using Robust.Shared.Audio;
  5. using Robust.Shared.Containers;
  6. namespace Content.Server.Mech.Equipment.Components;
  7. /// <summary>
  8. /// A piece of mech equipment that grabs entities and stores them
  9. /// inside of a container so large objects can be moved.
  10. /// </summary>
  11. [RegisterComponent]
  12. public sealed partial class MechGrabberComponent : Component
  13. {
  14. /// <summary>
  15. /// The change in energy after each grab.
  16. /// </summary>
  17. [DataField("grabEnergyDelta")]
  18. public float GrabEnergyDelta = -30;
  19. /// <summary>
  20. /// How long does it take to grab something?
  21. /// </summary>
  22. [DataField("grabDelay")]
  23. public float GrabDelay = 2.5f;
  24. /// <summary>
  25. /// The offset from the mech when an item is dropped.
  26. /// This is here for things like lockers and vendors
  27. /// </summary>
  28. [DataField("depositOffset")]
  29. public Vector2 DepositOffset = new(0, -1);
  30. /// <summary>
  31. /// The maximum amount of items that can be fit in this grabber
  32. /// </summary>
  33. [DataField("maxContents")]
  34. public int MaxContents = 10;
  35. /// <summary>
  36. /// The sound played when a mech is grabbing something
  37. /// </summary>
  38. [DataField("grabSound")]
  39. public SoundSpecifier GrabSound = new SoundPathSpecifier("/Audio/Mecha/sound_mecha_hydraulic.ogg");
  40. public EntityUid? AudioStream;
  41. [ViewVariables(VVAccess.ReadWrite)]
  42. public Container ItemContainer = default!;
  43. [DataField, ViewVariables(VVAccess.ReadOnly)]
  44. public DoAfterId? DoAfter;
  45. }