mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 17:28:57 +07:00
Added "Remaining [civFilter] Civilizations" as countable value
This commit is contained in:
@ -1968,13 +1968,9 @@ Cannot be built on [tileFilter] tiles =
|
|||||||
Does not need removal of [feature] =
|
Does not need removal of [feature] =
|
||||||
Gain a free [building] [cityFilter] =
|
Gain a free [building] [cityFilter] =
|
||||||
|
|
||||||
# Uniques not found in JSON files
|
# Countables
|
||||||
|
|
||||||
Only available after [] turns =
|
Remaining [civFilter] Civilizations =
|
||||||
This Unit upgrades for free =
|
|
||||||
[stats] when a city adopts this religion for the first time =
|
|
||||||
Never destroyed when the city is captured =
|
|
||||||
Invisible to others =
|
|
||||||
|
|
||||||
# Unused Resources
|
# Unused Resources
|
||||||
|
|
||||||
|
@ -33,6 +33,10 @@ object Countables {
|
|||||||
return civInfo.cities.sumOf { it.cityConstructions.getBuiltBuildings()
|
return civInfo.cities.sumOf { it.cityConstructions.getBuiltBuildings()
|
||||||
.count { it.matchesFilter(placeholderParameters[0]) } }
|
.count { it.matchesFilter(placeholderParameters[0]) } }
|
||||||
|
|
||||||
|
if (countable.equalsPlaceholderText("Remaining [] Civilizations"))
|
||||||
|
return gameInfo.civilizations.filter { !it.isDefeated() }
|
||||||
|
.count { it.matchesFilter(placeholderParameters[0]) }
|
||||||
|
|
||||||
if (gameInfo.ruleset.tileResources.containsKey(countable))
|
if (gameInfo.ruleset.tileResources.containsKey(countable))
|
||||||
return stateForConditionals.getResourceAmount(countable)
|
return stateForConditionals.getResourceAmount(countable)
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ import com.unciv.models.ruleset.unique.UniqueParameterType.Companion.guessTypeFo
|
|||||||
import com.unciv.models.ruleset.validation.Suppression
|
import com.unciv.models.ruleset.validation.Suppression
|
||||||
import com.unciv.models.stats.Stat
|
import com.unciv.models.stats.Stat
|
||||||
import com.unciv.models.translations.TranslationFileWriter
|
import com.unciv.models.translations.TranslationFileWriter
|
||||||
|
import com.unciv.models.translations.equalsPlaceholderText
|
||||||
|
|
||||||
// 'region' names beginning with an underscore are used here for a prettier "Structure window" - they go in front of the rest.
|
// 'region' names beginning with an underscore are used here for a prettier "Structure window" - they go in front of the rest.
|
||||||
|
|
||||||
@ -71,6 +72,10 @@ enum class UniqueParameterType(
|
|||||||
|
|
||||||
override fun isKnownValue(parameterText: String, ruleset: Ruleset) = when {
|
override fun isKnownValue(parameterText: String, ruleset: Ruleset) = when {
|
||||||
parameterText.toIntOrNull() != null -> true
|
parameterText.toIntOrNull() != null -> true
|
||||||
|
parameterText.equalsPlaceholderText("[] Buildings") -> true
|
||||||
|
parameterText.equalsPlaceholderText("[] Cities") -> true
|
||||||
|
parameterText.equalsPlaceholderText("[] Units") -> true
|
||||||
|
parameterText.equalsPlaceholderText("Remaining [] Civilizations") -> true
|
||||||
else -> super.isKnownValue(parameterText, ruleset)
|
else -> super.isKnownValue(parameterText, ruleset)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user