mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 01:08:25 +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] =
|
||||
Gain a free [building] [cityFilter] =
|
||||
|
||||
# Uniques not found in JSON files
|
||||
# Countables
|
||||
|
||||
Only available after [] turns =
|
||||
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 =
|
||||
Remaining [civFilter] Civilizations =
|
||||
|
||||
# Unused Resources
|
||||
|
||||
|
@ -32,6 +32,10 @@ object Countables {
|
||||
if (countable.equalsPlaceholderText("[] Buildings"))
|
||||
return civInfo.cities.sumOf { it.cityConstructions.getBuiltBuildings()
|
||||
.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))
|
||||
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.stats.Stat
|
||||
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.
|
||||
|
||||
@ -71,6 +72,10 @@ enum class UniqueParameterType(
|
||||
|
||||
override fun isKnownValue(parameterText: String, ruleset: Ruleset) = when {
|
||||
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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user