Make energy sword reflect projectiles and hitscan shots (#14029)
This commit is contained in:
26
Content.Server/Weapons/Reflect/ReflectSystem.cs
Normal file
26
Content.Server/Weapons/Reflect/ReflectSystem.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user