From 0ae558db6407f321e4b97f0cfd275758c24ba59b Mon Sep 17 00:00:00 2001
From: Jabak <163307958+Jabaks@users.noreply.github.com>
Date: Sun, 29 Sep 2024 13:47:20 +0300
Subject: [PATCH] fucking upsteram
---
Content.Client/Lobby/UI/LobbyGui.xaml | 6 ----
.../Silicons/Borgs/SharedBorgSystem.cs | 31 ++++++++++++++-----
.../Mobs/Cyborgs/base_borg_chassis.yml | 3 ++
3 files changed, 26 insertions(+), 14 deletions(-)
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: