Files
crystall-punk-14/Content.Shared/Trigger/Components/Effects/RepulseAttractOnTriggerComponent.cs

40 lines
1.3 KiB
C#
Raw Permalink Normal View History

using Content.Shared.Physics;
using Content.Shared.Whitelist;
2025-08-03 21:20:37 +02:00
using Robust.Shared.GameStates;
2025-08-03 21:20:37 +02:00
namespace Content.Shared.Trigger.Components.Effects;
/// <summary>
2025-08-03 21:20:37 +02:00
/// Generates a gravity pulse/repulse using the RepulseAttractComponent around the entity when triggered.
/// If TargetUser is true their location will be used instead.
/// </summary>
2025-08-03 21:20:37 +02:00
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class RepulseAttractOnTriggerComponent : BaseXOnTriggerComponent
{
/// <summary>
/// How fast should the Repulsion/Attraction be?
2025-08-03 21:20:37 +02:00
/// A positive value will repulse objects, a negative value will attract.
/// </summary>
2025-08-03 21:20:37 +02:00
[DataField, AutoNetworkedField]
public float Speed = 5.0f;
/// <summary>
/// How close do the entities need to be?
/// </summary>
2025-08-03 21:20:37 +02:00
[DataField, AutoNetworkedField]
public float Range = 5.0f;
/// <summary>
/// What kind of entities should this effect apply to?
/// </summary>
2025-08-03 21:20:37 +02:00
[DataField, AutoNetworkedField]
public EntityWhitelist? Whitelist;
/// <summary>
/// What collision layers should be excluded?
/// The default excludes ghost mobs, revenants, the AI camera etc.
/// </summary>
2025-08-03 21:20:37 +02:00
[DataField, AutoNetworkedField]
public CollisionGroup CollisionMask = CollisionGroup.GhostImpassable;
}