mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-12 03:48:16 +07:00
"No Maintenance costs for improvements in []" generic unique. Compatibility for Incan unique without having to edit the nations.json file. (#3194)
This commit is contained in:
parent
30396239c1
commit
56dbd5459e
@ -45,11 +45,20 @@ class CivInfoStats(val civInfo: CivilizationInfo){
|
||||
var transportationUpkeep = 0
|
||||
// we no longer use .flatMap, because there are a lot of tiles and keeping them all in a list
|
||||
// just to go over them once is a waste of memory - there are low-end phones who don't have much ram
|
||||
val ignoreHillTiles = civInfo.hasUnique("No Maintenance costs for improvements in Hills")
|
||||
|
||||
val ignoredTileTypes = civInfo.getMatchingUniques("No Maintenance costs for improvements in []").map { it.params[0] }
|
||||
// accounting for both the old way and the new way of doing no maintenance in hills
|
||||
val ignoreHillTiles = civInfo.hasUnique("No Maintenance costs for improvements in Hills")|| "Hills" in ignoredTileTypes
|
||||
|
||||
for (city in civInfo.cities) {
|
||||
for (tile in city.getTiles()) {
|
||||
if (tile.isCityCenter()) continue
|
||||
if (ignoreHillTiles && tile.isHill()) continue
|
||||
|
||||
if (tile.terrainFeature in ignoredTileTypes || tile.baseTerrain in ignoredTileTypes) {
|
||||
continue
|
||||
}
|
||||
|
||||
val tileUpkeep =
|
||||
when (tile.roadStatus) {
|
||||
RoadStatus.Road -> 1
|
||||
|
Loading…
Reference in New Issue
Block a user