diff --git a/Content.Client/Lobby/UI/LobbyGui.xaml b/Content.Client/Lobby/UI/LobbyGui.xaml index b31b30d10b..8a0d445fed 100644 --- a/Content.Client/Lobby/UI/LobbyGui.xaml +++ b/Content.Client/Lobby/UI/LobbyGui.xaml @@ -96,12 +96,6 @@ ButtonText="Опции" Margin="0 7 0 7" /> - - _voices = new(); /// public override void Initialize() @@ -35,22 +37,35 @@ public abstract partial class SharedBorgSystem : EntitySystem SubscribeLocalEvent(OnInserted); SubscribeLocalEvent(OnRemoved); SubscribeLocalEvent(OnRefreshMovementSpeedModifiers); - SubscribeLocalEvent(RandomTTS); + + //Honk + SubscribeLocalEvent(RandomTTS); + GenerateVoiceList(); + //Honk InitializeRelay(); } - private void RandomTTS(EntityUid uid, SharedTTSComponent component, ComponentStartup args) + //Honk + private void RandomTTS(EntityUid uid, SharedTTSComponent component, ComponentInit args) { - if (TryComp(uid, out _)) + if (!HasComp(uid)) return; - var voiceList = PrototypeManager.EnumeratePrototypes().ToHashSet(); - var voice = RobustRandom.Pick(voiceList); - component.VoicePrototypeId = voice.ID; + var voiceId = RobustRandom.Pick(_voices); + component.VoicePrototypeId = voiceId.ID; + Dirty(uid, component); } + private void GenerateVoiceList() + { + _voices = PrototypeManager.EnumeratePrototypes() + .Where(x => x.BorgVoice) + .ToHashSet(); + } + //Honk + private void OnItemSlotInsertAttempt(EntityUid uid, BorgChassisComponent component, ref ItemSlotInsertAttemptEvent args) { if (args.Cancelled) diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index a05e50badd..052f35e99e 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -129,6 +129,9 @@ - type: TypingIndicator proto: robot - type: TTS + - type: Speech + speechVerb: Robotic + speechSounds: Borg - type: UnblockableSpeech - type: FootstepModifier footstepSoundCollection: