diff --git a/Content.Server/DeltaV/Implants/SyrinxImplantComponent.cs b/Content.Server/DeltaV/Implants/SyrinxImplantComponent.cs
deleted file mode 100644
index c87d5859d34..00000000000
--- a/Content.Server/DeltaV/Implants/SyrinxImplantComponent.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace Content.Server.DeltaV.Implants;
-
-///
-/// Gives the user a built-in voice changer.
-/// Defaults to your actual name instead of Unknown.
-///
-[RegisterComponent, Access(typeof(SyrinxImplantSystem))]
-public sealed partial class SyrinxImplantComponent : Component
-{
- ///
- /// Whether the user already had VoiceOverrideComponent.
- /// Used to not break other voice overriding things.
- ///
- [DataField]
- public bool Existing;
-}
diff --git a/Content.Server/DeltaV/Implants/SyrinxImplantSystem.cs b/Content.Server/DeltaV/Implants/SyrinxImplantSystem.cs
index 949eadaf14e..6393eb6a249 100644
--- a/Content.Server/DeltaV/Implants/SyrinxImplantSystem.cs
+++ b/Content.Server/DeltaV/Implants/SyrinxImplantSystem.cs
@@ -1,115 +1,23 @@
-using Content.Server.Administration.Logs;
-using Content.Server.Implants;
-using Content.Server.Speech.Components;
-using Content.Shared.Database;
-using Content.Shared.DeltaV.Implants;
+using Content.Server.VoiceMask;
using Content.Shared.Implants;
-using Content.Shared.Inventory;
-using Content.Shared.Popups;
-using Content.Shared.Preferences;
-using Content.Shared.Speech;
-using Content.Shared.VoiceMask;
-using Robust.Shared.Prototypes;
-namespace Content.Server.DeltaV.Implants;
+namespace Content.Server.Implants;
-public sealed class SyrinxImplantSystem : EntitySystem
+public sealed class SubdermalBionicSyrinxImplantSystem : EntitySystem
{
- [Dependency] private readonly IAdminLogManager _adminLogger = default!;
- [Dependency] private readonly IPrototypeManager _proto = default!;
- [Dependency] private readonly SharedPopupSystem _popup = default!;
- [Dependency] private readonly SharedUserInterfaceSystem _ui = default!;
-
public override void Initialize()
{
base.Initialize();
- SubscribeLocalEvent(OnImplanted);
- SubscribeLocalEvent(OnRemoved);
- SubscribeLocalEvent(OnChangeName);
- SubscribeLocalEvent(OnChangeVerb);
- SubscribeLocalEvent(OpenUI);
- }
-
- private void OnImplanted(Entity ent, ref ImplantImplantedEvent args)
- {
- if (args.Implanted is not {} user)
- return;
-
- ent.Comp.Existing = HasComp(user);
-
- var voice = EnsureComp(user);
- voice.NameOverride = Name(user);
- }
-
- private void OnRemoved(Entity ent, ref ImplantRemovedEvent args)
- {
- if (args.Implanted is not {} user)
- return;
-
- if (ent.Comp.Existing && TryComp(user, out var voice))
- voice.NameOverride = Name(user);
- else
- RemComp(user);
- }
-
- private void OnChangeVerb(Entity ent, ref VoiceMaskChangeVerbMessage msg)
- {
- var user = msg.Actor;
- if (!TryComp(user, out var voice))
- return;
-
- if (msg.Verb is {} id && !_proto.HasIndex(id))
- return;
-
- voice.SpeechVerbOverride = msg.Verb;
- // verb is only important to metagamers so no need to log as opposed to name
-
- _popup.PopupEntity(Loc.GetString("voice-mask-popup-success"), ent, user);
-
- UpdateUI(ent, voice);
- }
-
- ///
- /// Copy from VoiceMaskSystem, adapted to work with SyrinxImplantComponent.
- ///
- private void OnChangeName(Entity ent, ref VoiceMaskChangeNameMessage msg)
- {
- var user = msg.Actor;
- if (!TryComp(user, out var voice))
- return;
-
- if (msg.Name.Length > HumanoidCharacterProfile.MaxNameLength || msg.Name.Length <= 0)
- {
- _popup.PopupEntity(Loc.GetString("voice-mask-popup-failure"), user, user, PopupType.SmallCaution);
- return;
- }
-
- voice.NameOverride = msg.Name.Trim();
- _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(user):player} set voice of {ToPrettyString(ent):mask}: {voice.NameOverride}");
-
- _popup.PopupEntity(Loc.GetString("voice-mask-popup-success"), user, user);
-
- UpdateUI(ent, voice);
- }
-
- ///
- /// Copy from VoiceMaskSystem, adapted to work with SyrinxImplantComponent.
- ///
- private void UpdateUI(EntityUid uid, VoiceOverrideComponent voice)
- {
- var state = new VoiceMaskBuiState(voice.NameOverride ?? Loc.GetString("voice-mask-default-name-override"), voice.SpeechVerbOverride);
- _ui.SetUiState(uid, VoiceMaskUIKey.Key, state);
+ SubscribeLocalEvent(OnInsert);
}
- private void OpenUI(SyrinxImplantSetNameEvent args)
+ private void OnInsert(Entity ent, ref ImplantImplantedEvent args)
{
- var user = args.Performer;
- if (!TryComp(user, out var voice))
+ if (!args.Implanted.HasValue)
return;
- var uid = args.Action.Comp.Container!.Value;
- _ui.TryOpenUi(uid, VoiceMaskUIKey.Key, user);
- UpdateUI(uid, voice);
+ // Update the name so it's the entities default name. You can't take it off like a voice mask so it's important!
+ ent.Comp.VoiceMaskName = Name(args.Implanted.Value);
}
}
diff --git a/Content.Server/VoiceMask/VoiceMaskSystem.cs b/Content.Server/VoiceMask/VoiceMaskSystem.cs
index 47ea98d2ccf..18b83870849 100644
--- a/Content.Server/VoiceMask/VoiceMaskSystem.cs
+++ b/Content.Server/VoiceMask/VoiceMaskSystem.cs
@@ -3,6 +3,7 @@
using Content.Shared.Chat;
using Content.Shared.Clothing;
using Content.Shared.Database;
+using Content.Shared.Implants;
using Content.Shared.Inventory;
using Content.Shared.Popups;
using Content.Shared.Preferences;
@@ -24,6 +25,7 @@ public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent>(OnTransformSpeakerName);
+ SubscribeLocalEvent>(OnTransformSpeakerNameImplant);
SubscribeLocalEvent(OnChangeName);
SubscribeLocalEvent(OnChangeVerb);
SubscribeLocalEvent(OnEquip);
@@ -36,6 +38,13 @@ private void OnTransformSpeakerName(Entity entity, ref Inven
args.Args.SpeechVerb = entity.Comp.VoiceMaskSpeechVerb ?? args.Args.SpeechVerb;
}
+ // Delta-v specific for implants
+ private void OnTransformSpeakerNameImplant(Entity entity, ref ImplantRelayEvent args)
+ {
+ args.Event.VoiceName = GetCurrentVoiceName(entity);
+ args.Event.SpeechVerb = entity.Comp.VoiceMaskSpeechVerb ?? args.Event.SpeechVerb;
+ }
+
#region User inputs from UI
private void OnChangeVerb(Entity entity, ref VoiceMaskChangeVerbMessage msg)
{
diff --git a/Content.Shared/DeltaV/Implants/SyrinxImplantSetNameEvent.cs b/Content.Shared/DeltaV/Implants/SyrinxImplantSetNameEvent.cs
deleted file mode 100644
index ca4bdedce25..00000000000
--- a/Content.Shared/DeltaV/Implants/SyrinxImplantSetNameEvent.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using Content.Shared.Actions;
-
-namespace Content.Shared.DeltaV.Implants;
-
-///
-/// Opens the Syrinx ui to set name/verb when used.
-///
-public sealed partial class SyrinxImplantSetNameEvent : InstantActionEvent;
diff --git a/Content.Shared/Implants/SharedSubdermalImplantSystem.cs b/Content.Shared/Implants/SharedSubdermalImplantSystem.cs
index 97deff49260..afdd9196909 100644
--- a/Content.Shared/Implants/SharedSubdermalImplantSystem.cs
+++ b/Content.Shared/Implants/SharedSubdermalImplantSystem.cs
@@ -1,5 +1,6 @@
using System.Linq;
using Content.Shared.Actions;
+using Content.Shared.Chat; // Delta-v
using Content.Shared.Implants.Components;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
@@ -29,6 +30,7 @@ public override void Initialize()
SubscribeLocalEvent(RelayToImplantEvent);
SubscribeLocalEvent(RelayToImplantEvent);
SubscribeLocalEvent(RelayToImplantEvent);
+ SubscribeLocalEvent(RelayToImplantEvent); // Delta-v
}
private void OnInsert(EntityUid uid, SubdermalImplantComponent component, EntGotInsertedIntoContainerMessage args)
diff --git a/Resources/Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml b/Resources/Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml
index d3daae5e4d3..e02b1697e41 100644
--- a/Resources/Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml
+++ b/Resources/Prototypes/DeltaV/Entities/Mobs/Species/harpy.yml
@@ -221,4 +221,4 @@
- type: InstantAction
icon: DeltaV/Interface/Actions/harpy_syrinx.png
itemIconStyle: BigAction
- event: !type:SyrinxImplantSetNameEvent
+ event: !type:VoiceMaskSetNameEvent
diff --git a/Resources/Prototypes/DeltaV/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/DeltaV/Entities/Objects/Misc/subdermal_implants.yml
index 3aa0f806520..65e29a4a75e 100644
--- a/Resources/Prototypes/DeltaV/Entities/Objects/Misc/subdermal_implants.yml
+++ b/Resources/Prototypes/DeltaV/Entities/Objects/Misc/subdermal_implants.yml
@@ -9,12 +9,12 @@
implantAction: ActionSyrinxChangeVoiceMask
whitelist:
components:
- - HarpySinger
+ - HarpySinger # Ensure this is only for harpies and if this component gets renamed, CHANGE IT TO THE NEW VALUE!!!
+ - type: VoiceMask
- type: UserInterface
interfaces:
enum.VoiceMaskUIKey.Key:
type: VoiceMaskBoundUserInterface
- - type: SyrinxImplant
- type: entity
categories: [ HideSpawnMenu, Spawner ]