* fix: Ботинки клоуна сново работают

* fix: Световое копье теперь исчезает если его передать
This commit is contained in:
Spatison
2024-07-30 03:13:05 +03:00
committed by GitHub
parent 74e1f3c618
commit 397e74079b
8 changed files with 115 additions and 96 deletions

View File

@@ -0,0 +1,31 @@
using Content.Shared._White.Animations;
using Content.Shared.Clothing.Components;
using Content.Shared.Inventory.Events;
namespace Content.Shared.Clothing.EntitySystems;
public sealed class WaddleClothingSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<WaddleWhenWornComponent, GotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<WaddleWhenWornComponent, GotUnequippedEvent>(OnGotUnequipped);
}
private void OnGotEquipped(EntityUid entity, WaddleWhenWornComponent comp, GotEquippedEvent args)
{
var waddleAnimComp = EnsureComp<WaddleAnimationComponent>(args.Equipee);
waddleAnimComp.AnimationLength = comp.AnimationLength;
waddleAnimComp.HopIntensity = comp.HopIntensity;
waddleAnimComp.RunAnimationLengthMultiplier = comp.RunAnimationLengthMultiplier;
waddleAnimComp.TumbleIntensity = comp.TumbleIntensity;
}
private void OnGotUnequipped(EntityUid entity, WaddleWhenWornComponent comp, GotUnequippedEvent args)
{
RemComp<WaddleAnimationComponent>(args.Equipee);
}
}