Add ore bag area pickups (#19358)

This commit is contained in:
metalgearsloth
2023-09-12 22:34:04 +10:00
committed by GitHub
parent 7d9550bc55
commit 7064f262b4
18 changed files with 256 additions and 83 deletions

View File

@@ -0,0 +1,36 @@
using Content.Shared.Inventory;
using Content.Shared.Tag;
using Content.Shared.Whitelist;
namespace Content.Server.Storage.Components;
/// <summary>
/// Applies an ongoing pickup area around the attached entity.
/// </summary>
[RegisterComponent]
public sealed partial class MagnetPickupComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField("nextScan")]
public TimeSpan NextScan = TimeSpan.Zero;
/// <summary>
/// What container slot the magnet needs to be in to work.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("slotFlags")]
public SlotFlags SlotFlags = SlotFlags.BELT;
[ViewVariables(VVAccess.ReadWrite), DataField("range")]
public float Range = 1f;
[ValidatePrototypeId<TagPrototype>]
private const string DefaultTag = "Ore";
[ViewVariables(VVAccess.ReadWrite), DataField("whitelist")]
public EntityWhitelist? Whitelist = new()
{
Tags = new List<string>()
{
DefaultTag,
}
};
}