From cd537a1f9a6c30e1c083a0ca2e0e166ceefd028b Mon Sep 17 00:00:00 2001 From: yairm210 Date: Thu, 12 Sep 2024 21:09:14 +0300 Subject: [PATCH] AI is displeased when you become the new ally of a city-state it was the ally of --- .../unciv/logic/civilization/diplomacy/CityStateFunctions.kt | 4 ++++ .../unciv/logic/civilization/diplomacy/DiplomacyManager.kt | 1 + .../logic/civilization/diplomacy/DiplomacyTurnManager.kt | 1 + 3 files changed, 6 insertions(+) diff --git a/core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt b/core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt index 25fd5b8323..26ec998736 100644 --- a/core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt +++ b/core/src/com/unciv/logic/civilization/diplomacy/CityStateFunctions.kt @@ -316,6 +316,10 @@ class CityStateFunctions(val civInfo: Civilization) { NotificationCategory.Diplomacy, civInfo.civName, NotificationIcon.Diplomacy ) + if (newAllyName != null && oldAllyCiv.knows(newAllyName)){ + val diplomacyManager = oldAllyCiv.getDiplomacyManager(newAllyName)!! + diplomacyManager.addModifier(DiplomaticModifiers.StoleOurAlly, -10f) + } oldAllyCiv.cache.updateViewableTiles() oldAllyCiv.cache.updateCivResources() } diff --git a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt index f39d47d884..f0eb6f5c75 100644 --- a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt +++ b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyManager.kt @@ -104,6 +104,7 @@ enum class DiplomaticModifiers(val text: String) { BulliedProtectedMinor("You demanded tribute from City-States that were under our protection!"), SidedWithProtectedMinor("You sided with a City-State over us"), SpiedOnUs("You spied on us!"), + StoleOurAlly("You took the alliance we had with a City-State"), // Positive YearsOfPeace("Years of peace have strengthened our relations."), diff --git a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt index 98364ba4fa..0133b3efe9 100644 --- a/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt +++ b/core/src/com/unciv/logic/civilization/diplomacy/DiplomacyTurnManager.kt @@ -292,6 +292,7 @@ object DiplomacyTurnManager { revertToZero(DiplomaticModifiers.DenouncedOurEnemies, 1 / 4f) revertToZero(DiplomaticModifiers.Denunciation, 1 / 8f) // That's personal, it'll take a long time to fade revertToZero(DiplomaticModifiers.SpiedOnUs, 1 / 4f) + revertToZero(DiplomaticModifiers.StoleOurAlly, 1 / 2f) // Fair enough, don't like it but not directly against us per se // Positives revertToZero(DiplomaticModifiers.GaveUsUnits, 1 / 4f)