Files
tbd-station-14/Content.Server/GameObjects/Components/Botany/LogComponent.cs
Swept e05698c027 Tags everything that should be tagged (#3372)
* GlassBeaker and FirelockElectronics

* Moves BaseItem

* The rest

* Indentations

* Functional

* for sloth

* Applied zum reviews

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2021-02-23 18:48:57 +11:00

37 lines
1.0 KiB
C#

using System.Threading.Tasks;
using Content.Shared.GameObjects.Components.Tag;
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Utility;
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Botany
{
[RegisterComponent]
public class LogComponent : Component, IInteractUsing
{
public override string Name => "Log";
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
{
if (!ActionBlockerSystem.CanInteract(eventArgs.User))
return false;
if (eventArgs.Using.HasTag("BotanySharp"))
{
for (var i = 0; i < 2; i++)
{
var plank = Owner.EntityManager.SpawnEntity("WoodPlank1", Owner.Transform.Coordinates);
plank.RandomOffset(0.25f);
}
Owner.Delete();
return true;
}
return false;
}
}
}