mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 15:29:32 +07:00
Resolved #3483 - settlers require at least 2 population to construct, as per Civ V
This commit is contained in:
@ -15,7 +15,8 @@
|
|||||||
"unitType": "Civilian",
|
"unitType": "Civilian",
|
||||||
"movement": 2,
|
"movement": 2,
|
||||||
"cost": 106,
|
"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
|
"hurryCostModifier": 20
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -124,12 +124,15 @@ class BaseUnit : INamed, IConstruction {
|
|||||||
return "Can only build water units in coastal cities"
|
return "Can only build water units in coastal cities"
|
||||||
for (unique in uniqueObjects.filter { it.placeholderText == "Not displayed as an available construction without []" }) {
|
for (unique in uniqueObjects.filter { it.placeholderText == "Not displayed as an available construction without []" }) {
|
||||||
val filter = unique.params[0]
|
val filter = unique.params[0]
|
||||||
if ((filter in construction.cityInfo.civInfo.gameInfo.ruleSet.tileResources && !construction.cityInfo.civInfo.hasResource(filter))
|
if (filter in construction.cityInfo.civInfo.gameInfo.ruleSet.tileResources && !construction.cityInfo.civInfo.hasResource(filter)
|
||||||
|| (filter in construction.cityInfo.civInfo.gameInfo.ruleSet.buildings && !construction.containsBuildingOrEquivalent(filter)))
|
|| filter in construction.cityInfo.civInfo.gameInfo.ruleSet.buildings && !construction.containsBuildingOrEquivalent(filter))
|
||||||
return "Should not be displayed"
|
return "Should not be displayed"
|
||||||
}
|
}
|
||||||
val civRejectionReason = getRejectionReason(construction.cityInfo.civInfo)
|
val civRejectionReason = getRejectionReason(construction.cityInfo.civInfo)
|
||||||
if (civRejectionReason != "") return civRejectionReason
|
if (civRejectionReason != "") return civRejectionReason
|
||||||
|
for (unique in uniqueObjects.filter { it.placeholderText == "Requires at least [] population" })
|
||||||
|
if (unique.params[0].toInt() > construction.cityInfo.population.population)
|
||||||
|
return unique.text
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +141,8 @@ class BaseUnit : INamed, IConstruction {
|
|||||||
if (requiredTech != null && !civInfo.tech.isResearched(requiredTech!!)) return "$requiredTech not researched"
|
if (requiredTech != null && !civInfo.tech.isResearched(requiredTech!!)) return "$requiredTech not researched"
|
||||||
if (obsoleteTech != null && civInfo.tech.isResearched(obsoleteTech!!)) return "Obsolete by $obsoleteTech"
|
if (obsoleteTech != null && civInfo.tech.isResearched(obsoleteTech!!)) return "Obsolete by $obsoleteTech"
|
||||||
if (uniqueTo != null && uniqueTo != civInfo.civName) return "Unique to $uniqueTo"
|
if (uniqueTo != null && uniqueTo != civInfo.civName) return "Unique to $uniqueTo"
|
||||||
if (civInfo.gameInfo.ruleSet.units.values.any { it.uniqueTo == civInfo.civName && it.replaces == name }) return "Our unique unit replaces this"
|
if (civInfo.gameInfo.ruleSet.units.values.any { it.uniqueTo == civInfo.civName && it.replaces == name })
|
||||||
|
return "Our unique unit replaces this"
|
||||||
if (!civInfo.gameInfo.gameParameters.nuclearWeaponsEnabled
|
if (!civInfo.gameInfo.gameParameters.nuclearWeaponsEnabled
|
||||||
&& uniques.contains("Nuclear weapon")) return "Disabled by setting"
|
&& uniques.contains("Nuclear weapon")) return "Disabled by setting"
|
||||||
for (unique in uniqueObjects.filter { it.placeholderText == "Requires []" }) {
|
for (unique in uniqueObjects.filter { it.placeholderText == "Requires []" }) {
|
||||||
|
Reference in New Issue
Block a user