Add teleporter logs (#13375)

This commit is contained in:
Chief-Engineer
2023-02-16 18:27:43 -06:00
committed by GitHub
parent d44730a267
commit 061d4de1e4
6 changed files with 52 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ namespace Content.Shared.Teleportation.Systems;
/// <summary>
/// Handles symmetrically linking two entities together, and removing links properly.
/// This does not do anything on its own (outside of deleting entities that have 0 links, if that option is true)
/// Systems can do whatever they please with the linked entities, such as <see cref="PortalSystem"/>.
/// Systems can do whatever they please with the linked entities, such as <see cref="SharedPortalSystem"/>.
/// </summary>
public sealed class LinkedEntitySystem : EntitySystem
{

View File

@@ -16,7 +16,7 @@ namespace Content.Shared.Teleportation.Systems;
/// <summary>
/// This handles teleporting entities through portals, and creating new linked portals.
/// </summary>
public sealed class PortalSystem : EntitySystem
public abstract class SharedPortalSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly INetManager _netMan = default!;
@@ -153,9 +153,16 @@ public sealed class PortalSystem : EntitySystem
projectile.IgnoreShooter = false;
}
LogTeleport(portal, subject, Transform(subject).Coordinates, target);
Transform(subject).Coordinates = target;
_audio.PlayPredicted(departureSound, portal, subject);
_audio.PlayPredicted(arrivalSound, subject, subject);
}
protected virtual void LogTeleport(EntityUid portal, EntityUid subject, EntityCoordinates source,
EntityCoordinates target)
{
}
}