mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-22 05:41:11 +07:00
Can no longer adopt policies after being defeated
This commit is contained in:
@ -1453,6 +1453,10 @@
|
|||||||
Russian:"юниты на открытой местности"
|
Russian:"юниты на открытой местности"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"units in rough terrain":{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
"Barrage I":{
|
"Barrage I":{
|
||||||
Italian:"Fuoco di Fila I"
|
Italian:"Fuoco di Fila I"
|
||||||
German:"Sperrfeuer I"
|
German:"Sperrfeuer I"
|
||||||
|
@ -395,7 +395,12 @@ class CivilizationInfo {
|
|||||||
notifications.add(Notification(text, color, action))
|
notifications.add(Notification(text, color, action))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addGreatPerson(greatPerson: String, city:CityInfo = cities.random()) {
|
fun addGreatPerson(greatPerson: String){
|
||||||
|
if(cities.isEmpty()) return
|
||||||
|
addGreatPerson(greatPerson, cities.random())
|
||||||
|
}
|
||||||
|
|
||||||
|
fun addGreatPerson(greatPerson: String, city:CityInfo) {
|
||||||
placeUnitNearTile(city.location, greatPerson)
|
placeUnitNearTile(city.location, greatPerson)
|
||||||
addNotification("A [$greatPerson] has been born!".tr(), city.location, Color.GOLD)
|
addNotification("A [$greatPerson] has been born!".tr(), city.location, Color.GOLD)
|
||||||
}
|
}
|
||||||
|
@ -118,13 +118,13 @@ class VictoryScreen : PickerScreen() {
|
|||||||
fun scienceVictoryColumn():Table{
|
fun scienceVictoryColumn():Table{
|
||||||
val t = Table()
|
val t = Table()
|
||||||
t.defaults().pad(5f)
|
t.defaults().pad(5f)
|
||||||
t.add(getMilestone("Built Apollo Program".tr(),playerCivInfo.containsBuildingUnique("Enables construction of Spaceship parts"))).row()
|
t.add(getMilestone("Built Apollo Program",playerCivInfo.containsBuildingUnique("Enables construction of Spaceship parts"))).row()
|
||||||
|
|
||||||
val victoryManager= playerCivInfo.victoryManager
|
val victoryManager= playerCivInfo.victoryManager
|
||||||
|
|
||||||
for (key in victoryManager.requiredSpaceshipParts.keys)
|
for (key in victoryManager.requiredSpaceshipParts.keys)
|
||||||
for (i in 0 until victoryManager.requiredSpaceshipParts[key]!!)
|
for (i in 0 until victoryManager.requiredSpaceshipParts[key]!!)
|
||||||
t.add(getMilestone(key.tr(), victoryManager.currentsSpaceshipParts[key]!! > i)).row() //(key, builtSpaceshipParts)
|
t.add(getMilestone(key, victoryManager.currentsSpaceshipParts[key]!! > i)).row() //(key, builtSpaceshipParts)
|
||||||
|
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ class VictoryScreen : PickerScreen() {
|
|||||||
t.defaults().pad(5f)
|
t.defaults().pad(5f)
|
||||||
for(branch in GameBasics.PolicyBranches.values) {
|
for(branch in GameBasics.PolicyBranches.values) {
|
||||||
val finisher = branch.policies.last().name
|
val finisher = branch.policies.last().name
|
||||||
t.add(getMilestone(finisher.tr(), playerCivInfo.policies.isAdopted(finisher))).row()
|
t.add(getMilestone(finisher, playerCivInfo.policies.isAdopted(finisher))).row()
|
||||||
}
|
}
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
@ -147,13 +147,13 @@ class VictoryScreen : PickerScreen() {
|
|||||||
val civName =
|
val civName =
|
||||||
if (playerCivInfo.diplomacy.containsKey(civ.civName)) civ.civName
|
if (playerCivInfo.diplomacy.containsKey(civ.civName)) civ.civName
|
||||||
else "???"
|
else "???"
|
||||||
table.add(getMilestone("Destroy [$civName]".tr(), civ.isDefeated())).row()
|
table.add(getMilestone("Destroy [$civName]", civ.isDefeated())).row()
|
||||||
}
|
}
|
||||||
return table
|
return table
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getMilestone(text:String, achieved:Boolean): TextButton {
|
fun getMilestone(text:String, achieved:Boolean): TextButton {
|
||||||
val textButton = TextButton(text,skin)
|
val textButton = TextButton(text.tr(),skin)
|
||||||
if(achieved) textButton.color = Color.GREEN
|
if(achieved) textButton.color = Color.GREEN
|
||||||
else textButton.color = Color.GRAY
|
else textButton.color = Color.GRAY
|
||||||
return textButton
|
return textButton
|
||||||
@ -175,7 +175,7 @@ class VictoryScreen : PickerScreen() {
|
|||||||
private fun getGlobalDominationVictoryColumn(majorCivs: List<CivilizationInfo>): Table {
|
private fun getGlobalDominationVictoryColumn(majorCivs: List<CivilizationInfo>): Table {
|
||||||
val dominationVictoryColumn = Table().apply { defaults().pad(10f) }
|
val dominationVictoryColumn = Table().apply { defaults().pad(10f) }
|
||||||
|
|
||||||
dominationVictoryColumn.add("Undefeated civs".tr().toLabel()).row()
|
dominationVictoryColumn.add("Undefeated civs".toLabel()).row()
|
||||||
dominationVictoryColumn.addSeparator()
|
dominationVictoryColumn.addSeparator()
|
||||||
|
|
||||||
for (civ in majorCivs.filter { !it.isDefeated() })
|
for (civ in majorCivs.filter { !it.isDefeated() })
|
||||||
@ -189,7 +189,7 @@ class VictoryScreen : PickerScreen() {
|
|||||||
|
|
||||||
private fun getGlobalCulturalVictoryColumn(majorCivs: List<CivilizationInfo>): Table {
|
private fun getGlobalCulturalVictoryColumn(majorCivs: List<CivilizationInfo>): Table {
|
||||||
val policyVictoryColumn = Table().apply { defaults().pad(10f) }
|
val policyVictoryColumn = Table().apply { defaults().pad(10f) }
|
||||||
policyVictoryColumn.add("Branches completed".tr().toLabel()).row()
|
policyVictoryColumn.add("Branches completed".toLabel()).row()
|
||||||
policyVictoryColumn.addSeparator()
|
policyVictoryColumn.addSeparator()
|
||||||
|
|
||||||
data class civToBranchesCompleted(val civ: CivilizationInfo, val branchesCompleted: Int)
|
data class civToBranchesCompleted(val civ: CivilizationInfo, val branchesCompleted: Int)
|
||||||
@ -206,7 +206,7 @@ class VictoryScreen : PickerScreen() {
|
|||||||
|
|
||||||
private fun getGlobalScientificVictoryColumn(majorCivs: List<CivilizationInfo>): Table {
|
private fun getGlobalScientificVictoryColumn(majorCivs: List<CivilizationInfo>): Table {
|
||||||
val scientificVictoryColumn = Table().apply { defaults().pad(10f) }
|
val scientificVictoryColumn = Table().apply { defaults().pad(10f) }
|
||||||
scientificVictoryColumn.add("Spaceship parts remaining".tr().toLabel()).row()
|
scientificVictoryColumn.add("Spaceship parts remaining".toLabel()).row()
|
||||||
scientificVictoryColumn.addSeparator()
|
scientificVictoryColumn.addSeparator()
|
||||||
|
|
||||||
data class civToSpaceshipPartsRemaining(val civ: CivilizationInfo, val partsRemaining: Int)
|
data class civToSpaceshipPartsRemaining(val civ: CivilizationInfo, val partsRemaining: Int)
|
||||||
|
@ -80,6 +80,7 @@ class PolicyPickerScreen(val worldScreen: WorldScreen) : PickerScreen() {
|
|||||||
|
|
||||||
private fun pickPolicy(policy: Policy) {
|
private fun pickPolicy(policy: Policy) {
|
||||||
if (!worldScreen.isPlayersTurn
|
if (!worldScreen.isPlayersTurn
|
||||||
|
|| viewingCiv.isDefeated()
|
||||||
|| viewingCiv.policies.isAdopted(policy.name)
|
|| viewingCiv.policies.isAdopted(policy.name)
|
||||||
|| policy.name.endsWith("Complete")
|
|| policy.name.endsWith("Complete")
|
||||||
|| !viewingCiv.policies.isAdoptable(policy)
|
|| !viewingCiv.policies.isAdoptable(policy)
|
||||||
|
@ -111,7 +111,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
|
|||||||
if (otherCivDiplomacyManager.relationshipLevel() >= RelationshipLevel.Friend) {
|
if (otherCivDiplomacyManager.relationshipLevel() >= RelationshipLevel.Friend) {
|
||||||
friendBonusLabel.setFontColor(Color.GREEN)
|
friendBonusLabel.setFontColor(Color.GREEN)
|
||||||
val turnsToRelationshipChange = otherCivDiplomacyManager.influence.toInt() - 30 + 1
|
val turnsToRelationshipChange = otherCivDiplomacyManager.influence.toInt() - 30 + 1
|
||||||
diplomacyTable.add("Relationship changes in another [$turnsToRelationshipChange] turns".tr().toLabel()).row()
|
diplomacyTable.add("Relationship changes in another [$turnsToRelationshipChange] turns".toLabel()).row()
|
||||||
} else
|
} else
|
||||||
friendBonusLabel.setFontColor(Color.GRAY)
|
friendBonusLabel.setFontColor(Color.GRAY)
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ class TradePopup(worldScreen: WorldScreen): PopupTable(worldScreen){
|
|||||||
|
|
||||||
val trade = tradeRequest.trade
|
val trade = tradeRequest.trade
|
||||||
val tradeOffersTable = Table().apply { defaults().pad(10f) }
|
val tradeOffersTable = Table().apply { defaults().pad(10f) }
|
||||||
tradeOffersTable.add("[${translatedNation.getNameTranslation()}]'s trade offer".tr().toLabel())
|
tradeOffersTable.add("[${translatedNation.getNameTranslation()}]'s trade offer".toLabel())
|
||||||
tradeOffersTable.add("Our trade offer".tr().toLabel())
|
tradeOffersTable.add("Our trade offer".toLabel())
|
||||||
tradeOffersTable.row()
|
tradeOffersTable.row()
|
||||||
for(i in 0..max(trade.theirOffers.lastIndex, trade.ourOffers.lastIndex)){
|
for(i in 0..max(trade.theirOffers.lastIndex, trade.ourOffers.lastIndex)){
|
||||||
if(trade.theirOffers.lastIndex>=i) tradeOffersTable.add(trade.theirOffers[i].getOfferText().toLabel())
|
if(trade.theirOffers.lastIndex>=i) tradeOffersTable.add(trade.theirOffers[i].getOfferText().toLabel())
|
||||||
|
Reference in New Issue
Block a user