Trying to fix check fails (#1036)

* Update unique_loot.yml

* test

* slarti help

* test omega
This commit is contained in:
Ed
2025-03-18 00:41:43 +03:00
committed by GitHub
parent a6250d7491
commit 8e1f531767
4 changed files with 209 additions and 31 deletions

View File

@@ -204,45 +204,52 @@ public sealed partial class CP14DemiplaneSystem
private void GeneratorMapInit(Entity<CP14DemiplaneGeneratorDataComponent> generator, ref MapInitEvent args)
{
//Location generation
HashSet<CP14DemiplaneLocationPrototype> suitableConfigs = new();
foreach (var locationConfig in _proto.EnumeratePrototypes<CP14DemiplaneLocationPrototype>())
{
suitableConfigs.Add(locationConfig);
}
CP14DemiplaneLocationPrototype? selectedConfig = null;
while (suitableConfigs.Count > 0)
//Location generation
if (generator.Comp.Location is null)
{
var randomConfig = _random.Pick(suitableConfigs);
if (!generator.Comp.TiersContent.ContainsKey(randomConfig.Tier))
HashSet<CP14DemiplaneLocationPrototype> suitableConfigs = new();
foreach (var locationConfig in _proto.EnumeratePrototypes<CP14DemiplaneLocationPrototype>())
{
suitableConfigs.Remove(randomConfig);
continue;
suitableConfigs.Add(locationConfig);
}
if (!_random.Prob(generator.Comp.TiersContent[randomConfig.Tier]))
while (suitableConfigs.Count > 0)
{
suitableConfigs.Remove(randomConfig);
continue;
var randomConfig = _random.Pick(suitableConfigs);
if (!generator.Comp.TiersContent.ContainsKey(randomConfig.Tier))
{
suitableConfigs.Remove(randomConfig);
continue;
}
if (!_random.Prob(generator.Comp.TiersContent[randomConfig.Tier]))
{
suitableConfigs.Remove(randomConfig);
continue;
}
selectedConfig = randomConfig;
break;
}
selectedConfig = randomConfig;
break;
}
if (selectedConfig is null)
{
// We dont should be here
if (selectedConfig is null)
Log.Warning("Expedition mission generation failed: No suitable location configs.");
QueueDel(generator);
return;
}
generator.Comp.Location = selectedConfig;
}
else
{
// We dont should be here
Log.Warning("Expedition mission generation failed: No suitable location configs.");
QueueDel(generator);
return;
if (!_proto.TryIndex(generator.Comp.Location, out selectedConfig))
return;
}
generator.Comp.Location = selectedConfig;
//Modifier generation
Dictionary<CP14DemiplaneModifierPrototype, float> suitableModifiersWeights = new();
foreach (var modifier in _proto.EnumeratePrototypes<CP14DemiplaneModifierPrototype>())

View File

@@ -1,8 +1,14 @@
- type: entity
id: CP14SpawnUniqueBase
abstract: true
parent: MarkerBase
categories: [ ForkFiltered, Spawner ]
- type: entity
name: random artifact spawner
id: CP14SpawnUniqueArtifact
parent: MarkerBase
categories: [ ForkFiltered, DoNotMap ]
parent: CP14SpawnUniqueBase
categories: [ DoNotMap ]
components:
- type: CP14UniqueLootSpawner
tag: CP14UniqueSpawnDemiplanetLoot
@@ -16,8 +22,7 @@
- type: entity
name: random tradepost spawner
id: CP14SpawnUniqueTradepost
parent: MarkerBase
categories: [ ForkFiltered ]
parent: CP14SpawnUniqueBase
components:
- type: CP14UniqueLootSpawner
tag: CP14UniqueSpawnTradepost

View File

@@ -57,4 +57,31 @@
MapLight: 1
selectedModifiers:
- EntryRoom
- Exit
- type: entity
id: CP14DemiplaneKeyOmega
parent: CP14BaseSubdimensionalKey
suffix: Omega
components:
- type: Sprite
scale: 2, 2
layers:
- state: core
color: red
- type: CP14DemiplaneGeneratorData
tiersContent:
1: 0.6 # We dont have lot t2 content now. In future, decrease to 0.33
2: 1
limits:
Reward: 5
Danger: 5
Fun: 1
Weather: 1
MapLight: 1
location: T1OmegaTest
autoRifts:
- CP14DemiplanePassway
selectedModifiers:
- EntryRoom
- Exit

View File

@@ -0,0 +1,139 @@
- type: cp14DemiplaneLocation
id: T1OmegaTest
tier: 1
locationConfig: CP14OmegaTest
name: cp14-demiplane-location-cave
tags:
- CP14DemiplaneOres
- CP14DemiplaneUnderground
- CP14DemiplaneHerbals
- CP14DemiplaneWater
- CP14DemiplaneAnimalsSwamp
- type: dungeonConfig
id: CP14OmegaTest
layers:
#Masks
- !type:PrototypeDunGen
proto: CP14DemiplaneOmegaPlatingMaskBorder
- !type:PrototypeDunGen
proto: CP14DemiplaneOmegaCavesFloorMaskStone
- !type:PrototypeDunGen
proto: CP14DemiplaneOmegaCavesFloorMaskAir
- !type:PrototypeDunGen
proto: CP14DemiplaneOmegaCavesFloorMaskAir2
- !type:PrototypeDunGen
proto: CP14DemiplaneOmegaCavesFloorMaskAir3
# Biomes
- !type:BiomeDunGen
biomeTemplate: CP14CavesIndestructibleFill
tileMask:
- Plating
- !type:BiomeDunGen
biomeTemplate: CP14CavesGeneric
tileMask:
- CP14FloorSand
- !type:BiomeDunGen
biomeTemplate: CP14Grassland
tileMask:
- CP14FloorGrass
- !type:BiomeDunGen
biomeTemplate: CP14LeafMaze
tileMask:
- CP14FloorSnow
- !type:BiomeDunGen
biomeTemplate: CP14SwampFill
tileMask:
- CP14FloorGrassTall
- type: dungeonConfig
id: CP14DemiplaneOmegaPlatingMaskBorder
layers:
- !type:NoiseDistanceDunGen
size: 260, 260
distanceConfig: !type:DunGenEuclideanSquaredDistance
blendWeight: 1
layers:
- tile: Plating
threshold: 0.50
noise:
frequency: 0.010
noiseType: OpenSimplex2
fractalType: FBm
octaves: 5
lacunarity: 2
gain: 0.5
- type: dungeonConfig
id: CP14DemiplaneOmegaCavesFloorMaskStone
layers:
- !type:NoiseDistanceDunGen
size: 200, 200
distanceConfig: !type:DunGenEuclideanSquaredDistance
blendWeight: 0.9
layers:
- tile: CP14FloorSand
threshold: 0.50
noise:
frequency: 0.010
noiseType: OpenSimplex2
fractalType: FBm
octaves: 5
lacunarity: 2
gain: 0.5
- type: dungeonConfig
id: CP14DemiplaneOmegaCavesFloorMaskAir
layers:
- !type:NoiseDistanceDunGen
size: 100, 100
distanceConfig: !type:DunGenEuclideanSquaredDistance
blendWeight: 0.7
layers:
- tile: CP14FloorGrass
threshold: 0.60
noise:
frequency: 0.020
noiseType: OpenSimplex2
fractalType: FBm
octaves: 5
lacunarity: 2
gain: 0.5
- type: dungeonConfig
id: CP14DemiplaneOmegaCavesFloorMaskAir2
layers:
- !type:NoiseDistanceDunGen
size: 80, 80
distanceConfig: !type:DunGenEuclideanSquaredDistance
blendWeight: 0.5
layers:
- tile: CP14FloorSnow
threshold: 0.50
noise:
frequency: 0.030
noiseType: OpenSimplex2
fractalType: FBm
octaves: 5
lacunarity: 2
gain: 0.5
- type: dungeonConfig
id: CP14DemiplaneOmegaCavesFloorMaskAir3
layers:
- !type:NoiseDistanceDunGen
size: 100, 100
distanceConfig: !type:DunGenEuclideanSquaredDistance
blendWeight: 0.4
layers:
- tile: CP14FloorGrassTall
threshold: 0.50
noise:
frequency: 0.045
noiseType: OpenSimplex2
fractalType: FBm
octaves: 5
lacunarity: 2
gain: 0.5