ActionGunComponent.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Content.Shared.Actions;
  2. using Content.Shared.Weapons.Ranged.Systems;
  3. using Robust.Shared.GameStates;
  4. using Robust.Shared.Prototypes;
  5. namespace Content.Shared.Weapons.Ranged.Components;
  6. /// <summary>
  7. /// Lets you shoot a gun using an action.
  8. /// </summary>
  9. [RegisterComponent, NetworkedComponent, Access(typeof(ActionGunSystem))]
  10. public sealed partial class ActionGunComponent : Component
  11. {
  12. /// <summary>
  13. /// Action to create, must use <see cref="ActionGunShootEvent"/>.
  14. /// </summary>
  15. [DataField(required: true)]
  16. public EntProtoId Action = string.Empty;
  17. [DataField]
  18. public EntityUid? ActionEntity;
  19. /// <summary>
  20. /// Prototype of gun entity to spawn.
  21. /// Deleted when this component is removed.
  22. /// </summary>
  23. [DataField(required: true)]
  24. public EntProtoId GunProto = string.Empty;
  25. [DataField]
  26. public EntityUid? Gun;
  27. }
  28. /// <summary>
  29. /// Action event for <see cref="ActionGunComponent"/> to shoot at a position.
  30. /// </summary>
  31. public sealed partial class ActionGunShootEvent : WorldTargetActionEvent;