1
0

WieldableComponent.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Robust.Shared.Audio;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.Wieldable.Components;
  5. /// <summary>
  6. /// Used for objects that can be wielded in two or more hands,
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, Access(typeof(SharedWieldableSystem)), AutoGenerateComponentState]
  9. public sealed partial class WieldableComponent : Component
  10. {
  11. [DataField("wieldSound")]
  12. public SoundSpecifier? WieldSound = new SoundPathSpecifier("/Audio/Effects/thudswoosh.ogg");
  13. [DataField("unwieldSound")]
  14. public SoundSpecifier? UnwieldSound;
  15. /// <summary>
  16. /// Number of free hands required (excluding the item itself) required
  17. /// to wield it
  18. /// </summary>
  19. [DataField("freeHandsRequired")]
  20. public int FreeHandsRequired = 1;
  21. [AutoNetworkedField, DataField("wielded")]
  22. public bool Wielded = false;
  23. /// <summary>
  24. /// Whether using the item inhand while wielding causes the item to unwield.
  25. /// Unwielding can conflict with other inhand actions.
  26. /// </summary>
  27. [DataField]
  28. public bool UnwieldOnUse = true;
  29. /// <summary>
  30. /// Should use delay trigger after the wield/unwield?
  31. /// </summary>
  32. [DataField]
  33. public bool UseDelayOnWield = true;
  34. [DataField("wieldedInhandPrefix")]
  35. public string? WieldedInhandPrefix = "wielded";
  36. public string? OldInhandPrefix = null;
  37. }
  38. [Serializable, NetSerializable]
  39. public enum WieldableVisuals : byte
  40. {
  41. Wielded
  42. }