mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 21:03:15 -04:00
Minor style updates (#11154)
* Properly Calculate Population based on Food Conversion to Prod Trigger properly when Queue is changed * Remove triggers * Missed a trigger * Add triggers in CityConstructionsTable so we can call cityScreen.update() * Properly Calculate Population based on Food Conversion to Prod Trigger properly when Queue is changed * Remove triggers * Missed a trigger * Add triggers in CityConstructionsTable so we can call cityScreen.update() * Minor style cleanups * Properly Calculate Population based on Food Conversion to Prod Trigger properly when Queue is changed * Remove triggers * Missed a trigger * Properly Calculate Population based on Food Conversion to Prod Trigger properly when Queue is changed * Remove triggers * Missed a trigger * Minor style cleanups
This commit is contained in:
parent
6c87bef1cf
commit
d3356c94fd
@ -63,7 +63,7 @@ object Automation {
|
||||
|
||||
val surplusFood = cityStats[Stat.Food]
|
||||
// If current Production converts Food into Production, then calculate increased Production Yield
|
||||
if(cityStatsObj.canConvertFoodToProduction(surplusFood, city.cityConstructions.getCurrentConstruction())) {
|
||||
if (cityStatsObj.canConvertFoodToProduction(surplusFood, city.cityConstructions.getCurrentConstruction())) {
|
||||
// calculate delta increase of food->prod. This isn't linear
|
||||
yieldStats.production += cityStatsObj.getProductionFromExcessiveFood(surplusFood+yieldStats.food) - cityStatsObj.getProductionFromExcessiveFood(surplusFood)
|
||||
yieldStats.food = 0f // all food goes to 0
|
||||
|
@ -606,8 +606,13 @@ class CityStats(val city: City) {
|
||||
&& currentConstruction.hasUnique(UniqueType.ConvertFoodToProductionWhenConstructed))
|
||||
}
|
||||
|
||||
// calculate the conversion of the excessive food to the production
|
||||
// See for details: https://civilization.fandom.com/wiki/Settler_(Civ5)
|
||||
/**
|
||||
* Calculate the conversion of the excessive food to production when
|
||||
* [UniqueType.ConvertFoodToProductionWhenConstructed] is at front of the build queue
|
||||
* @param food is amount of excess Food generates this turn
|
||||
* See for details: https://civilization.fandom.com/wiki/Settler_(Civ5)
|
||||
* @see calcFoodEaten as well for Food consumed this turn
|
||||
*/
|
||||
fun getProductionFromExcessiveFood(food : Float): Float {
|
||||
return if (food >= 4.0f ) 2.0f + (food / 4.0f).toInt()
|
||||
else if (food >= 2.0f ) 2.0f
|
||||
|
Loading…
x
Reference in New Issue
Block a user