Adds wirecutter, powernet wire interaction (#34)

So it begins, the first of many interactions. Wirecutters cut powernet wires.
This commit is contained in:
clusterfack
2018-02-13 00:07:50 -06:00
committed by GitHub
parent cf29e4b7bd
commit 05d4b2793b

View File

@@ -1,15 +1,18 @@
using SS14.Server.GameObjects; using Content.Server.GameObjects.EntitySystems;
using SS14.Server.GameObjects;
using SS14.Server.Interfaces.GameObjects; using SS14.Server.Interfaces.GameObjects;
using SS14.Shared.GameObjects; using SS14.Shared.GameObjects;
using SS14.Shared.IoC; using SS14.Shared.IoC;
using System.Linq; using System.Linq;
using SS14.Shared.Interfaces.GameObjects;
using Content.Server.GameObjects.Components.Interactable.Tools;
namespace Content.Server.GameObjects.Components.Power namespace Content.Server.GameObjects.Components.Power
{ {
/// <summary> /// <summary>
/// Component to transfer power to nearby components, can create powernets and connect to nodes /// Component to transfer power to nearby components, can create powernets and connect to nodes
/// </summary> /// </summary>
public class PowerTransferComponent : Component public class PowerTransferComponent : Component, IAttackby
{ {
public override string Name => "PowerTransfer"; public override string Name => "PowerTransfer";
@@ -125,5 +128,15 @@ namespace Content.Server.GameObjects.Components.Power
{ {
return Parent != null && Parent.Dirty == false && !Regenerating; return Parent != null && Parent.Dirty == false && !Regenerating;
} }
public bool Attackby(IEntity user, IEntity attackwith)
{
if(attackwith.TryGetComponent(out WirecutterComponent wirecutter))
{
Owner.Delete();
return true;
}
return false;
}
} }
} }