From 2e16a96c4d1b516d6b5aad1c556b2a0c840d6c54 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 16 May 2019 22:08:45 +0300 Subject: [PATCH] Can no longer gift city states with gold you don't have --- android/assets/jsons/Translations/Other.json | 5 ++++- android/build.gradle | 4 ++-- core/src/com/unciv/ui/trade/DiplomacyScreen.kt | 11 ++++++----- core/src/com/unciv/ui/worldscreen/AlertPopup.kt | 5 +++-- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/android/assets/jsons/Translations/Other.json b/android/assets/jsons/Translations/Other.json index 469ce2a19d..d8123a696e 100644 --- a/android/assets/jsons/Translations/Other.json +++ b/android/assets/jsons/Translations/Other.json @@ -2528,7 +2528,7 @@ French:"Pas cette fois." } - "Excellent!":{ // AI statement after we accept a trade they proposed + "Excellent!":{ // AI statement after we accept a trade they proposed, and when we meet a city state Italian:"Eccellente!" Simplified_Chinese:"好极了!和和气气才是生财之道。" French:"Excellent!" @@ -2552,6 +2552,9 @@ Simplified_Chinese:"我们的关系:" } + "We have encountered the City-State of [name]!":{ // e.g. the Cultured city state of Vienna + } + // Friendship declaration flavor texts "Declare Friendship ([numberOfTurns] turns)":{ Italian:"Dichiarazione di Amicizia ([numberOfTurns] turni)" diff --git a/android/build.gradle b/android/build.gradle index a15adb60a5..7749a44543 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,8 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 28 - versionCode 241 - versionName "2.16.5" + versionCode 242 + versionName "2.16.6" } // Had to add this crap for Travis to build, it wanted to sign the app diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index 6ee04be19b..192a39c4b6 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -79,10 +79,10 @@ class DiplomacyScreen:CameraStageBaseScreen() { return tradeTable } - fun giveGoldGift(otherCiv: CivilizationInfo) { + fun giveGoldGift(otherCiv: CivilizationInfo, giftAmount: Int) { val currentPlayerCiv = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization() - currentPlayerCiv.gold -= 100 - otherCiv.getDiplomacyManager(currentPlayerCiv).influence += 10 + currentPlayerCiv.gold -= giftAmount + otherCiv.getDiplomacyManager(currentPlayerCiv).influence += giftAmount/10 rightSideTable.clear() rightSideTable.add(getCityStateDiplomacyTable(otherCiv)) } @@ -112,9 +112,10 @@ class DiplomacyScreen:CameraStageBaseScreen() { diplomacyTable.addSeparator() val giftButton = TextButton("Give 100 gold".tr(), skin) - giftButton.onClick{ giveGoldGift(otherCiv) } + val giftAmount = 100 + giftButton.onClick{ giveGoldGift(otherCiv,giftAmount ) } diplomacyTable.add(giftButton).row() - if (currentPlayerCiv.gold < 1) giftButton.disable() + if (currentPlayerCiv.gold < giftAmount ) giftButton.disable() val diplomacyManager = currentPlayerCiv.getDiplomacyManager(otherCiv) diff --git a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt index 8b3131e981..b6f17b8fab 100644 --- a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt @@ -47,8 +47,9 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu val translatedNation = civ.getTranslatedNation() if (civ.isCityState()) { addLeaderName(translatedNation) - addGoodSizedLabel("Type : " + civ.getCityStateType()).row() - add(getCloseButton("A pleasure to meet you.")) + val cityStateType = civ.getCityStateType() + addGoodSizedLabel("We have encountered the City-State of [${translatedNation.getNameTranslation()}]!").row() + add(getCloseButton("Excellent!")) } else { addLeaderName(translatedNation) addGoodSizedLabel(translatedNation.introduction).row()