using Content.Shared.Physics; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Shared.Lightning.Components; /// /// Handles how lightning acts and is spawned. Use the ShootLightning method to fire lightning from one user to a target. /// public abstract class SharedLightningComponent : Component { /// /// Can this lightning arc? /// [ViewVariables(VVAccess.ReadWrite)] [DataField("canArc")] public bool CanArc; /// /// How much should lightning arc in total? /// Controls the amount of bolts that will spawn. /// [ViewVariables(VVAccess.ReadWrite)] [DataField("maxTotalArc")] public int MaxTotalArcs = 50; /// /// The prototype ID used for arcing bolts. Usually will be the same name as the main proto but it could be flexible. /// [ViewVariables(VVAccess.ReadWrite)] [DataField("lightningPrototype", customTypeSerializer:typeof(PrototypeIdSerializer))] public string LightningPrototype = "Lightning"; /// /// The target that the lightning will Arc to. /// [DataField("arcTarget")] public EntityUid? ArcTarget; /// /// How far should this lightning go? /// [ViewVariables(VVAccess.ReadWrite)] [DataField("maxLength")] public float MaxLength = 5f; /// /// List of targets that this collided with already /// [DataField("arcTargets")] public HashSet ArcTargets = new(); /// /// What should this arc to? /// [DataField("collisionMask")] public int CollisionMask = (int) (CollisionGroup.MobMask | CollisionGroup.MachineMask); }