BaseTargetActionComponent.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Content.Shared.Interaction;
  2. namespace Content.Shared.Actions;
  3. public abstract partial class BaseTargetActionComponent : BaseActionComponent
  4. {
  5. /// <summary>
  6. /// For entity- or map-targeting actions, if this is true the action will remain selected after it is used, so
  7. /// it can be continuously re-used. If this is false, the action will be deselected after one use.
  8. /// </summary>
  9. [DataField("repeat")] public bool Repeat;
  10. /// <summary>
  11. /// For entity- or map-targeting action, determines whether the action is deselected if the user doesn't click a valid target.
  12. /// </summary>
  13. [DataField("deselectOnMiss")] public bool DeselectOnMiss;
  14. /// <summary>
  15. /// Whether the action system should block this action if the user cannot actually access the target
  16. /// (unobstructed, in inventory, in backpack, etc). Some spells or abilities may want to disable this and
  17. /// implement their own checks.
  18. /// </summary>
  19. /// <remarks>
  20. /// Even if this is false, the <see cref="Range"/> will still be checked.
  21. /// </remarks>
  22. [DataField("checkCanAccess")] public bool CheckCanAccess = true;
  23. [DataField("range")] public float Range = SharedInteractionSystem.InteractionRange;
  24. /// <summary>
  25. /// If the target is invalid, this bool determines whether the left-click will default to performing a standard-interaction
  26. /// </summary>
  27. /// <remarks>
  28. /// Interactions will still be blocked if the target-validation generates a pop-up
  29. /// </remarks>
  30. [DataField("interactOnMiss")] public bool InteractOnMiss = false;
  31. /// <summary>
  32. /// If true, and if <see cref="ShowHandItemOverlay"/> is enabled, then this action's icon will be drawn by that
  33. /// over lay in place of the currently held item "held item".
  34. /// </summary>
  35. [DataField("targetingIndicator")] public bool TargetingIndicator = true;
  36. }