Files
wwdpublic/Content.Server/_White/Bark/BarkSystem.cs
Cinkafox 916d889fc4 - add: Bark (#827)
* - add: bark

* - tweak: Bark now in client side

* - add: bark config in options

* - add: migration prepare

* - add: Migrations

* - add: more barks

* - add: bark preference in character profile

* - add: knob

* - add: change value by mouse wheel

* - tweak: optimise WWDP thinks

* - tweak: improve NeoTabContainer optimisation

* - add: limit of barks

* - fix: кролькины фиксы

* - fix: change things in tab id

* Update Content.Client/_White/TTS/TTSSystem.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* - fix: спатисон дурак блин ты сломал что то..

* - fix: спатисонов фиксы

* Update Content.Server/_White/Bark/BarkSystem.cs

* - fix: буковки

* Apply suggestions from code review

---------

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-06 03:37:39 +10:00

59 lines
1.8 KiB
C#

using Content.Shared._White.Bark;
using Content.Shared._White.Bark.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Console;
using Robust.Shared.Player;
using BarkComponent = Content.Shared._White.Bark.Components.BarkComponent;
namespace Content.Server._White.Bark;
public sealed class BarkSystem : SharedBarkSystem
{
[Dependency] private readonly TransformSystem _transformSystem = default!;
public override void Bark(Entity<BarkComponent> entity, List<BarkData> barks)
{
var mapPos = _transformSystem.GetMapCoordinates(entity.Owner);
var filter = Filter.Empty().AddInRange(mapPos, 16f);
RaiseNetworkEvent(new EntityBarkEvent(GetNetEntity(entity), barks), filter);
}
}
public sealed class AddBarkCommand : IConsoleCommand
{
public string Command => "addbark";
public string Description => "add bark to self";
public string Help => Command + " uid prototype";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var entMan = IoCManager.Resolve<IEntityManager>();
if (args.Length < 2)
{
shell.WriteError("Small args count");
return;
}
if (!entMan.TryParseNetEntity(args[0], out var attachedEnt))
{
shell.WriteError($"Could not find attached entity " + args[0]);
return;
}
entMan.System<BarkSystem>().ApplyBark(attachedEnt.Value, args[1]);
}
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
{
if(args.Length == 1)
return
CompletionResult.FromHint("Uid");
if (args.Length == 2)
return CompletionResult.FromHintOptions(CompletionHelper.PrototypeIDs<BarkVoicePrototype>(), "bark prototype");
return CompletionResult.Empty;
}
}