Tiles no longer change hands between civilizations (I was probably thinking of Civ IV because I tthough that was how the game worked =| )

"Mandate of heaven" no longer decreases your culture when your empire is unhappy
This commit is contained in:
Yair Morgenstern 2018-08-29 17:50:29 +03:00
parent 17e440d557
commit 5df19a9fb2
2 changed files with 7 additions and 6 deletions

View file

@ -33,10 +33,8 @@ class CityExpansionManager {
fun chooseNewTileToOwn(): TileInfo? {
for (i in 2..5) {
val tiles = cityInfo.getCenterTile().getTilesInDistance(i).filter {
it.getOwner() != cityInfo.civInfo
&& it.getTilesInDistance(1).none { tile->tile.isCityCenter() } // This SHOULD stop cities from grabbing tiles surrounding a city
}
val tiles = cityInfo.getCenterTile().getTilesInDistance(i)
.filter {it.getOwner() == null && it.neighbors.any { tile->tile.getOwner()==cityInfo.civInfo }}
if (tiles.isEmpty()) continue
val chosenTile = tiles.maxBy { Automation().rankTile(it,cityInfo.civInfo) }
return chosenTile

View file

@ -94,8 +94,11 @@ class CivilizationInfo {
statMap["Unit upkeep"] = Stats().apply { gold=- getUnitUpkeep().toFloat()}
if (policies.isAdopted("Mandate Of Heaven")) {
if (!statMap.containsKey("Policies")) statMap["Policies"] = Stats()
statMap["Policies"]!!.culture += statMap.values.map { it.happiness }.sum() / 2
val happiness = statMap.values.map { it.happiness }.sum()
if(happiness>0) {
if (!statMap.containsKey("Policies")) statMap["Policies"] = Stats()
statMap["Policies"]!!.culture += happiness / 2
}
}
// negative gold hurts science