mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 16:47:26 +00:00
41 lines
1.5 KiB
C#
41 lines
1.5 KiB
C#
using Content.Shared.Inventory.Events;
|
|
using Content.Shared.Tag;
|
|
using Content.Shared.Humanoid;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared._DV.Harpy;
|
|
|
|
public sealed class HarpyVisualsSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly TagSystem _tagSystem = default!;
|
|
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
|
|
|
|
private readonly ProtoId<TagPrototype> HarpyWingsTag = "HidesHarpyWings";
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<HarpySingerComponent, DidEquipEvent>(OnDidEquipEvent);
|
|
SubscribeLocalEvent<HarpySingerComponent, DidUnequipEvent>(OnDidUnequipEvent);
|
|
}
|
|
|
|
private void OnDidEquipEvent(EntityUid uid, HarpySingerComponent component, DidEquipEvent args)
|
|
{
|
|
if (args.Slot == "outerClothing" && _tagSystem.HasTag(args.Equipment, HarpyWingsTag))
|
|
{
|
|
_appearanceSystem.SetData(uid, HumanoidVisualLayers.RArmExtension, false); // Frontier: RArm<RArmExtension
|
|
_appearanceSystem.SetData(uid, HumanoidVisualLayers.Tail, false);
|
|
}
|
|
}
|
|
|
|
private void OnDidUnequipEvent(EntityUid uid, HarpySingerComponent component, DidUnequipEvent args)
|
|
{
|
|
if (args.Slot == "outerClothing" && _tagSystem.HasTag(args.Equipment, HarpyWingsTag))
|
|
{
|
|
_appearanceSystem.SetData(uid, HumanoidVisualLayers.RArmExtension, true); // Frontier: RArm<RArmExtension
|
|
_appearanceSystem.SetData(uid, HumanoidVisualLayers.Tail, true);
|
|
}
|
|
}
|
|
}
|