mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 23:37:31 +07:00
Added "Provides yield without assigned population" uniques to tile improvements
This commit is contained in:
parent
755586eecd
commit
dd4778495e
@ -42,7 +42,8 @@ class CityStats {
|
||||
private fun getStatsFromTiles(): Stats {
|
||||
val stats = Stats()
|
||||
for (cell in cityInfo.tilesInRange
|
||||
.filter { cityInfo.location == it.position || cityInfo.isWorked(it) })
|
||||
.filter { cityInfo.location == it.position || cityInfo.isWorked(it) ||
|
||||
it.getTileImprovement()?.hasUnique("Provides yield without assigned population")==true && it.owningCity == cityInfo })
|
||||
stats.add(cell.getTileStats(cityInfo, cityInfo.civInfo))
|
||||
return stats
|
||||
}
|
||||
|
@ -219,7 +219,8 @@ open class TileInfo {
|
||||
}
|
||||
|
||||
fun isWorked(): Boolean = getWorkingCity() != null
|
||||
fun providesYield() = getCity() != null && (isCityCenter() || isWorked())
|
||||
fun providesYield() = getCity() != null && (isCityCenter() || isWorked()
|
||||
|| getTileImprovement()?.hasUnique("Provides yield without assigned population")==true)
|
||||
|
||||
fun isLocked(): Boolean {
|
||||
val workingCity = getWorkingCity()
|
||||
|
@ -18,8 +18,7 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo, tileSetStrin
|
||||
isTransform = false // performance helper - nothing here is rotated or scaled
|
||||
addActor(yieldGroup)
|
||||
if (city.location == tileInfo.position) {
|
||||
icons.addPopulationIcon(ImageGetter.getImage("OtherIcons/Star")
|
||||
.apply { color = Color.GOLD })
|
||||
icons.addPopulationIcon(ImageGetter.getImage("OtherIcons/Star"))
|
||||
}
|
||||
unitLayerGroup.isVisible = false
|
||||
unitImageLayerGroup.isVisible = false
|
||||
@ -50,7 +49,7 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo, tileSetStrin
|
||||
icons.addPopulationIcon(ImageGetter.getImage("OtherIcons/Lock"))
|
||||
}
|
||||
|
||||
!tileInfo.isCityCenter() -> { // workable
|
||||
tileInfo.isWorked() || !tileInfo.providesYield() -> { // workable
|
||||
icons.addPopulationIcon()
|
||||
isWorkable = true
|
||||
}
|
||||
@ -85,8 +84,9 @@ class CityTileGroup(private val city: CityInfo, tileInfo: TileInfo, tileSetStrin
|
||||
populationIcon.setPosition(width / 2 - populationIcon.width / 2,
|
||||
height * 0.85f - populationIcon.height / 2)
|
||||
|
||||
if (tileInfo.providesYield()) populationIcon.color = Color.WHITE
|
||||
else populationIcon.color = Color.GRAY.cpy()
|
||||
if (tileInfo.isCityCenter()) populationIcon.color = Color.GOLD
|
||||
else if (tileInfo.providesYield()) populationIcon.color = Color.WHITE
|
||||
else populationIcon.color = Color.GRAY.cpy() // City center gets a GOLD star
|
||||
|
||||
populationIcon.toFront()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user