mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-07 00:41:39 +07:00
AI can no longer raze capital cities
This commit is contained in:
@ -122,9 +122,7 @@ object Battle {
|
||||
}
|
||||
|
||||
for (unique in bonusUniques) {
|
||||
if (!defeatedUnit.matchesCategory(unique.params[1])) {
|
||||
continue
|
||||
}
|
||||
if (!defeatedUnit.matchesCategory(unique.params[1])) continue
|
||||
|
||||
val yieldPercent = unique.params[0].toFloat() / 100
|
||||
val defeatedUnitYieldSourceType = unique.params[2]
|
||||
@ -303,13 +301,13 @@ object Battle {
|
||||
attackerCiv.addNotification("We have conquered the city of [${city.name}]!", city.location, Color.RED)
|
||||
|
||||
city.getCenterTile().apply {
|
||||
if(militaryUnit!=null) militaryUnit!!.destroy()
|
||||
if(civilianUnit!=null) captureCivilianUnit(attacker, MapUnitCombatant(civilianUnit!!))
|
||||
for(airUnit in airUnits.toList()) airUnit.destroy()
|
||||
if (militaryUnit != null) militaryUnit!!.destroy()
|
||||
if (civilianUnit != null) captureCivilianUnit(attacker, MapUnitCombatant(civilianUnit!!))
|
||||
for (airUnit in airUnits.toList()) airUnit.destroy()
|
||||
}
|
||||
city.hasJustBeenConquered = true
|
||||
|
||||
if (!attackerCiv.isMajorCiv()){
|
||||
if (!attackerCiv.isMajorCiv()) {
|
||||
city.destroyCity()
|
||||
return
|
||||
}
|
||||
@ -317,10 +315,9 @@ object Battle {
|
||||
if (attackerCiv.isPlayerCivilization()) {
|
||||
attackerCiv.popupAlerts.add(PopupAlert(AlertType.CityConquered, city.id))
|
||||
UncivGame.Current.settings.addCompletedTutorialTask("Conquer a city")
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
city.puppetCity(attackerCiv)
|
||||
if (city.population.population < 4) {
|
||||
if (city.population.population < 4 && !city.isOriginalCapital) {
|
||||
city.annexCity()
|
||||
city.isBeingRazed = true
|
||||
}
|
||||
@ -328,9 +325,9 @@ object Battle {
|
||||
}
|
||||
|
||||
fun getMapCombatantOfTile(tile:TileInfo): ICombatant? {
|
||||
if(tile.isCityCenter()) return CityCombatant(tile.getCity()!!)
|
||||
if(tile.militaryUnit!=null) return MapUnitCombatant(tile.militaryUnit!!)
|
||||
if(tile.civilianUnit!=null) return MapUnitCombatant(tile.civilianUnit!!)
|
||||
if (tile.isCityCenter()) return CityCombatant(tile.getCity()!!)
|
||||
if (tile.militaryUnit != null) return MapUnitCombatant(tile.militaryUnit!!)
|
||||
if (tile.civilianUnit != null) return MapUnitCombatant(tile.civilianUnit!!)
|
||||
return null
|
||||
}
|
||||
|
||||
|
@ -125,8 +125,10 @@ internal object DesktopLauncher {
|
||||
* this causes a delay, leading to horrible lag if there are enough switches.
|
||||
* The cost of this specific solution is that the entire game.png needs be be kept in-memory constantly.
|
||||
* It's currently only 1.5MB so it should be okay, but it' an important point to remember for the future.
|
||||
* Sidenode: Modded tilesets don't have this problem, since all the images are included in the mod's single PNG.
|
||||
* Sidenote: Modded tilesets don't have this problem, since all the images are included in the mod's single PNG.
|
||||
* Probably. Unless they have some truly huge images.
|
||||
* Sidenote 2: Okay entire so custom tilesets do have this problem because they can get so big that what accommodates
|
||||
* the regular tileset (4096) doesn't suit them. Looking at you 5hex.
|
||||
*/
|
||||
settings.maxWidth = 4096
|
||||
settings.maxHeight = 4096
|
||||
|
Reference in New Issue
Block a user