mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 13:27:22 -04: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)
|
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()
|
goldCostOfUpgrade *= unique.params[0].toPercent()
|
||||||
|
|
||||||
if (goldCostOfUpgrade < 0) return 0 // For instance, Landsknecht costs less than Spearman, so upgrading would cost negative gold
|
if (goldCostOfUpgrade < 0) return 0 // For instance, Landsknecht costs less than Spearman, so upgrading would cost negative gold
|
||||||
|
Loading…
x
Reference in New Issue
Block a user