Player can enter city-state borders.

This commit is contained in:
Duan Tao 2019-05-06 10:44:49 +08:00 committed by Yair Morgenstern
parent ef7b73ad5f
commit 30531316d2
3 changed files with 12 additions and 5 deletions

View File

@ -240,6 +240,9 @@ class DiplomacyManager() {
thirdCiv.getDiplomacyManager(civInfo).addModifier(DiplomaticModifiers.WarMongerer,5f)
else thirdCiv.getDiplomacyManager(civInfo).addModifier(DiplomaticModifiers.WarMongerer,-5f)
}
//Damage diplomatic relationship
otherCivDiplomacy.influence = -50f
}
fun makePeace(){

View File

@ -150,8 +150,12 @@ class MapUnit {
return false
val tileOwner = tile.getOwner()
if(tileOwner!=null && tileOwner.civName!=owner
&& (tile.isCityCenter() || !civInfo.canEnterTiles(tileOwner))) return false
if(tileOwner!=null && tileOwner.civName!=owner) {
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()
if(unitsInTile.isNotEmpty()){

View File

@ -73,8 +73,8 @@ class DiplomacyScreen:CameraStageBaseScreen() {
fun giveGoldGift(otherCiv: CivilizationInfo) {
val currentPlayerCiv = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization()
currentPlayerCiv.gold -= 50
otherCiv.getDiplomacyManager(currentPlayerCiv).influence += 5
currentPlayerCiv.gold -= 100
otherCiv.getDiplomacyManager(currentPlayerCiv).influence += 10
rightSideTable.clear()
rightSideTable.add(getDiplomacyTable(otherCiv))
}
@ -101,7 +101,7 @@ class DiplomacyScreen:CameraStageBaseScreen() {
diplomacyTable.addSeparator()
if(otherCiv.isCityState()) {
val giftButton = TextButton("Give 50 gold".tr(), skin)
val giftButton = TextButton("Give 100 gold".tr(), skin)
giftButton.onClick{ giveGoldGift(otherCiv) }
diplomacyTable.add(giftButton).row()
if (currentPlayerCiv.gold < 1) giftButton.disable()