mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 23:40:01 +07:00
Notify when Barbs don't give more XP (#6115)
* Updates to allow BarbXP gain check * Remove from ICombatant * Revert Battle.kt * Fix code in BattleTable * Add template.properties entry * Fix space issue * Silly autoformatting Co-authored-by: temurakami <spellman23@gmail.com>
This commit is contained in:
@ -873,6 +873,7 @@ Attack =
|
||||
Bombard =
|
||||
NUKE =
|
||||
Captured! =
|
||||
Cannot gain more XP from Barbarians =
|
||||
|
||||
# Battle modifier categories
|
||||
|
||||
|
@ -30,4 +30,4 @@ interface ICombatant {
|
||||
return this is CityCombatant
|
||||
}
|
||||
fun isCivilian() = this is MapUnitCombatant && this.unit.isCivilian()
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user