ECS botany except for plantholder (#6466)

This commit is contained in:
mirrorcult
2022-02-06 13:14:41 -07:00
committed by GitHub
parent f049305f0f
commit 19bbbefdf5
14 changed files with 566 additions and 566 deletions

View File

@@ -0,0 +1,32 @@
using Content.Server.Botany.Components;
using Content.Shared.ActionBlocker;
using Content.Shared.Interaction;
using Content.Shared.Random.Helpers;
using Content.Shared.Tag;
using Robust.Shared.GameObjects;
namespace Content.Server.Botany.Systems;
public sealed class LogSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<LogComponent, InteractUsingEvent>(OnInteractUsing);
}
private void OnInteractUsing(EntityUid uid, LogComponent component, InteractUsingEvent args)
{
if (args.Used.HasTag("BotanySharp"))
{
for (var i = 0; i < component.SpawnCount; i++)
{
var plank = Spawn(component.SpawnedPrototype, Transform(uid).Coordinates);
plank.RandomOffset(0.25f);
}
QueueDel(uid);
}
}
}