GatherableComponent.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using Content.Shared.EntityList;
  2. using Content.Shared.Whitelist;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Server.Gatherable.Components;
  5. [RegisterComponent]
  6. [Access(typeof(GatherableSystem))]
  7. public sealed partial class GatherableComponent : Component
  8. {
  9. /// <summary>
  10. /// Whitelist for specifying the kind of tools can be used on a resource
  11. /// Supports multiple tags.
  12. /// </summary>
  13. [DataField(required: true)]
  14. public EntityWhitelist? ToolWhitelist;
  15. /// <summary>
  16. /// YAML example below
  17. /// (Tag1, Tag2, LootTableID1, LootTableID2 are placeholders for example)
  18. /// --------------------
  19. /// useMappedLoot: true
  20. /// toolWhitelist:
  21. /// tags:
  22. /// - Tag1
  23. /// - Tag2
  24. /// loot:
  25. /// Tag1: LootTableID1
  26. /// Tag2: LootTableID2
  27. /// </summary>
  28. [DataField]
  29. public Dictionary<string, ProtoId<EntityLootTablePrototype>>? Loot = new();
  30. /// <summary>
  31. /// Random shift of the appearing entity during gathering
  32. /// </summary>
  33. [DataField]
  34. public float GatherOffset = 0.3f;
  35. }