mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 11:28:03 +07:00
Unit upgrade can accept unit conditionals
This commit is contained in:
parent
63f927af83
commit
ce3b6dfb3a
@ -527,7 +527,7 @@ class MapUnit {
|
||||
goldCostOfUpgrade *= (1 - unique.params[1].toFloat() / 100f)
|
||||
}
|
||||
//
|
||||
for (unique in civInfo.getMatchingUniques(UniqueType.UnitUpgradeCost))
|
||||
for (unique in civInfo.getMatchingUniques(UniqueType.UnitUpgradeCost, StateForConditionals(civInfo, unit=this)))
|
||||
goldCostOfUpgrade *= unique.params[0].toPercent()
|
||||
|
||||
if (goldCostOfUpgrade < 0) return 0 // For instance, Landsknecht costs less than Spearman, so upgrading would cost negative gold
|
||||
|
Loading…
Reference in New Issue
Block a user