Salvage expeditions (#12745)
This commit is contained in:
34
Content.Shared/Parallax/Biomes/Layers/BiomeDecalLayer.cs
Normal file
34
Content.Shared/Parallax/Biomes/Layers/BiomeDecalLayer.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Content.Shared.Decals;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Noise;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
|
||||
namespace Content.Shared.Parallax.Biomes.Layers;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class BiomeDecalLayer : IBiomeWorldLayer
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
[DataField("allowedTiles", customTypeSerializer:typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
|
||||
public List<string> AllowedTiles { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Divide each tile up by this amount.
|
||||
/// </summary>
|
||||
[DataField("divisions")]
|
||||
public float Divisions = 1f;
|
||||
|
||||
[DataField("noise")]
|
||||
public FastNoiseLite Noise { get; } = new(0);
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("threshold")]
|
||||
public float Threshold { get; } = 0.8f;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("invert")] public bool Invert { get; } = false;
|
||||
|
||||
[DataField("decals", required: true, customTypeSerializer:typeof(PrototypeIdListSerializer<DecalPrototype>))]
|
||||
public List<string> Decals = new();
|
||||
}
|
||||
18
Content.Shared/Parallax/Biomes/Layers/BiomeDummyLayer.cs
Normal file
18
Content.Shared/Parallax/Biomes/Layers/BiomeDummyLayer.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Robust.Shared.Noise;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Parallax.Biomes.Layers;
|
||||
|
||||
/// <summary>
|
||||
/// Dummy layer that specifies a marker to be replaced by external code.
|
||||
/// For example if they wish to add their own layers at specific points across different templates.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class BiomeDummyLayer : IBiomeLayer
|
||||
{
|
||||
[DataField("id", required: true)] public string ID = string.Empty;
|
||||
|
||||
public FastNoiseLite Noise { get; } = new();
|
||||
public float Threshold { get; }
|
||||
public bool Invert { get; }
|
||||
}
|
||||
27
Content.Shared/Parallax/Biomes/Layers/BiomeEntityLayer.cs
Normal file
27
Content.Shared/Parallax/Biomes/Layers/BiomeEntityLayer.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Noise;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
|
||||
namespace Content.Shared.Parallax.Biomes.Layers;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class BiomeEntityLayer : IBiomeWorldLayer
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
[DataField("allowedTiles", customTypeSerializer:typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
|
||||
public List<string> AllowedTiles { get; } = new();
|
||||
|
||||
[DataField("noise")] public FastNoiseLite Noise { get; } = new(0);
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("threshold")]
|
||||
public float Threshold { get; } = 0.5f;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("invert")] public bool Invert { get; } = false;
|
||||
|
||||
[DataField("entities", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
|
||||
public List<string> Entities = new();
|
||||
}
|
||||
28
Content.Shared/Parallax/Biomes/Layers/BiomeTileLayer.cs
Normal file
28
Content.Shared/Parallax/Biomes/Layers/BiomeTileLayer.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Noise;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared.Parallax.Biomes.Layers;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class BiomeTileLayer : IBiomeLayer
|
||||
{
|
||||
[DataField("noise")] public FastNoiseLite Noise { get; } = new(0);
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("threshold")]
|
||||
public float Threshold { get; } = 0.5f;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[DataField("invert")] public bool Invert { get; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Which tile variants to use for this layer. Uses all of the tile's variants if none specified
|
||||
/// </summary>
|
||||
[DataField("variants")]
|
||||
public List<byte>? Variants = null;
|
||||
|
||||
[DataField("tile", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<ContentTileDefinition>))]
|
||||
public string Tile = string.Empty;
|
||||
}
|
||||
22
Content.Shared/Parallax/Biomes/Layers/IBiomeLayer.cs
Normal file
22
Content.Shared/Parallax/Biomes/Layers/IBiomeLayer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Robust.Shared.Noise;
|
||||
|
||||
namespace Content.Shared.Parallax.Biomes.Layers;
|
||||
|
||||
[ImplicitDataDefinitionForInheritors]
|
||||
public interface IBiomeLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Seed is used an offset from the relevant BiomeComponent's seed.
|
||||
/// </summary>
|
||||
FastNoiseLite Noise { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Threshold for this layer to be present. If set to 0 forces it for every tile.
|
||||
/// </summary>
|
||||
float Threshold { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Is the thresold inverted so we need to be lower than it.
|
||||
/// </summary>
|
||||
public bool Invert { get; }
|
||||
}
|
||||
12
Content.Shared/Parallax/Biomes/Layers/IBiomeWorldLayer.cs
Normal file
12
Content.Shared/Parallax/Biomes/Layers/IBiomeWorldLayer.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Content.Shared.Parallax.Biomes.Layers;
|
||||
|
||||
/// <summary>
|
||||
/// Handles actual objects such as decals and entities.
|
||||
/// </summary>
|
||||
public interface IBiomeWorldLayer : IBiomeLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// What tiles we're allowed to spawn on, real or biome.
|
||||
/// </summary>
|
||||
List<string> AllowedTiles { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user