diff --git a/android/assets/jsons/Civ V - Vanilla/Buildings.json b/android/assets/jsons/Civ V - Vanilla/Buildings.json index bc134fc6df..42f37fa3c2 100644 --- a/android/assets/jsons/Civ V - Vanilla/Buildings.json +++ b/android/assets/jsons/Civ V - Vanilla/Buildings.json @@ -106,7 +106,7 @@ "isWonder": true, "cost": 185, "greatPersonPoints": {"production": 1}, - "uniques": ["+[10]% growth in all cities", "+[15]% Production when constructing [ranged units]"], + "uniques": ["+[10]% growth in all cities", "+[15]% Production when constructing [Ranged] units"], "requiredTech": "Archery", "quote": "'It is not so much for its beauty that the forest makes a claim upon men's hearts, as for that subtle something, that quality of air, that emanation from old trees, that so wonderfully changes and renews a weary spirit.' - Robert Louis Stevenson" }, diff --git a/android/assets/jsons/Civ V - Vanilla/Policies.json b/android/assets/jsons/Civ V - Vanilla/Policies.json index 8bc04d5a87..34da0bc0d7 100644 --- a/android/assets/jsons/Civ V - Vanilla/Policies.json +++ b/android/assets/jsons/Civ V - Vanilla/Policies.json @@ -93,7 +93,7 @@ "policies": [ { "name": "Warrior Code", - "uniques":["+[20]% Production when constructing [melee units]"], + "uniques":["+[20]% Production when constructing [Melee] units"], "row": 1, "column": 2 }, @@ -413,7 +413,7 @@ }, { "name": "Total War", - "uniques": ["+[15]% Production when constructing [military units]", "New [military] units start with [15] Experience"], + "uniques": ["+[15]% Production when constructing [Military] units", "New [Military] units start with [15] Experience"], "requires": ["Police State","Fascism"], "row": 3, "column": 4 diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index 23e14160a2..95680aa08e 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -358,6 +358,11 @@ class CityStats { stats.production += unique.params[0].toInt() } + for (unique in uniques.filter { it.placeholderText == "+[]% Production when constructing [] units" }) { + if (currentConstruction is BaseUnit && currentConstruction.matchesFilter(unique.params[1])) + stats.production += unique.params[0].toInt() + } + if (cityInfo.cityConstructions.getBuiltBuildings().any { it.isWonder } && uniques.any { it.text == "+33% culture in all cities with a world wonder" }) @@ -375,12 +380,14 @@ class CityStats { fun constructionMatchesFilter(construction:IConstruction, filter:String): Boolean { return construction.name == filter + // All of these are deprecated as of 3.11.20 || filter == "land units" && construction is BaseUnit && construction.unitType.isLandUnit() || filter == "naval units" && construction is BaseUnit && construction.unitType.isWaterUnit() || filter == "ranged units" && construction is BaseUnit && construction.unitType == UnitType.Ranged || filter == "mounted units" && construction is BaseUnit && construction.unitType == UnitType.Mounted || filter == "military units" && construction is BaseUnit && !construction.unitType.isCivilian() || filter == "melee units" && construction is BaseUnit && construction.unitType.isMelee() + || filter == "Buildings" && construction is Building && !(construction.isWonder || construction.isNationalWonder) || filter == "Wonders" && construction is Building && (construction.isWonder || construction.isNationalWonder) || construction is Building && construction.uniques.contains(filter) diff --git a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt index a7c979ecbb..6507ca2eac 100644 --- a/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt +++ b/core/src/com/unciv/models/ruleset/unit/BaseUnit.kt @@ -212,7 +212,7 @@ class BaseUnit : INamed, IConstruction { else ruleset.units[replaces!!]!! } - fun matchesFilter(filter:String):Boolean{ + fun matchesFilter(filter:String):Boolean { if (filter == unitType.name) return true if (filter == name) return true if (filter == "All") return true @@ -220,7 +220,7 @@ class BaseUnit : INamed, IConstruction { if ((filter == "Water" || filter == "water units") && unitType.isWaterUnit()) return true if ((filter == "Air" || filter == "air units") && unitType.isAirUnit()) return true if (filter == "non-air" && !unitType.isAirUnit()) return true - if ((filter == "military" || filter == "military units") && unitType.isMilitary()) return true + if ((filter == "military" || filter == "Military" || filter == "military units") && unitType.isMilitary()) return true return false } }