Move units out of cities when liberating

This commit is contained in:
Yair Morgenstern 2020-06-07 21:27:27 +03:00
parent 05ae6fc81f
commit bc458c72ff
2 changed files with 13 additions and 9 deletions

View File

@ -153,9 +153,7 @@ object BattleDamage {
if (defender is CityCombatant &&
attacker.getCivInfo().containsBuildingUnique("+15% Combat Strength for all units when attacking Cities"))
modifiers["Statue of Zeus"] = 0.15f
}
else if (attacker is CityCombatant) {
} else if (attacker is CityCombatant) {
if (policies.hasEffect("Units in cities cost no Maintenance, garrisoned city +50% attacking strength")
&& attacker.city.getCenterTile().militaryUnit != null)
modifiers["Oligarchy"] = 0.5f

View File

@ -450,6 +450,12 @@ class CityInfo {
if(foundingCiv.cities.size == 1) cityConstructions.addBuilding("Palace") // Resurrection!
isPuppet = false
cityStats.update()
// Move units out of the city when liberated
for(unit in getTiles().flatMap { it.getUnits() }.toList())
if(!unit.movement.canPassThrough(unit.currentTile))
unit.movement.teleportToClosestMoveableTile()
UncivGame.Current.worldScreen.shouldUpdate=true
}