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
This commit is contained in:
random271 2023-07-09 22:24:38 +02:00 committed by GitHub
parent 3c56319640
commit 8f761642f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -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 =

View File

@ -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)
}
}
}