Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harpy Instrument Additions #184

Merged
merged 4 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Content.Server/Instruments/SwappableInstrumentComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true by default, meaning that ALL swappable instruments are affected by this change. You didn't modify the yaml prototypes of other instruments, meaning that all swappable instruments (synthesizers, guitars, etc) are affected by this change and cannot be swapped by anyone unless they get possessed by an admin...

You should make it false by default, and set it to true on MapInit in SingerSystem instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okie dokie

}
3 changes: 3 additions & 0 deletions Content.Server/Instruments/SwappableInstrumentSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ private void AddStyleVerb(EntityUid uid, SwappableInstrumentComponent component,
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)
{
Expand Down
3 changes: 3 additions & 0 deletions Resources/Prototypes/Traits/Misc/singer_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"Acoustic": {24: 0}
"Flute": {73: 0}
"Sax": {66: 0}
"Piano": {1: 0}
"Church Organ": {19: 0}
"Harp": {46: 0}
defaultInstrument: "Voice"
midiUi:
key: enum.InstrumentUiKey.Key
Expand Down
Loading