Skip to content

Commit

Permalink
docs: better unique parameter documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Apr 25, 2023
1 parent 079c237 commit cb62686
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
51 changes: 30 additions & 21 deletions docs/Modders/Unique-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit cb62686

Please sign in to comment.