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>
This commit is contained in:
foxcurl
2025-04-16 22:13:14 +00:00
committed by GitHub
co-authored by Whatstone
parent 0397750902
commit bb9f0d3893
3 changed files with 11 additions and 0 deletions
@@ -11,4 +11,11 @@ public sealed partial class SwappableInstrumentComponent : Component
/// </summary>
[DataField("instrumentList", required: true)]
public Dictionary<string, (byte, byte)> InstrumentList = new();
// Frontier: harpy instruments
/// <summary>
/// When true, only the instrument entity itself can swap its sound.
/// </summary>
[DataField]
public bool OnlySetBySelf;
}
@@ -25,6 +25,9 @@ public sealed class SwappableInstrumentSystem : EntitySystem
if (!TryComp<InstrumentComponent>(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)
{
@@ -22,6 +22,7 @@
"Piano": {1: 0}
"Church Organ": {19: 0}
"Harp": {46: 0}
onlySetBySelf: true # Frontier
- type: UserInterface
interfaces:
enum.InstrumentUiKey.Key: