Puppeted cities now always auto assign production

Resolved #1124 - added annex and puppet tutorial
This commit is contained in:
Yair Morgenstern
2019-09-28 21:43:27 +03:00
parent 27e2b0615a
commit 5980f18f89
4 changed files with 27 additions and 9 deletions

View File

@ -286,6 +286,21 @@
]
]
ConqueredEnemyCity: [
[
"You have conquered an enemy city!",
"You can now choose to either or raze, puppet, or annex the city.",
"Razing the city will lower its population by 1 each turn until the city is destroyed."
],
[
"Puppeting the city will mean that you have no control on the city's production.",
"The city will not increase your tech or policy cost, but its citizens will generate 1.5x the regular unhappiness.",
"Annexing the city will give you control over the production, but will increase the citizen's unhappiness to 2x!",
"This can be mitigated by building a courthouse in the city, returning the citizen's unhappiness to normal.",
"A puppeted city can be annexed at any time, but annexed vities cannot be returned to a puppeted state!"
]
]
BarbarianEncountered: [
[
"You have encountered a barbarian unit!",

View File

@ -45,7 +45,9 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
}
fun chooseNextConstruction() {
if (!UnCivGame.Current.settings.autoAssignCityProduction && civInfo.playerType== PlayerType.Human) return
if (!UnCivGame.Current.settings.autoAssignCityProduction
&& civInfo.playerType== PlayerType.Human && !cityInfo.isPuppet)
return
if (cityConstructions.getCurrentConstruction() !is SpecialConstruction) return // don't want to be stuck on these forever
addFoodBuildingChoice()

View File

@ -88,7 +88,7 @@ class PlayerPickerTable(val newGameScreen: NewGameScreen, val newGameParameters:
}
playerIdTable.add(setCurrentUserButton)
val copyFromClipboardButton = TextButton("Player ID from clipboard",CameraStageBaseScreen.skin)
val copyFromClipboardButton = TextButton("Player ID from clipboard".tr(),CameraStageBaseScreen.skin)
copyFromClipboardButton.onClick {
playerIdTextfield.text = Gdx.app.clipboard.contents
onPlayerIdTextUpdated()

View File

@ -10,7 +10,6 @@ import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
import com.unciv.Constants
import com.unciv.UnCivGame
import com.unciv.logic.GameInfo
import com.unciv.logic.GameSaver
import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.logic.civilization.diplomacy.DiplomaticStatus
@ -155,7 +154,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
// and we don't get any silly concurrency problems!
private fun update() {
displayTutorialsOnUpdate(viewingCiv, gameInfo)
displayTutorialsOnUpdate()
bottomBar.update(tileMapHolder.selectedTile) // has to come before tilemapholder update because the tilemapholder actions depend on the selected unit!
battleTable.update()
@ -196,7 +195,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
updateNextTurnButton()
}
private fun displayTutorialsOnUpdate(cloneCivilization: CivilizationInfo, gameClone: GameInfo) {
private fun displayTutorialsOnUpdate() {
if (UnCivGame.Current.settings.hasCrashedRecently) {
displayTutorials("GameCrashed")
UnCivGame.Current.settings.tutorialsShown.remove("GameCrashed")
@ -210,18 +209,20 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
if (!UnCivGame.Current.settings.tutorialsShown.contains("EnemyCityNeedsConqueringWithMeleeUnit")) {
for (enemyCity in cloneCivilization.diplomacy.values.filter { it.diplomaticStatus == DiplomaticStatus.War }
for (enemyCity in viewingCiv.diplomacy.values.filter { it.diplomaticStatus == DiplomaticStatus.War }
.map { it.otherCiv() }.flatMap { it.cities }) {
if (enemyCity.health == 1 && enemyCity.getCenterTile().getTilesInDistance(2)
.any { it.getUnits().any { unit -> unit.civInfo == cloneCivilization } })
.any { it.getUnits().any { unit -> unit.civInfo == viewingCiv} })
displayTutorials("EnemyCityNeedsConqueringWithMeleeUnit")
}
}
if(viewingCiv.cities.any { it.hasJustBeenConquered })
displayTutorials("ConqueredEnemyCity")
if (gameClone.getCurrentPlayerCivilization().getCivUnits().any { it.health < 100 })
if (gameInfo.getCurrentPlayerCivilization().getCivUnits().any { it.health < 100 })
displayTutorials("InjuredUnits")
if (gameClone.getCurrentPlayerCivilization().getCivUnits().any { it.name == Constants.worker })
if (gameInfo.getCurrentPlayerCivilization().getCivUnits().any { it.name == Constants.worker })
displayTutorials("WorkerTrained")
}