mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-08 23:08:35 +07:00
@ -297,7 +297,7 @@ object Nuke {
|
|||||||
2 -> (60 + Random.Default.nextInt(10) + Random.Default.nextInt(10)) / 100f
|
2 -> (60 + Random.Default.nextInt(10) + Random.Default.nextInt(10)) / 100f
|
||||||
else -> 1f // hypothetical nukeStrength 3 -> always to 1 pop
|
else -> 1f // hypothetical nukeStrength 3 -> always to 1 pop
|
||||||
}
|
}
|
||||||
).toInt().coerceAtMost(targetedCity.population.population - 1)
|
).toInt()
|
||||||
targetedCity.population.addPopulation(-populationLoss)
|
targetedCity.population.addPopulation(-populationLoss)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,9 +124,8 @@ class CityTurnManager(val city: City) {
|
|||||||
val removedPopulation =
|
val removedPopulation =
|
||||||
1 + city.civ.getMatchingUniques(UniqueType.CitiesAreRazedXTimesFaster)
|
1 + city.civ.getMatchingUniques(UniqueType.CitiesAreRazedXTimesFaster)
|
||||||
.sumOf { it.params[0].toInt() - 1 }
|
.sumOf { it.params[0].toInt() - 1 }
|
||||||
city.population.addPopulation(-1 * removedPopulation)
|
|
||||||
|
|
||||||
if (city.population.population <= 0) {
|
if (city.population.population <= removedPopulation) {
|
||||||
city.espionage.removeAllPresentSpies(SpyFleeReason.CityCaptured)
|
city.espionage.removeAllPresentSpies(SpyFleeReason.CityCaptured)
|
||||||
city.civ.addNotification(
|
city.civ.addNotification(
|
||||||
"[${city.name}] has been razed to the ground!",
|
"[${city.name}] has been razed to the ground!",
|
||||||
@ -135,6 +134,7 @@ class CityTurnManager(val city: City) {
|
|||||||
)
|
)
|
||||||
city.destroyCity()
|
city.destroyCity()
|
||||||
} else { //if not razed yet:
|
} else { //if not razed yet:
|
||||||
|
city.population.addPopulation(-removedPopulation)
|
||||||
if (city.population.foodStored >= city.population.getFoodToNextPopulation()) { //if surplus in the granary...
|
if (city.population.foodStored >= city.population.getFoodToNextPopulation()) { //if surplus in the granary...
|
||||||
city.population.foodStored =
|
city.population.foodStored =
|
||||||
city.population.getFoodToNextPopulation() - 1 //...reduce below the new growth threshold
|
city.population.getFoodToNextPopulation() - 1 //...reduce below the new growth threshold
|
||||||
|
Reference in New Issue
Block a user