Files
tbd-station-14/Content.Server/Weapons/Reflect/ReflectSystem.cs
Nim 4ed11ca73b Energy Shield (#16996)
* energy shield

* description edits

* shields protect

* small correction

* say no to asteroid bees

* fix

* BlockModifier

* fix

* tweak

* tweak

* ops

* fix

* Update RobustToolbox

* Revert "Update RobustToolbox"

This reverts commit 55be82fe537490367e0afaf86365b0e274e6597e.

* formatting
2023-06-22 00:08:58 -04:00

42 lines
1.3 KiB
C#

using Content.Server.Weapons.Melee.EnergySword;
using Content.Server.Weapons.Melee.ItemToggle;
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);
SubscribeLocalEvent<ReflectComponent, ItemToggleActivatedEvent>(ShieldEnableReflect);
SubscribeLocalEvent<ReflectComponent, ItemToggleDeactivatedEvent>(ShieldDisableReflect);
}
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);
}
private void ShieldEnableReflect(EntityUid uid, ReflectComponent comp, ref ItemToggleActivatedEvent args)
{
comp.Enabled = true;
Dirty(comp);
}
private void ShieldDisableReflect(EntityUid uid, ReflectComponent comp, ref ItemToggleDeactivatedEvent args)
{
comp.Enabled = false;
Dirty(comp);
}
}