mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-13 11:30:31 +07:00
Resolved #3483 - settlers require at least 2 population to construct, as per Civ V
This commit is contained in:
parent
8c50e70f22
commit
26c817a4a1
@ -15,7 +15,8 @@
|
||||
"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
|
||||
},
|
||||
{
|
||||
|
@ -124,12 +124,15 @@ class BaseUnit : INamed, IConstruction {
|
||||
return "Can only build water units in coastal cities"
|
||||
for (unique in uniqueObjects.filter { it.placeholderText == "Not displayed as an available construction without []" }) {
|
||||
val filter = unique.params[0]
|
||||
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)))
|
||||
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))
|
||||
return "Should not be displayed"
|
||||
}
|
||||
val civRejectionReason = getRejectionReason(construction.cityInfo.civInfo)
|
||||
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 ""
|
||||
}
|
||||
|
||||
@ -138,7 +141,8 @@ class BaseUnit : INamed, IConstruction {
|
||||
if (requiredTech != null && !civInfo.tech.isResearched(requiredTech!!)) return "$requiredTech not researched"
|
||||
if (obsoleteTech != null && civInfo.tech.isResearched(obsoleteTech!!)) return "Obsolete by $obsoleteTech"
|
||||
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
|
||||
&& uniques.contains("Nuclear weapon")) return "Disabled by setting"
|
||||
for (unique in uniqueObjects.filter { it.placeholderText == "Requires []" }) {
|
||||
|
Loading…
Reference in New Issue
Block a user