2023-01-02 19:58:25 -06:00
|
|
|
|
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>
|
2024-01-03 17:24:02 +11:00
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class PortalComponent : Component
|
2023-01-02 19:58:25 -06:00
|
|
|
|
{
|
|
|
|
|
|
/// <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>
|
2023-11-19 15:17:53 -05:00
|
|
|
|
[DataField("maxRandomRadius"), ViewVariables(VVAccess.ReadWrite)]
|
2023-01-03 01:53:16 -06:00
|
|
|
|
public float MaxRandomRadius = 7.0f;
|
2023-08-15 13:56:14 -07:00
|
|
|
|
|
|
|
|
|
|
/// <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>
|
2023-08-29 12:28:03 -04:00
|
|
|
|
[DataField("canTeleportToOtherMaps"), ViewVariables(VVAccess.ReadWrite)]
|
2023-08-15 13:56:14 -07:00
|
|
|
|
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>
|
2023-11-19 15:17:53 -05:00
|
|
|
|
[DataField("maxTeleportRadius"), ViewVariables(VVAccess.ReadWrite)]
|
2023-08-15 13:56:14 -07:00
|
|
|
|
public float? MaxTeleportRadius;
|
2023-11-15 13:23:40 +11:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Should we teleport randomly if nothing is linked.
|
|
|
|
|
|
/// </summary>
|
2023-11-19 15:17:53 -05:00
|
|
|
|
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
|
2023-11-15 13:23:40 +11:00
|
|
|
|
public bool RandomTeleport = true;
|
2023-01-02 19:58:25 -06:00
|
|
|
|
}
|