Adds wirecutter, powernet wire interaction (#34)
So it begins, the first of many interactions. Wirecutters cut powernet wires.
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user