Added tutorials when first encountering barbarians and other civilizations

This commit is contained in:
Yair Morgenstern
2018-08-09 18:33:47 +03:00
parent b79b682376
commit e6bc3a1ab7
2 changed files with 21 additions and 0 deletions

View File

@ -242,6 +242,22 @@
]
]
BarbarianEncountered: [
[
"You have encountered a barbarian unit!",
"Barbarians attack everyone indiscriminately, so don't let your ",
" civilian units go near them, and be careful of your scout!"
]
]
OtherCivEncountered: [
[
"You have encountered another civilization!",
"Other civilizations start out peaceful, and you can trade with them,",
" but they may choose to declare war on you later on"
]
]
}

View File

@ -124,6 +124,7 @@ class WorldScreen : CameraStageBaseScreen() {
if(civInfo.diplomacy.values.map { it.otherCiv() }
.filterNot { it.isDefeated() || it.isPlayerCivilization() || it.isBarbarianCivilization() }
.any()) {
displayTutorials("OtherCivEncountered")
val btn = TextButton("Diplomacy".tr(), skin)
btn.addClickListener { UnCivGame.Current.screen = DiplomacyScreen() }
diplomacyButtonWrapper.add(btn)
@ -201,7 +202,11 @@ class WorldScreen : CameraStageBaseScreen() {
// otherwise images will not load properly!
update()
displayTutorials("NextTurn")
if("BarbarianEncountered" !in UnCivGame.Current.settings.tutorialsShown
&& civInfo.getViewableTiles().any { it.getUnits().any { unit -> unit.civInfo.isBarbarianCivilization() } })
displayTutorials("BarbarianEncountered")
if(civInfo.cities.size > 2) displayTutorials("SecondCity")
if(civInfo.happiness<0) displayTutorials("Unhappiness")
if(civInfo.goldenAges.isGoldenAge()) displayTutorials("GoldenAge")