mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 04:43:05 -04:00
Promotions can now be picked if ANY of the prerequisites is met, rather than all (thanks am-per-sand!)
This commit is contained in:
parent
9f81ac6676
commit
895b4b55e2
@ -257,10 +257,12 @@ class CityStats {
|
||||
baseStatList["Policies"]!!.food += getGrowthBonusFromPolicies() * excessFood
|
||||
|
||||
val buildingsMaintainance = cityInfo.cityConstructions.getMaintenanceCosts().toFloat() // this is AFTER the bonus calculation!
|
||||
baseStatList["Maintainance"] = Stats().apply { gold = -buildingsMaintainance }
|
||||
baseStatList["Maintenance"] = Stats().apply { gold = -buildingsMaintainance }
|
||||
|
||||
currentCityStats = Stats()
|
||||
for (stat in baseStatList.values) currentCityStats.add(stat)
|
||||
|
||||
if(currentCityStats.production<1) currentCityStats.production=1
|
||||
}
|
||||
|
||||
|
||||
|
@ -21,6 +21,6 @@ class UnitPromotions{
|
||||
fun getAvailablePromotions(): List<Promotion> {
|
||||
return GameBasics.UnitPromotions.values
|
||||
.filter { unit.getBaseUnit().unitType.toString() in it.unitTypes && it.name !in promotions }
|
||||
.filter { it.prerequisites.isEmpty() || it.prerequisites.all { p->p in promotions } }
|
||||
.filter { it.prerequisites.isEmpty() || it.prerequisites.any { p->p in promotions } }
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user