From bf874fe7493a68495a67b2e7fe97f2ac487126de Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 24 Jul 2020 17:56:59 +0300 Subject: [PATCH] [stat] from [terrain] tiles applied to all existing buildings --- .../jsons/Civ V - Vanilla/Buildings.json | 11 ++++++----- core/src/com/unciv/logic/map/TileInfo.kt | 18 +----------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/android/assets/jsons/Civ V - Vanilla/Buildings.json b/android/assets/jsons/Civ V - Vanilla/Buildings.json index 4e7b27533f..1b26316a2c 100644 --- a/android/assets/jsons/Civ V - Vanilla/Buildings.json +++ b/android/assets/jsons/Civ V - Vanilla/Buildings.json @@ -166,7 +166,8 @@ "culture": 1, "greatPersonPoints": {"gold": 1}, "isWonder": true, - "uniques": ["Provides a sum of gold each time you spend a Great Person", "+2 Gold for each source of Marble and Stone"], + "uniques": ["Provides a sum of gold each time you spend a Great Person", + "[+2 Gold] from [Marble] tiles", "[+2 Gold] from [Stone] tiles", "requiredTech": "Masonry" "quote": "'The whole earth is the tomb of heroic men and their story is not given only on stone over their clay but abides everywhere without visible symbol woven into the stuff of other men's lives.' - Pericles" }, @@ -297,7 +298,7 @@ "hurryCostModifier": 25, "percentStatBonus": {"gold": 25}, "uniques": ["Provides 1 extra copy of each improved luxury resource near this City", - "+2 Gold for each source of Oil and oasis"], + "[+2 Gold] from [Oil] tiles", "[+2 Gold] from [Oasis] tiles"], "requiredTech": "Currency" }, { @@ -410,7 +411,7 @@ "production": 2, "specialistSlots": {"production": 1}, "hurryCostModifier": 25, - "uniques": ["+1 Production from each worked Forest tile"], + "uniques": ["[+1 Production] from [Forest] tiles"], "requiredTech": "Metal Casting" }, { @@ -437,7 +438,7 @@ "percentStatBonus": {"science": 33}, "specialistSlots": {"science": 2}, "requiredBuilding": "Library", - "uniques": ["+2 Science from each worked Jungle tile"], + "uniques": ["[+2 Science] from [Jungle] tiles"], "requiredTech": "Education" }, { @@ -450,7 +451,7 @@ "specialistSlots": {"science": 2}, "culture": 3, "requiredBuilding": "Library", - "uniques": ["+2 Science from each worked Jungle tile"], + "uniques": ["[+2 Science] from [Jungle] tiles"], "requiredTech": "Education" }, { diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 93d4a69adf..d0b1d0ea91 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -176,7 +176,7 @@ open class TileInfo { if (unique.equalsPlaceholderText("[] from [] tiles")) { val placeholderParams = unique.getPlaceholderParameters() val tileType = placeholderParams[1] - if (baseTerrain == tileType || terrainFeature == tileType) + if (baseTerrain == tileType || terrainFeature == tileType || resource == tileType) stats.add(Stats.parse(placeholderParams[0])) } } @@ -187,16 +187,6 @@ open class TileInfo { stats = terrainFeatureBase.clone() else stats.add(terrainFeatureBase) - - if (terrainFeature == Constants.jungle && city != null - && city.containsBuildingUnique("+2 Science from each worked Jungle tile")) - stats.science += 2f - if (terrainFeature == "Oasis" && city != null - && city.containsBuildingUnique("+2 Gold for each source of Oil and oasis")) - stats.gold += 2 - if (terrainFeature == Constants.forest && city != null - && city.containsBuildingUnique("+1 Production from each worked Forest tile")) - stats.production += 1 } if (naturalWonder != null) { @@ -220,12 +210,6 @@ open class TileInfo { && observingCiv.nation.unique == UniqueAbility.SIBERIAN_RICHES) stats.production += 1 if (city != null) { - if (resource.name == "Oil" - && city.containsBuildingUnique("+2 Gold for each source of Oil and oasis")) - stats.gold += 2 - if ((resource.name == "Marble" || resource.name == "Stone") - && city.containsBuildingUnique("+2 Gold for each source of Marble and Stone")) - stats.gold += 2 if (isWater) { if (city.containsBuildingUnique("+1 production from all sea resources worked by the city")) stats.production += 1