mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-09 02:25:03 +07:00
Victory screen now contains Conquest victory
This commit is contained in:
parent
be5cd0c334
commit
3eaf1afef4
@ -184,4 +184,6 @@ class CivilizationInfo {
|
||||
}
|
||||
|
||||
override fun toString(): String {return civName} // for debug
|
||||
|
||||
fun isDefeated()= cities.isEmpty() && !getCivUnits().any{it.name=="Settler"}
|
||||
}
|
@ -17,24 +17,31 @@ class VictoryScreen : PickerScreen() {
|
||||
topTable.defaults().pad(10f)
|
||||
topTable.add("Science victory")
|
||||
topTable.add("Cultural victory")
|
||||
topTable.add("Conquest victory")
|
||||
topTable.row()
|
||||
topTable.add(scienceVictoryColumn())
|
||||
topTable.add(culturalVictoryColumn())
|
||||
topTable.add(conquestVictoryColumn())
|
||||
topTable.row()
|
||||
topTable.add("Complete all the spaceship parts to win!")
|
||||
topTable.add("Complete 4 policy branches to win!")
|
||||
topTable.add("Complete all the spaceship parts\n to win!")
|
||||
topTable.add("Complete 4 policy branches\n to win!")
|
||||
topTable.add("Destroy all enemies\n to win!")
|
||||
|
||||
rightSideButton.isVisible=false
|
||||
|
||||
if(civInfo.scienceVictory.hasWon()){
|
||||
rightSideButton.setText("Start new game")
|
||||
rightSideButton.isVisible=true
|
||||
closeButton.isVisible=false
|
||||
descriptionLabel.setText("You have won a scientific victory!")
|
||||
won()
|
||||
}
|
||||
|
||||
if(civInfo.policies.adoptedPolicies.count{it.endsWith("Complete")} > 3){
|
||||
descriptionLabel.setText("You have won a cultural victory!")
|
||||
won()
|
||||
}
|
||||
|
||||
if(civInfo.gameInfo.civilizations.all { it.isPlayerCivilization() || it.isDefeated() }){
|
||||
descriptionLabel.setText("You have won a cultural victory!")
|
||||
won()
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,6 +76,16 @@ class VictoryScreen : PickerScreen() {
|
||||
return t
|
||||
}
|
||||
|
||||
fun conquestVictoryColumn():Table{
|
||||
val t=Table()
|
||||
t.defaults().pad(5f)
|
||||
for (civ in civInfo.gameInfo.civilizations){
|
||||
if(civ.isPlayerCivilization() || civ == civInfo.gameInfo.getBarbarianCivilization()) continue
|
||||
t.add(getMilestone("Destroy "+civ.civName, civ.isDefeated())).row()
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
fun getMilestone(text:String, achieved:Boolean): TextButton {
|
||||
val TB = TextButton(text,skin)
|
||||
if(achieved) TB.setColor(Color.GREEN)
|
||||
|
Loading…
Reference in New Issue
Block a user