mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-23 03:23:17 -04:00
Added promotionName as possible value for mapUnitFilter
This commit is contained in:
parent
3dbedf04ba
commit
37b9943ff3
@ -554,6 +554,7 @@ class MapUnit : IsPartOfGameInfoSerialization {
|
|||||||
if (baseUnit.matchesFilter(filter)) return true
|
if (baseUnit.matchesFilter(filter)) return true
|
||||||
if (civ.matchesFilter(filter)) return true
|
if (civ.matchesFilter(filter)) return true
|
||||||
if (tempUniquesMap.containsKey(filter)) return true
|
if (tempUniquesMap.containsKey(filter)) return true
|
||||||
|
if (promotions.promotions.contains(filter)) return true
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,7 @@ enum class UniqueParameterType(
|
|||||||
|
|
||||||
override fun isKnownValue(parameterText: String, ruleset: Ruleset) = when {
|
override fun isKnownValue(parameterText: String, ruleset: Ruleset) = when {
|
||||||
parameterText in knownValues -> true
|
parameterText in knownValues -> true
|
||||||
|
parameterText in ruleset.unitPromotions -> true
|
||||||
ruleset.unitPromotions.values.any { it.hasUnique(parameterText) } -> true
|
ruleset.unitPromotions.values.any { it.hasUnique(parameterText) } -> true
|
||||||
CivFilter.isKnownValue(parameterText, ruleset) -> true
|
CivFilter.isKnownValue(parameterText, ruleset) -> true
|
||||||
else -> BaseUnitFilter.isKnownValue(parameterText, ruleset)
|
else -> BaseUnitFilter.isKnownValue(parameterText, ruleset)
|
||||||
|
@ -34,6 +34,8 @@ Display of complex filters in Civilopedia may become unreadable. If so, consider
|
|||||||
|
|
||||||
Allows filtering for specific civs.
|
Allows filtering for specific civs.
|
||||||
|
|
||||||
|
Allowed values:
|
||||||
|
|
||||||
- `Human player`
|
- `Human player`
|
||||||
- `AI player`
|
- `AI player`
|
||||||
- [nationFilter](#nationfilter)
|
- [nationFilter](#nationfilter)
|
||||||
@ -42,6 +44,8 @@ Allows filtering for specific civs.
|
|||||||
|
|
||||||
Allows filtering for specific nations. Used by [ModOptions.nationsToRemove](Mod-file-structure/5-Miscellaneous-JSON-files.md#modoptionsjson).
|
Allows filtering for specific nations. Used by [ModOptions.nationsToRemove](Mod-file-structure/5-Miscellaneous-JSON-files.md#modoptionsjson).
|
||||||
|
|
||||||
|
Allowed values:
|
||||||
|
|
||||||
- `All`
|
- `All`
|
||||||
- `City-states`
|
- `City-states`
|
||||||
- `Major`
|
- `Major`
|
||||||
@ -55,7 +59,7 @@ The former is tested against the unit as it appears in the json.
|
|||||||
This means it doesn't have an owning civ or tile it stands on, just its base properties.
|
This means it doesn't have an owning civ or tile it stands on, just its base properties.
|
||||||
The latter is tested against the unit as it appears on the map, including its nation, tile, health and all other properties.
|
The latter is tested against the unit as it appears on the map, including its nation, tile, health and all other properties.
|
||||||
|
|
||||||
The following are allowed to be used:
|
Allowed values:
|
||||||
|
|
||||||
- unit name
|
- unit name
|
||||||
- unit type - e.g. Melee, Ranged, WaterSubmarine, etc.
|
- unit type - e.g. Melee, Ranged, WaterSubmarine, etc.
|
||||||
@ -79,9 +83,12 @@ The following are allowed to be used:
|
|||||||
|
|
||||||
This indicates a unit as placed on the map. Compare with `baseUnitFilter`.
|
This indicates a unit as placed on the map. Compare with `baseUnitFilter`.
|
||||||
|
|
||||||
|
Allowed values:
|
||||||
|
|
||||||
- Any matching [baseUnitFilter](#baseunitfilter)
|
- Any matching [baseUnitFilter](#baseunitfilter)
|
||||||
- Any [civFilter](#civfilter) matching the owner
|
- Any [civFilter](#civfilter) matching the owner
|
||||||
- Any unique the unit has - also includes uniques not caught by the [baseUnitFilter](#baseunitfilter), for example promotions
|
- Any unique the unit has - also includes uniques not caught by the [baseUnitFilter](#baseunitfilter), for example promotions
|
||||||
|
- Any promotion name
|
||||||
- `Wounded`
|
- `Wounded`
|
||||||
- `Embarked`
|
- `Embarked`
|
||||||
- `City-State`
|
- `City-State`
|
||||||
@ -92,7 +99,9 @@ You can check this in-game using the console with the `unit checkfilter <filter>
|
|||||||
|
|
||||||
## buildingFilter
|
## buildingFilter
|
||||||
|
|
||||||
Allows to only activate a unique for certain buildings. Allowed options are:
|
Allows to only activate a unique for certain buildings.
|
||||||
|
|
||||||
|
Allowed values:
|
||||||
|
|
||||||
- `All`
|
- `All`
|
||||||
- `Buildings`, `Building`
|
- `Buildings`, `Building`
|
||||||
@ -143,7 +152,7 @@ You can check this in-game using the console with the `city checkfilter <filter>
|
|||||||
|
|
||||||
For filtering a specific improvement.
|
For filtering a specific improvement.
|
||||||
|
|
||||||
Allowed values are:
|
Allowed values:
|
||||||
|
|
||||||
- improvement name
|
- improvement name
|
||||||
- `All`
|
- `All`
|
||||||
@ -152,7 +161,9 @@ Allowed values are:
|
|||||||
|
|
||||||
## populationFilter
|
## populationFilter
|
||||||
|
|
||||||
A filter determining a part of the population of a city. It can be any of the following values:
|
A filter determining a part of the population of a city.
|
||||||
|
|
||||||
|
Allowed values:
|
||||||
|
|
||||||
- `Population`
|
- `Population`
|
||||||
- `Specialists`
|
- `Specialists`
|
||||||
@ -161,7 +172,7 @@ A filter determining a part of the population of a city. It can be any of the fo
|
|||||||
|
|
||||||
## policyFilter
|
## policyFilter
|
||||||
|
|
||||||
Can be any of:
|
Allowed values:
|
||||||
|
|
||||||
- `All` or `all`
|
- `All` or `all`
|
||||||
- `[policyBranchName] branch`
|
- `[policyBranchName] branch`
|
||||||
@ -170,7 +181,8 @@ Can be any of:
|
|||||||
|
|
||||||
## combatantFilter
|
## combatantFilter
|
||||||
|
|
||||||
Can be any of:
|
Allowed values:
|
||||||
|
|
||||||
- [mapUnitFilter](#mapunitfilter), for unit combatants
|
- [mapUnitFilter](#mapunitfilter), for unit combatants
|
||||||
- `City`, `All`, or [civFilter](#civfilter), for city combatants
|
- `City`, `All`, or [civFilter](#civfilter), for city combatants
|
||||||
|
|
||||||
@ -188,7 +200,7 @@ Allowed values are `Hybrid` and the name of any terrain that has one of the foll
|
|||||||
|
|
||||||
Used by NaturalWonderGenerator to place natural wonders
|
Used by NaturalWonderGenerator to place natural wonders
|
||||||
|
|
||||||
Allowed values are:
|
Allowed values:
|
||||||
|
|
||||||
- `Land`
|
- `Land`
|
||||||
- `Water`
|
- `Water`
|
||||||
@ -226,7 +238,7 @@ them in other Uniques.
|
|||||||
|
|
||||||
At the moment only implemented for [ModOptions.techsToRemove](Mod-file-structure/5-Miscellaneous-JSON-files.md#modoptionsjson).
|
At the moment only implemented for [ModOptions.techsToRemove](Mod-file-structure/5-Miscellaneous-JSON-files.md#modoptionsjson).
|
||||||
|
|
||||||
Allowed values are:
|
Allowed values:
|
||||||
|
|
||||||
- `All`
|
- `All`
|
||||||
- The name of an Era
|
- The name of an Era
|
||||||
@ -235,7 +247,9 @@ Allowed values are:
|
|||||||
|
|
||||||
## terrainFilter
|
## terrainFilter
|
||||||
|
|
||||||
This indicates the terrain on a single tile. The following values are allowed:
|
This indicates the terrain on a single tile.
|
||||||
|
|
||||||
|
Allowed values:
|
||||||
|
|
||||||
- A filter names a specific json attribute (by name):
|
- A filter names a specific json attribute (by name):
|
||||||
- Base terrain
|
- Base terrain
|
||||||
@ -267,7 +281,7 @@ So for instance, the unique "[stats] from [tileFilter] tiles [cityFilter]" can m
|
|||||||
|
|
||||||
## tileFilter
|
## tileFilter
|
||||||
|
|
||||||
Any of:
|
Allowed values:
|
||||||
|
|
||||||
- [terrainFilter](#terrainfilter) for this tile
|
- [terrainFilter](#terrainfilter) for this tile
|
||||||
- [improvementFilter](#improvementfilter) for this tile
|
- [improvementFilter](#improvementfilter) for this tile
|
||||||
@ -280,7 +294,7 @@ You can check this in-game using the console with the `tile checkfilter <filter>
|
|||||||
|
|
||||||
Used to indicate for what use the terrain should be viewed when dividing the world into regions, in each of which a single player is placed at the start of the game.
|
Used to indicate for what use the terrain should be viewed when dividing the world into regions, in each of which a single player is placed at the start of the game.
|
||||||
|
|
||||||
Allowed values are:
|
Allowed values:
|
||||||
|
|
||||||
- improvement name (Note that "Road" and "Railroad" _do_ work as improvementFilters, but not as tileFilters at the moment.)
|
- improvement name (Note that "Road" and "Railroad" _do_ work as improvementFilters, but not as tileFilters at the moment.)
|
||||||
- `All`
|
- `All`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user