using Content.Shared.Atmos; using Content.Shared.Light.Components; using Content.Shared.Movement.Systems; using Content.Shared.Tools; using Robust.Shared.Audio; using Robust.Shared.Map; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Array; using Robust.Shared.Utility; namespace Content.Shared.Maps { [Prototype("tile")] public sealed partial class ContentTileDefinition : IPrototype, IInheritingPrototype, ITileDefinition { [ValidatePrototypeId] public const string PryingToolQuality = "Prying"; public const string SpaceID = "Space"; [ParentDataFieldAttribute(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; private set; } [NeverPushInheritance] [AbstractDataFieldAttribute] public bool Abstract { get; private set; } [IdDataField] public string ID { get; private set; } = string.Empty; public ushort TileId { get; private set; } [DataField("name")] public string Name { get; private set; } = ""; [DataField("sprite")] public ResPath? Sprite { get; private set; } [DataField("edgeSprites")] public Dictionary EdgeSprites { get; private set; } = new(); [DataField("edgeSpritePriority")] public int EdgeSpritePriority { get; private set; } = 0; [DataField("isSubfloor")] public bool IsSubFloor { get; private set; } [DataField("baseTurf")] public string BaseTurf { get; private set; } = string.Empty; [DataField] public PrototypeFlags DeconstructTools { get; set; } = new(); /// /// Legacy AF but nice to have. /// public bool CanCrowbar => DeconstructTools.Contains(PryingToolQuality); /// /// These play when the mob has shoes on. /// [DataField("footstepSounds")] public SoundSpecifier? FootstepSounds { get; private set; } /// /// These play when the mob has no shoes on. /// [DataField("barestepSounds")] public SoundSpecifier? BarestepSounds { get; private set; } = new SoundCollectionSpecifier("BarestepHard"); [DataField("friction")] public float Friction { get; set; } = 0.2f; [DataField("variants")] public byte Variants { get; set; } = 1; /// /// This controls what variants the `variantize` command is allowed to use. /// [DataField("placementVariants")] public float[] PlacementVariants { get; set; } = { 1f }; [DataField("thermalConductivity")] public float ThermalConductivity = 0.04f; // Heat capacity is opt-in, not opt-out. [DataField("heatCapacity")] public float HeatCapacity = Atmospherics.MinimumHeatCapacity; [DataField("itemDrop", customTypeSerializer:typeof(PrototypeIdSerializer))] public string ItemDropPrototypeName { get; private set; } = "FloorTileItemSteel"; // TODO rename data-field in yaml /// /// Whether or not the tile is exposed to the map's atmosphere. /// [DataField("isSpace")] public bool MapAtmosphere { get; private set; } /// /// Friction override for mob mover in /// [DataField("mobFriction")] public float? MobFriction { get; private set; } /// /// No-input friction override for mob mover in /// [DataField("mobFrictionNoInput")] public float? MobFrictionNoInput { get; private set; } /// /// Accel override for mob mover in /// [DataField("mobAcceleration")] public float? MobAcceleration { get; private set; } [DataField("sturdy")] public bool Sturdy { get; private set; } = true; /// /// Can weather affect this tile. /// [DataField("weather")] public bool Weather = false; /// /// Is this tile immune to RCD deconstruct. /// [DataField("indestructible")] public bool Indestructible = false; public void AssignTileId(ushort id) { TileId = id; } } }