From 05d4b2793bf84647472e52911a12d6b222384d58 Mon Sep 17 00:00:00 2001 From: clusterfack Date: Tue, 13 Feb 2018 00:07:50 -0600 Subject: [PATCH] Adds wirecutter, powernet wire interaction (#34) So it begins, the first of many interactions. Wirecutters cut powernet wires. --- .../Components/Power/PowerTransferComponent.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs b/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs index d1f155e3ca..6e54451ffa 100644 --- a/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs @@ -1,15 +1,18 @@ -using SS14.Server.GameObjects; +using Content.Server.GameObjects.EntitySystems; +using SS14.Server.GameObjects; using SS14.Server.Interfaces.GameObjects; using SS14.Shared.GameObjects; using SS14.Shared.IoC; using System.Linq; +using SS14.Shared.Interfaces.GameObjects; +using Content.Server.GameObjects.Components.Interactable.Tools; namespace Content.Server.GameObjects.Components.Power { /// /// Component to transfer power to nearby components, can create powernets and connect to nodes /// - public class PowerTransferComponent : Component + public class PowerTransferComponent : Component, IAttackby { public override string Name => "PowerTransfer"; @@ -125,5 +128,15 @@ namespace Content.Server.GameObjects.Components.Power { 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; + } } }