mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 09:48:12 +07:00
Added tutorials for siege units and embarkation
This commit is contained in:
@ -290,4 +290,22 @@
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
SiegeUnitTrained:[
|
||||||
|
[
|
||||||
|
"You have trained a siege unit!",
|
||||||
|
"Siege units are extremely powerful against cities, but need to be Set Up before they can attack.",
|
||||||
|
"Once your siege unit is set up, it can attack from the current tile,",
|
||||||
|
" but once moved to another tile, it will need to be set up again."
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
CanEmbark:[
|
||||||
|
[
|
||||||
|
"Your land units can now embark!",
|
||||||
|
"Siege units are extremely powerful against cities, but need to be Set Up before they can attack.",
|
||||||
|
"Once your siege unit is set up, it can attack from the current tile,",
|
||||||
|
" but once moved to another tile, it will need to be set up again."
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ import com.unciv.logic.GameSaver
|
|||||||
import com.unciv.logic.civilization.CivilizationInfo
|
import com.unciv.logic.civilization.CivilizationInfo
|
||||||
import com.unciv.logic.civilization.DiplomaticStatus
|
import com.unciv.logic.civilization.DiplomaticStatus
|
||||||
import com.unciv.models.gamebasics.tile.ResourceType
|
import com.unciv.models.gamebasics.tile.ResourceType
|
||||||
|
import com.unciv.models.gamebasics.unit.UnitType
|
||||||
import com.unciv.ui.pickerscreens.GreatPersonPickerScreen
|
import com.unciv.ui.pickerscreens.GreatPersonPickerScreen
|
||||||
import com.unciv.ui.pickerscreens.PolicyPickerScreen
|
import com.unciv.ui.pickerscreens.PolicyPickerScreen
|
||||||
import com.unciv.ui.pickerscreens.TechButton
|
import com.unciv.ui.pickerscreens.TechButton
|
||||||
@ -236,7 +237,7 @@ class WorldScreen : CameraStageBaseScreen() {
|
|||||||
// but the main thread does other stuff, including showing tutorials which guess what? Changes the game data
|
// but the main thread does other stuff, including showing tutorials which guess what? Changes the game data
|
||||||
// BOOM! Exception!
|
// BOOM! Exception!
|
||||||
// That's why this needs to be after the game is saved.
|
// That's why this needs to be after the game is saved.
|
||||||
shouldUpdate=true
|
shouldUpdateBecauseOfNewTurn=true
|
||||||
|
|
||||||
nextTurnButton.setText("Next turn".tr())
|
nextTurnButton.setText("Next turn".tr())
|
||||||
Gdx.input.inputProcessor = stage
|
Gdx.input.inputProcessor = stage
|
||||||
@ -255,14 +256,15 @@ class WorldScreen : CameraStageBaseScreen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var shouldUpdate=false
|
private var shouldUpdateBecauseOfNewTurn=false
|
||||||
override fun render(delta: Float) {
|
override fun render(delta: Float) {
|
||||||
if(shouldUpdate){ // This is so that updates happen in the MAIN THREAD, where there is a GL Context,
|
if(shouldUpdateBecauseOfNewTurn){ // This is so that updates happen in the MAIN THREAD, where there is a GL Context,
|
||||||
// otherwise images will not load properly!
|
// otherwise images will not load properly!
|
||||||
update()
|
update()
|
||||||
|
|
||||||
|
val shownTutorials = UnCivGame.Current.settings.tutorialsShown
|
||||||
displayTutorials("NextTurn")
|
displayTutorials("NextTurn")
|
||||||
if("BarbarianEncountered" !in UnCivGame.Current.settings.tutorialsShown
|
if("BarbarianEncountered" !in shownTutorials
|
||||||
&& civInfo.getViewableTiles().any { it.getUnits().any { unit -> unit.civInfo.isBarbarianCivilization() } })
|
&& civInfo.getViewableTiles().any { it.getUnits().any { unit -> unit.civInfo.isBarbarianCivilization() } })
|
||||||
displayTutorials("BarbarianEncountered")
|
displayTutorials("BarbarianEncountered")
|
||||||
if(civInfo.cities.size > 2) displayTutorials("SecondCity")
|
if(civInfo.cities.size > 2) displayTutorials("SecondCity")
|
||||||
@ -272,12 +274,18 @@ class WorldScreen : CameraStageBaseScreen() {
|
|||||||
val resources = civInfo.getCivResources()
|
val resources = civInfo.getCivResources()
|
||||||
if(resources.keys.any { it.resourceType==ResourceType.Luxury }) displayTutorials("LuxuryResource")
|
if(resources.keys.any { it.resourceType==ResourceType.Luxury }) displayTutorials("LuxuryResource")
|
||||||
if(resources.keys.any { it.resourceType==ResourceType.Strategic}) displayTutorials("StrategicResource")
|
if(resources.keys.any { it.resourceType==ResourceType.Strategic}) displayTutorials("StrategicResource")
|
||||||
if(civInfo.exploredTiles.asSequence().map { gameInfo.tileMap[it] }.any { it.isCityCenter() && it.getOwner()!=civInfo })
|
if("EnemyCity" !in shownTutorials
|
||||||
|
&& civInfo.exploredTiles.asSequence().map { gameInfo.tileMap[it] }
|
||||||
|
.any { it.isCityCenter() && it.getOwner()!=civInfo })
|
||||||
displayTutorials("EnemyCity")
|
displayTutorials("EnemyCity")
|
||||||
if("Enables construction of Spaceship parts" in civInfo.getBuildingUniques())
|
if("Enables construction of Spaceship parts" in civInfo.getBuildingUniques())
|
||||||
displayTutorials("ApolloProgram")
|
displayTutorials("ApolloProgram")
|
||||||
|
if(civInfo.getCivUnits().any { it.baseUnit.unitType == UnitType.Siege })
|
||||||
|
displayTutorials("SiegeUnitTrained")
|
||||||
|
if(civInfo.tech.getUniques().contains("Enables embarkation for land units"))
|
||||||
|
displayTutorials("CanEmbark")
|
||||||
|
|
||||||
shouldUpdate=false
|
shouldUpdateBecauseOfNewTurn=false
|
||||||
}
|
}
|
||||||
super.render(delta)
|
super.render(delta)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user