1
0

SharedKitchenSpikeSystem.cs 962 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Content.Shared.DoAfter;
  2. using Content.Shared.DragDrop;
  3. using Content.Shared.Kitchen.Components;
  4. using Content.Shared.Nutrition.Components;
  5. using Robust.Shared.Serialization;
  6. namespace Content.Shared.Kitchen;
  7. public abstract class SharedKitchenSpikeSystem : EntitySystem
  8. {
  9. public override void Initialize()
  10. {
  11. base.Initialize();
  12. SubscribeLocalEvent<KitchenSpikeComponent, CanDropTargetEvent>(OnCanDrop);
  13. }
  14. private void OnCanDrop(EntityUid uid, KitchenSpikeComponent component, ref CanDropTargetEvent args)
  15. {
  16. if (args.Handled)
  17. return;
  18. args.Handled = true;
  19. if (!HasComp<ButcherableComponent>(args.Dragged))
  20. {
  21. args.CanDrop = false;
  22. return;
  23. }
  24. // TODO: Once we get silicons need to check organic
  25. args.CanDrop = true;
  26. }
  27. }
  28. [Serializable, NetSerializable]
  29. public sealed partial class SpikeDoAfterEvent : SimpleDoAfterEvent
  30. {
  31. }