mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 22:00:24 +07:00
unique "[] units gain the [] promotion" affects exisiting units (#3387)
* "[] units gain the [] promotion" unique affects existing units * removed toString() and flipped && * probably this is closer to what you had in mind :)
This commit is contained in:
@ -78,6 +78,15 @@ object UniqueTriggerActivation {
|
|||||||
"+20% attack bonus to all Military Units for 30 turns" -> civInfo.policies.autocracyCompletedTurns = 30
|
"+20% attack bonus to all Military Units for 30 turns" -> civInfo.policies.autocracyCompletedTurns = 30
|
||||||
|
|
||||||
"Reveals the entire map" -> civInfo.exploredTiles.addAll(civInfo.gameInfo.tileMap.values.asSequence().map { it.position })
|
"Reveals the entire map" -> civInfo.exploredTiles.addAll(civInfo.gameInfo.tileMap.values.asSequence().map { it.position })
|
||||||
|
|
||||||
|
"[] units gain the [] promotion" -> {
|
||||||
|
val filter = unique.params[0]
|
||||||
|
val promotion = unique.params[1]
|
||||||
|
for (unit in civInfo.getCivUnits())
|
||||||
|
if (unit.matchesCategory(filter)
|
||||||
|
|| (civInfo.gameInfo.ruleSet.unitPromotions.values.any { it.name == promotion
|
||||||
|
&& unit.type.name in it.unitTypes }))
|
||||||
|
unit.promotions.addPromotion(promotion, isFree = true)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user