Add snow rocks to planets (#17692)

This commit is contained in:
metalgearsloth
2023-06-28 21:32:01 +10:00
committed by GitHub
parent 2f85b5ea3c
commit 4fefd8b8b7
12 changed files with 340 additions and 15 deletions

View File

@@ -206,13 +206,13 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
if (!lootProto.Guaranteed)
continue;
await SpawnDungeonLoot(dungeon, lootProto, mapUid, grid, random, reservedTiles);
await SpawnDungeonLoot(dungeon, missionBiome, lootProto, mapUid, grid, random, reservedTiles);
}
return true;
}
private async Task SpawnDungeonLoot(Dungeon? dungeon, SalvageLootPrototype loot, EntityUid gridUid, MapGridComponent grid, Random random, List<Vector2i> reservedTiles)
private async Task SpawnDungeonLoot(Dungeon? dungeon, SalvageBiomeMod biomeMod, SalvageLootPrototype loot, EntityUid gridUid, MapGridComponent grid, Random random, List<Vector2i> reservedTiles)
{
for (var i = 0; i < loot.LootRules.Count; i++)
{
@@ -222,9 +222,10 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
{
case BiomeMarkerLoot biomeLoot:
{
if (_entManager.TryGetComponent<BiomeComponent>(gridUid, out var biome))
if (_entManager.TryGetComponent<BiomeComponent>(gridUid, out var biome) &&
biomeLoot.Prototype.TryGetValue(biomeMod.ID, out var mod))
{
_biome.AddMarkerLayer(biome, biomeLoot.Prototype);
_biome.AddMarkerLayer(biome, mod);
}
}
break;

View File

@@ -1,5 +1,6 @@
using Content.Shared.Parallax.Biomes.Markers;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
namespace Content.Shared.Procedural.Loot;
@@ -8,6 +9,7 @@ namespace Content.Shared.Procedural.Loot;
/// </summary>
public sealed class BiomeMarkerLoot : IDungeonLoot
{
[DataField("proto", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<BiomeMarkerLayerPrototype>))]
public string Prototype = string.Empty;
[DataField("proto", required: true,
customTypeSerializer: typeof(PrototypeIdValueDictionarySerializer<string, BiomeMarkerLayerPrototype>))]
public Dictionary<string, string> Prototype = new();
}

View File

@@ -287,3 +287,201 @@
- map: [ "enum.EdgeLayer.West" ]
state: rock_west
- state: rock_artifact_fragment
# Basalt variants
# WICI
# Snow variants
- type: entity
id: WallRockSnow
parent: WallRock
components:
- type: Sprite
sprite: Structures/Walls/rock.rsi
layers:
- state: rock_snow
- map: [ "enum.EdgeLayer.South" ]
state: rock_snow_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_snow_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_snow_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_snow_west
- type: entity
id: WallRockSnowGold
parent: WallRockSnow
description: An ore vein rich with gold.
suffix: Gold
components:
- type: OreVein
oreChance: 1.0
currentOre: OreGold
- type: Sprite
layers:
- state: rock_snow
- map: [ "enum.EdgeLayer.South" ]
state: rock_snow_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_snow_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_snow_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_snow_west
- state: rock_gold
- type: entity
id: WallRockSnowPlasma
parent: WallRockSnow
description: An ore vein rich with plasma.
suffix: Plasma
components:
- type: OreVein
oreChance: 1.0
currentOre: OrePlasma
- type: Sprite
layers:
- state: rock_snow
- map: [ "enum.EdgeLayer.South" ]
state: rock_snow_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_snow_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_snow_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_snow_west
- state: rock_phoron
- type: entity
id: WallRockSnowQuartz
parent: WallRockSnow
description: An ore vein rich with quartz.
suffix: Quartz
components:
- type: OreVein
oreChance: 1.0
currentOre: OreSpaceQuartz
- type: Sprite
layers:
- state: rock_snow
- map: [ "enum.EdgeLayer.South" ]
state: rock_snow_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_snow_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_snow_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_snow_west
- state: rock_quartz
- type: entity
id: WallRockSnowSilver
parent: WallRockSnow
description: An ore vein rich with silver.
suffix: Silver
components:
- type: OreVein
oreChance: 1.0
currentOre: OreSilver
- type: Sprite
layers:
- state: rock_snow
- map: [ "enum.EdgeLayer.South" ]
state: rock_snow_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_snow_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_snow_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_snow_west
- state: rock_silver
- type: entity
id: WallRockSnowTin
parent: WallRockSnow
description: An ore vein rich with steel.
suffix: Steel
components:
- type: OreVein
oreChance: 1.0
currentOre: OreSteel
- type: Sprite
layers:
- state: rock_snow
- map: [ "enum.EdgeLayer.South" ]
state: rock_snow_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_snow_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_snow_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_snow_west
- state: rock_tin
- type: entity
id: WallRockSnowUranium
parent: WallRockSnow
description: An ore vein rich with uranium.
suffix: Uranium
components:
- type: OreVein
oreChance: 1.0
currentOre: OreUranium
- type: Sprite
layers:
- state: rock_snow
- map: [ "enum.EdgeLayer.South" ]
state: rock_snow_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_snow_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_snow_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_snow_west
- state: rock_uranium
- type: entity
id: WallRockSnowBananium
parent: WallRockSnow
description: An ore vein rich with bananium.
suffix: Bananium
components:
- type: OreVein
oreChance: 1.0
currentOre: OreBananium
- type: Sprite
layers:
- state: rock_snow
- map: [ "enum.EdgeLayer.South" ]
state: rock_snow_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_snow_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_snow_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_snow_west
- state: rock_bananium
- type: entity
id: WallRockSnowArtifactFragment
parent: WallRockSnow
description: A rock wall. What's that sticking out of it?
suffix: Artifact Fragment
components:
- type: OreVein
oreChance: 1.0
currentOre: OreArtifactFragment
- type: Sprite
layers:
- state: rock_snow
- map: [ "enum.EdgeLayer.South" ]
state: rock_snow_south
- map: [ "enum.EdgeLayer.East" ]
state: rock_snow_east
- map: [ "enum.EdgeLayer.North" ]
state: rock_snow_north
- map: [ "enum.EdgeLayer.West" ]
state: rock_snow_west
- state: rock_artifact_fragment

View File

@@ -69,3 +69,79 @@
maxCount: 6
groupCount: 1
radius: 4
# Basalt variant
# WICI
# Snow variant
# Low value
- type: biomeMarkerLayer
id: SnowOreTin
proto: WallRockSnowTin
entityMask: WallRockSnow
maxCount: 30
groupCount: 10
radius: 4
- type: biomeMarkerLayer
id: SnowOreQuartz
proto: WallRockSnowQuartz
entityMask: WallRockSnow
maxCount: 30
groupCount: 10
radius: 4
# Medium value
# Gold
- type: biomeMarkerLayer
id: SnowOreGold
proto: WallRockSnowGold
entityMask: WallRockSnow
maxCount: 30
groupCount: 5
radius: 4
# Silver
- type: biomeMarkerLayer
id: SnowOreSilver
proto: WallRockSnowSilver
entityMask: WallRockSnow
maxCount: 30
groupCount: 5
radius: 4
# High value
# Plasma
- type: biomeMarkerLayer
id: SnowOrePlasma
proto: WallRockSnowPlasma
entityMask: WallRockSnow
maxCount: 12
groupCount: 5
radius: 4
# Uranium
- type: biomeMarkerLayer
id: SnowOreUranium
proto: WallRockSnowUranium
entityMask: WallRockSnow
maxCount: 12
groupCount: 5
radius: 4
- type: biomeMarkerLayer
id: SnowOreBananium
proto: WallRockSnowBananium
entityMask: WallRockSnow
maxCount: 12
groupCount: 5
radius: 4
# Artifact Fragment
- type: biomeMarkerLayer
id: SnowOreArtifactFragment
proto: WallRockSnowArtifactFragment
entityMask: WallRockSnow
maxCount: 6
groupCount: 1
radius: 4

View File

@@ -356,6 +356,23 @@
- FloraTreeSnow04
- FloraTreeSnow05
- FloraTreeSnow06
# Rock formations
- !type:BiomeEntityLayer
allowedTiles:
- FloorSnow
threshold: -0.15
noise:
seed: 0
noiseType: Cellular
frequency: 0.05
lacunarity: 2
fractalType: FBm
octaves: 5
gain: 1
cellularDistanceFunction: Euclidean
cellularReturnType: Distance2
entities:
- WallRockSnow
- !type:BiomeDummyLayer
id: Loot
- !type:BiomeTileLayer

View File

@@ -6,7 +6,9 @@
guaranteed: true
loots:
- !type:BiomeMarkerLoot
proto: OreTin
proto:
Grasslands: OreTin
Snow: SnowOreTin
- type: salvageLoot
id: OreQuartz
@@ -14,7 +16,9 @@
guaranteed: true
loots:
- !type:BiomeMarkerLoot
proto: OreQuartz
proto:
Grasslands: OreQuartz
Snow: SnowOreQuartz
# - Medium value
- type: salvageLoot
@@ -23,7 +27,9 @@
guaranteed: true
loots:
- !type:BiomeMarkerLoot
proto: OreGold
proto:
Grasslands: OreGold
Snow: SnowOreGold
- type: salvageLoot
id: OreSilver
@@ -31,7 +37,9 @@
guaranteed: true
loots:
- !type:BiomeMarkerLoot
proto: OreSilver
proto:
Grasslands: OreSilver
Snow: SnowOreSilver
# - High value
- type: salvageLoot
@@ -40,7 +48,9 @@
guaranteed: true
loots:
- !type:BiomeMarkerLoot
proto: OrePlasma
proto:
Grasslands: OrePlasma
Snow: SnowOrePlasma
- type: salvageLoot
id: OreUranium
@@ -48,7 +58,9 @@
guaranteed: true
loots:
- !type:BiomeMarkerLoot
proto: OreUranium
proto:
Grasslands: OreUranium
Snow: SnowOreUranium
- type: salvageLoot
id: OreBananium
@@ -56,7 +68,9 @@
guaranteed: true
loots:
- !type:BiomeMarkerLoot
proto: OreBananium
proto:
Grasslands: OreBananium
Snow: SnowOreBananium
- type: salvageLoot
id: OreArtifactFragment
@@ -64,4 +78,6 @@
guaranteed: true
loots:
- !type:BiomeMarkerLoot
proto: OreArtifactFragment
proto:
Grasslands: OreArtifactFragment
Snow: SnowOreArtifactFragment

View File

@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "https://github.com/Citadel-Station-13/Citadel-Station-13-RP/blob/817e7c1f225876b45891e3f06908e6d032f0a8bc/icons/turf/walls.dmiMade, rock_bananium made by brainfood1183 (github) for ss14",
"copyright": "https://github.com/Citadel-Station-13/Citadel-Station-13-RP/blob/817e7c1f225876b45891e3f06908e6d032f0a8bc/icons/turf/walls.dmi, rock_bananium made by brainfood1183 (github) for ss14, rock_snow and co from https://github.com/tgstation/tgstation/tree/e929cf39cded5207d63df1fa8521f41f2816b383",
"size": {
"x": 32,
"y": 32
@@ -22,6 +22,21 @@
{
"name": "rock_west"
},
{
"name": "rock_snow"
},
{
"name": "rock_snow_south"
},
{
"name": "rock_snow_east"
},
{
"name": "rock_snow_north"
},
{
"name": "rock_snow_west"
},
{
"name": "rock_artifact_fragment"
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB