2022-07-29 14:13:12 +12:00
|
|
|
using Content.Shared.Atmos;
|
2023-08-31 14:31:23 -07:00
|
|
|
using Content.Shared.Movement.Systems;
|
2024-01-23 02:45:40 -05:00
|
|
|
using Content.Shared.Tools;
|
2022-07-29 14:13:12 +12:00
|
|
|
using Robust.Shared.Audio;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.Map;
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Shared.Prototypes;
|
2021-05-27 11:39:30 +02:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2022-08-01 14:39:37 +02:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array;
|
2022-08-10 17:05:40 +10:00
|
|
|
using Robust.Shared.Utility;
|
2019-04-03 21:20:26 +02:00
|
|
|
|
|
|
|
|
namespace Content.Shared.Maps
|
|
|
|
|
{
|
|
|
|
|
[Prototype("tile")]
|
2023-11-01 19:56:23 -07:00
|
|
|
public sealed partial class ContentTileDefinition : IPrototype, IInheritingPrototype, ITileDefinition
|
2019-04-03 21:20:26 +02:00
|
|
|
{
|
2024-01-23 02:45:40 -05:00
|
|
|
[ValidatePrototypeId<ToolQualityPrototype>]
|
|
|
|
|
public const string PryingToolQuality = "Prying";
|
|
|
|
|
|
2022-08-10 17:05:40 +10:00
|
|
|
public const string SpaceID = "Space";
|
|
|
|
|
|
2022-08-01 14:39:37 +02:00
|
|
|
[ParentDataFieldAttribute(typeof(AbstractPrototypeIdArraySerializer<ContentTileDefinition>))]
|
|
|
|
|
public string[]? Parents { get; private set; }
|
2021-12-02 19:06:48 -07:00
|
|
|
|
|
|
|
|
[NeverPushInheritance]
|
2022-04-03 02:01:22 +02:00
|
|
|
[AbstractDataFieldAttribute]
|
2021-12-02 19:06:48 -07:00
|
|
|
public bool Abstract { get; private set; }
|
|
|
|
|
|
2023-01-19 03:56:45 +01:00
|
|
|
[IdDataField] public string ID { get; } = string.Empty;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
2019-04-03 21:20:26 +02:00
|
|
|
public ushort TileId { get; private set; }
|
|
|
|
|
|
2022-09-14 05:53:37 +03:00
|
|
|
[DataField("name")]
|
2022-12-20 23:25:34 +01:00
|
|
|
public string Name { get; private set; } = "";
|
2023-08-22 18:14:33 -07:00
|
|
|
[DataField("sprite")] public ResPath? Sprite { get; private set; }
|
2019-04-04 15:09:06 +02:00
|
|
|
|
2023-08-22 18:14:33 -07:00
|
|
|
[DataField("edgeSprites")] public Dictionary<Direction, ResPath> EdgeSprites { get; private set; } = new();
|
2023-02-12 13:15:09 +11:00
|
|
|
|
2023-08-31 14:31:23 -07:00
|
|
|
[DataField("edgeSpritePriority")] public int EdgeSpritePriority { get; private set; } = 0;
|
|
|
|
|
|
2022-08-10 17:05:40 +10:00
|
|
|
[DataField("isSubfloor")] public bool IsSubFloor { get; private set; }
|
2020-02-22 20:30:36 -03:00
|
|
|
|
2023-05-19 08:10:56 +01:00
|
|
|
[DataField("baseTurf")]
|
2023-08-22 18:14:33 -07:00
|
|
|
public string BaseTurf { get; private set; } = string.Empty;
|
2019-04-04 15:09:06 +02:00
|
|
|
|
2024-01-23 02:45:40 -05:00
|
|
|
[DataField]
|
|
|
|
|
public PrototypeFlags<ToolQualityPrototype> DeconstructTools { get; set; } = new();
|
2020-11-25 10:48:49 +01:00
|
|
|
|
2024-01-23 02:45:40 -05:00
|
|
|
/// <remarks>
|
|
|
|
|
/// Legacy AF but nice to have.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
public bool CanCrowbar => DeconstructTools.Contains(PryingToolQuality);
|
2022-08-31 01:24:51 -07:00
|
|
|
|
2022-08-10 17:05:40 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// These play when the mob has shoes on.
|
|
|
|
|
/// </summary>
|
2023-08-22 18:14:33 -07:00
|
|
|
[DataField("footstepSounds")] public SoundSpecifier? FootstepSounds { get; private set; }
|
2019-04-05 02:04:34 +02:00
|
|
|
|
2022-08-10 17:05:40 +10:00
|
|
|
/// <summary>
|
|
|
|
|
/// These play when the mob has no shoes on.
|
|
|
|
|
/// </summary>
|
2023-08-22 18:14:33 -07:00
|
|
|
[DataField("barestepSounds")] public SoundSpecifier? BarestepSounds { get; private set; } = new SoundCollectionSpecifier("BarestepHard");
|
2022-08-08 12:03:56 +03:00
|
|
|
|
2023-06-28 16:03:16 -04:00
|
|
|
[DataField("friction")] public float Friction { get; set; } = 0.2f;
|
2019-04-11 17:04:48 +02:00
|
|
|
|
2022-03-09 13:59:44 -06:00
|
|
|
[DataField("variants")] public byte Variants { get; set; } = 1;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This controls what variants the `variantize` command is allowed to use.
|
|
|
|
|
/// </summary>
|
2024-01-28 21:41:59 -05:00
|
|
|
[DataField("placementVariants")] public float[] PlacementVariants { get; set; } = { 1f };
|
2022-03-09 13:59:44 -06:00
|
|
|
|
2023-03-05 12:11:19 +11:00
|
|
|
[DataField("thermalConductivity")] public float ThermalConductivity = 0.04f;
|
2019-11-23 16:10:05 -05:00
|
|
|
|
2021-11-30 11:42:48 +01:00
|
|
|
// Heat capacity is opt-in, not opt-out.
|
|
|
|
|
[DataField("heatCapacity")] public float HeatCapacity = Atmospherics.MinimumHeatCapacity;
|
|
|
|
|
|
2022-08-10 17:05:40 +10:00
|
|
|
[DataField("itemDrop", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public string ItemDropPrototypeName { get; private set; } = "FloorTileItemSteel";
|
2020-08-13 14:18:26 +02:00
|
|
|
|
2024-03-24 03:34:56 +11:00
|
|
|
// TODO rename data-field in yaml
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether or not the tile is exposed to the map's atmosphere.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("isSpace")] public bool MapAtmosphere { get; private set; }
|
2023-08-31 14:31:23 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Friction override for mob mover in <see cref="SharedMoverController"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("mobFriction")]
|
|
|
|
|
public float? MobFriction { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// No-input friction override for mob mover in <see cref="SharedMoverController"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("mobFrictionNoInput")]
|
|
|
|
|
public float? MobFrictionNoInput { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Accel override for mob mover in <see cref="SharedMoverController"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("mobAcceleration")]
|
|
|
|
|
public float? MobAcceleration { get; private set; }
|
|
|
|
|
|
2021-10-23 19:32:33 -05:00
|
|
|
[DataField("sturdy")] public bool Sturdy { get; private set; } = true;
|
2019-11-23 16:10:05 -05:00
|
|
|
|
2023-01-17 20:26:52 +11:00
|
|
|
/// <summary>
|
|
|
|
|
/// Can weather affect this tile.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("weather")] public bool Weather = false;
|
|
|
|
|
|
2023-07-16 13:46:35 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Is this tile immune to RCD deconstruct.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("indestructible")] public bool Indestructible = false;
|
|
|
|
|
|
2021-03-05 01:08:38 +01:00
|
|
|
public void AssignTileId(ushort id)
|
|
|
|
|
{
|
|
|
|
|
TileId = id;
|
|
|
|
|
}
|
2019-04-03 21:20:26 +02:00
|
|
|
}
|
|
|
|
|
}
|