diff --git a/Content.Server/Salvage/SpawnSalvageMissionJob.cs b/Content.Server/Salvage/SpawnSalvageMissionJob.cs index 48e721c3d2..7034057261 100644 --- a/Content.Server/Salvage/SpawnSalvageMissionJob.cs +++ b/Content.Server/Salvage/SpawnSalvageMissionJob.cs @@ -206,13 +206,13 @@ public sealed class SpawnSalvageMissionJob : Job 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 reservedTiles) + private async Task SpawnDungeonLoot(Dungeon? dungeon, SalvageBiomeMod biomeMod, SalvageLootPrototype loot, EntityUid gridUid, MapGridComponent grid, Random random, List reservedTiles) { for (var i = 0; i < loot.LootRules.Count; i++) { @@ -222,9 +222,10 @@ public sealed class SpawnSalvageMissionJob : Job { case BiomeMarkerLoot biomeLoot: { - if (_entManager.TryGetComponent(gridUid, out var biome)) + if (_entManager.TryGetComponent(gridUid, out var biome) && + biomeLoot.Prototype.TryGetValue(biomeMod.ID, out var mod)) { - _biome.AddMarkerLayer(biome, biomeLoot.Prototype); + _biome.AddMarkerLayer(biome, mod); } } break; diff --git a/Content.Shared/Procedural/Loot/BiomeMarkerLoot.cs b/Content.Shared/Procedural/Loot/BiomeMarkerLoot.cs index 9ab51733f2..fad8674f07 100644 --- a/Content.Shared/Procedural/Loot/BiomeMarkerLoot.cs +++ b/Content.Shared/Procedural/Loot/BiomeMarkerLoot.cs @@ -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; /// public sealed class BiomeMarkerLoot : IDungeonLoot { - [DataField("proto", required: true, customTypeSerializer:typeof(PrototypeIdSerializer))] - public string Prototype = string.Empty; + [DataField("proto", required: true, + customTypeSerializer: typeof(PrototypeIdValueDictionarySerializer))] + public Dictionary Prototype = new(); } diff --git a/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml b/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml index 7e4b86e61c..64b0c71c01 100644 --- a/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml +++ b/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml @@ -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 diff --git a/Resources/Prototypes/Procedural/biome_ore_templates.yml b/Resources/Prototypes/Procedural/biome_ore_templates.yml index e548f64d2c..27936fb450 100644 --- a/Resources/Prototypes/Procedural/biome_ore_templates.yml +++ b/Resources/Prototypes/Procedural/biome_ore_templates.yml @@ -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 diff --git a/Resources/Prototypes/Procedural/biome_templates.yml b/Resources/Prototypes/Procedural/biome_templates.yml index 9c8b11f446..873d442da3 100644 --- a/Resources/Prototypes/Procedural/biome_templates.yml +++ b/Resources/Prototypes/Procedural/biome_templates.yml @@ -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 diff --git a/Resources/Prototypes/Procedural/salvage_loot.yml b/Resources/Prototypes/Procedural/salvage_loot.yml index ecc45159ab..43054b4bbd 100644 --- a/Resources/Prototypes/Procedural/salvage_loot.yml +++ b/Resources/Prototypes/Procedural/salvage_loot.yml @@ -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 diff --git a/Resources/Textures/Structures/Walls/rock.rsi/meta.json b/Resources/Textures/Structures/Walls/rock.rsi/meta.json index 3cbf7d4fae..26a3e9bd59 100644 --- a/Resources/Textures/Structures/Walls/rock.rsi/meta.json +++ b/Resources/Textures/Structures/Walls/rock.rsi/meta.json @@ -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" }, diff --git a/Resources/Textures/Structures/Walls/rock.rsi/rock_snow.png b/Resources/Textures/Structures/Walls/rock.rsi/rock_snow.png new file mode 100644 index 0000000000..9328003449 Binary files /dev/null and b/Resources/Textures/Structures/Walls/rock.rsi/rock_snow.png differ diff --git a/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_east.png b/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_east.png new file mode 100644 index 0000000000..3ffa1fb56d Binary files /dev/null and b/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_east.png differ diff --git a/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_north.png b/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_north.png new file mode 100644 index 0000000000..9f35a26cf4 Binary files /dev/null and b/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_north.png differ diff --git a/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_south.png b/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_south.png new file mode 100644 index 0000000000..e1a11d8cb6 Binary files /dev/null and b/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_south.png differ diff --git a/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_west.png b/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_west.png new file mode 100644 index 0000000000..ab6306ae46 Binary files /dev/null and b/Resources/Textures/Structures/Walls/rock.rsi/rock_snow_west.png differ