mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Player can enter city-state borders.
This commit is contained in:
parent
ef7b73ad5f
commit
30531316d2
@ -240,6 +240,9 @@ class DiplomacyManager() {
|
|||||||
thirdCiv.getDiplomacyManager(civInfo).addModifier(DiplomaticModifiers.WarMongerer,5f)
|
thirdCiv.getDiplomacyManager(civInfo).addModifier(DiplomaticModifiers.WarMongerer,5f)
|
||||||
else thirdCiv.getDiplomacyManager(civInfo).addModifier(DiplomaticModifiers.WarMongerer,-5f)
|
else thirdCiv.getDiplomacyManager(civInfo).addModifier(DiplomaticModifiers.WarMongerer,-5f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Damage diplomatic relationship
|
||||||
|
otherCivDiplomacy.influence = -50f
|
||||||
}
|
}
|
||||||
|
|
||||||
fun makePeace(){
|
fun makePeace(){
|
||||||
|
@ -150,8 +150,12 @@ class MapUnit {
|
|||||||
return false
|
return false
|
||||||
|
|
||||||
val tileOwner = tile.getOwner()
|
val tileOwner = tile.getOwner()
|
||||||
if(tileOwner!=null && tileOwner.civName!=owner
|
if(tileOwner!=null && tileOwner.civName!=owner) {
|
||||||
&& (tile.isCityCenter() || !civInfo.canEnterTiles(tileOwner))) return false
|
if (tile.isCityCenter()) return false
|
||||||
|
if (!civInfo.canEnterTiles(tileOwner)
|
||||||
|
&& !(civInfo.isPlayerCivilization() && tileOwner.isCityState())) return false
|
||||||
|
// AIs won't enter city-state's border.
|
||||||
|
}
|
||||||
|
|
||||||
val unitsInTile = tile.getUnits()
|
val unitsInTile = tile.getUnits()
|
||||||
if(unitsInTile.isNotEmpty()){
|
if(unitsInTile.isNotEmpty()){
|
||||||
|
@ -73,8 +73,8 @@ class DiplomacyScreen:CameraStageBaseScreen() {
|
|||||||
|
|
||||||
fun giveGoldGift(otherCiv: CivilizationInfo) {
|
fun giveGoldGift(otherCiv: CivilizationInfo) {
|
||||||
val currentPlayerCiv = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization()
|
val currentPlayerCiv = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization()
|
||||||
currentPlayerCiv.gold -= 50
|
currentPlayerCiv.gold -= 100
|
||||||
otherCiv.getDiplomacyManager(currentPlayerCiv).influence += 5
|
otherCiv.getDiplomacyManager(currentPlayerCiv).influence += 10
|
||||||
rightSideTable.clear()
|
rightSideTable.clear()
|
||||||
rightSideTable.add(getDiplomacyTable(otherCiv))
|
rightSideTable.add(getDiplomacyTable(otherCiv))
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ class DiplomacyScreen:CameraStageBaseScreen() {
|
|||||||
diplomacyTable.addSeparator()
|
diplomacyTable.addSeparator()
|
||||||
|
|
||||||
if(otherCiv.isCityState()) {
|
if(otherCiv.isCityState()) {
|
||||||
val giftButton = TextButton("Give 50 gold".tr(), skin)
|
val giftButton = TextButton("Give 100 gold".tr(), skin)
|
||||||
giftButton.onClick{ giveGoldGift(otherCiv) }
|
giftButton.onClick{ giveGoldGift(otherCiv) }
|
||||||
diplomacyTable.add(giftButton).row()
|
diplomacyTable.add(giftButton).row()
|
||||||
if (currentPlayerCiv.gold < 1) giftButton.disable()
|
if (currentPlayerCiv.gold < 1) giftButton.disable()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user