using Robust.Shared.Prototypes; using Content.Shared.Maps; using Content.Shared.Decals; namespace Content.Server.Spawners.Components; /// /// This component spawns decals around the entity on MapInit. /// See doc strings for the various parameters for more information. /// [RegisterComponent, EntityCategory("Spawner")] public sealed partial class RandomDecalSpawnerComponent : Component { /// /// A list of decals to randomly select from when spawning. /// [DataField] public List> Decals = new(); /// /// Radius (in tiles) to spawn decals in. 0 will target only the tile the entity is on. /// [DataField] public float Radius = 1f; /// /// Probability that a particular decal gets spawned. /// [DataField] public float Prob = 1f; /// /// The maximum amount of decals to spawn across the entire radius. /// [DataField] public int MaxDecals = 1; /// /// The maximum amount of decals to spawn within a tile. /// /// /// A value <= 0 or null is considered unlimited. /// [DataField] public int? MaxDecalsPerTile = null; /// /// Whether decals should have a random rotation applied to them. /// [DataField] public bool RandomRotation = false; /// /// Whether decals should snap to 90 degree orientations, does nothing if RandomRotation is false. /// [DataField] public bool SnapRotation = false; /// /// Whether decals should snap to the center omf a grid space or be placed randoly. /// /// /// A null value will cause this to attempt to use the default value (DefaultSnap) for the decal. /// [DataField] public bool? SnapPosition = false; /// /// zIndex for the generated decals /// [DataField] public int ZIndex = 0; /// /// Color for the generated decals. Does nothing if RandomColorList is set. /// [DataField] public Color Color = Color.White; /// /// A random color to select from. Overrides Color if set. /// [DataField] public List? RandomColorList = new(); /// /// Whether the new decals are cleanable or not /// /// /// A null value will cause this to attempt to use the default value (DefaultCleanable) for the decal. /// [DataField] public bool? Cleanable = null; /// /// A list of tile prototype IDs to only place decals on. /// /// /// Causes the TileBlacklist to be ignored if this is set. /// Note that due to the nature of tile-based placement, it's possible for decals to "spill over" onto nearby tiles. /// This is mostly so dirt decals don't go on diagonal tiles that won't work for them. /// [DataField] public List> TileWhitelist = new(); /// /// A list of tile prototype IDs to avoid placing decals on. /// /// /// Ignored if TileWhitelist is set. /// Note that due to the nature of tile-based placement, it's possible for decals to "spill over" onto nearby tiles. /// This is mostly so dirt decals don't go on diagonal tiles that won't work for them. /// [DataField] public List> TileBlacklist = new(); /// /// Sets whether to delete the entity with this component after the spawner is finished. /// [DataField] public bool DeleteSpawnerAfterSpawn = false; }