This commit is contained in:
rhailrake
2023-05-24 17:41:22 +06:00
committed by Aviu00
parent 514c7d0513
commit 2dd362fb65
7 changed files with 82 additions and 3 deletions

View File

@@ -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);
}
}
}

View File

@@ -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<VoiceOfGodComponent>(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);

View File

@@ -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";
}

View File

@@ -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<VoiceOfGodComponent, AccentGetEvent>(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);
}
}

Binary file not shown.

View File

@@ -1,2 +0,0 @@
reflect-shot = Отразил!
carry-verb = Тащить на руках

View File

@@ -0,0 +1,6 @@
reflect-shot = Отразил!
carry-verb = Тащить на руках
chat-manager-entity-say-god-wrap-message = {$entityName} командует, "[color={$color}]{$message}[/color]"