From a1453a8b37cb5bf4992f45688f2b275db2e7e38a Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 2 Mar 2023 22:07:34 +0200 Subject: [PATCH] chore: Added explicit unit consumption to Settlers' Found City unique --- android/assets/jsons/Civ V - Gods & Kings/Units.json | 2 +- android/assets/jsons/Civ V - Vanilla/Units.json | 2 +- core/src/com/unciv/models/ruleset/RulesetValidator.kt | 2 +- .../unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/android/assets/jsons/Civ V - Gods & Kings/Units.json b/android/assets/jsons/Civ V - Gods & Kings/Units.json index 6de7e11c60..3cfcaca21f 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Units.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Units.json @@ -15,7 +15,7 @@ "unitType": "Civilian", "movement": 2, "cost": 106, - "uniques": ["Founds a new city", "Excess Food converted to Production when under construction", + "uniques": ["Founds a new city ", "Excess Food converted to Production when under construction", "Requires at least [2] population"], "hurryCostModifier": 20 }, diff --git a/android/assets/jsons/Civ V - Vanilla/Units.json b/android/assets/jsons/Civ V - Vanilla/Units.json index 3a893175ee..2b7bc7b702 100644 --- a/android/assets/jsons/Civ V - Vanilla/Units.json +++ b/android/assets/jsons/Civ V - Vanilla/Units.json @@ -15,7 +15,7 @@ "unitType": "Civilian", "movement": 2, "cost": 106, - "uniques": ["Founds a new city", "Excess Food converted to Production when under construction", + "uniques": ["Founds a new city ", "Excess Food converted to Production when under construction", "Requires at least [2] population"], "hurryCostModifier": 20 }, diff --git a/core/src/com/unciv/models/ruleset/RulesetValidator.kt b/core/src/com/unciv/models/ruleset/RulesetValidator.kt index 35f366f48a..190a13d45f 100644 --- a/core/src/com/unciv/models/ruleset/RulesetValidator.kt +++ b/core/src/com/unciv/models/ruleset/RulesetValidator.kt @@ -132,7 +132,7 @@ class RulesetValidator(val ruleset: Ruleset) { val vanillaRuleset = RulesetCache.getVanillaRuleset() // for UnitTypes fallback - if (ruleset.units.values.none { it.hasUnique(UniqueType.FoundCity) }) + if (ruleset.units.values.none { it.hasUnique(UniqueType.FoundCity, StateForConditionals.IgnoreConditionals) }) lines += "No city-founding units in ruleset!" for (unit in ruleset.units.values) { diff --git a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt index bc59ce0dfd..030a0867d1 100644 --- a/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt +++ b/core/src/com/unciv/ui/screens/worldscreen/unit/actions/UnitActions.kt @@ -202,6 +202,8 @@ object UnitActions { return UnitAction( type = UnitActionType.FoundCity, + title = if (!hasActionModifiers) UnitActionType.FoundCity.value + else "${UnitActionType.FoundCity.value} ${getSideEffectString(unique)}", uncivSound = UncivSound.Chimes, action = { // check if we would be breaking a promise