using Content.Shared.DragDrop; using Content.Shared.Emoting; using Content.Shared.Interaction.Events; using Content.Shared.Item; using Robust.Shared.Serialization; namespace Content.Shared.Ghost { /// /// System for the . /// Prevents ghosts from interacting when is false. /// public abstract class SharedGhostSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnAttempt); SubscribeLocalEvent(OnAttempt); SubscribeLocalEvent(OnAttempt); SubscribeLocalEvent(OnAttempt); SubscribeLocalEvent(OnAttempt); } private void OnAttempt(EntityUid uid, SharedGhostComponent component, CancellableEntityEventArgs args) { if (!component.CanGhostInteract) args.Cancel(); } public void SetCanReturnToBody(SharedGhostComponent component, bool value) { component.CanReturnToBody = value; } } /// /// A client to server request to get places a ghost can warp to. /// Response is sent via /// [Serializable, NetSerializable] public sealed class GhostWarpsRequestEvent : EntityEventArgs { } /// /// A server to client response for a . /// Contains players, and locations a ghost can warp to /// [Serializable, NetSerializable] public sealed class GhostWarpsResponseEvent : EntityEventArgs { public GhostWarpsResponseEvent(List locations, Dictionary players) { Locations = locations; Players = players; } /// /// A list of location names that can be warped to. /// public List Locations { get; } /// /// A dictionary containing the entity id, and name of players that can be warped to. /// public Dictionary Players { get; } } /// /// A client to server request for their ghost to be warped to a location /// [Serializable, NetSerializable] public sealed class GhostWarpToLocationRequestEvent : EntityEventArgs { /// /// The location name to warp to. /// public string Name { get; } public GhostWarpToLocationRequestEvent(string locationName) { Name = locationName; } } /// /// A client to server request for their ghost to be warped to an entity /// [Serializable, NetSerializable] public sealed class GhostWarpToTargetRequestEvent : EntityEventArgs { public EntityUid Target { get; } public GhostWarpToTargetRequestEvent(EntityUid target) { Target = target; } } /// /// A client to server request for their ghost to return to body /// [Serializable, NetSerializable] public sealed class GhostReturnToBodyRequest : EntityEventArgs { } /// /// A server to client update with the available ghost role count /// [Serializable, NetSerializable] public sealed class GhostUpdateGhostRoleCountEvent : EntityEventArgs { public int AvailableGhostRoles { get; } public GhostUpdateGhostRoleCountEvent(int availableGhostRoleCount) { AvailableGhostRoles = availableGhostRoleCount; } } }