AI now puppets cities by default - much better for long-term strategy, since puppeted cities are technically also controlled by AI controllers so...

This commit is contained in:
Yair Morgenstern 2019-09-24 16:57:49 +03:00
parent 38a28888ef
commit 27b8cd5f1b
3 changed files with 7 additions and 9 deletions

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.app" applicationId "com.unciv.app"
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 29 targetSdkVersion 29
versionCode 300 versionCode 301
versionName "3.0.7" versionName "3.1.0"
} }
// Had to add this crap for Travis to build, it wanted to sign the app // Had to add this crap for Travis to build, it wanted to sign the app

View File

@ -212,11 +212,9 @@ class Battle(val gameInfo:GameInfo) {
} }
if (attacker.getCivInfo().isPlayerCivilization()) { if (attacker.getCivInfo().isPlayerCivilization())
attackerCiv.popupAlerts.add(PopupAlert(AlertType.CityConquered, city.name)) attackerCiv.popupAlerts.add(PopupAlert(AlertType.CityConquered, city.name))
} else { else city.puppetCity(attacker.getCivInfo())
city.annexCity(attacker.getCivInfo())
}
} }
fun getMapCombatantOfTile(tile:TileInfo): ICombatant? { fun getMapCombatantOfTile(tile:TileInfo): ICombatant? {

View File

@ -434,15 +434,15 @@ class CityInfo {
/* /*
When someone settles a city within 6 tiles of another civ, When someone settles a city within 6 tiles of another civ,
this makes the AI unhappy and it starts a rolling event. this makes the AI unhappy and it starts a rolling event.
The SettledCitiesNearUs flag gets added to the AI so it knows this happened, The SettledCitiesNearUs flag gets added to the AI so it knows this happened,
and on its turn it asks the player to stop (with a DemandToStopSettlingCitiesNear alert type) and on its turn it asks the player to stop (with a DemandToStopSettlingCitiesNear alert type)
If the player says "whatever, I'm not promising to stop", they get a -10 modifier which gradually disappears in 40 turns If the player says "whatever, I'm not promising to stop", they get a -10 modifier which gradually disappears in 40 turns
If they DO agree, then if they keep their promise for ~100 turns they get a +10 modifier for keeping the promise, If they DO agree, then if they keep their promise for ~100 turns they get a +10 modifier for keeping the promise,
But if they don't keep their promise they get a -20 that will only fully disappear in 160 turns. But if they don't keep their promise they get a -20 that will only fully disappear in 160 turns.
There's a lot of triggering going on here. There's a lot of triggering going on here.
*/ */
fun triggerCitiesSettledNearOtherCiv(){ private fun triggerCitiesSettledNearOtherCiv(){
val citiesWithin6Tiles = civInfo.gameInfo.civilizations.filter { it.isMajorCiv() && it!=civInfo } val citiesWithin6Tiles = civInfo.gameInfo.civilizations.filter { it.isMajorCiv() && it!=civInfo }
.flatMap { it.cities } .flatMap { it.cities }
.filter { it.getCenterTile().arialDistanceTo(getCenterTile()) <= 6 } .filter { it.getCenterTile().arialDistanceTo(getCenterTile()) <= 6 }