using Content.Server.Explosion.EntitySystems; using Robust.Shared.GameObjects; using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; using System.Collections.Generic; using Content.Shared.Explosion; namespace Content.Server.Explosion.Components { /// /// Raises a whenever an entity collides with a fixture attached to the owner of this component. /// [RegisterComponent] public sealed class TriggerOnProximityComponent : SharedTriggerOnProximityComponent { public const string FixtureID = "trigger-on-proximity-fixture"; public HashSet Colliding = new(); [DataField("shape", required: true)] public IPhysShape Shape { get; set; } = new PhysShapeCircle {Radius = 2}; /// /// How long the the proximity trigger animation plays for. /// [ViewVariables] [DataField("animationDuration")] public float AnimationDuration = 0.3f; /// /// Whether the entity needs to be anchored for the proximity to work. /// [ViewVariables] [DataField("requiresAnchored")] public bool RequiresAnchored { get; set; } = true; [ViewVariables] [DataField("enabled")] public bool Enabled = true; [ViewVariables(VVAccess.ReadWrite)] [DataField("cooldown")] public float Cooldown { get; set; } = 5f; /// /// How much cooldown has elapsed (if relevant). /// public float Accumulator = 0f; /// /// What speed should the other object be moving at to trigger the proximity fixture? /// [ViewVariables(VVAccess.ReadWrite)] [DataField("triggerSpeed")] public float TriggerSpeed { get; set; } = 3.5f; /// /// If this proximity is triggered should we continually repeat it? /// [DataField("repeating")] internal bool Repeating = true; } }