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 18:13:14 -04:00 committed by GitHub
parent 0397750902
commit bb9f0d3893
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions

View File

@ -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;
}

View File

@ -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)
{

View File

@ -22,6 +22,7 @@
"Piano": {1: 0}
"Church Organ": {19: 0}
"Harp": {46: 0}
onlySetBySelf: true # Frontier
- type: UserInterface
interfaces:
enum.InstrumentUiKey.Key: