Files
wwdpublic/Content.Shared/DeltaV/Harpy/HarpyVisualsSystem.cs
Mnemotechnican 441dee258c Convert Harpy Singing Into a Trait (#714)
# Description
Adds a new trait that lets characters play midi without needing an
instrument.

Singer a 1-point positive trait. For now it's only available for vulps
and felinids as they are naturally more vocal than other species.

Also refactored harpy singing system a bit.

# TODO

- [X] Find out whatever causes this. Not critical, but probably should
be fixed...
<details><p>


![image](https://github.com/user-attachments/assets/8e0a6bf5-5fa3-4a0a-8937-2931dfe4ee62)

</p></details>

<details><summary><h1>Media</h1></summary>
<p>

Outdated


![image](https://github.com/user-attachments/assets/018b6cf3-d510-46e2-8c38-4bd49e1929bd)


![image](https://github.com/user-attachments/assets/f27bd451-b3c2-4a22-ab50-35c2f4ecbcb3)

</p>
</details>

# Changelog
🆑
- add: Added a new positive trait - singer. It allows you to play midi
songs without an instrument, similarly to harpies.

---------

Signed-off-by: Mnemotechnican <69920617+Mnemotechnician@users.noreply.github.com>
Co-authored-by: Danger Revolution! <142105406+DangerRevolution@users.noreply.github.com>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
2024-08-15 07:06:25 +01:00

41 lines
1.6 KiB
C#

using Content.Shared.Inventory.Events;
using Content.Shared.Tag;
using Content.Shared.Humanoid;
namespace Content.Shared.DeltaV.Harpy;
public sealed class HarpyVisualsSystem : EntitySystem
{
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly SharedHumanoidAppearanceSystem _humanoidSystem = default!;
[ValidatePrototypeId<TagPrototype>]
private const string HarpyWingsTag = "HidesHarpyWings";
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<Traits.Assorted.Components.SingerComponent, DidEquipEvent>(OnDidEquipEvent);
SubscribeLocalEvent<Traits.Assorted.Components.SingerComponent, DidUnequipEvent>(OnDidUnequipEvent);
}
private void OnDidEquipEvent(EntityUid uid, Traits.Assorted.Components.SingerComponent component, DidEquipEvent args)
{
if (args.Slot == "outerClothing" && _tagSystem.HasTag(args.Equipment, HarpyWingsTag))
{
_humanoidSystem.SetLayerVisibility(uid, HumanoidVisualLayers.RArm, false);
_humanoidSystem.SetLayerVisibility(uid, HumanoidVisualLayers.Tail, false);
}
}
private void OnDidUnequipEvent(EntityUid uid, Traits.Assorted.Components.SingerComponent component, DidUnequipEvent args)
{
if (args.Slot == "outerClothing" && _tagSystem.HasTag(args.Equipment, HarpyWingsTag))
{
_humanoidSystem.SetLayerVisibility(uid, HumanoidVisualLayers.RArm, true);
_humanoidSystem.SetLayerVisibility(uid, HumanoidVisualLayers.Tail, true);
}
}
}