mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 14:24:43 -04:00
"<for [nationFilter]>" conditional added
This commit is contained in:
parent
7748ef42ab
commit
0d9cff0922
@ -302,7 +302,9 @@ class Nation : RulesetObject() {
|
|||||||
"All" -> true
|
"All" -> true
|
||||||
name -> true
|
name -> true
|
||||||
"Major" -> isMajorCiv
|
"Major" -> isMajorCiv
|
||||||
|
// To be deprecated, replaced by "City-States"
|
||||||
"CityState" -> isCityState
|
"CityState" -> isCityState
|
||||||
|
Constants.cityStates -> isCityState
|
||||||
else -> uniques.contains(filter)
|
else -> uniques.contains(filter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,6 +175,21 @@ enum class UniqueParameterType(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** Implemented by [Nation.matchesFilter][com.unciv.models.ruleset.Building.matchesFilter] */
|
||||||
|
NationFilter("nationFilter", Constants.cityStates) {
|
||||||
|
private val knownValues = setOf(Constants.cityStates, "Major", "All")
|
||||||
|
|
||||||
|
override fun getErrorSeverity(
|
||||||
|
parameterText: String,
|
||||||
|
ruleset: Ruleset
|
||||||
|
): UniqueType.UniqueComplianceErrorSeverity? {
|
||||||
|
if (parameterText in knownValues) return null
|
||||||
|
if (ruleset.nations.containsKey(parameterText)) return null
|
||||||
|
if (ruleset.nations.values.any { it.hasUnique(parameterText) }) return null
|
||||||
|
return UniqueType.UniqueComplianceErrorSeverity.RulesetSpecific
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/** Implemented by [CityInfo.matchesFilter][com.unciv.logic.city.City.matchesFilter] */
|
/** Implemented by [CityInfo.matchesFilter][com.unciv.logic.city.City.matchesFilter] */
|
||||||
CityFilter("cityFilter", "in all cities", null, "City filters") {
|
CityFilter("cityFilter", "in all cities", null, "City filters") {
|
||||||
private val cityFilterStrings = setOf(
|
private val cityFilterStrings = setOf(
|
||||||
|
@ -628,6 +628,7 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
|||||||
|
|
||||||
|
|
||||||
/////// civ conditionals
|
/////// civ conditionals
|
||||||
|
ConditionalCivFilter("for [nationFilter]", UniqueTarget.Conditional),
|
||||||
ConditionalWar("when at war", UniqueTarget.Conditional),
|
ConditionalWar("when at war", UniqueTarget.Conditional),
|
||||||
ConditionalNotWar("when not at war", UniqueTarget.Conditional),
|
ConditionalNotWar("when not at war", UniqueTarget.Conditional),
|
||||||
ConditionalGoldenAge("during a Golden Age", UniqueTarget.Conditional),
|
ConditionalGoldenAge("during a Golden Age", UniqueTarget.Conditional),
|
||||||
|
@ -65,6 +65,7 @@ class SpecialistAllocationTable(val cityScreen: CityScreen) : Table(BaseScreen.s
|
|||||||
else Color.GRAY // unassigned
|
else Color.GRAY // unassigned
|
||||||
val icon = ImageGetter.getSpecialistIcon(color)
|
val icon = ImageGetter.getSpecialistIcon(color)
|
||||||
specialistIconTable.add(icon).size(30f)
|
specialistIconTable.add(icon).size(30f)
|
||||||
|
if (i % 6 == 0) specialistIconTable.row()
|
||||||
}
|
}
|
||||||
return specialistIconTable
|
return specialistIconTable
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,16 @@ 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 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])
|
- 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
|
||||||
|
- Nation unique
|
||||||
|
|
||||||
## cityFilter
|
## cityFilter
|
||||||
|
|
||||||
cityFilters allow us to choose the range of cities affected by this unique:
|
cityFilters allow us to choose the range of cities affected by this unique:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user