OreVeinComponent.cs 953 B

12345678910111213141516171819202122232425262728293031
  1. using Content.Shared.Random;
  2. using Robust.Shared.Prototypes;
  3. namespace Content.Shared.Mining.Components;
  4. /// <summary>
  5. /// Defines an entity that will drop a random ore after being destroyed.
  6. /// </summary>
  7. [RegisterComponent]
  8. public sealed partial class OreVeinComponent : Component
  9. {
  10. /// <summary>
  11. /// How often an entity will be seeded with ore. Note: the amount of ore
  12. /// that is dropped is dependent on the ore prototype. <see crefalso="OrePrototype"/>
  13. /// </summary>
  14. [DataField]
  15. public float OreChance = 0.1f;
  16. /// <summary>
  17. /// The weighted random prototype used for determining what ore will be dropped.
  18. /// </summary>
  19. [DataField]
  20. public ProtoId<WeightedRandomOrePrototype>? OreRarityPrototypeId;
  21. /// <summary>
  22. /// The ore that this entity holds.
  23. /// If set in the prototype, it will not be overriden.
  24. /// </summary>
  25. [DataField]
  26. public ProtoId<OrePrototype>? CurrentOre;
  27. }