From d640ed9557ba9221da39a3e244bb2f149229cb58 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Tue, 25 Jun 2024 23:44:10 +0300 Subject: [PATCH] Revert "Better countables - phase 1" This reverts commit 7165c6257356adf3246e27680564f7a6dd48ae00. --- .../assets/jsons/Civ V - Gods & Kings/Events.json | 12 ++++++------ .../com/unciv/models/ruleset/unique/Countables.kt | 4 ++-- .../models/ruleset/unique/UniqueParameterType.kt | 5 ++--- docs/Modders/Unique-parameters.md | 6 ++---- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/android/assets/jsons/Civ V - Gods & Kings/Events.json b/android/assets/jsons/Civ V - Gods & Kings/Events.json index 6523765ff8..3a23e19b0c 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Events.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Events.json @@ -8,7 +8,7 @@ {"text":"Click on a unit → Click on a destination → Click the arrow popup."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -34,7 +34,7 @@ {"text":"Click the city button twice."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -60,7 +60,7 @@ {"text":"Enter city screen → Click on a unit or building → Click 'add to queue'."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -86,7 +86,7 @@ {"text":"Enter city screen → Click the assigned tile to unassign → Click an unassigned tile to assign population."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -131,7 +131,7 @@ {"text":"Construct a Worker unit → Move it to a Plains or Grassland tile → Click 'Construct improvement' → Choose the farm → Leave the worker there until it's finished."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -144,7 +144,7 @@ {"text":"Construct roads between your capital and another city. Or, automate your worker and let him get to that eventually."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, diff --git a/core/src/com/unciv/models/ruleset/unique/Countables.kt b/core/src/com/unciv/models/ruleset/unique/Countables.kt index 696b62ca44..7440239c31 100644 --- a/core/src/com/unciv/models/ruleset/unique/Countables.kt +++ b/core/src/com/unciv/models/ruleset/unique/Countables.kt @@ -17,8 +17,8 @@ object Countables { val civInfo = stateForConditionals.relevantCiv ?: return null - if (countable == "cities") return civInfo.cities.size - if (countable == "units") return civInfo.units.getCivUnitsSize() + if (countable == "Cities") return civInfo.cities.size + if (countable == "Units") return civInfo.units.getCivUnitsSize() if (countable == "Air units") return civInfo.units.getCivUnits().count { it.baseUnit.movesLikeAirUnits() } if (gameInfo.ruleset.tileResources.containsKey(countable)) diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt index b8af036d2c..9594dd1e7c 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueParameterType.kt @@ -65,7 +65,7 @@ enum class UniqueParameterType( Countable("countable", "1000", "This indicates a number or a numeric variable") { // todo add more countables private val knownValues = setOf( - "year", "turns", "cities", "units" + "year", "turns", "Cities", "Units" ) override fun isKnownValue(parameterText: String, ruleset: Ruleset) = when { @@ -75,8 +75,7 @@ enum class UniqueParameterType( parameterText in ruleset.tileResources -> true parameterText in ruleset.units -> true parameterText.removeSuffix(" units").removeSurrounding("[", "]") in ruleset.unitTypes -> true - parameterText in ruleset.buildings -> true - else -> false + else -> parameterText in ruleset.buildings } }, diff --git a/docs/Modders/Unique-parameters.md b/docs/Modders/Unique-parameters.md index d9a1ce4db3..df2d04479f 100644 --- a/docs/Modders/Unique-parameters.md +++ b/docs/Modders/Unique-parameters.md @@ -287,10 +287,8 @@ Allowed values are: Indicates *something that can be counted*, used both for comparisons and for multiplying uniques Allowed values: - -- `year` -- `turns` -- `cities`, `units`, `Air units` - these count your total number +- `year`, `turns` +- `Cities`, `Units`, `Air units` - these count your total number - Unit name (counts your existing units) - ` units` (e.g. `Mounted units`) - counts your units by their type (this is not a filter, use the unitType verbatim) - Building name (counts your existing buildings)