diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index f63aae3ee2..5d40339fe9 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -873,6 +873,7 @@ Attack = Bombard = NUKE = Captured! = +Cannot gain more XP from Barbarians = # Battle modifier categories diff --git a/core/src/com/unciv/logic/battle/ICombatant.kt b/core/src/com/unciv/logic/battle/ICombatant.kt index 2b924f386d..2b41c3ff4b 100644 --- a/core/src/com/unciv/logic/battle/ICombatant.kt +++ b/core/src/com/unciv/logic/battle/ICombatant.kt @@ -30,4 +30,4 @@ interface ICombatant { return this is CityCombatant } fun isCivilian() = this is MapUnitCombatant && this.unit.isCivilian() -} \ No newline at end of file +} diff --git a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt index 07b01d00c1..8184af5606 100644 --- a/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt +++ b/core/src/com/unciv/ui/worldscreen/bottombar/BattleTable.kt @@ -163,6 +163,14 @@ class BattleTable(val worldScreen: WorldScreen): Table() { row().pad(2f) } + // from Battle.addXp(), check for can't gain more XP from Barbarians + val modConstants = attacker.getCivInfo().gameInfo.ruleSet.modOptions.constants + if (attacker is MapUnitCombatant && (attacker as MapUnitCombatant).unit.promotions.totalXpProduced() >= modConstants.maxXPfromBarbarians + && defender.getCivInfo().isBarbarian()){ + add("Cannot gain more XP from Barbarians".tr().toLabel(fontSize = 16).apply { wrap=true }).width(quarterScreen) + row() + } + var damageToDefender = BattleDamage.calculateDamageToDefender(attacker,null,defender) var damageToAttacker = BattleDamage.calculateDamageToAttacker(attacker,null,defender)