mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-03 13:30:51 +07:00
Add owned tiles countable (#12423)
* Added owned tiles countable * Applied yairm210's suggestions * Added template.properties key
This commit is contained in:
parent
c1e52d9073
commit
bdcc0bb0d6
@ -1973,6 +1973,7 @@ Gain a free [building] [cityFilter] =
|
||||
# Countables
|
||||
|
||||
Remaining [civFilter] Civilizations =
|
||||
Owned [tileFilter] Tiles =
|
||||
|
||||
# Unused Resources
|
||||
|
||||
|
@ -37,6 +37,9 @@ object Countables {
|
||||
return gameInfo.civilizations.filter { !it.isDefeated() }
|
||||
.count { it.matchesFilter(placeholderParameters[0]) }
|
||||
|
||||
if (countable.equalsPlaceholderText("Owned [] Tiles"))
|
||||
return civInfo.cities.sumOf { it.getTiles().count { it.matchesFilter(placeholderParameters[0]) } }
|
||||
|
||||
if (gameInfo.ruleset.tileResources.containsKey(countable))
|
||||
return stateForConditionals.getResourceAmount(countable)
|
||||
|
||||
|
@ -76,6 +76,7 @@ enum class UniqueParameterType(
|
||||
parameterText.equalsPlaceholderText("[] Cities") -> true
|
||||
parameterText.equalsPlaceholderText("[] Units") -> true
|
||||
parameterText.equalsPlaceholderText("Remaining [] Civilizations") -> true
|
||||
parameterText.equalsPlaceholderText("Owned [] Tiles") -> true
|
||||
else -> super.isKnownValue(parameterText, ruleset)
|
||||
}
|
||||
|
||||
|
@ -313,6 +313,7 @@ Allowed values:
|
||||
- `Units`, `[mapUnitFilter] Units`
|
||||
- `[buildingFilter] Buildings`
|
||||
- `Remaining [civFilter] Civilizations`
|
||||
- `[tileFilter] Tiles`
|
||||
- Stat name - gets the stat *reserve*, not the amount per turn (can be city stats or civilization stats, depending on where the unique is used)
|
||||
- Resource name (can be city stats or civilization stats, depending on where the unique is used)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user