2024-05-18 15:16:20 +03:00
|
|
|
using Content.Shared.EntityList;
|
2022-05-12 05:53:31 -07:00
|
|
|
using Content.Shared.Whitelist;
|
2024-05-18 15:16:20 +03:00
|
|
|
using Robust.Shared.Prototypes;
|
2022-05-12 05:53:31 -07:00
|
|
|
|
|
|
|
|
namespace Content.Server.Gatherable.Components;
|
|
|
|
|
|
|
|
|
|
[RegisterComponent]
|
2022-06-07 15:26:28 +02:00
|
|
|
[Access(typeof(GatherableSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class GatherableComponent : Component
|
2022-05-12 05:53:31 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whitelist for specifying the kind of tools can be used on a resource
|
|
|
|
|
/// Supports multiple tags.
|
|
|
|
|
/// </summary>
|
2024-05-18 15:16:20 +03:00
|
|
|
[DataField(required: true)]
|
2022-05-12 05:53:31 -07:00
|
|
|
public EntityWhitelist? ToolWhitelist;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// YAML example below
|
|
|
|
|
/// (Tag1, Tag2, LootTableID1, LootTableID2 are placeholders for example)
|
|
|
|
|
/// --------------------
|
|
|
|
|
/// useMappedLoot: true
|
2024-05-18 15:16:20 +03:00
|
|
|
/// toolWhitelist:
|
2022-05-12 05:53:31 -07:00
|
|
|
/// tags:
|
|
|
|
|
/// - Tag1
|
|
|
|
|
/// - Tag2
|
2024-05-18 15:16:20 +03:00
|
|
|
/// loot:
|
2022-05-12 05:53:31 -07:00
|
|
|
/// Tag1: LootTableID1
|
|
|
|
|
/// Tag2: LootTableID2
|
|
|
|
|
/// </summary>
|
2024-05-18 15:16:20 +03:00
|
|
|
[DataField]
|
|
|
|
|
public Dictionary<string, ProtoId<EntityLootTablePrototype>>? Loot = new();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Random shift of the appearing entity during gathering
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public float GatherOffset = 0.3f;
|
2022-05-12 05:53:31 -07:00
|
|
|
}
|