Files
crystall-punk-14/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.Echoes.cs
Ed 72c9cb9014 Unstable demiplane update (#866)
* replace heat trigger to unsafe damage trigger

* end demiplane music

* timed demiplane modifier

* unhardcode some values

* demiplane crystal destruction waves

* time limit

* fixes

* Update CP14UniqueLootSystem.cs

* Update unstable_rift.yml

* tweks

* Update unstable_rift.yml
2025-02-09 17:18:24 +03:00

33 lines
857 B
C#

using Content.Server.Chat.Systems;
using Robust.Shared.Random;
namespace Content.Server._CP14.Demiplane;
public sealed partial class CP14DemiplaneSystem
{
private void InitEchoes()
{
SubscribeLocalEvent<EntitySpokeEvent>(OnSpeak);
}
private void OnSpeak(EntitySpokeEvent ev)
{
var map = Transform(ev.Source).MapUid;
if (!_demiplaneQuery.TryComp(map, out var demiplane))
return;
//Get random exit, and send message there
if (demiplane.ExitPoints.Count == 0)
return;
var exit = _random.Pick(demiplane.ExitPoints);
_chat.TrySendInGameICMessage(exit,
ev.Message,
InGameICChatType.Whisper,
ChatTransmitRange.NoGhosts,
nameOverride: Loc.GetString("cp14-demiplane-echoes"),
hideLog: true);
}
}