mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-31 15:19:29 +07:00
More Unique types, with some deprecations
This commit is contained in:
@ -77,13 +77,6 @@ class CivConstructions {
|
||||
.mapValues { unique -> unique.value.sumOf { it.params[1].toInt() } }
|
||||
.toMutableMap()
|
||||
|
||||
// Deprecated since 3.16.15
|
||||
statUniquesData[Stat.Culture] = (statUniquesData[Stat.Culture] ?: 0) +
|
||||
civInfo.getMatchingUniques(UniqueType.FreeStatBuildingsDeprecated)
|
||||
.sumOf { it.params[0].toInt() }
|
||||
//
|
||||
|
||||
|
||||
for ((stat, amount) in statUniquesData) {
|
||||
addFreeStatBuildings(stat, amount)
|
||||
}
|
||||
@ -102,11 +95,8 @@ class CivConstructions {
|
||||
}
|
||||
|
||||
private fun addFreeSpecificBuildings() {
|
||||
val buildingsUniquesData = (civInfo.getMatchingUniques(UniqueType.FreeSpecificBuildings)
|
||||
// Deprecated since 3.16.15
|
||||
+ civInfo.getMatchingUniques(UniqueType.FreeSpecificBuildingsDeprecated)
|
||||
//
|
||||
).groupBy { it.params[0] }
|
||||
val buildingsUniquesData = civInfo.getMatchingUniques(UniqueType.FreeSpecificBuildings)
|
||||
.groupBy { it.params[0] }
|
||||
.mapValues { unique -> unique.value.sumOf { it.params[1].toInt() } }
|
||||
|
||||
for ((building, amount) in buildingsUniquesData) {
|
||||
|
@ -346,7 +346,8 @@ class MapUnit {
|
||||
return 1
|
||||
}
|
||||
|
||||
visibilityRange += getMatchingUniques(UniqueType.Sight, checkCivInfoUniques = true).sumOf { it.params[0].toInt() }
|
||||
visibilityRange += getMatchingUniques(UniqueType.Sight, checkCivInfoUniques = true)
|
||||
.sumOf { it.params[0].toInt() }
|
||||
|
||||
// Deprecated since 3.17.5
|
||||
for (unique in getMatchingUniques(UniqueType.SightUnits))
|
||||
|
@ -364,7 +364,7 @@ open class TileInfo {
|
||||
return terrain.getMatchingUniques(UniqueType.OverrideFertility).first().params[0].toInt()
|
||||
else
|
||||
fertility += terrain.getMatchingUniques(UniqueType.AddFertility)
|
||||
.sumBy { it.params[0].toInt() }
|
||||
.sumOf { it.params[0].toInt() }
|
||||
}
|
||||
if (isAdjacentToRiver()) fertility += 1
|
||||
if (isAdjacentToFreshwater) fertility += 1 // meaning total +2 for river
|
||||
|
@ -466,9 +466,9 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
|
||||
FreeStatBuildings("Provides the cheapest [stat] building in your first [amount] cities for free", UniqueTarget.Global), // used in Policy
|
||||
FreeSpecificBuildings("Provides a [buildingName] in your first [amount] cities for free", UniqueTarget.Global), // used in Policy
|
||||
|
||||
@Deprecated("As of 3.16.15", ReplaceWith("Provides the cheapest [stat] building in your first [amount] cities for free"))
|
||||
@Deprecated("As of 3.16.15 - removed 3.18.4", ReplaceWith("Provides the cheapest [stat] building in your first [amount] cities for free"), DeprecationLevel.ERROR)
|
||||
FreeStatBuildingsDeprecated("Immediately creates the cheapest available cultural building in each of your first [amount] cities for free", UniqueTarget.Global),
|
||||
@Deprecated("As of 3.16.15", ReplaceWith("Provides a [buildingName] in your first [amount] cities for free"))
|
||||
@Deprecated("As of 3.16.15 - removed 3.18.4", ReplaceWith("Provides a [buildingName] in your first [amount] cities for free"), DeprecationLevel.ERROR)
|
||||
FreeSpecificBuildingsDeprecated("Immediately creates a [buildingName] in each of your first [amount] cities for free", UniqueTarget.Global),
|
||||
|
||||
///////////////////////////////////////////// META /////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user