From acb1096615df465e6a94c51a325bd36070a52100 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Thu, 18 Jul 2024 17:51:54 +0300 Subject: [PATCH] Terrain civilopedia displays improvements that can be placed there --- core/src/com/unciv/models/ruleset/tile/Terrain.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/com/unciv/models/ruleset/tile/Terrain.kt b/core/src/com/unciv/models/ruleset/tile/Terrain.kt index ee27684800..e8b868418f 100644 --- a/core/src/com/unciv/models/ruleset/tile/Terrain.kt +++ b/core/src/com/unciv/models/ruleset/tile/Terrain.kt @@ -97,6 +97,15 @@ class Terrain : RulesetStatsObject() { } } + val improvementsThatCanBePlacedHere = ruleset.tileImprovements.values + .filter { it.terrainsCanBeBuiltOn.contains(name) } + if (improvementsThatCanBePlacedHere.isNotEmpty()){ + textList += FormattedLine("{Tile Improvements}:") + for (improvement in improvementsThatCanBePlacedHere){ + textList += FormattedLine(improvement.name, improvement.makeLink(), indent=1) + } + } + if (turnsInto != null) { textList += FormattedLine("Placed on [$turnsInto]", link="Terrain/$turnsInto") }