mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +07:00
In Civ VI there are certain units available only if a specific building is built, and this was raised as a request by modders as well. (#6160)
Instead of expanding the existing 'requires building' unique to units and adding limiters, it's both easier and more generalizable to add conditionals for cities with and without certain buildings to replace the uniques entirely
This commit is contained in:
@ -1048,7 +1048,7 @@
|
||||
"requiredBuilding": "Factory",
|
||||
"maintenance": 3,
|
||||
"requiredTech": "Ecology",
|
||||
"uniques": ["Must be next to [Desert]", "Cannot be built with [Nuclear Plant]"]
|
||||
"uniques": ["Must be next to [Desert]", "Only available <in cities without a [Nuclear Plant]>"]
|
||||
},
|
||||
{
|
||||
"name": "Recycling Center",
|
||||
@ -1073,7 +1073,7 @@
|
||||
"maintenance": 3,
|
||||
"requiredResource": "Uranium",
|
||||
"requiredTech": "Nuclear Fission",
|
||||
"uniques": ["Cannot be built with [Solar Plant]"]
|
||||
"uniques": ["Only available <in cities without a [Solar Plant]>"]
|
||||
},
|
||||
{
|
||||
"name": "Apollo Program",
|
||||
|
@ -917,7 +917,7 @@
|
||||
"requiredBuilding": "Factory",
|
||||
"maintenance": 3,
|
||||
"requiredTech": "Ecology",
|
||||
"uniques": ["Must be next to [Desert]", "Cannot be built with [Nuclear Plant]"]
|
||||
"uniques": ["Must be next to [Desert]", "Only available <in cities without a [Nuclear Plant]>"]
|
||||
},
|
||||
{
|
||||
"name": "Nuclear Plant",
|
||||
@ -927,7 +927,7 @@
|
||||
"maintenance": 3,
|
||||
"requiredResource": "Uranium",
|
||||
"requiredTech": "Nuclear Fission",
|
||||
"uniques": ["Cannot be built with [Solar Plant]"]
|
||||
"uniques": ["Only available <in cities without a [Solar Plant]>"]
|
||||
},
|
||||
{
|
||||
"name": "Apollo Program",
|
||||
|
@ -114,6 +114,10 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
|
||||
UniqueType.ConditionalNoPolicy ->
|
||||
state.civInfo != null && !state.civInfo.policies.isAdopted(condition.params[0])
|
||||
|
||||
UniqueType.ConditionalCityWithBuilding ->
|
||||
state.cityInfo != null && state.cityInfo.cityConstructions.containsBuildingOrEquivalent(condition.params[0])
|
||||
UniqueType.ConditionalCityWithoutBuilding ->
|
||||
state.cityInfo != null && !state.cityInfo.cityConstructions.containsBuildingOrEquivalent(condition.params[0])
|
||||
UniqueType.ConditionalSpecialistCount ->
|
||||
state.cityInfo != null && state.cityInfo.population.getNumberOfSpecialists() >= condition.params[0].toInt()
|
||||
UniqueType.ConditionalFollowerCount ->
|
||||
|
@ -342,7 +342,10 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
|
||||
|
||||
CostIncreasesPerCity("Cost increases by [amount] per owned city", UniqueTarget.Building),
|
||||
|
||||
@Deprecated("as of 3.19.9", ReplaceWith("Only available <in cities without a [buildingName]>"))
|
||||
CannotBeBuiltWith("Cannot be built with [buildingName]", UniqueTarget.Building),
|
||||
@Deprecated("as of 3.19.9", ReplaceWith("Only available <in cities with a [buildingName]>"))
|
||||
RequiresAnotherBuilding("Requires a [buildingName] in this city", UniqueTarget.Building),
|
||||
RequiresBuildingInAllCities("Requires a [buildingName] in all cities", UniqueTarget.Building),
|
||||
RequiresBuildingInSomeCities("Requires a [buildingName] in at least [amount] cities", UniqueTarget.Building),
|
||||
@ -587,6 +590,8 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
ConditionalTimedUnique("for [amount] turns", UniqueTarget.Conditional),
|
||||
|
||||
/////// city conditionals
|
||||
ConditionalCityWithBuilding("in cities with a [buildingFilter]", UniqueTarget.Conditional),
|
||||
ConditionalCityWithoutBuilding("in cities without a [buildingFilter]", UniqueTarget.Conditional),
|
||||
ConditionalSpecialistCount("if this city has at least [amount] specialists", UniqueTarget.Conditional),
|
||||
ConditionalFollowerCount("in cities where this religion has at least [amount] followers", UniqueTarget.Conditional),
|
||||
ConditionalWhenGarrisoned("with a garrison", UniqueTarget.Conditional),
|
||||
|
@ -381,9 +381,6 @@ Applicable to: Global
|
||||
#### Enables construction of Spaceship parts
|
||||
Applicable to: Global
|
||||
|
||||
#### Notified of new Barbarian encampments
|
||||
Applicable to: Global
|
||||
|
||||
#### Enables Open Borders agreements
|
||||
Applicable to: Global
|
||||
|
||||
@ -752,16 +749,6 @@ Example: "Cost increases by [20] per owned city"
|
||||
|
||||
Applicable to: Building
|
||||
|
||||
#### Cannot be built with [buildingName]
|
||||
Example: "Cannot be built with [Library]"
|
||||
|
||||
Applicable to: Building
|
||||
|
||||
#### Requires a [buildingName] in this city
|
||||
Example: "Requires a [Library] in this city"
|
||||
|
||||
Applicable to: Building
|
||||
|
||||
#### Requires a [buildingName] in all cities
|
||||
Example: "Requires a [Library] in all cities"
|
||||
|
||||
@ -1391,6 +1378,16 @@ Example: "<for [20] turns>"
|
||||
|
||||
Applicable to: Conditional
|
||||
|
||||
#### <in cities with a [buildingFilter]>
|
||||
Example: "<in cities with a [Culture]>"
|
||||
|
||||
Applicable to: Conditional
|
||||
|
||||
#### <in cities without a [buildingFilter]>
|
||||
Example: "<in cities without a [Culture]>"
|
||||
|
||||
Applicable to: Conditional
|
||||
|
||||
#### <if this city has at least [amount] specialists>
|
||||
Example: "<if this city has at least [20] specialists>"
|
||||
|
||||
@ -1572,8 +1569,7 @@ Applicable to: Conditional
|
||||
- "-33% unit upkeep costs" - Deprecated Extremely old - used for auto-updates only, replace with "[-33]% maintenance costs <for [All] units>"
|
||||
- "-50% food consumption by specialists" - Deprecated Extremely old - used for auto-updates only, replace with "[-50]% Food consumption by specialists [in all cities]"
|
||||
- "+50% attacking strength for cities with garrisoned units" - Deprecated Extremely old - used for auto-updates only, replace with "[+50]% Strength for cities <with a garrison> <when attacking>"
|
||||
- "Incompatible with [policy/tech/promotion]" - Deprecated as of 3.19.8, replace with "Only available <before adopting [policy/tech/promotion]>" OR "Only available <before discovering [policy/tech/promotion]>" OR "Only available <for units without [policy/tech/promotion]>"
|
||||
- "Not displayed as an available construction without [buildingName/tech/resource/policy]" - Deprecated as of 3.19.8, replace with "Only available <after adopting [buildingName/tech/resource/policy]>" OR "Only available <with [buildingName/tech/resource/policy]>" OR "Only available <after discovering [buildingName/tech/resource/policy]>"
|
||||
|
||||
- "[stats] with [resource]" - Deprecated as of 3.19.7, replace with "[stats] <with [resource]>"
|
||||
- "Not displayed as an available construction unless [buildingName] is built" - Deprecated as of 3.16.11, replace with "Not displayed as an available construction without [buildingName]"
|
||||
- "[stats] once [tech] is discovered" - Deprecated as of 3.17.10 - removed 3.18.19, replace with "[stats] <after discovering [tech]>"
|
||||
|
Reference in New Issue
Block a user