* Ore veins

I dislike rocks just providing generic drops and this factors into mining more.

* fixes

* descriptions

* comment

* every flipping time
This commit is contained in:
metalgearsloth
2023-02-12 23:40:57 +11:00
committed by GitHub
parent 351c53e774
commit f96fc1be41
31 changed files with 434 additions and 9 deletions

View File

@@ -0,0 +1,32 @@
using Content.Shared.Mining;
using Content.Shared.Random;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Mining.Components;
/// <summary>
/// Defines an entity that will drop a random ore after being destroyed.
/// </summary>
[RegisterComponent]
public sealed class OreVeinComponent : Component
{
/// <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>
[DataField("oreChance")]
public float OreChance = 0.1f;
/// <summary>
/// The weighted random prototype used for determining what ore will be dropped.
/// </summary>
[DataField("oreRarityPrototypeId", customTypeSerializer: typeof(PrototypeIdSerializer<WeightedRandomPrototype>))]
public string? OreRarityPrototypeId;
/// <summary>
/// The ore that this entity holds.
/// If set in the prototype, it will not be overriden.
/// </summary>
[DataField("currentOre", customTypeSerializer: typeof(PrototypeIdSerializer<OrePrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string? CurrentOre;
}

View File

@@ -7,7 +7,6 @@ namespace Content.Shared.Mining;
/// This is a prototype for defining ores that generate in rock
/// </summary>
[Prototype("ore")]
[DataDefinition]
public sealed class OrePrototype : IPrototype
{
/// <inheritdoc/>