using Content.Shared.Atmos; using Content.Shared.Materials; using Content.Shared.Movement.Systems; using Content.Shared.Shuttles.Systems; using Content.Shared.Tools; using Robust.Shared.Audio; using Robust.Shared.Map; using Robust.Shared.Prototypes; 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 { public static readonly ProtoId PryingToolQuality = "Prying"; public const string SpaceID = "Space"; [ParentDataField(typeof(AbstractPrototypeIdArraySerializer))] public string[]? Parents { get; private set; } [NeverPushInheritance] [AbstractDataField] public bool Abstract { get; private set; } [IdDataField] public string ID { get; private set; } = string.Empty; public ushort TileId { get; private set; } [DataField] public string Name { get; private set; } = ""; [DataField] public ResPath? Sprite { get; private set; } [DataField] public Dictionary EdgeSprites { get; private set; } = new(); [DataField] public int EdgeSpritePriority { get; private set; } = 0; [DataField("isSubfloor")] public bool IsSubFloor { get; private set; } [DataField] public ProtoId? BaseTurf { get; private set; } /// /// On what tiles this tile can be placed on. BaseTurf is already included. /// [DataField] public List> BaseWhitelist { get; private set; } = new(); [DataField] public HashSet> DeconstructTools = new(); /// /// Effective mass of this tile for grid impacts. /// [DataField] public float Mass = SharedShuttleSystem.TileDensityMultiplier; /// /// Legacy AF but nice to have. /// public bool CanCrowbar => DeconstructTools.Contains(PryingToolQuality); /// /// These play when the mob has shoes on. /// [DataField] public SoundSpecifier? FootstepSounds { get; private set; } /// /// These play when the mob has no shoes on. /// [DataField] public SoundSpecifier? BarestepSounds { get; private set; } = new SoundCollectionSpecifier("BarestepHard"); /// /// Base friction modifier for this tile. /// [DataField] public float Friction { get; set; } = 1f; [DataField] public byte Variants { get; set; } = 1; /// /// Allows the tile to be rotated/mirrored when placed on a grid. /// [DataField] public bool AllowRotationMirror { get; set; } = false; /// /// This controls what variants the `variantize` command is allowed to use. /// If null, the distribution will be uniform. /// [DataField] public float[]? PlacementVariants { get; set; } = null; [DataField] public float ThermalConductivity = 0.04f; // Heat capacity is opt-in, not opt-out. [DataField] public float HeatCapacity = Atmospherics.MinimumHeatCapacity; [DataField("itemDrop")] public EntProtoId? 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] public float? MobFriction { get; private set; } /// /// Accel override for mob mover in /// [DataField] public float? MobAcceleration { get; private set; } [DataField] public bool Sturdy { get; private set; } = true; /// /// Can weather affect this tile. /// [DataField] public bool Weather = false; /// /// Is this tile immune to RCD deconstruct. /// [DataField] public bool Indestructible = false; /// /// Hide this tile in the tile placement editor. /// [DataField] public bool EditorHidden { get; private set; } = false; /// /// If this tile is reclaimed, what materials would come out of it? /// [DataField] public Dictionary, int> MaterialComposition = new(); public void AssignTileId(ushort id) { TileId = id; } }