mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 05:14:32 -04:00
Civ-wide uniques for city-wide resources
This commit is contained in:
parent
04528696f7
commit
4f5fdf1727
@ -21,7 +21,7 @@ object CityResources {
|
|||||||
|
|
||||||
manageCityResourcesRequiredByBuildings(city, cityResources)
|
manageCityResourcesRequiredByBuildings(city, cityResources)
|
||||||
|
|
||||||
getCityResourcesFromUniqueBuildings(city, cityResources, resourceModifer)
|
getCityResourcesFromCiv(city, cityResources, resourceModifer)
|
||||||
|
|
||||||
if (city.civ.isCityState() && city.isCapital() && city.civ.cityStateResource != null) {
|
if (city.civ.isCityState() && city.isCapital() && city.civ.cityStateResource != null) {
|
||||||
cityResources.add(
|
cityResources.add(
|
||||||
@ -33,7 +33,6 @@ object CityResources {
|
|||||||
return cityResources
|
return cityResources
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Gets the number of resources available to this city
|
/** Gets the number of resources available to this city
|
||||||
* Accommodates both city-wide and civ-wide resources */
|
* Accommodates both city-wide and civ-wide resources */
|
||||||
fun getResourceAmount(city: City, resourceName: String): Int {
|
fun getResourceAmount(city: City, resourceName: String): Int {
|
||||||
@ -82,9 +81,9 @@ object CityResources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getCityResourcesFromUniqueBuildings(city: City, cityResources: ResourceSupplyList, resourceModifer: HashMap<String, Float>) {
|
private fun getCityResourcesFromCiv(city: City, cityResources: ResourceSupplyList, resourceModifer: HashMap<String, Float>) {
|
||||||
for (unique in city.cityConstructions.builtBuildingUniqueMap
|
// This includes the uniques from buildings, from this and all other cities
|
||||||
.getMatchingUniques(UniqueType.ProvidesResources, StateForConditionals(city.civ, city))) { // E.G "Provides [1] [Iron]"
|
for (unique in city.civ.getMatchingUniques(UniqueType.ProvidesResources, StateForConditionals(city.civ, city))) { // E.G "Provides [1] [Iron]"
|
||||||
val resource = city.getRuleset().tileResources[unique.params[1]]
|
val resource = city.getRuleset().tileResources[unique.params[1]]
|
||||||
?: continue
|
?: continue
|
||||||
cityResources.add(
|
cityResources.add(
|
||||||
|
@ -2084,6 +2084,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
|||||||
|
|
||||||
Applicable to: Conditional
|
Applicable to: Conditional
|
||||||
|
|
||||||
|
??? example "<in cities with [amount] [populationFilter]>"
|
||||||
|
Example: "<in cities with [3] [Followers of this Religion]>"
|
||||||
|
|
||||||
|
Applicable to: Conditional
|
||||||
|
|
||||||
??? example "<with a garrison>"
|
??? example "<with a garrison>"
|
||||||
Applicable to: Conditional
|
Applicable to: Conditional
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user