diff --git a/android/assets/jsons/Units.json b/android/assets/jsons/Units.json index d5c52a1526..05999a3fc7 100644 --- a/android/assets/jsons/Units.json +++ b/android/assets/jsons/Units.json @@ -39,19 +39,19 @@ }, { name:"Archer", - unitType:"Archery", + unitType:"Ranged", movement:2, strength:5, rangedStrength:7, cost: 40, hurryCostModifier:20 - requiredTech:"Archery", + requiredTech:"Ranged", obsoleteTech:"Machinery", upgradesTo:"Crossbowman" }, { name:"Chariot Archer", - unitType:"Archery", + unitType:"Ranged", movement:4, strength:6, rangedStrength:10, @@ -114,7 +114,7 @@ // Medieval Era { name:"Crossbowman", - unitType:"Archery", + unitType:"Ranged", movement:2, strength:13, rangedStrength:18, diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index 85e9ea8e59..b553d3888d 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -69,8 +69,8 @@ class Automation { val combatUnits = city.cityConstructions.getConstructableUnits().filter { it.unitType != UnitType.Civilian } val chosenUnit: Unit if(city.civInfo.cities.any { it.getCenterTile().militaryUnit==null} - && combatUnits.any { it.unitType== UnitType.Archery }) // this is for city defence so get an archery unit if we can - chosenUnit = combatUnits.filter { it.unitType== UnitType.Archery }.maxBy { it.cost }!! + && 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 }!! else{ // randomize type of unit and takee the most expensive of its kind val chosenUnitType = combatUnits.map { it.unitType }.distinct().getRandom() diff --git a/core/src/com/unciv/logic/battle/ICombatant.kt b/core/src/com/unciv/logic/battle/ICombatant.kt index e4d362a445..21e5de4beb 100644 --- a/core/src/com/unciv/logic/battle/ICombatant.kt +++ b/core/src/com/unciv/logic/battle/ICombatant.kt @@ -19,6 +19,6 @@ interface ICombatant{ return this.getUnitType() in listOf(UnitType.Melee, UnitType.Mounted) } fun isRanged(): Boolean { - return this.getUnitType() in listOf(UnitType.Archery, UnitType.Siege) + return this.getUnitType() in listOf(UnitType.Ranged, UnitType.Siege) } } \ No newline at end of file diff --git a/core/src/com/unciv/models/gamebasics/unit/UnitType.kt b/core/src/com/unciv/models/gamebasics/unit/UnitType.kt index 9631207963..11f64ee996 100644 --- a/core/src/com/unciv/models/gamebasics/unit/UnitType.kt +++ b/core/src/com/unciv/models/gamebasics/unit/UnitType.kt @@ -4,7 +4,7 @@ enum class UnitType{ City, Civilian, Melee, - Archery, + Ranged, Mounted, Siege } \ No newline at end of file diff --git a/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt b/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt index fbfc88f9b3..e0b50d27a4 100644 --- a/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt +++ b/core/src/com/unciv/ui/worldscreen/TileMapHolder.kt @@ -102,7 +102,7 @@ class TileMapHolder(internal val worldScreen: WorldScreen, internal val tileMap: val attackableTiles: List = when(unit.getBaseUnit().unitType){ UnitType.Civilian -> unit.getDistanceToTiles().keys.toList() UnitType.Melee, UnitType.Mounted -> unit.getDistanceToTiles().keys.toList() - UnitType.Archery, UnitType.Siege -> unit.getTile().getTilesInDistance(2) + UnitType.Ranged, UnitType.Siege -> unit.getTile().getTilesInDistance(2) UnitType.City -> throw Exception("A unit shouldn't have a City unittype!") }