mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04: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:
parent
92f0be995d
commit
1420ad845c
@ -873,6 +873,7 @@ Attack =
|
|||||||
Bombard =
|
Bombard =
|
||||||
NUKE =
|
NUKE =
|
||||||
Captured! =
|
Captured! =
|
||||||
|
Cannot gain more XP from Barbarians =
|
||||||
|
|
||||||
# Battle modifier categories
|
# Battle modifier categories
|
||||||
|
|
||||||
|
@ -30,4 +30,4 @@ interface ICombatant {
|
|||||||
return this is CityCombatant
|
return this is CityCombatant
|
||||||
}
|
}
|
||||||
fun isCivilian() = this is MapUnitCombatant && this.unit.isCivilian()
|
fun isCivilian() = this is MapUnitCombatant && this.unit.isCivilian()
|
||||||
}
|
}
|
||||||
|
@ -163,6 +163,14 @@ class BattleTable(val worldScreen: WorldScreen): Table() {
|
|||||||
row().pad(2f)
|
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 damageToDefender = BattleDamage.calculateDamageToDefender(attacker,null,defender)
|
||||||
var damageToAttacker = BattleDamage.calculateDamageToAttacker(attacker,null,defender)
|
var damageToAttacker = BattleDamage.calculateDamageToAttacker(attacker,null,defender)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user