mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 03:18:18 +07:00
Fixed a bug where unit discounts would not work (#6081)
This commit is contained in:
parent
f6e22f60bf
commit
0951e5d6fd
@ -208,7 +208,9 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
|
||||
BuyItemsDiscount("[stat] cost of purchasing items in cities [amount]%", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||
BuyBuildingsDiscount("[stat] cost of purchasing [buildingFilter] buildings [amount]%", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||
BuyUnitsDiscount("[stat] cost of purchasing [baseUnitFilter] units in cities [amount]%", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||
BuyUnitsDiscount("[stat] cost of purchasing [baseUnitFilter] units [amount]%", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||
@Deprecated("As of 3.19.3", ReplaceWith("[stat] cost of purchasing [baseUnitFilter] units [amount]%"))
|
||||
BuyUnitsDiscountDeprecated("[stat] cost of purchasing [baseUnitFilter] units in cities [amount]%", UniqueTarget.Global, UniqueTarget.FollowerBelief),
|
||||
|
||||
// Should be replaced with moddable improvements when roads become moddable
|
||||
RoadMovementSpeed("Improves movement speed on roads",UniqueTarget.Global),
|
||||
|
@ -324,7 +324,7 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
||||
var cost = getBaseBuyCost(cityInfo, stat)?.toDouble()
|
||||
if (cost == null) return null
|
||||
|
||||
for (unique in cityInfo.getMatchingUniques(UniqueType.BuyUnitsDiscount)) {
|
||||
for (unique in cityInfo.getMatchingUniques(UniqueType.BuyUnitsDiscount) + cityInfo.getMatchingUniques(UniqueType.BuyUnitsDiscountDeprecated)) {
|
||||
if (stat.name == unique.params[0] && matchesFilter(unique.params[1]))
|
||||
cost *= unique.params[2].toPercent()
|
||||
}
|
||||
|
@ -313,8 +313,8 @@ Example: "[Culture] cost of purchasing [Culture] buildings [20]%"
|
||||
|
||||
Applicable to: Global, FollowerBelief
|
||||
|
||||
#### [stat] cost of purchasing [baseUnitFilter] units in cities [amount]%
|
||||
Example: "[Culture] cost of purchasing [Melee] units in cities [20]%"
|
||||
#### [stat] cost of purchasing [baseUnitFilter] units [amount]%
|
||||
Example: "[Culture] cost of purchasing [Melee] units [20]%"
|
||||
|
||||
Applicable to: Global, FollowerBelief
|
||||
|
||||
@ -1434,6 +1434,7 @@ Applicable to: Conditional
|
||||
- "-[amount]% Culture cost of acquiring tiles [cityFilter]" - Deprecated As of 3.19.1, replace with "[-amount]% Culture cost of natural border growth [cityFilter]"
|
||||
- "[amount]% cost of natural border growth" - Deprecated As of 3.19.1, replace with "[amount]% Culture cost of natural border growth [cityFilter]"
|
||||
- "-[amount]% Gold cost of acquiring tiles [cityFilter]" - Deprecated As of 3.19.1, replace with "[-amount]% Gold cost of acquiring tiles [cityFilter]"
|
||||
- "[stat] cost of purchasing [baseUnitFilter] units in cities [amount]%" - Deprecated As of 3.19.3, replace with "[stat] cost of purchasing [baseUnitFilter] units [amount]%"
|
||||
- "Maintenance on roads & railroads reduced by [amount]%" - Deprecated As of 3.18.17, replace with "[-amount]% maintenance on road & railroads"
|
||||
- "-[amount]% maintenance cost for buildings [cityFilter]" - Deprecated As of 3.18.17, replace with "[-amount]% maintenance cost for buildings [cityFilter]"
|
||||
- "+[amount] happiness from each type of luxury resource" - Deprecated As of 3.18.17, replace with "[+amount] Happiness from each type of luxury resource"
|
||||
|
Loading…
Reference in New Issue
Block a user