1
0

RepulseAttractComponent.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Content.Shared.Physics;
  2. using Content.Shared.Whitelist;
  3. using Robust.Shared.GameStates;
  4. namespace Content.Shared.RepulseAttract;
  5. /// <summary>
  6. /// Used to repulse or attract entities away from the entity this is on
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(RepulseAttractSystem))]
  9. public sealed partial class RepulseAttractComponent : Component
  10. {
  11. /// <summary>
  12. /// How fast should the Repulsion/Attraction be?
  13. /// A positive value will repulse objects, a negative value will attract
  14. /// </summary>
  15. [DataField, AutoNetworkedField]
  16. public float Speed = 5.0f;
  17. /// <summary>
  18. /// How close do the entities need to be?
  19. /// </summary>
  20. [DataField, AutoNetworkedField]
  21. public float Range = 5.0f;
  22. /// <summary>
  23. /// What kind of entities should this effect apply to?
  24. /// </summary>
  25. [DataField, AutoNetworkedField]
  26. public EntityWhitelist? Whitelist;
  27. /// <summary>
  28. /// What collision layers should be excluded?
  29. /// The default excludes ghost mobs, revenants, the AI camera etc.
  30. /// </summary>
  31. [DataField, AutoNetworkedField]
  32. public CollisionGroup CollisionMask = CollisionGroup.GhostImpassable;
  33. }