docs: better unique parameter documentation

This commit is contained in:
Yair Morgenstern
2023-04-25 17:45:00 +03:00
parent 079c237547
commit cb626861df
2 changed files with 31 additions and 22 deletions

View File

@ -70,7 +70,7 @@ enum class UniqueParameterType(
}
},
/** Implemented by [MapUnit.matchesFilter][com.unciv.logic.map.MapUnit.matchesFilter] */
/** Implemented by [MapUnit.matchesFilter][com.unciv.logic.map.mapunit.MapUnit.matchesFilter] */
MapUnitFilter("mapUnitFilter", Constants.wounded, null, "Map Unit Filters") {
private val knownValues = setOf(Constants.wounded, Constants.barbarians, "City-State", Constants.embarked, "Non-City")
override fun getErrorSeverity(parameterText: String, ruleset: Ruleset):

View File

@ -9,6 +9,16 @@ These are split into two categories:
Note that all of these are case-sensitive!
## nationFilter
Allows filtering for specific nations.
- `All`
- `City-states`
- `Major`
- Nation name
- A unique a Nation has (verbatim, no placeholders)
## baseUnitFilter
Unit filters can be divided up into two parts: `baseUnitFilter`s and `mapUnitFilter`s.
@ -35,6 +45,19 @@ The following are allowed to be used:
- Any exact unique the unit type has
- Any combination of the above (will match only if all match). The format is `{filter1} {filter2}` and can match any number of filters. For example: `[{Military} {Water}]` units, `[{non-air} {Armor}]` units, etc. No space or other text is allowed between the `[` and the first `{`.
## mapUnitFilter
This indicates a unit as placed on the map. Compare with `baseUnitFilter`.
- Any matching [baseUnitFilter](#baseunitfilter)
- Any [nationFilter](#nationfilter) matching the owner
- Any unique the unit has - also includes uniques not caught by the [baseUnitFilter](#baseunitfilter), for example promotions
- `Wounded`
- `Embarked`
- `City-State`
- `Barbarians`, `Barbarian`
- Again, any combination of the above is also allowed, e.g. `[{Wounded} {Water}]` units.
## buildingFilter
Allows to only activate a unique for certain buildings. Allowed options are:
@ -53,16 +76,6 @@ Allows to only activate a unique for certain buildings. Allowed options are:
- Provides that stat as a bonus for resources (e.g. +1 Food from every Wheat)
- Provides that stat per some amount of population (e.g. +1 Science for every 2 population [cityFilter])
## nationFilter
Allows filtering for specific nations.
- `All`
- `City-states`
- `Major`
- Nation name
- A unique a Nation has (verbatim, no placeholders)
## cityFilter
cityFilters allow us to choose the range of cities affected by this unique:
@ -97,17 +110,6 @@ Allowed values are:
- `All Road` - for Roads & Railroads
## mapUnitFilter
This indicates a unit as placed on the map. Compare with `baseUnitFilter`.
- Any value noted in `baseUnitFilter`
- `Wounded`
- `Embarked`
- `City-State`
- `Barbarians`, `Barbarian`
- Again, any combination of the above is also allowed, e.g. `[{Wounded} {Water}]` units.
## populationFilter
A filter determining a part of the population of a city. It can be any of the following values:
@ -186,6 +188,13 @@ Also note: Resource filters depend on whether a viewing civ is known in the cont
So for instance, the unique "[stats] from [tileFilter] tiles [cityFilter]" can match several cases:
## tileFilter
Any of:
- [terrainFilter](#terrainfilter) for this tile
- [improvementFilter](#improvementfilter) for this tile
- `unimproved' if no improvement exists
## terrainQuality
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.