mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-15 10:18:26 +07:00
Fixed a bug where citadels did not damage nearby units (#5941)
* Fixed a bug where citadels did not damage nearby units * Fixed tests
This commit is contained in:
@ -1054,8 +1054,10 @@ class MapUnit {
|
||||
&& it.improvement != null
|
||||
&& civInfo.isAtWarWith(it.getOwner()!!)
|
||||
}.map { tile ->
|
||||
tile to tile.getTileImprovement()!!
|
||||
.getMatchingUniques(UniqueType.DamagesAdjacentEnemyUnits)
|
||||
tile to (
|
||||
tile.getTileImprovement()!!.getMatchingUniques(UniqueType.DamagesAdjacentEnemyUnits) +
|
||||
tile.getTileImprovement()!!.getMatchingUniques(UniqueType.DamagesAdjacentEnemyUnitsOld)
|
||||
)
|
||||
.sumOf { it.params[0].toInt() }
|
||||
}.maxByOrNull { it.second }
|
||||
?: return
|
||||
|
@ -386,7 +386,9 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
|
||||
|
||||
DefensiveBonus("Gives a defensive bonus of [amount]%", UniqueTarget.Improvement),
|
||||
ImprovementMaintenance("Costs [amount] gold per turn when in your territory", UniqueTarget.Improvement), // Unused
|
||||
DamagesAdjacentEnemyUnits("Deal [amount] damage to adjacent enemy units", UniqueTarget.Improvement),
|
||||
DamagesAdjacentEnemyUnits("Adjacent enemy units ending their turn take [amount] damage", UniqueTarget.Improvement),
|
||||
@Deprecated("As of 3.18.17", ReplaceWith("Adjacent enemy units ending their turn take [30] damage"), DeprecationLevel.WARNING)
|
||||
DamagesAdjacentEnemyUnitsOld("Deal [amount] damage to adjacent enemy units", UniqueTarget.Improvement),
|
||||
@Deprecated("As of 3.17.10", ReplaceWith("Adjacent enemy units ending their turn take [30] damage"), DeprecationLevel.WARNING)
|
||||
DamagesAdjacentEnemyUnitsForExactlyThirtyDamage("Deal 30 damage to adjacent enemy units", UniqueTarget.Improvement),
|
||||
|
||||
|
@ -805,8 +805,8 @@ Example: "Costs [20] gold per turn when in your territory"
|
||||
|
||||
Applicable to: Improvement
|
||||
|
||||
#### Deal [amount] damage to adjacent enemy units
|
||||
Example: "Deal [20] damage to adjacent enemy units"
|
||||
#### Adjacent enemy units ending their turn take [30] damage
|
||||
Example: "Adjacent enemy units ending their turn take [30] damage"
|
||||
|
||||
Applicable to: Improvement
|
||||
|
||||
|
Reference in New Issue
Block a user