2022-10-20 09:16:29 -04:00
|
|
|
using Content.Shared.Random;
|
2024-09-06 10:05:53 -04:00
|
|
|
using Robust.Shared.Prototypes;
|
2022-10-20 09:16:29 -04:00
|
|
|
|
2024-09-06 10:05:53 -04:00
|
|
|
namespace Content.Shared.Mining.Components;
|
2022-10-20 09:16:29 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Defines an entity that will drop a random ore after being destroyed.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class OreVeinComponent : Component
|
2022-10-20 09:16:29 -04:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// How often an entity will be seeded with ore. Note: the amount of ore
|
|
|
|
|
/// that is dropped is dependent on the ore prototype. <see crefalso="OrePrototype"/>
|
|
|
|
|
/// </summary>
|
2024-09-06 10:05:53 -04:00
|
|
|
[DataField]
|
2022-10-20 09:16:29 -04:00
|
|
|
public float OreChance = 0.1f;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The weighted random prototype used for determining what ore will be dropped.
|
|
|
|
|
/// </summary>
|
2024-09-06 10:05:53 -04:00
|
|
|
[DataField]
|
|
|
|
|
public ProtoId<WeightedRandomOrePrototype>? OreRarityPrototypeId;
|
2022-10-20 09:16:29 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The ore that this entity holds.
|
|
|
|
|
/// If set in the prototype, it will not be overriden.
|
|
|
|
|
/// </summary>
|
2024-09-06 10:05:53 -04:00
|
|
|
[DataField]
|
|
|
|
|
public ProtoId<OrePrototype>? CurrentOre;
|
2022-10-20 09:16:29 -04:00
|
|
|
}
|