mirror of
https://github.com/yairm210/Unciv.git
synced 2025-08-03 00:29:18 +07:00
Can no longer gift city states with gold you don't have
This commit is contained in:
@ -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)
|
||||
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user