chore: remove deprecated uniques

This commit is contained in:
yairm210 2024-10-21 22:14:36 +03:00
parent 84abd709f0
commit 44d08c8703
2 changed files with 6 additions and 10 deletions

View File

@ -150,18 +150,14 @@ class NaturalWonderGenerator(val ruleset: Ruleset, val randomness: MapGeneration
clearTile(location, wonder.occursOn)
}
val conversionUniques = wonder.getMatchingUniques(UniqueType.NaturalWonderConvertNeighbors, StateForConditionals.IgnoreConditionals) +
wonder.getMatchingUniques(UniqueType.NaturalWonderConvertNeighborsExcept, StateForConditionals.IgnoreConditionals)
val conversionUniques = wonder.getMatchingUniques(UniqueType.NaturalWonderConvertNeighbors, StateForConditionals.IgnoreConditionals)
if (conversionUniques.none()) return
for (tile in location.neighbors) {
val state = StateForConditionals(tile = tile)
for (unique in conversionUniques) {
if (!unique.conditionalsApply(state)) continue
val convertTo = if (unique.type == UniqueType.NaturalWonderConvertNeighborsExcept) {
if (tile.matchesWonderFilter(unique.params[0])) continue
unique.params[1]
} else unique.params[0]
val convertTo = unique.params[0]
if (tile.baseTerrain == convertTo || convertTo in tile.terrainFeatures) continue
if (convertTo == Constants.lakes && tile.isCoastalTile()) continue
val terrainObject = location.ruleset.terrains[convertTo] ?: continue

View File

@ -539,10 +539,6 @@ enum class UniqueType(
NaturalWonderConvertNeighbors("Neighboring tiles will convert to [baseTerrain/terrainFeature]", UniqueTarget.Terrain, flags = UniqueFlag.setOfHiddenToUsers,
docDescription = "Supports conditionals that need only a Tile as context and nothing else, like `<with [n]% chance>`, and applies them per neighbor." +
"\nIf your mod renames Coast or Lakes, do not use this with one of these as parameter, as the code preventing artifacts won't work."),
@Deprecated("As of 4.12.19", ReplaceWith("Neighboring tiles will convert to [baseTerrain/terrainFeature] <in tiles without [simpleTerrain]>"))
NaturalWonderConvertNeighborsExcept("Neighboring tiles except [simpleTerrain] will convert to [baseTerrain/terrainFeature]", UniqueTarget.Terrain, flags = UniqueFlag.setOfHiddenToUsers,
docDescription = "Supports conditionals that need only a Tile as context and nothing else, like `<with [n]% chance>`, and applies them per neighbor." +
"\nIf your mod renames Coast or Lakes, do not use this with one of these as parameter, as the code preventing artifacts won't work."),
GrantsStatsToFirstToDiscover("Grants [stats] to the first civilization to discover it", UniqueTarget.Terrain),
// General terrain
@ -998,6 +994,10 @@ enum class UniqueType(
// endregion
///////////////////////////////////////////// region 99 DEPRECATED AND REMOVED /////////////////////////////////////////////
@Deprecated("As of 4.12.19", ReplaceWith("Neighboring tiles will convert to [baseTerrain/terrainFeature] <in tiles without [simpleTerrain]>"), DeprecationLevel.ERROR)
NaturalWonderConvertNeighborsExcept("Neighboring tiles except [simpleTerrain] will convert to [baseTerrain/terrainFeature]", UniqueTarget.Terrain, flags = UniqueFlag.setOfHiddenToUsers,
docDescription = "Supports conditionals that need only a Tile as context and nothing else, like `<with [n]% chance>`, and applies them per neighbor." +
"\nIf your mod renames Coast or Lakes, do not use this with one of these as parameter, as the code preventing artifacts won't work."),
@Deprecated("As of 4.12.16", ReplaceWith("in tiles adjacent to [tileFilter] tiles"), DeprecationLevel.ERROR)
ConditionalAdjacentToOld("in tiles adjacent to [tileFilter]", UniqueTarget.Conditional),
@Deprecated("As of 4.12.16", ReplaceWith("in tiles not adjacent to [tileFilter] tiles"), DeprecationLevel.ERROR)