Genericized hill's "extra sight for land units" to a unique

This commit is contained in:
Yair Morgenstern
2021-05-06 14:28:54 +03:00
parent 8d2629088f
commit 34bed66198
3 changed files with 5 additions and 3 deletions

View File

@ -85,7 +85,7 @@
"defenceBonus": 0.25,
"RGB": [105,125,72],
"occursOn": ["Tundra","Plains","Grassland","Desert","Snow"],
"uniques": ["Rough terrain", "+[5] Strength for cities built on this terrain"]
"uniques": ["Rough terrain", "[+5] Strength for cities built on this terrain", "[+1] Sight for [Land] units"]
},
{
"name": "Forest",

View File

@ -39,7 +39,7 @@ class CityCombatant(val city: CityInfo) : ICombatant {
strength += (city.population.population / 5) * 2 // Each 5 pop gives 2 defence
val cityTile = city.getCenterTile()
for (unique in cityTile.getAllTerrains().flatMap { it.uniqueObjects })
if (unique.placeholderText == "+[] Strength for cities built on this terrain")
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()

View File

@ -208,7 +208,9 @@ class MapUnit {
if (isEmbarked() && civInfo.hasUnique("+1 Sight when embarked"))
visibilityRange += 1
val tile = getTile()
if (tile.isHill() && type.isLandUnit()) visibilityRange += 1
for (unique in tile.getAllTerrains().flatMap { it.uniqueObjects })
if (unique.placeholderText == "[] Sight for [] units" && matchesFilter(unique.params[1]))
visibilityRange += unique.params[0].toInt()
viewableTiles = tile.getViewableTilesList(visibilityRange)
}