diff --git a/android/ImagesToPackSeparately/UnitIcons/Guided Missile.png b/android/ImagesToPackSeparately/UnitIcons/Guided Missile.png new file mode 100644 index 0000000000..e5e7d3d102 Binary files /dev/null and b/android/ImagesToPackSeparately/UnitIcons/Guided Missile.png differ diff --git a/android/assets/BuildingIcons.atlas b/android/assets/BuildingIcons.atlas index 17b40b4741..189e5460e7 100644 --- a/android/assets/BuildingIcons.atlas +++ b/android/assets/BuildingIcons.atlas @@ -1,8 +1,8 @@ BuildingIcons.png -size: 2048,1024 +size: 2048, 1024 format: RGBA8888 -filter: MipMapLinearLinear,MipMapLinearLinear +filter: MipMapLinearLinear, MipMapLinearLinear repeat: none Alhambra rotate: false diff --git a/android/assets/BuildingIcons.png b/android/assets/BuildingIcons.png index e71a49b37b..d3f7ecfd94 100644 Binary files a/android/assets/BuildingIcons.png and b/android/assets/BuildingIcons.png differ diff --git a/android/assets/FlagIcons.png b/android/assets/FlagIcons.png index 5a76abed36..4337444176 100644 Binary files a/android/assets/FlagIcons.png and b/android/assets/FlagIcons.png differ diff --git a/android/assets/UnitIcons.atlas b/android/assets/UnitIcons.atlas index 560829bf66..dbe74093ff 100644 --- a/android/assets/UnitIcons.atlas +++ b/android/assets/UnitIcons.atlas @@ -1,8 +1,8 @@ UnitIcons.png -size: 2048,512 +size: 2048, 512 format: RGBA8888 -filter: MipMapLinearLinear,MipMapLinearLinear +filter: MipMapLinearLinear, MipMapLinearLinear repeat: none Anti-Aircraft Gun rotate: false @@ -256,188 +256,195 @@ Great War Infantry orig: 100, 100 offset: 0, 0 index: -1 -Helicopter Gunship +Guided Missile rotate: false xy: 614, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Hoplite +Helicopter Gunship rotate: false xy: 614, 2 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Horseman +Hoplite rotate: false xy: 716, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Hwach'a +Horseman rotate: false xy: 818, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Infantry +Hwach'a rotate: false xy: 920, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Ironclad +Infantry rotate: false xy: 716, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Jaguar +Ironclad rotate: false xy: 716, 2 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Janissary +Jaguar rotate: false xy: 818, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Jet Fighter +Janissary rotate: false xy: 920, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Keshik +Jet Fighter rotate: false xy: 1022, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Khan +Keshik rotate: false xy: 818, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Knight +Khan rotate: false xy: 818, 2 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Lancer +Knight rotate: false xy: 920, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Landship +Lancer rotate: false xy: 1022, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Landsknecht +Landship rotate: false xy: 1124, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Legion +Landsknecht rotate: false xy: 920, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Longbowman +Legion rotate: false xy: 920, 2 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Longswordsman +Longbowman rotate: false xy: 1022, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Machine Gun +Longswordsman rotate: false xy: 1124, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Mandekalu Cavalry +Machine Gun rotate: false xy: 1226, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Maori Warrior +Mandekalu Cavalry rotate: false xy: 1022, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Mechanized Infantry +Maori Warrior rotate: false xy: 1022, 2 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Minuteman +Mechanized Infantry rotate: false xy: 1124, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Modern Armor +Minuteman rotate: false xy: 1226, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Mohawk Warrior +Modern Armor rotate: false xy: 1328, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 -Musketeer +Mohawk Warrior rotate: false xy: 1124, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 +Musketeer + rotate: false + xy: 1124, 2 + size: 100, 100 + orig: 100, 100 + offset: 0, 0 + index: -1 Musketman rotate: false xy: 1226, 207 @@ -447,210 +454,210 @@ Musketman index: -1 Naresuan's Elephant rotate: false - xy: 1124, 2 + xy: 1328, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Norwegian Ski Infantry rotate: false - xy: 1328, 308 + xy: 1430, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Nuclear Missile rotate: false - xy: 1430, 410 + xy: 1226, 105 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Panzer rotate: false - xy: 1226, 105 + xy: 1328, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Persian Immortal rotate: false - xy: 1328, 206 + xy: 1430, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Pikeman rotate: false - xy: 1430, 308 + xy: 1532, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Rifleman rotate: false - xy: 1532, 410 + xy: 1226, 3 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Rocket Artillery rotate: false - xy: 1226, 3 + xy: 1328, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Samurai rotate: false - xy: 1328, 104 + xy: 1328, 2 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Scout rotate: false - xy: 1328, 2 + xy: 1430, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Settler rotate: false - xy: 1430, 206 + xy: 1532, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Ship of the Line rotate: false - xy: 1532, 308 + xy: 1634, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Sipahi rotate: false - xy: 1634, 410 + xy: 1430, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Slinger rotate: false - xy: 1430, 104 + xy: 1430, 2 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Spearman rotate: false - xy: 1430, 2 + xy: 1532, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Stealth Bomber rotate: false - xy: 1532, 206 + xy: 1634, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Submarine rotate: false - xy: 1634, 308 + xy: 1736, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Swordsman rotate: false - xy: 1736, 410 + xy: 1532, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Tank rotate: false - xy: 1532, 104 + xy: 1532, 2 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Tercio rotate: false - xy: 1532, 2 + xy: 1634, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Trebuchet rotate: false - xy: 1634, 206 + xy: 1736, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Triplane rotate: false - xy: 1736, 308 + xy: 1838, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Trireme rotate: false - xy: 1838, 409 + xy: 1634, 103 size: 100, 101 orig: 100, 101 offset: 0, 0 index: -1 Turtle Ship rotate: false - xy: 1634, 104 + xy: 1736, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 War Chariot rotate: false - xy: 1634, 2 + xy: 1838, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 War Elephant rotate: false - xy: 1736, 206 + xy: 1940, 410 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Warrior rotate: false - xy: 1838, 307 + xy: 1736, 104 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Work Boats rotate: false - xy: 1940, 410 + xy: 1736, 2 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Worker rotate: false - xy: 1736, 104 + xy: 1838, 206 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 Zero rotate: false - xy: 1736, 2 + xy: 1940, 308 size: 100, 100 orig: 100, 100 offset: 0, 0 diff --git a/android/assets/UnitIcons.png b/android/assets/UnitIcons.png index 15d767d195..7636a30274 100644 Binary files a/android/assets/UnitIcons.png and b/android/assets/UnitIcons.png differ diff --git a/android/assets/game.atlas b/android/assets/game.atlas index f13b3d4c23..cc44de04d0 100644 --- a/android/assets/game.atlas +++ b/android/assets/game.atlas @@ -160,14 +160,14 @@ ImprovementIcons/Quarry index: -1 ImprovementIcons/Railroad rotate: false - xy: 1326, 1152 + xy: 1224, 948 size: 100, 100 orig: 100, 100 offset: 0, 0 index: -1 TileSets/Default/Railroad rotate: false - xy: 1326, 1152 + xy: 1224, 948 size: 100, 100 orig: 100, 100 offset: 0, 0 @@ -1644,7 +1644,7 @@ TechIcons/Radio index: -1 TechIcons/Railroad rotate: false - xy: 1224, 948 + xy: 1326, 1152 size: 100, 100 orig: 100, 100 offset: 0, 0 diff --git a/android/assets/game.png b/android/assets/game.png index 912d6a1d97..c6dd04ee51 100644 Binary files a/android/assets/game.png and b/android/assets/game.png differ diff --git a/android/assets/jsons/Civ V - Vanilla/Units.json b/android/assets/jsons/Civ V - Vanilla/Units.json index bd9fd1ea21..c2b41346bc 100644 --- a/android/assets/jsons/Civ V - Vanilla/Units.json +++ b/android/assets/jsons/Civ V - Vanilla/Units.json @@ -1054,7 +1054,7 @@ // Plane rather than a missile - can be based in city or Carrier only. But cannot be intercepted because of a civ 5 bug that was never fixed. // Single-use like missile // No strength/rangedStrength tags in civ 5 xmls. Instead has NukeDamageLevel = 1 tag (Nuclear Missile has NukeDamageLevel = 2) - }, + }, */ { "name": "Guided Missile", "unitType": "Missile", @@ -1063,11 +1063,9 @@ "rangedStrength": 60, "range": 8, "cost": 150, - "requiredTech": "Satellites" - // don't cost Maintenance, but count towards the limit of air units in city - // requiredTech "Advanced ballistics" in expansions + "requiredTech": "Rocketry", + "uniques": ["Self-destructs when attacking"] }, - */ { "name": "Nuclear Missile", "unitType": "Missile", @@ -1078,7 +1076,7 @@ "cost": 1000, "requiredTech": "Rocketry", "requiredResource": "Uranium", - "uniques": ["Nuclear weapon", "Requires [Manhattan Project]"] + "uniques": ["Self-destructs when attacking", "Nuclear weapon", "Requires [Manhattan Project]"] }, { "name": "Landship", diff --git a/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt b/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt index 6031385a32..73d99f3ae7 100644 --- a/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt @@ -311,18 +311,19 @@ object SpecificUnitAutomation { // This really needs to be changed, to have better targetting for missiles fun automateMissile(unit: MapUnit) { - - val tilesInRange = unit.currentTile.getTilesInDistance(unit.getRange() * 2) - - for (tile in tilesInRange) { - // For now AI will only use nukes against cities because in all honesty that's the best use for them. - if (tile.isCityCenter() && tile.getOwner()!!.isAtWarWith(unit.civInfo)) { - Battle.nuke(MapUnitCombatant(unit), tile) - return + val tilesInRange = unit.currentTile.getTilesInDistance(unit.getRange()) + if (unit.hasUnique("Nuclear weapon")) { + for (tile in tilesInRange) { + // For now AI will only use nukes against cities because in all honesty that's the best use for them. + if (tile.isCityCenter() && tile.getOwner()!!.isAtWarWith(unit.civInfo)) { + Battle.nuke(MapUnitCombatant(unit), tile) + return + } } + } else { //Guided Missile + if (BattleHelper.tryAttackNearbyEnemy(unit)) return } - - + val immediatelyReachableCities = tilesInRange .filter { unit.movement.canMoveTo(it) } diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 0128bf7391..6d0678eb7f 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -415,7 +415,9 @@ object Battle { } // Instead of postBattleAction() just destroy the missile, all other functions are not relevant - (attacker as MapUnitCombatant).unit.destroy() + if ((attacker as MapUnitCombatant).unit.hasUnique("Self-destructs when attacking")) { + (attacker as MapUnitCombatant).unit.destroy() + } } private fun tryInterceptAirAttack(attacker: MapUnitCombatant, defender: ICombatant) { diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt index 3c76efffe8..71343c3eed 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt @@ -43,7 +43,7 @@ class BattleTable(val worldScreen: WorldScreen): Table() { val attacker = tryGetAttacker() if(attacker==null || !worldScreen.canChangeState){ hide(); return } - if (attacker.getUnitType()==UnitType.Missile) { + if (attacker is MapUnitCombatant && attacker.unit.hasUnique("Nuclear weapon")) { val selectedTile = worldScreen.mapHolder.selectedTile if (selectedTile == null) { hide(); return } // no selected tile simulateNuke(attacker as MapUnitCombatant, selectedTile)