diff --git a/android/Images/UnitPromotionIcons/Targeting I (air).png b/android/Images/UnitPromotionIcons/Air Targeting.png similarity index 100% rename from android/Images/UnitPromotionIcons/Targeting I (air).png rename to android/Images/UnitPromotionIcons/Air Targeting.png diff --git a/android/assets/jsons/Civ V - Vanilla/Units.json b/android/assets/jsons/Civ V - Vanilla/Units.json index 842850bc58..6c6e8940d4 100644 --- a/android/assets/jsons/Civ V - Vanilla/Units.json +++ b/android/assets/jsons/Civ V - Vanilla/Units.json @@ -273,7 +273,7 @@ { "name": "Battering Ram", "replaces": "Spearman", - "uniqueTo": "Huns", + "uniqueTo": "The Huns", "unitType": "Melee", "movement": 2, "strength": 10, diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index e02b40fe6b..d2c6264f91 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -12,6 +12,7 @@ import com.unciv.models.AttackableTile import com.unciv.models.ruleset.Unique import com.unciv.models.ruleset.unit.UnitType import com.unciv.models.stats.Stat +import com.unciv.models.stats.Stats import java.util.* import kotlin.math.max @@ -186,21 +187,31 @@ object Battle { } private fun plunderFromDamage(plunderingUnit: ICombatant, plunderedUnit: ICombatant, damageDealt: Int) { - if (plunderingUnit is MapUnitCombatant) { - for (unique in plunderingUnit.unit.getMatchingUniques("Earn []% of the damage done to [] units as []")) { - if (plunderedUnit.matchesCategory(unique.params[1])) { - val resourcesPlundered = - (unique.params[0].toFloat() / 100f * damageDealt).toInt() - plunderingUnit.getCivInfo().addStat(Stat.valueOf(unique.params[2]), resourcesPlundered) - plunderingUnit.getCivInfo() - .addNotification( - "Your [${plunderingUnit.getName()}] plundered [${resourcesPlundered}] [${unique.params[2]}] from [${plunderedUnit.getName()}]", - plunderedUnit.getTile().position, - NotificationIcon.War - ) - } + val plunderedGoods = Stats() + if (plunderingUnit !is MapUnitCombatant) return + + for (unique in plunderingUnit.unit.getMatchingUniques("Earn []% of the damage done to [] units as []")) { + if (plunderedUnit.matchesCategory(unique.params[1])) { + val resourcesPlundered = + unique.params[0].toFloat() / 100f * damageDealt + plunderedGoods.add(Stat.valueOf(unique.params[2]), resourcesPlundered) } } + + val plunderableStats = listOf("Gold", "Science", "Culture", "Faith").map { Stat.valueOf(it) } + for (stat in plunderableStats) { + val resourcesPlundered = plunderedGoods.get(stat) + if (resourcesPlundered == 0f) continue + plunderingUnit.getCivInfo().addStat(stat, resourcesPlundered.toInt()) + plunderingUnit.getCivInfo() + .addNotification( + "Your [${plunderingUnit.getName()}] plundered [${resourcesPlundered}] [${stat.name}] from [${plunderedUnit.getName()}]", + plunderedUnit.getTile().position, + NotificationIcon.War + ) + + + } } private fun postBattleNotifications(