mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 05:09:25 +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
|
||||
}
|
||||
|
||||
fun AcquireOwnership(tileInfo: TileInfo){
|
||||
takeOwnership(tileInfo)
|
||||
}
|
||||
|
||||
private fun takeOwnership(tileInfo: TileInfo){
|
||||
if(tileInfo.isCityCenter()) throw Exception("What?")
|
||||
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()
|
||||
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.setPosition(stage.width - 10f - tileTable.width, 10f)
|
||||
|
Reference in New Issue
Block a user