From ff5480bf2e963401ebe7ac5f25ab5c3d15fa4fa9 Mon Sep 17 00:00:00 2001 From: Loof <223481293+unciv-loof@users.noreply.github.com> Date: Wed, 10 Sep 2025 16:09:44 +0200 Subject: [PATCH] Add cityAirUnitCapacity ModConstant (#13883) * Add ModConstant to modify city air unit capacity * Update docs: cityAirUnitCapacity ModConstant --- core/src/com/unciv/logic/city/City.kt | 5 +---- core/src/com/unciv/models/ModConstants.kt | 3 +++ .../Modders/Mod-file-structure/5-Miscellaneous-JSON-files.md | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/com/unciv/logic/city/City.kt b/core/src/com/unciv/logic/city/City.kt index bf85b3e09c..b4ff4084b3 100644 --- a/core/src/com/unciv/logic/city/City.kt +++ b/core/src/com/unciv/logic/city/City.kt @@ -272,11 +272,8 @@ class City : IsPartOfGameInfoSerialization, INamed { @Readonly fun getStrength() = cityConstructions.getBuiltBuildings().sumOf { it.cityStrength }.toFloat() - // This should probably be configurable - @Transient - private val maxAirUnits = 6 /** Gets max air units that can remain in the city untransported */ - @Readonly fun getMaxAirUnits() = maxAirUnits + @Readonly fun getMaxAirUnits() = civ.gameInfo.ruleset.modOptions.constants.cityAirUnitCapacity override fun toString() = name // for debug diff --git a/core/src/com/unciv/models/ModConstants.kt b/core/src/com/unciv/models/ModConstants.kt index b3917e20e5..c4d5331112 100644 --- a/core/src/com/unciv/models/ModConstants.kt +++ b/core/src/com/unciv/models/ModConstants.kt @@ -51,6 +51,9 @@ class ModConstants { var baseCityBombardRange = 2 var cityWorkRange = 3 var cityExpandRange = 5 + + // Number of air units that can be stationed in a city + var cityAirUnitCapacity = 6 // Modifies how much the gold value of a one-sided trade is applied to the gifts diplomatic modifier. // Eg: One side offers a city, resource or gold for nothing in return. diff --git a/docs/Modders/Mod-file-structure/5-Miscellaneous-JSON-files.md b/docs/Modders/Mod-file-structure/5-Miscellaneous-JSON-files.md index a3645d8870..78f9b40d3c 100644 --- a/docs/Modders/Mod-file-structure/5-Miscellaneous-JSON-files.md +++ b/docs/Modders/Mod-file-structure/5-Miscellaneous-JSON-files.md @@ -211,6 +211,7 @@ and city distance in another. In case of conflicts, there is no guarantee which | baseCityBombardRange | Int | 2 | [^S] | | cityWorkRange | Int | 3 | [^T] | | cityExpandRange | Int | 5 | [^U] | +| cityAirUnitCapacity | Int | 6 | [^W] | | unitSupplyPerPopulation | Float | 0.5 | [^C] | | minimalCityDistance | Int | 3 | [^D] | | minimalCityDistanceOnDifferentContinents | Int | 2 | [^D] | @@ -279,6 +280,7 @@ Legend: - [^T]: The multiplier of the gold value of a one-sided trade to be stored as gifts. - [^U]: The multiplier of the gold value of a regular trade to be stored as gifts. Set to 0 to disable gold gifting in two-sided trades. - [^U]: Modifies how quickly the GaveUsGifts dimplomacy modifier runs out. A higher value makes it run out quicker. Normally the gifts reduced by ~2.5% per turn depending on the diplomatic relations with the default value. +- [^W]: Number of air units that can be stationed in a city, not including carried/transported air units. #### UnitUpgradeCost