Files
tbd-station-14/Content.Shared/Teleportation/Components/PortalComponent.cs
Kara 2e86f4c556 Portal sprite & behavior tweaks (#19179)
* Portal repalette

* Portal traversal verb + anchoring

* map restriction

* optional max distance checks if we decide to have them later

* lower pointlight energy slightly hopefully makes it less garish
2023-08-15 14:56:14 -06:00

51 lines
2.0 KiB
C#

using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Teleportation.Components;
/// <summary>
/// Marks an entity as being a 'portal' which teleports entities sent through it to linked entities.
/// Relies on <see cref="LinkedEntityComponent"/> being set up.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed class PortalComponent : Component
{
/// <summary>
/// Sound played on arriving to this portal, centered on the destination.
/// The arrival sound of the entered portal will play if the destination is not a portal.
/// </summary>
[DataField("arrivalSound")]
public SoundSpecifier ArrivalSound = new SoundPathSpecifier("/Audio/Effects/teleport_arrival.ogg");
/// <summary>
/// Sound played on departing from this portal, centered on the original portal.
/// </summary>
[DataField("departureSound")]
public SoundSpecifier DepartureSound = new SoundPathSpecifier("/Audio/Effects/teleport_departure.ogg");
/// <summary>
/// If no portals are linked, the subject will be teleported a random distance at maximum this far away.
/// </summary>
[DataField("maxRandomRadius")]
public float MaxRandomRadius = 7.0f;
/// <summary>
/// If false, this portal will fail to teleport and fizzle out if attempting to send an entity to a different map
/// </summary>
/// <remarks>
/// Shouldn't be able to teleport people to centcomm or the eshuttle from the station
/// </remarks>
[DataField("canTeleportToOtherMaps")]
public bool CanTeleportToOtherMaps = false;
/// <summary>
/// Maximum distance that portals can teleport to, in all cases. Mostly this matters for linked portals.
/// Null means no restriction on distance.
/// </summary>
/// <remarks>
/// Obviously this should strictly be larger than <see cref="MaxRandomRadius"/> (or null)
/// </remarks>
[DataField("maxTeleportRadius")]
public float? MaxTeleportRadius;
}