mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-05 15:59:50 +07:00
Better fix, will also solve future problems of this sort
This commit is contained in:
@ -265,7 +265,7 @@ object Battle {
|
|||||||
for (unique in plunderingUnit.unit.getMatchingUniques(UniqueType.DamageUnitsPlunder, checkCivInfoUniques = true)) {
|
for (unique in plunderingUnit.unit.getMatchingUniques(UniqueType.DamageUnitsPlunder, checkCivInfoUniques = true)) {
|
||||||
if (plunderedUnit.matchesCategory(unique.params[1])) {
|
if (plunderedUnit.matchesCategory(unique.params[1])) {
|
||||||
val percentage = unique.params[0].toFloat()
|
val percentage = unique.params[0].toFloat()
|
||||||
plunderedGoods.add(Stat.valueOf(unique.params[2]), percentage / 100f * min(damageDealt,100))
|
plunderedGoods.add(Stat.valueOf(unique.params[2]), percentage / 100f * damageDealt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,8 @@ class MapUnitCombatant(val unit: MapUnit) : ICombatant {
|
|||||||
|
|
||||||
override fun takeDamage(damage: Int) {
|
override fun takeDamage(damage: Int) {
|
||||||
unit.health -= damage
|
unit.health -= damage
|
||||||
if(isDefeated()) unit.destroy()
|
if (unit.health < 0) unit.health = 0
|
||||||
|
if (isDefeated()) unit.destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getAttackingStrength(): Int {
|
override fun getAttackingStrength(): Int {
|
||||||
|
Reference in New Issue
Block a user