2021-05-20 10:37:34 +02:00
|
|
|
using Robust.Shared.Prototypes;
|
2022-08-01 14:39:37 +02:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
|
2023-10-10 20:06:24 -07:00
|
|
|
using Robust.Shared.Utility;
|
2021-05-20 10:37:34 +02:00
|
|
|
|
|
|
|
|
namespace Content.Shared.Materials
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Materials are read-only storage for the properties of specific materials.
|
|
|
|
|
/// Properties should be intrinsic (or at least as much is necessary for game purposes).
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Prototype("material")]
|
2023-11-01 19:56:23 -07:00
|
|
|
public sealed partial class MaterialPrototype : IPrototype, IInheritingPrototype
|
2021-05-20 10:37:34 +02:00
|
|
|
{
|
|
|
|
|
[ViewVariables]
|
2022-08-01 14:39:37 +02:00
|
|
|
[ParentDataField(typeof(AbstractPrototypeIdArraySerializer<MaterialPrototype>))]
|
|
|
|
|
public string[]? Parents { get; }
|
2021-05-20 10:37:34 +02:00
|
|
|
|
|
|
|
|
[ViewVariables]
|
2023-10-10 20:06:24 -07:00
|
|
|
[AbstractDataField]
|
2021-05-20 10:37:34 +02:00
|
|
|
public bool Abstract { get; } = false;
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2023-01-19 03:56:45 +01:00
|
|
|
[IdDataField]
|
2023-08-22 18:14:33 -07:00
|
|
|
public string ID { get; private set; } = default!;
|
2021-05-20 10:37:34 +02:00
|
|
|
|
2023-01-07 13:09:05 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// For material storage to be able to convert back and forth
|
|
|
|
|
/// between the material and physical entities you can carry,
|
|
|
|
|
/// include which stack we should spawn by default.
|
|
|
|
|
/// </summary>
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField]
|
|
|
|
|
public ProtoId<EntityPrototype>? StackEntity;
|
2021-05-20 10:37:34 +02:00
|
|
|
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField]
|
2023-09-08 03:11:10 +01:00
|
|
|
public string Name = string.Empty;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Locale id for the unit of this material.
|
|
|
|
|
/// Lathe recipe tooltips and material storage display use this to let you change a material to sound nicer.
|
|
|
|
|
/// For example, 5 bars of gold is better than 5 sheets of gold.
|
|
|
|
|
/// </summary>
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField]
|
|
|
|
|
public LocId Unit = "materials-unit-sheet";
|
2021-05-20 10:37:34 +02:00
|
|
|
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField]
|
2023-08-22 18:14:33 -07:00
|
|
|
public Color Color { get; private set; } = Color.Gray;
|
2021-05-20 10:37:34 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// An icon used to represent the material in graphic interfaces.
|
|
|
|
|
/// </summary>
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField]
|
2023-08-22 18:14:33 -07:00
|
|
|
public SpriteSpecifier Icon { get; private set; } = SpriteSpecifier.Invalid;
|
2022-06-03 10:56:11 -05:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The price per cm3.
|
|
|
|
|
/// </summary>
|
2023-10-10 20:06:24 -07:00
|
|
|
[DataField(required: true)]
|
2022-06-03 10:56:11 -05:00
|
|
|
public double Price = 0;
|
2021-05-20 10:37:34 +02:00
|
|
|
}
|
|
|
|
|
}
|