mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-25 23:29:47 +07:00
Allow city to acuqire nearby tiles from friendly cities.
This commit is contained in:
@ -84,6 +84,10 @@ class CityExpansionManager {
|
|||||||
tileInfo.owningCity=null
|
tileInfo.owningCity=null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun AcquireOwnership(tileInfo: TileInfo){
|
||||||
|
takeOwnership(tileInfo)
|
||||||
|
}
|
||||||
|
|
||||||
private fun takeOwnership(tileInfo: TileInfo){
|
private fun takeOwnership(tileInfo: TileInfo){
|
||||||
if(tileInfo.isCityCenter()) throw Exception("What?")
|
if(tileInfo.isCityCenter()) throw Exception("What?")
|
||||||
if(tileInfo.getCity()!=null) tileInfo.getCity()!!.expansion.relinquishOwnership(tileInfo)
|
if(tileInfo.getCity()!=null) tileInfo.getCity()!!.expansion.relinquishOwnership(tileInfo)
|
||||||
|
@ -240,6 +240,12 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
|
|||||||
if(goldCostOfTile>city.civInfo.gold) buyTileButton.disable()
|
if(goldCostOfTile>city.civInfo.gold) buyTileButton.disable()
|
||||||
tileTable.add(buyTileButton)
|
tileTable.add(buyTileButton)
|
||||||
}
|
}
|
||||||
|
if(tile.getOwner()!=null && tile.getOwner()!!.isPlayerCivilization()
|
||||||
|
&& tile.arialDistanceTo(city.getCenterTile()) <= 3){
|
||||||
|
val transferTileButton = TextButton("Acquire".tr(),skin)
|
||||||
|
transferTileButton.onClick { city.expansion.AcquireOwnership(tile); game.screen = CityScreen(city); dispose() }
|
||||||
|
tileTable.add(transferTileButton)
|
||||||
|
}
|
||||||
|
|
||||||
tileTable.pack()
|
tileTable.pack()
|
||||||
tileTable.setPosition(stage.width - 10f - tileTable.width, 10f)
|
tileTable.setPosition(stage.width - 10f - tileTable.width, 10f)
|
||||||
|
Reference in New Issue
Block a user