Чё я нахуй сделал
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Access.Components;
|
||||
using System.Linq;
|
||||
using Content.Shared._White.TTS;
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
@@ -7,6 +8,8 @@ using Content.Shared.PowerCell.Components;
|
||||
using Content.Shared.Silicons.Borgs.Components;
|
||||
using Content.Shared.Wires;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Shared.Silicons.Borgs;
|
||||
|
||||
@@ -30,10 +33,21 @@ public abstract partial class SharedBorgSystem : EntitySystem
|
||||
SubscribeLocalEvent<BorgChassisComponent, EntInsertedIntoContainerMessage>(OnInserted);
|
||||
SubscribeLocalEvent<BorgChassisComponent, EntRemovedFromContainerMessage>(OnRemoved);
|
||||
SubscribeLocalEvent<BorgChassisComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeedModifiers);
|
||||
SubscribeLocalEvent<SharedTTSComponent, ComponentStartup>(RandomTTS);
|
||||
|
||||
InitializeRelay();
|
||||
}
|
||||
|
||||
private void RandomTTS(EntityUid uid, SharedTTSComponent component, ComponentStartup args)
|
||||
{
|
||||
if (TryComp<BorgChassisComponent>(uid, out var borgChassis) && borgChassis.Initialized)
|
||||
{
|
||||
var voices = IoCManager.Resolve<IPrototypeManager>().EnumeratePrototypes<TTSBorgVoicePrototype>().ToList();
|
||||
var voice = IoCManager.Resolve<IRobustRandom>().Pick(voices);
|
||||
component.VoicePrototypeId = voice.ID;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnItemSlotInsertAttempt(EntityUid uid, BorgChassisComponent component, ref ItemSlotInsertAttemptEvent args)
|
||||
{
|
||||
if (args.Cancelled)
|
||||
|
||||
@@ -34,3 +34,25 @@ public sealed class TTSVoicePrototype : IPrototype
|
||||
[DataField]
|
||||
public bool BorgVoice { get; }
|
||||
}
|
||||
|
||||
[Prototype("ttsBorgVoice")]
|
||||
public sealed class TTSBorgVoicePrototype : IPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[DataField]
|
||||
public string Name { get; } = string.Empty;
|
||||
|
||||
[DataField(required: true)]
|
||||
public Sex Sex { get; }
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField(required: true)]
|
||||
public string Speaker { get; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the species is available "at round start" (In the character editor)
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool RoundStart { get; } = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user