Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added notification for destruction of tile improvements [via unit ability] #9754

Merged
merged 3 commits into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/assets/jsons/translations/template.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
6 changes: 6 additions & 0 deletions core/src/com/unciv/logic/battle/Battle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}