diff --git a/android/build.gradle b/android/build.gradle index 070e6d0fcc..ec45b61696 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.game" minSdkVersion 14 targetSdkVersion 26 - versionCode 78 - versionName "2.4.8" + versionCode 80 + versionName "2.4.10" } buildTypes { release { diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 95a8e93b81..f2e8615ebf 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -163,8 +163,10 @@ class Battle(val gameInfo:GameInfo=UnCivGame.Current.gameInfo) { conquerCity((defender as CityCombatant).city, attacker) } + // we're a melee unit and we destroyed\captured an enemy unit else if (attacker.isMelee() && (defender.isDefeated() || defender.getCivilization()==attacker.getCivilization() )) { - if(attackedTile.civilianUnit!=null) + // we destroyed an enemy military unit and there was a civilian unit in the same tile as well + if(attackedTile.civilianUnit!=null && attackedTile.civilianUnit!!.civInfo != attacker.getCivilization()) captureCivilianUnit(attacker,MapUnitCombatant(attackedTile.civilianUnit!!)) (attacker as MapUnitCombatant).unit.moveToTile(attackedTile) } @@ -222,7 +224,10 @@ class Battle(val gameInfo:GameInfo=UnCivGame.Current.gameInfo) { } fun captureCivilianUnit(attacker: ICombatant, defender: ICombatant){ - if(attacker.getCivilization().isBarbarianCivilization()) defender.takeDamage(100) // barbarians don't capture civilians! + if(attacker.getCivilization().isBarbarianCivilization()){ + defender.takeDamage(100) + return + } // barbarians don't capture civilians! val capturedUnit = (defender as MapUnitCombatant).unit capturedUnit.civInfo.addNotification("Our "+defender.getName()+" was captured by an enemy "+attacker.getName(), defender.getTile().position, Color.RED) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 5401b485fe..f6d76c1e55 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -113,6 +113,7 @@ class MapUnit { fun startTurn(){ currentMovement = maxMovement.toFloat() + attacksThisTurn=0 doPreTurnAction() } diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt index 2d1858d6e5..cafa54db92 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt @@ -98,7 +98,7 @@ class BattleTable(val worldScreen: WorldScreen): Table() { else if (damageToDefender>defender.getHealth()) damageToDefender=defender.getHealth() - if(attacker.isMelee() && defender.getUnitType()==UnitType.Civilian) { + if(attacker.isMelee() && (defender.getUnitType()==UnitType.Civilian || defender.getUnitType()==UnitType.City && defender.isDefeated())) { add("") add("Captured!") }