Promotions can now be picked if ANY of the prerequisites is met, rather than all (thanks am-per-sand!)

This commit is contained in:
Yair Morgenstern 2018-07-04 19:59:56 +03:00
parent 9f81ac6676
commit 895b4b55e2
2 changed files with 4 additions and 2 deletions

View File

@ -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
}

View File

@ -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 } }
}
}