From 27b8cd5f1b796d761e1eb5362e67640ade767981 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Tue, 24 Sep 2019 16:57:49 +0300 Subject: [PATCH] AI now puppets cities by default - much better for long-term strategy, since puppeted cities are technically also controlled by AI controllers so... --- android/build.gradle | 4 ++-- core/src/com/unciv/logic/battle/Battle.kt | 6 ++---- core/src/com/unciv/logic/city/CityInfo.kt | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 16e93a0a11..832f4358a6 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 29 - versionCode 300 - versionName "3.0.7" + versionCode 301 + versionName "3.1.0" } // Had to add this crap for Travis to build, it wanted to sign the app diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 953ef5c635..fb86f34ee4 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -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)) - } else { - city.annexCity(attacker.getCivInfo()) - } + else city.puppetCity(attacker.getCivInfo()) } fun getMapCombatantOfTile(tile:TileInfo): ICombatant? { diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 8ab996aa9e..e3973308bd 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -434,15 +434,15 @@ class CityInfo { /* 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, - 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 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. There's a lot of triggering going on here. */ - fun triggerCitiesSettledNearOtherCiv(){ + private fun triggerCitiesSettledNearOtherCiv(){ val citiesWithin6Tiles = civInfo.gameInfo.civilizations.filter { it.isMajorCiv() && it!=civInfo } .flatMap { it.cities } .filter { it.getCenterTile().arialDistanceTo(getCenterTile()) <= 6 }