Files
tbd-station-14/Content.Server/Chat/Systems/AnnounceOnSpawnSystem.cs
deltanedas 88119c6469 nar'sie fake (#20299)
* import narsie sprite

* narsie_rises audio

* rename SmokeDissipateSpawnComponent to SpawnOnDespawnComponent

* add AnnounceOnSpawn system

* oop

* NAR'SIE HAS RISEN

* suffix

* base prototype, changes

* fix

* mapinit

* downscale

* new toys

* singuloose

* still not fix

* honki sprite

* add honki spawn animation

* revert spawnondespawn change

* really revert

* use LocId for announceonspawn

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2023-12-06 20:24:33 -05:00

23 lines
692 B
C#

using Content.Server.Chat;
namespace Content.Server.Chat.Systems;
public sealed class AnnounceOnSpawnSystem : EntitySystem
{
[Dependency] private readonly ChatSystem _chat = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AnnounceOnSpawnComponent, MapInitEvent>(OnInit);
}
private void OnInit(EntityUid uid, AnnounceOnSpawnComponent comp, MapInitEvent args)
{
var message = Loc.GetString(comp.Message);
var sender = comp.Sender != null ? Loc.GetString(comp.Sender) : "Central Command";
_chat.DispatchGlobalAnnouncement(message, sender, playSound: true, comp.Sound, comp.Color);
}
}