CatStation/Content.Shared/Teleportation/Components/TeleportLocationsComponent.cs
Голубь d15d16651f
Teleport scroll and ninja bomb whitelist and blacklist (#40758)
* Teleport scroll whitelist

* Stupid

* review

review

* Update dat_fukken_disk.yml

* NinjaWhitelist

* uuuupdate

* Update station_beacon.yml

* Update emergency_amber.yml

* Update Resources/Prototypes/Entities/Markers/warp_point.yml

Co-authored-by: Errant <35878406+Errant-4@users.noreply.github.com>

* request

* Revert tags

* Apply suggestions from code review

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

---------

Co-authored-by: Errant <35878406+Errant-4@users.noreply.github.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2026-06-30 22:47:15 +00:00

79 lines
2.3 KiB
C#

using Content.Shared.Teleportation.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Content.Shared.Whitelist;
using Robust.Shared.Serialization;
namespace Content.Shared.Teleportation.Components;
// TODO: In the future assimilate ghost UI to use this.
/// <summary>
/// Used where you want an entity to display a list of player-safe teleport locations
/// They teleport to the location clicked
/// Looks for non Ghost-Only WarpPointComponents
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedTeleportLocationsSystem)), AutoGenerateComponentState]
public sealed partial class TeleportLocationsComponent : Component
{
/// <summary>
/// List of available warp points
/// </summary>
[DataField, AutoNetworkedField]
public HashSet<TeleportPoint> AvailableWarps = new();
/// <summary>
/// What should spawn as an effect when the user teleports?
/// </summary>
[DataField]
public EntProtoId? TeleportEffect;
/// <summary>
/// Should this close the BUI after teleport?
/// </summary>
[DataField]
public bool CloseAfterTeleport;
/// <summary>
/// Name of the Teleport Location menu
/// </summary>
[DataField]
public LocId Name;
/// <summary>
/// Should the user have some speech if they teleport?
/// If enabled it will be prepended to the location name.
/// So something like "I am going to" would become "I am going to (Bridge)"
/// </summary>
[DataField]
public LocId? Speech;
/// <summary>
/// Which warp points should be made available for teleportation?
/// </summary>
[DataField]
public EntityWhitelist? Whitelist;
/// <summary>
/// Which warp points should be made unavailable for teleportation?
/// </summary>
[DataField]
public EntityWhitelist? Blacklist;
}
/// <summary>
/// A teleport point, which has a location (the destination) and the entity that it represents.
/// </summary>
[Serializable, NetSerializable, DataDefinition]
public partial record struct TeleportPoint
{
[DataField]
public string Location;
[DataField]
public NetEntity TelePoint;
public TeleportPoint(string Location, NetEntity TelePoint)
{
this.Location = Location;
this.TelePoint = TelePoint;
}
}