mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-07 05:51:12 +07: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)
|
||||
|
||||
getCityResourcesFromUniqueBuildings(city, cityResources, resourceModifer)
|
||||
getCityResourcesFromCiv(city, cityResources, resourceModifer)
|
||||
|
||||
if (city.civ.isCityState() && city.isCapital() && city.civ.cityStateResource != null) {
|
||||
cityResources.add(
|
||||
@ -33,7 +33,6 @@ object CityResources {
|
||||
return cityResources
|
||||
}
|
||||
|
||||
|
||||
/** Gets the number of resources available to this city
|
||||
* Accommodates both city-wide and civ-wide resources */
|
||||
fun getResourceAmount(city: City, resourceName: String): Int {
|
||||
@ -82,9 +81,9 @@ object CityResources {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getCityResourcesFromUniqueBuildings(city: City, cityResources: ResourceSupplyList, resourceModifer: HashMap<String, Float>) {
|
||||
for (unique in city.cityConstructions.builtBuildingUniqueMap
|
||||
.getMatchingUniques(UniqueType.ProvidesResources, StateForConditionals(city.civ, city))) { // E.G "Provides [1] [Iron]"
|
||||
private fun getCityResourcesFromCiv(city: City, cityResources: ResourceSupplyList, resourceModifer: HashMap<String, Float>) {
|
||||
// This includes the uniques from buildings, from this and all other cities
|
||||
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]]
|
||||
?: continue
|
||||
cityResources.add(
|
||||
|
@ -2084,6 +2084,11 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
||||
|
||||
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>"
|
||||
Applicable to: Conditional
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user