Use nav beacon locations for announcements (#26437)

* use nav beacon locations for announcements

* :thumbs_up:
This commit is contained in:
Nemanja
2024-03-28 01:53:18 -04:00
committed by GitHub
parent b064985f24
commit 766192f4b5
15 changed files with 231 additions and 98 deletions

View File

@@ -3,6 +3,7 @@ using Content.Server.Body.Systems;
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Explosion.Components;
using Content.Server.Flash;
using Content.Server.Pinpointer;
using Content.Shared.Flash.Components;
using Content.Server.Radio.EntitySystems;
using Content.Shared.Chemistry.Components;
@@ -31,6 +32,7 @@ using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Player;
using Content.Shared.Coordinates;
using Robust.Shared.Utility;
namespace Content.Server.Explosion.EntitySystems
{
@@ -67,6 +69,7 @@ namespace Content.Server.Explosion.EntitySystems
[Dependency] private readonly BodySystem _body = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly NavMapSystem _navMap = default!;
[Dependency] private readonly RadioSystem _radioSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
@@ -185,12 +188,7 @@ namespace Content.Server.Explosion.EntitySystems
return;
// Gets location of the implant
var ownerXform = Transform(uid);
var pos = ownerXform.MapPosition;
var x = (int) pos.X;
var y = (int) pos.Y;
var posText = $"({x}, {y})";
var posText = FormattedMessage.RemoveMarkup(_navMap.GetNearestBeaconString(uid));
var critMessage = Loc.GetString(component.CritMessage, ("user", implanted.ImplantedEntity.Value), ("position", posText));
var deathMessage = Loc.GetString(component.DeathMessage, ("user", implanted.ImplantedEntity.Value), ("position", posText));