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

Lyre Birb Trait #1747

Merged
merged 1 commit into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 7 additions & 2 deletions Content.Client/Traits/SingerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
using Content.Client.Instruments;
using Content.Shared.Instruments;
using Content.Shared.Traits.Assorted.Prototypes;
using Content.Shared.Traits.Assorted.Systems;

namespace Content.Client.Traits;

public sealed class SingerSystem : SharedSingerSystem
{
protected override SharedInstrumentComponent EnsureInstrumentComp(EntityUid uid)
protected override SharedInstrumentComponent EnsureInstrumentComp(EntityUid uid, SingerInstrumentPrototype singer)
{
return EnsureComp<InstrumentComponent>(uid); // I hate this, but it's the only way.
var instrumentComp = EnsureComp<InstrumentComponent>(uid);
instrumentComp.AllowPercussion = singer.AllowPercussion;
instrumentComp.AllowProgramChange = singer.AllowProgramChange;

return instrumentComp;
}
}
9 changes: 7 additions & 2 deletions Content.Server/Traits/Assorted/SingerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,16 @@ public override void Initialize()
SubscribeLocalEvent<SingerComponent, OpenUiActionEvent>(OnInstrumentOpen, before: [typeof(ActivatableUISystem)]);
}

protected override SharedInstrumentComponent EnsureInstrumentComp(EntityUid uid)
protected override SharedInstrumentComponent EnsureInstrumentComp(EntityUid uid, SingerInstrumentPrototype singer)
{
return EnsureComp<InstrumentComponent>(uid);
var instrumentComp = EnsureComp<InstrumentComponent>(uid);
instrumentComp.AllowPercussion = singer.AllowPercussion;
instrumentComp.AllowProgramChange = singer.AllowProgramChange;

return instrumentComp;
}


protected override void SetUpSwappableInstrument(EntityUid uid, SingerInstrumentPrototype singer)
{
if (singer.InstrumentList.Count <= 1)
Expand Down
1 change: 0 additions & 1 deletion Content.Shared/Instruments/SharedInstrumentComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
namespace Content.Shared.Instruments;

[NetworkedComponent]
[Access(typeof(SharedInstrumentSystem))]
public abstract partial class SharedInstrumentComponent : Component
{
[ViewVariables]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ public sealed partial class SingerInstrumentPrototype : IPrototype
// The below is server only, as it uses a server-BUI event !type
[DataField(serverOnly: true, required: true)]
public EntProtoId MidiActionId;

[DataField]
public bool AllowPercussion;

[DataField]
public bool AllowProgramChange;
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void OnStartup(Entity<SingerComponent> ent, ref ComponentStartup args)

_actionsSystem.AddAction(ent, ref ent.Comp.MidiAction, ent.Comp.MidiActionId);

var instrumentComp = EnsureInstrumentComp(ent);
var instrumentComp = EnsureInstrumentComp(ent, singer);
var defaultData = singer.InstrumentList[singer.DefaultInstrument];
_instrument.SetInstrumentProgram(ent.Owner, instrumentComp, defaultData.Item1, defaultData.Item2);
SetUpSwappableInstrument(ent, singer);
Expand Down Expand Up @@ -92,5 +92,5 @@ protected virtual void SetUpSwappableInstrument(EntityUid uid, SingerInstrumentP
/// <summary>
/// Ensures an InstrumentComponent on the entity. Uses client-side comp on client and server-side comp on the server.
/// </summary>
protected abstract SharedInstrumentComponent EnsureInstrumentComp(EntityUid uid);
protected abstract SharedInstrumentComponent EnsureInstrumentComp(EntityUid uid, SingerInstrumentPrototype singer);
}
7 changes: 6 additions & 1 deletion Resources/Locale/en-US/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -540,5 +540,10 @@ trait-description-ThermographicVision =
biological life forms. It can even detect individuals through the walls of a station.

trait-name-ShadowkinBlackeye = Blackeye
trait-description-ShadowkinBlackeye =
trait-description-ShadowkinBlackeye =
You lose your special Shadowkin powers & respect amongst your peers, in return for some points. Effectively, you are only a Shadowkin in name, not in practice.

trait-name-LyreBird = Lyre Bird
trait-description-LyreBird =
Your natural talent for mimicry vastly exceeds that of other Harpies. You have the ability to perfectly imitate songs in their entirety.
Be your own full symphony orchestra, jazz group, or metal band.
10 changes: 10 additions & 0 deletions Resources/Prototypes/Traits/Misc/singer_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
midiUi: Key
midiActionId: ActionHarpyPlayMidi

- type: SingerInstrument
id: HarpySingerAll
instrumentList:
"Lyresong": {52: 0}
defaultInstrument: "Lyresong"
midiUi: Key
midiActionId: ActionHarpyPlayMidi
allowPercussion: true
allowProgramChange: true

- type: SingerInstrument
id: NormalSinger
instrumentList:
Expand Down
14 changes: 14 additions & 0 deletions Resources/Prototypes/Traits/skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,20 @@
- type: Singer
proto: NormalSinger

- type: trait
id: LyreBird
category: Auditory
points: -10
requirements:
- !type:CharacterSpeciesRequirement
species:
- Harpy
functions:
- !type:TraitReplaceComponent
components:
- type: Singer
proto: HarpySingerAll

- type: trait
id: LatentPsychic
category: Mental
Expand Down
Loading