using Content.Shared.Chat.Prototypes; using Content.Shared.Whitelist; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; namespace Content.Shared.Chasm; /// /// Marks a component that will cause entities to fall into them on a step trigger activation /// [NetworkedComponent, RegisterComponent, Access(typeof(ChasmSystem))] public sealed partial class ChasmComponent : Component { /// /// Entities allowed to fall into the hole. If null, anything not on the blacklist can fall into the hole. If both /// are null, anything can. /// [DataField] public EntityWhitelist? Whitelist; /// /// Entities not allowed to fall into the hole. If null, anything on the whitelist can fall into the hole. If both /// are null, anything can. /// [DataField] public EntityWhitelist? Blacklist; /// /// Sound that should be played when an entity falls into the chasm /// [DataField] public SoundSpecifier FallingSound = new SoundPathSpecifier("/Audio/Effects/falling.ogg"); /// /// Optional emote that should play when an entity falls into the chasm. /// [DataField] public ProtoId? Emote = "Scream"; } /// /// This event is raised on a chasm when tries to start falling into it. This is used to allow /// systems an opportunity to cancel the falling for whatever reason. /// [ByRefEvent] public record struct EntityStartFallingAttemptEvent(EntityUid Faller) { public readonly EntityUid Faller = Faller; public bool Cancelled = false; } /// /// Raised on a chasm when it would cause an entity to fall but the chasm's white-/blacklist prevented it. /// [ByRefEvent] public readonly record struct FallerRejectedByChasmEvent(EntityUid Entity); /// /// This event is raised on an entity when it begins falling into . /// [ByRefEvent] public readonly record struct StartedFallingIntoChasmEvent(Entity FallingInto); /// /// This event is raised on a chasm when begins falling into it. /// [ByRefEvent] public readonly record struct EntityStartedFallingIntoChasmEvent(Entity Faller); /// /// This event is raised on an entity when it has finished falling into , just before it is deleted. /// [ByRefEvent] public readonly record struct CompletedFallingIntoChasmEvent(Entity FellInto); /// /// This event is raised on a chasm when has finished falling into it, just before it is deleted. /// [ByRefEvent] public readonly record struct EntityCompletedFallingIntoChasmEvent(Entity Faller);