Finish refactoring tools. Add multitools. (as in multiple tools in one)

This commit is contained in:
zumorica
2020-04-29 13:43:07 +02:00
parent ca5638badf
commit ff5549a0d1
37 changed files with 840 additions and 467 deletions

View File

@@ -0,0 +1,36 @@
using Content.Server.GameObjects.Components.Interactable;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Interactable;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.GameObjects.Components
{
[RegisterComponent]
public class AnchorableComponent : Component, IWrenchAct
{
public override string Name => "Anchorable";
public override void Initialize()
{
base.Initialize();
Owner.EnsureComponent<PhysicsComponent>();
}
public bool WrenchAct(WrenchActEventArgs eventArgs)
{
if (!Owner.TryGetComponent(out PhysicsComponent physics))
{
return false;
}
physics.Anchored = !physics.Anchored;
eventArgs.ToolComponent.PlayUseSound();
return true;
}
}
}