Files
tbd-station-14/Content.Server/Weapons/Reflect/ReflectSystem.cs

26 lines
787 B
C#

using Content.Server.Weapons.Melee.EnergySword;
using Content.Shared.Weapons.Reflect;
namespace Content.Server.Weapons.Reflect;
public sealed class ReflectSystem : SharedReflectSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ReflectComponent, EnergySwordActivatedEvent>(EnableReflect);
SubscribeLocalEvent<ReflectComponent, EnergySwordDeactivatedEvent>(DisableReflect);
}
private void EnableReflect(EntityUid uid, ReflectComponent comp, ref EnergySwordActivatedEvent args)
{
comp.Enabled = true;
Dirty(comp);
}
private void DisableReflect(EntityUid uid, ReflectComponent comp, ref EnergySwordDeactivatedEvent args)
{
comp.Enabled = false;
Dirty(comp);
}
}