Merge branch 'master' into 2020-04-28-tool-component
# Conflicts: # Content.Server/GameObjects/Components/AnchorableComponent.cs # Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs # Content.Server/GameObjects/Components/Doors/AirlockComponent.cs # Content.Server/GameObjects/Components/Gravity/GravityGeneratorComponent.cs # Content.Server/GameObjects/Components/Interactable/Tools/CrowbarComponent.cs # Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs # Content.Server/GameObjects/Components/WiresComponent.cs
This commit is contained in:
@@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
/// Component to transfer power to nearby components, can create powernets and connect to nodes
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public class PowerTransferComponent : Component, IAttackBy
|
||||
public class PowerTransferComponent : Component, IInteractUsing
|
||||
{
|
||||
public override string Name => "PowerTransfer";
|
||||
|
||||
@@ -140,9 +140,9 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
return Parent != null && Parent.Dirty == false && !Regenerating;
|
||||
}
|
||||
|
||||
public bool AttackBy(AttackByEventArgs eventArgs)
|
||||
public bool InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.AttackWith.TryGetComponent(out ToolComponent tool)) return false;
|
||||
if (!eventArgs.Using.TryGetComponent(out ToolComponent tool)) return false;
|
||||
if (!tool.UseTool(eventArgs.User, Owner, ToolQuality.Cutting)) return false;
|
||||
|
||||
Owner.Delete();
|
||||
|
||||
Reference in New Issue
Block a user