diff --git a/Content.Server/Administration/Commands/OwoifyCommand.cs b/Content.Server/Administration/Commands/OwoifyCommand.cs new file mode 100644 index 0000000000..f02191407c --- /dev/null +++ b/Content.Server/Administration/Commands/OwoifyCommand.cs @@ -0,0 +1,46 @@ +using Content.Server.Speech.EntitySystems; +using Content.Shared.Administration; +using Robust.Shared.Console; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; +using Robust.Shared.Localization; +using Robust.Shared.Random; + +namespace Content.Server.Administration.Commands; + +[AdminCommand(AdminFlags.Fun)] +public class OwoifyCommand : IConsoleCommand +{ + public string Command => "owoify"; + + public string Description => "For when you need everything to be cat. Uses OwOAccent's formatting on the name and description of an entity."; + + public string Help => "owoify "; + + public void Execute(IConsoleShell shell, string argStr, string[] args) + { + if (args.Length != 1) + { + shell.WriteLine(Loc.GetString("shell-wrong-arguments-number")); + return; + } + + var entityManager = IoCManager.Resolve(); + + if (!int.TryParse(args[0], out var targetId)) + { + shell.WriteLine(Loc.GetString("shell-argument-must-be-number")); + return; + } + + var eUid = new EntityUid(targetId); + + var meta = entityManager.GetComponent(eUid); + + var random = IoCManager.Resolve(); + var owoSys = EntitySystem.Get(); + + meta.EntityName = owoSys.Accentuate(meta.EntityName); + meta.EntityDescription = owoSys.Accentuate(meta.EntityDescription); + } +} diff --git a/Content.Server/Speech/EntitySystems/OwOAccentSystem.cs b/Content.Server/Speech/EntitySystems/OwOAccentSystem.cs index 5b7cf5499f..4ebb8beff3 100644 --- a/Content.Server/Speech/EntitySystems/OwOAccentSystem.cs +++ b/Content.Server/Speech/EntitySystems/OwOAccentSystem.cs @@ -19,8 +19,6 @@ namespace Content.Server.Speech.EntitySystems { "you", "wu" }, }; - private string RandomFace => _random.Pick(Faces); - public override void Initialize() { SubscribeLocalEvent(OnAccent); @@ -33,7 +31,7 @@ namespace Content.Server.Speech.EntitySystems message = message.Replace(word, repl); } - return message.Replace("!", RandomFace) + return message.Replace("!", _random.Pick(Faces)) .Replace("r", "w").Replace("R", "W") .Replace("l", "w").Replace("L", "W"); }