mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-13 19:39:34 +07:00
Hill city-strength bonus genericized
This commit is contained in:
parent
7686b1ee4a
commit
8d2629088f
@ -85,7 +85,7 @@
|
||||
"defenceBonus": 0.25,
|
||||
"RGB": [105,125,72],
|
||||
"occursOn": ["Tundra","Plains","Grassland","Desert","Snow"],
|
||||
"uniques": ["Rough terrain"]
|
||||
"uniques": ["Rough terrain", "+[5] Strength for cities built on this terrain"]
|
||||
},
|
||||
{
|
||||
"name": "Forest",
|
||||
|
@ -4,6 +4,7 @@
|
||||
"Hill": ["Grassland","Hill"],
|
||||
|
||||
"Hill+Forest+Uranium": ["Grassland","Hill","Uranium","HillForest"],
|
||||
"Grassland+Hill+Forest+Uranium": ["Grassland","Hill","Uranium","HillForest"],
|
||||
|
||||
|
||||
"Grassland+Jungle+Oil": ["Grassland","Oil","GrasslandJungle"],
|
||||
@ -15,6 +16,9 @@
|
||||
"Grassland+Forest+Furs": ["Grassland","Furs","GrasslandForest"],
|
||||
"Hill+Forest+Furs": ["Grassland","Hill","Furs","HillForest"],
|
||||
"Hill+Forest+Deer": ["Grassland","Hill","Deer","HillForest"],
|
||||
"Grassland+Hill+Forest+Furs": ["Grassland","Hill","Furs","HillForest"],
|
||||
"Grassland+Hill+Forest+Deer": ["Grassland","Hill","Deer","HillForest"],
|
||||
"Tundra+Hill+Forest+Deer": ["Tundra","Hill","Deer","HillForest"],
|
||||
|
||||
"Grassland+Hill+Forest": ["Grassland","Hill","HillForest"],
|
||||
"Plains+Hill+Forest": ["Plains","Hill","HillForest"],
|
||||
@ -22,13 +26,11 @@
|
||||
"Desert+Hill+Forest": ["Desert","Hill","HillForest"],
|
||||
"Snow+Hill+Forest": ["Snow","Hill","HillForest"],
|
||||
|
||||
"Hill+Furs+Ancient ruins": ["Grassland","Hill","Ancient ruins","Sheep"],
|
||||
"Grassland+Jungle+Ancient ruins": ["Grassland","Ancient ruins", "GrasslandJungle"],
|
||||
"Grassland+Forest+Ancient ruins": ["Grassland","Ancient ruins", "GrasslandForest"],
|
||||
"Grassland+Cattle+Ancient ruins": ["Grassland","Ancient ruins","Cattle"],
|
||||
"Grassland+Sheep+Ancient ruins": ["Grassland","Ancient ruins","Sheep"],
|
||||
|
||||
"Hill+Sheep+Ancient ruins": ["Grassland","Hill","Ancient ruins","Sheep"],
|
||||
"Plains+Forest+Deer": ["Plains","Deer","PlainsForest"]
|
||||
}
|
||||
}
|
@ -38,7 +38,9 @@ class CityCombatant(val city: CityInfo) : ICombatant {
|
||||
var strength = 8f
|
||||
strength += (city.population.population / 5) * 2 // Each 5 pop gives 2 defence
|
||||
val cityTile = city.getCenterTile()
|
||||
if (cityTile.isHill()) strength += 5
|
||||
for (unique in cityTile.getAllTerrains().flatMap { it.uniqueObjects })
|
||||
if (unique.placeholderText == "+[] Strength for cities built on this terrain")
|
||||
strength += unique.params[0].toInt()
|
||||
// as tech progresses so does city strength
|
||||
val techCount = getCivInfo().gameInfo.ruleSet.technologies.count()
|
||||
val techsPercentKnown: Float = if (techCount > 0) city.civInfo.tech.techsResearched.count().toFloat() / techCount else 0.5f // for mods with no tech
|
||||
@ -63,4 +65,4 @@ class CityCombatant(val city: CityInfo) : ICombatant {
|
||||
}
|
||||
|
||||
override fun toString() = city.name // for debug
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user