From 4114296cbe4174b069ec4615784480528c52f023 Mon Sep 17 00:00:00 2001 From: Arthur van der Staaij <32672293+avdstaaij@users.noreply.github.com> Date: Wed, 18 Aug 2021 11:19:08 +0200 Subject: [PATCH] Made water oil wells require the Refrigeration tech (#4889) * Made water oil wells require the Refrigeration tech Oil wells can now only be created on water with the refrigeration technology. This is not the ideal solution: it would be preferable to support multiple improvements for a single resource, to add offshore platforms as a separate improvement for coastal oil that requires refrigeration and to disable building oil wells on coast. Allowing multiple improvements for a resource would however be a much more significant refactor. * Added back "terrainsCanBeBuiltOn": ["Coast"] --- android/assets/jsons/Civ V - Vanilla/TileImprovements.json | 1 + core/src/com/unciv/logic/map/TileInfo.kt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/android/assets/jsons/Civ V - Vanilla/TileImprovements.json b/android/assets/jsons/Civ V - Vanilla/TileImprovements.json index f3d904400c..e434485196 100644 --- a/android/assets/jsons/Civ V - Vanilla/TileImprovements.json +++ b/android/assets/jsons/Civ V - Vanilla/TileImprovements.json @@ -52,6 +52,7 @@ "terrainsCanBeBuiltOn": ["Coast"], "turnsToBuild": 9, "techRequired": "Biology", + "uniques": ["Cannot be built on [Coast] tiles until [Refrigeration] is discovered"], "shortcutKey": "W" }, { diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 4a06b9669b..0f0c50f495 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -387,6 +387,10 @@ open class TileInfo { improvement.uniqueObjects.any { it.placeholderText == "Obsolete with []" && civInfo.tech.isResearched(it.params[0]) } -> return false + improvement.uniqueObjects.any { + it.placeholderText == "Cannot be built on [] tiles until [] is discovered" && + matchesTerrainFilter(it.params[0]) && !civInfo.tech.isResearched(it.params[1]) + } -> false else -> canImprovementBeBuiltHere(improvement, hasViewableResource(civInfo)) } }