diff --git a/Content.Client/White/Animations/EmoteAnimationSystem.cs b/Content.Client/White/Animations/EmoteAnimationSystem.cs index e7f0aa7fd9..6828789c07 100644 --- a/Content.Client/White/Animations/EmoteAnimationSystem.cs +++ b/Content.Client/White/Animations/EmoteAnimationSystem.cs @@ -128,6 +128,9 @@ public class EmoteAnimationSystem : EntitySystem return; component.AnimationId = state.AnimationId; - _emoteList[component.AnimationId].Invoke(uid); + if (_emoteList.ContainsKey(component.AnimationId)) + { + _emoteList[component.AnimationId].Invoke(uid); + } } } diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index 5d4a2e8495..6ae597d48d 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -9,6 +9,7 @@ using Content.Server.Speech.EntitySystems; using Content.Server.Station.Components; using Content.Server.Station.Systems; using Content.Server.UtkaIntegration; +using Content.Server.White.Other.Speech; using Content.Shared.ActionBlocker; using Content.Shared.Administration; using Content.Shared.CCVar; @@ -431,6 +432,17 @@ public sealed partial class ChatSystem : SharedChatSystem var wrappedMessage = Loc.GetString("chat-manager-entity-say-wrap-message", ("entityName", name), ("message", message)); + //WD-EDIT + if (TryComp(source, out var comp)) + { + wrappedMessage = Loc.GetString(comp.ChatLoc, + ("entityName", name), + ("message", FormattedMessage.EscapeText(message)), + ("color", comp.ChatColor) + ); + } + //WD-EDIT + SendInVoiceRange(ChatChannel.Local, message, wrappedMessage, source, range); var ev = new EntitySpokeEvent(source, message, originalMessage, null, null); diff --git a/Content.Server/White/Other/Speech/VoiceOfGodComponent.cs b/Content.Server/White/Other/Speech/VoiceOfGodComponent.cs new file mode 100644 index 0000000000..dd0b622ccf --- /dev/null +++ b/Content.Server/White/Other/Speech/VoiceOfGodComponent.cs @@ -0,0 +1,23 @@ +namespace Content.Server.White.Other.Speech; + +[RegisterComponent] +public sealed class VoiceOfGodComponent : Component +{ + [DataField("sound"), ViewVariables(VVAccess.ReadWrite)] + public string Sound { get; set; } = "/Audio/White/Voice/voice_of_god.ogg"; + + [DataField("soundRange"), ViewVariables(VVAccess.ReadWrite)] + public float SoundRange { get; set; } = 8; + + [DataField("volume"), ViewVariables(VVAccess.ReadWrite)] + public int Volume { get; set; } = 5; + + [DataField("accent"), ViewVariables(VVAccess.ReadWrite)] + public bool Accent { get; set; } = true; + + [DataField("color"), ViewVariables(VVAccess.ReadWrite)] + public string ChatColor { get; set; } = Color.Red.ToHex(); + + [DataField("locale"), ViewVariables(VVAccess.ReadWrite)] + public string ChatLoc { get; set; } = "chat-manager-entity-say-god-wrap-message"; +} diff --git a/Content.Server/White/Other/Speech/VoiceOfGodSystem.cs b/Content.Server/White/Other/Speech/VoiceOfGodSystem.cs new file mode 100644 index 0000000000..eb16617475 --- /dev/null +++ b/Content.Server/White/Other/Speech/VoiceOfGodSystem.cs @@ -0,0 +1,37 @@ +using Content.Server.Speech; +using Robust.Shared.Audio; +using Robust.Shared.Player; + +namespace Content.Server.White.Other.Speech; + +public sealed class VoiceOfGodSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnAccent); + } + + private string Accentuate(VoiceOfGodComponent component, string message) + { + if (!string.IsNullOrEmpty(component.Sound)) + { + SoundSystem.Play(component.Sound, + Filter.Pvs(component.Owner, component.SoundRange), + component.Owner, + new AudioParams() + { + Volume = component.Volume + } + ); + } + + return component.Accent ? message.ToUpper() : message; + } + + private void OnAccent(EntityUid uid, VoiceOfGodComponent component, AccentGetEvent args) + { + args.Message = Accentuate(component, args.Message); + } +} diff --git a/Resources/Audio/White/Voice/voice_of_god.ogg b/Resources/Audio/White/Voice/voice_of_god.ogg new file mode 100644 index 0000000000..2a249bb818 Binary files /dev/null and b/Resources/Audio/White/Voice/voice_of_god.ogg differ diff --git a/Resources/Locale/ru-RU/white/reflect.ftl b/Resources/Locale/ru-RU/white/reflect.ftl deleted file mode 100644 index 49f31f81e5..0000000000 --- a/Resources/Locale/ru-RU/white/reflect.ftl +++ /dev/null @@ -1,2 +0,0 @@ -reflect-shot = Отразил! -carry-verb = Тащить на руках diff --git a/Resources/Locale/ru-RU/white/something.ftl b/Resources/Locale/ru-RU/white/something.ftl new file mode 100644 index 0000000000..5251cf540a --- /dev/null +++ b/Resources/Locale/ru-RU/white/something.ftl @@ -0,0 +1,6 @@ +reflect-shot = Отразил! + +carry-verb = Тащить на руках + +chat-manager-entity-say-god-wrap-message = {$entityName} командует, "[color={$color}]{$message}[/color]" +