private bool GenerateExceptionalLandmark(PlanetNode planet) { for (int i = 0; i < 5; i++) // Safety measure in case of impossible conditions, and to reroll if chances are plain bad { int chance = 0; switch (Globals.RollD5()) { case 1: // Glacier switch (planet.ClimateType) { case ClimateTypes.BurningWorld: chance -= 100; break; case ClimateTypes.HotWorld: chance -= 20; break; case ClimateTypes.TemperateWorld: chance += 10; break; case ClimateTypes.ColdWorld: chance += 50; break; case ClimateTypes.IceWorld: chance += 100; break; default: throw new ArgumentOutOfRangeException(); } if (BaseTerrain == TerritoryBaseTerrain.Mountain) { chance += 25; } chance += TerritoryTraitExtremeTemperature * 15; if (Globals.RollD100() <= chance) { LandmarkGlacier++; return(true); } break; case 2: // Inland Sea chance = 50; if (BaseTerrain == TerritoryBaseTerrain.Mountain) { chance -= 50; } if (BaseTerrain == TerritoryBaseTerrain.Wasteland) { chance -= 60; } if (planet.ClimateType == ClimateTypes.BurningWorld) { chance -= 100; } if (planet.ClimateType == ClimateTypes.HotWorld) { chance -= 40; } chance += TerritoryTraitExpansive * 15; chance += TerritoryTraitFertile * 35; chance -= TerritoryTraitStagnant * 30; if (Globals.RollD100() <= chance) { LandmarkInlandSea++; return(true); } break; case 3: // Perpetual Storm if (planet.AtmosphereType == AtmosphereTypes.None || planet.AtmosphereType == AtmosphereTypes.Thin) { continue; } chance = 30; if (planet.AtmosphereType == AtmosphereTypes.Heavy) { chance += 25; } if (planet.ClimateType == ClimateTypes.IceWorld) { chance += 20; } if (planet.ClimateType == ClimateTypes.BurningWorld) { chance += 20; } if (planet.ClimateType == ClimateTypes.ColdWorld) { chance += 10; } if (planet.ClimateType == ClimateTypes.HotWorld) { chance += 10; } chance += TerritoryTraitBoundary * 20; chance += TerritoryTraitDesolate * 10; chance += TerritoryTraitExtremeTemperature * 15; chance -= TerritoryTraitFertile * 15; chance -= TerritoryTraitNotableSpecies * 10; chance += TerritoryTraitRuined * 50; chance -= TerritoryTraitStagnant * 20; if (Globals.RollD100() <= chance) { LandmarkPerpetualStorm++; return(true); } break; case 4: // Reef chance = 50; if (planet.ClimateType == ClimateTypes.BurningWorld) { chance -= 50; } if (BaseTerrain == TerritoryBaseTerrain.Mountain) { chance -= 40; } if (BaseTerrain == TerritoryBaseTerrain.Wasteland) { chance -= 40; } if (Globals.RollD100() <= chance) { LandmarkReef++; return(true); } break; case 5: // Whirlpool chance = 50; if (planet.ClimateType == ClimateTypes.BurningWorld) { chance -= 50; } if (BaseTerrain == TerritoryBaseTerrain.Mountain) { chance -= 40; } if (BaseTerrain == TerritoryBaseTerrain.Wasteland) { chance -= 40; } if (planet.GetNumOrbitalFeatures() < 2) { chance -= 45; } else { chance += (planet.GetNumOrbitalFeatures() - 2) * 50; } if (Globals.RollD100() <= chance) { LandmarkWhirlpool++; return(true); } break; } } return(false); }