From bb9f0d38930ceee86fbf529165bde2fb71e59e2f Mon Sep 17 00:00:00 2001 From: foxcurl <190527260+foxcurl@users.noreply.github.com> Date: Wed, 16 Apr 2025 18:13:14 -0400 Subject: [PATCH] Harpies' sound can only be changed by themselves (#3485) * Harpies' sound can only be changed by themselves (#1978) (cherry picked from commit 61b4d29974e05b5cf366e33cb76489150a6ac8f3) * comment --------- Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com> --- Content.Server/Instruments/SwappableInstrumentComponent.cs | 7 +++++++ Content.Server/Instruments/SwappableInstrumentSystem.cs | 3 +++ Resources/Prototypes/_DV/Entities/Mobs/Species/harpy.yml | 1 + 3 files changed, 11 insertions(+) diff --git a/Content.Server/Instruments/SwappableInstrumentComponent.cs b/Content.Server/Instruments/SwappableInstrumentComponent.cs index f8b2b97a10..6acf43151d 100644 --- a/Content.Server/Instruments/SwappableInstrumentComponent.cs +++ b/Content.Server/Instruments/SwappableInstrumentComponent.cs @@ -11,4 +11,11 @@ public sealed partial class SwappableInstrumentComponent : Component /// [DataField("instrumentList", required: true)] public Dictionary InstrumentList = new(); + + // Frontier: harpy instruments + /// + /// When true, only the instrument entity itself can swap its sound. + /// + [DataField] + public bool OnlySetBySelf; } diff --git a/Content.Server/Instruments/SwappableInstrumentSystem.cs b/Content.Server/Instruments/SwappableInstrumentSystem.cs index 9aef875cd6..81b3b2c100 100644 --- a/Content.Server/Instruments/SwappableInstrumentSystem.cs +++ b/Content.Server/Instruments/SwappableInstrumentSystem.cs @@ -25,6 +25,9 @@ public sealed class SwappableInstrumentSystem : EntitySystem if (!TryComp(uid, out var instrument)) return; + if (component.OnlySetBySelf && uid != args.User) // Frontier: restrict instrument changes + return; // Frontier: restrict instrument changes + var priority = 0; foreach (var entry in component.InstrumentList) { diff --git a/Resources/Prototypes/_DV/Entities/Mobs/Species/harpy.yml b/Resources/Prototypes/_DV/Entities/Mobs/Species/harpy.yml index b6c23584a6..221faf2b77 100644 --- a/Resources/Prototypes/_DV/Entities/Mobs/Species/harpy.yml +++ b/Resources/Prototypes/_DV/Entities/Mobs/Species/harpy.yml @@ -22,6 +22,7 @@ "Piano": {1: 0} "Church Organ": {19: 0} "Harp": {46: 0} + onlySetBySelf: true # Frontier - type: UserInterface interfaces: enum.InstrumentUiKey.Key: