diff --git a/android/assets/jsons/Nations.json b/android/assets/jsons/Nations.json index 2c7ef3ed4d..949741b499 100644 --- a/android/assets/jsons/Nations.json +++ b/android/assets/jsons/Nations.json @@ -17,7 +17,7 @@ name:"China", mainColor:[ 9, 112, 84], cities:["Beijing","Shanghai","Guangzhou","Nanjing","Xian","Chengdu","Hangzhou","Tianjin","Macau","Shandong", - "Kaifeng","Ningbo","Baoding","Yangzhou","Harbin"m"Chongqing","Luoyang","Kunming","Taipei","Shenyang", + "Kaifeng","Ningbo","Baoding","Yangzhou","Harbin","Chongqing","Luoyang","Kunming","Taipei","Shenyang", "Taiyuan","Tainan","Dalian","Lijiang","Wuxi","Suzhou","Maoming","Shaoguan","Yangjiang","Heyuan"] }, { diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 7075dc3ce7..d34bc7fa92 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -105,15 +105,22 @@ class Battle(val gameInfo:GameInfo) { private fun conquerCity(city: CityInfo, attacker: ICombatant) { val enemyCiv = city.civInfo attacker.getCivilization().addNotification("We have conquered the city of [${city.name}]!",city.location, Color.RED) - val currentPopulation = city.population.population - if(currentPopulation>1) city.population.population -= 1 + currentPopulation/4 // so from 2-4 population, remove 1, from 5-8, remove 2, etc. - city.moveToCiv(attacker.getCivilization()) - city.health = city.getMaxHealth() / 2 // I think that cities recover to half health when conquered? + city.getCenterTile().apply { if(militaryUnit!=null) militaryUnit!!.destroy() if(civilianUnit!=null) captureCivilianUnit(attacker,MapUnitCombatant(civilianUnit!!)) } + if (attacker.getCivilization().isBarbarianCivilization()){ + city.destroyCity() + } + else { + val currentPopulation = city.population.population + if(currentPopulation>1) city.population.population -= 1 + currentPopulation/4 // so from 2-4 population, remove 1, from 5-8, remove 2, etc. + city.health = city.getMaxHealth() / 2 // I think that cities recover to half health when conquered? + city.moveToCiv(attacker.getCivilization()) + } + if(city.cityConstructions.isBuilt("Palace")){ city.cityConstructions.builtBuildings.remove("Palace") if(enemyCiv.isDefeated()) { diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index a9244c3d05..20814c0d21 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -163,7 +163,7 @@ class CityInfo { population.population-- if(population.population==0){ civInfo.addNotification("$name {has been razed to the ground}!",location, Color.RED) - civInfo.cities.remove(this) + destroyCity() if(isCapital() && civInfo.cities.isNotEmpty()) // Yes, we actually razed the capital. Some people do this. civInfo.cities.first().cityConstructions.builtBuildings.add("Palace") } @@ -174,6 +174,11 @@ class CityInfo { population.unassignExtraPopulation() } + fun destroyCity() { + civInfo.cities.remove(this) + getTiles().forEach { expansion.relinquishOwnership(it) } + } + fun moveToCiv(newCivInfo: CivilizationInfo){ civInfo.cities.remove(this) newCivInfo.cities.add(this) diff --git a/core/src/com/unciv/logic/city/PopulationManager.kt b/core/src/com/unciv/logic/city/PopulationManager.kt index d8068157e9..fc193d1693 100644 --- a/core/src/com/unciv/logic/city/PopulationManager.kt +++ b/core/src/com/unciv/logic/city/PopulationManager.kt @@ -58,7 +58,6 @@ class PopulationManager { { if(population>1){ population-- - } foodStored = 0 }