diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index ff6b224ce1..66f64ef7ef 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -41,7 +41,7 @@ class Battle(val gameInfo:GameInfo) { var damageToDefender = BattleDamage().calculateDamageToDefender(attacker,defender) var damageToAttacker = BattleDamage().calculateDamageToAttacker(attacker,defender) - if (attacker.getUnitType().isMissileUnit()) { + if (attacker.getUnitType()==UnitType.Missile) { nuclearBlast(attacker, defender) } else if(defender.getUnitType().isCivilian() && attacker.isMelee()){ @@ -101,7 +101,7 @@ class Battle(val gameInfo:GameInfo) { attacker.unit.action = null if (attacker is MapUnitCombatant) { - if (attacker.getUnitType().isMissileUnit()) { + if (attacker.getUnitType()==UnitType.Missile) { attacker.unit.destroy() } else if (attacker.unit.action != null && attacker.unit.action!!.startsWith("moveTo")) { diff --git a/core/src/com/unciv/logic/map/UnitPromotions.kt b/core/src/com/unciv/logic/map/UnitPromotions.kt index 4549de5127..e95f1e7618 100644 --- a/core/src/com/unciv/logic/map/UnitPromotions.kt +++ b/core/src/com/unciv/logic/map/UnitPromotions.kt @@ -2,6 +2,7 @@ package com.unciv.logic.map import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.unit.Promotion +import com.unciv.models.gamebasics.unit.UnitType class UnitPromotions{ @Transient lateinit var unit:MapUnit @@ -13,7 +14,10 @@ class UnitPromotions{ var numberOfPromotions = 0 fun xpForNextPromotion() = (numberOfPromotions+1)*10 - fun canBePromoted() = XP >= xpForNextPromotion() + fun canBePromoted(): Boolean { + if(unit.type==UnitType.Missile) return false + return XP >= xpForNextPromotion() + } fun addPromotion(promotionName: String, isFree: Boolean = false){ if (!isFree) { diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt index a885207fa4..0fa68d1d0a 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt @@ -152,9 +152,9 @@ class BattleTable(val worldScreen: WorldScreen): Table() { row().pad(5f) val attackText : String = when { - attacker is MapUnitCombatant && attacker.getUnitType().isMissileUnit() -> "NUKE" - attacker is MapUnitCombatant -> "Attack" - else -> "Bombard" + attacker is CityCombatant -> "Bombard" + attacker.getUnitType()==UnitType.Missile -> "NUKE" + else -> "Attack" } val attackButton = TextButton(attackText.tr(), skin).apply { color= Color.RED }