Can no longer gift city states with gold you don't have

This commit is contained in:
Yair Morgenstern 2019-05-16 22:08:45 +03:00
parent 1f498f3fa6
commit 2e16a96c4d
4 changed files with 15 additions and 10 deletions

View File

@ -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)"

View File

@ -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

View File

@ -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)

View File

@ -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()