From 8f761642f6145d5d4c4e90cf8f6322474a7bf094 Mon Sep 17 00:00:00 2001 From: random271 <50424145+random271@users.noreply.github.com> Date: Sun, 9 Jul 2023 22:24:38 +0200 Subject: [PATCH] Added notification for destruction of tile improvements [via unit ability] (#9754) * Added notification for desctruction of tile improvements [via unit ability] * Modified template properties * Update template.properties --- android/assets/jsons/translations/template.properties | 1 + core/src/com/unciv/logic/battle/Battle.kt | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index f62d6a3f8a..614bc25af6 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -916,6 +916,7 @@ Our [interceptorName] ([amount] HP) intercepted and attacked an enemy [attackerN Nothing tried to intercept our [attackerName] = An enemy [unit] was spotted near our territory = An enemy [unit] was spotted in our territory = +An enemy [unit] has destroyed our tile improvement [improvement] = Your city [cityName] can bombard the enemy! = [amount] of your cities can bombard the enemy! = [amount] enemy units were spotted near our territory = diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index f4134d1c30..321195e8a5 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -1164,7 +1164,13 @@ object Battle { if (!attackedTile.getTileImprovement()!!.hasUnique(UniqueType.Unpillagable) && attacker.hasUnique(UniqueType.DestroysImprovementUponAttack, conditionalState) ) { + val currentTileImprovement = attackedTile.improvement attackedTile.changeImprovement(null) + defender.getCivInfo().addNotification( + "An enemy [${attacker.unit.baseUnit.name}] has destroyed our tile improvement [${currentTileImprovement}]", + LocationAction(attackedTile.position, attacker.getTile().position), + NotificationCategory.War, attacker.unit.baseUnit.name, + NotificationIcon.War) } } }