2021-02-27 04:12:09 +01:00
|
|
|
#nullable enable
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Shared.Maths;
|
|
|
|
|
using Robust.Shared.Prototypes;
|
2021-03-05 01:08:38 +01:00
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Shared.Utility;
|
2021-03-05 01:08:38 +01:00
|
|
|
using Robust.Shared.ViewVariables;
|
2018-07-27 17:11:58 +02:00
|
|
|
|
2019-04-26 15:51:05 +02:00
|
|
|
namespace Content.Shared.Materials
|
2018-07-27 17:11:58 +02:00
|
|
|
{
|
|
|
|
|
/// <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>
|
2021-03-05 01:08:38 +01:00
|
|
|
[Prototype("material")]
|
|
|
|
|
[DataDefinition]
|
2021-03-05 12:29:44 +01:00
|
|
|
public class MaterialPrototype : IPrototype, IInheritingPrototype
|
2018-07-27 17:11:58 +02:00
|
|
|
{
|
2021-03-05 01:08:38 +01:00
|
|
|
[ViewVariables]
|
2021-05-04 15:37:16 +02:00
|
|
|
[DataField("id", required: true)]
|
2021-03-05 01:08:38 +01:00
|
|
|
public string ID { get; } = default!;
|
|
|
|
|
|
|
|
|
|
[DataField("name")] public string Name { get; private set; } = "unobtanium";
|
2018-07-27 17:11:58 +02:00
|
|
|
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("color")] public Color Color { get; private set; } = Color.Gray;
|
2018-07-27 17:11:58 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Volumetric mass density, in kg.m^-3.
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("density")]
|
|
|
|
|
public double Density { get; private set; } = 1;
|
2018-07-27 17:11:58 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Electrical resistivity, NOT resistance.
|
|
|
|
|
/// Unit is ohm-meter (Ω⋅m).
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("electricResistivity")]
|
|
|
|
|
public double ElectricResistivity { get; private set; } = 1;
|
2018-07-27 17:11:58 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Thermal conductivity, in W.m-1.K-1
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("thermalConductivity")]
|
|
|
|
|
public double ThermalConductivity { get; private set; } = 1;
|
2018-07-27 17:11:58 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Specific heat, in J.kg-1.K-1
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("specificHeat")]
|
|
|
|
|
public double SpecificHeat { get; private set; } = 1;
|
2018-07-27 17:11:58 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Controls how durable the material is.
|
|
|
|
|
/// Basically how slowly it degrades.
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("durability")]
|
|
|
|
|
public double Durability { get; private set; } = 1;
|
2018-07-27 17:11:58 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Multiplier for how much this resists damage.
|
|
|
|
|
/// So higher means armor is more effective, for example.
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("hardness")]
|
|
|
|
|
public double Hardness { get; private set; } = 1;
|
2018-07-27 17:11:58 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Multiplier that determines damage on sharpness-based weapons like knives.
|
|
|
|
|
/// Higher means more damage is done.
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("sharpDamage")]
|
|
|
|
|
public double SharpDamage { get; private set; } = 1;
|
2018-07-27 17:11:58 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Multiplier that determines damage on blunt-based weapons like clubs.
|
|
|
|
|
/// Higher means more damage is done.
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("bluntDamage")]
|
|
|
|
|
public double BluntDamage { get; private set; } = 1;
|
2018-07-27 17:11:58 +02:00
|
|
|
|
2019-04-26 15:51:05 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// An icon used to represent the material in graphic interfaces.
|
|
|
|
|
/// </summary>
|
2021-03-05 01:08:38 +01:00
|
|
|
[DataField("icon")]
|
|
|
|
|
public SpriteSpecifier Icon { get; private set; } = SpriteSpecifier.Invalid;
|
2021-03-05 12:29:44 +01:00
|
|
|
|
2021-05-04 15:37:16 +02:00
|
|
|
[DataField("parent")]
|
2021-03-05 12:29:44 +01:00
|
|
|
public string? Parent { get; }
|
|
|
|
|
|
2021-05-04 15:37:16 +02:00
|
|
|
[DataField("abstract")]
|
2021-03-05 12:29:44 +01:00
|
|
|
public bool Abstract { get; }
|
2018-07-27 17:11:58 +02:00
|
|
|
}
|
|
|
|
|
}
|