diff --git a/android/build.gradle b/android/build.gradle index 1a93956b0f..bffd9d27a8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 28 - versionCode 218 - versionName "2.14.0" + versionCode 219 + versionName "2.14.1" } // Had to add this crap for Travis to build, it wanted to sign the app diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index 573b551c00..9d5e803af4 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -45,21 +45,21 @@ class Automation { return rank } - fun trainCombatUnit(city: CityInfo) { - val name = chooseCombatUnit(city) + fun trainMilitaryUnit(city: CityInfo) { + val name = chooseMilitaryUnit(city) city.cityConstructions.currentConstruction = name } - fun chooseCombatUnit(city: CityInfo) : String { - val combatUnits = city.cityConstructions.getConstructableUnits().filter { !it.unitType.isCivilian() } + fun chooseMilitaryUnit(city: CityInfo) : String { + val militaryUnits = city.cityConstructions.getConstructableUnits().filter { !it.unitType.isCivilian() } val chosenUnit: BaseUnit if(!city.civInfo.isAtWar() && city.civInfo.cities.any { it.getCenterTile().militaryUnit==null} - && combatUnits.any { it.unitType== UnitType.Ranged }) // this is for city defence so get an archery unit if we can - chosenUnit = combatUnits.filter { it.unitType== UnitType.Ranged }.maxBy { it.cost }!! + && militaryUnits.any { it.unitType== UnitType.Ranged }) // this is for city defence so get an archery unit if we can + chosenUnit = militaryUnits.filter { it.unitType== UnitType.Ranged }.maxBy { it.cost }!! else{ // randomize type of unit and take the most expensive of its kind - val chosenUnitType = combatUnits.map { it.unitType }.distinct().filterNot{it==UnitType.Scout}.getRandom() - chosenUnit = combatUnits.filter { it.unitType==chosenUnitType }.maxBy { it.cost }!! + val chosenUnitType = militaryUnits.map { it.unitType }.distinct().filterNot{it==UnitType.Scout}.getRandom() + chosenUnit = militaryUnits.filter { it.unitType==chosenUnitType }.maxBy { it.cost }!! } return chosenUnit.name } @@ -162,7 +162,7 @@ class Automation { } //Army - val militaryUnit = chooseCombatUnit(cityInfo) + val militaryUnit = chooseMilitaryUnit(cityInfo) val unitsToCitiesRatio = militaryUnits / cities.toFloat() // most buildings and civ units contribute the the civ's growth, military units are anti-growth val militaryChoice = ConstructionChoice(militaryUnit,unitsToCitiesRatio/5) diff --git a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt index 426f7b1718..28f690b967 100644 --- a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt @@ -242,7 +242,7 @@ class NextTurnAutomation{ Automation().chooseNextConstruction(city.cityConstructions) if (city.health < city.getMaxHealth()) - Automation().trainCombatUnit(city) // override previous decision if city is under attack + Automation().trainMilitaryUnit(city) // override previous decision if city is under attack } }