mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
Fixed war declaration against civs with a space in their name (e.g. The Ottomans)
This commit is contained in:
parent
6d38800093
commit
e59ad4ff94
@ -88,7 +88,7 @@ class TradeEvaluation{
|
|||||||
TradeType.Technology -> return sqrt(GameBasics.Technologies[offer.name]!!.cost.toDouble()).toInt()*20
|
TradeType.Technology -> return sqrt(GameBasics.Technologies[offer.name]!!.cost.toDouble()).toInt()*20
|
||||||
TradeType.Introduction -> return 250
|
TradeType.Introduction -> return 250
|
||||||
TradeType.WarDeclaration -> {
|
TradeType.WarDeclaration -> {
|
||||||
val nameOfCivToDeclareWarOn = offer.name.split(' ').last()
|
val nameOfCivToDeclareWarOn = offer.name.removePrefix("Declare war on ")
|
||||||
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(nameOfCivToDeclareWarOn)
|
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(nameOfCivToDeclareWarOn)
|
||||||
val threatToThem = Automation().threatAssessment(civInfo,civToDeclareWarOn)
|
val threatToThem = Automation().threatAssessment(civInfo,civToDeclareWarOn)
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ class TradeEvaluation{
|
|||||||
TradeType.Technology -> return sqrt(GameBasics.Technologies[offer.name]!!.cost.toDouble()).toInt()*20
|
TradeType.Technology -> return sqrt(GameBasics.Technologies[offer.name]!!.cost.toDouble()).toInt()*20
|
||||||
TradeType.Introduction -> return 250
|
TradeType.Introduction -> return 250
|
||||||
TradeType.WarDeclaration -> {
|
TradeType.WarDeclaration -> {
|
||||||
val nameOfCivToDeclareWarOn = offer.name.split(' ').last()
|
val nameOfCivToDeclareWarOn = offer.name.removePrefix("Declare war on ")
|
||||||
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(nameOfCivToDeclareWarOn)
|
val civToDeclareWarOn = civInfo.gameInfo.getCivilization(nameOfCivToDeclareWarOn)
|
||||||
val threatToUs = Automation().threatAssessment(civInfo, civToDeclareWarOn)
|
val threatToUs = Automation().threatAssessment(civInfo, civToDeclareWarOn)
|
||||||
|
|
||||||
|
@ -52,9 +52,8 @@ class DiplomacyScreen:CameraStageBaseScreen() {
|
|||||||
private fun updateLeftSideTable() {
|
private fun updateLeftSideTable() {
|
||||||
leftSideTable.clear()
|
leftSideTable.clear()
|
||||||
val currentPlayerCiv = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization()
|
val currentPlayerCiv = UnCivGame.Current.gameInfo.getCurrentPlayerCivilization()
|
||||||
for (civ in UnCivGame.Current.gameInfo.civilizations
|
for (civ in currentPlayerCiv.getKnownCivs()
|
||||||
.filterNot { it.isDefeated() || it.isPlayerCivilization() || it.isBarbarianCivilization() }) {
|
.filterNot { it.isDefeated() || it.isBarbarianCivilization() }) {
|
||||||
if (!currentPlayerCiv.knows(civ)) continue
|
|
||||||
|
|
||||||
val civIndicator = ImageGetter.getNationIndicator(civ.getNation(),100f)
|
val civIndicator = ImageGetter.getNationIndicator(civ.getNation(),100f)
|
||||||
|
|
||||||
@ -225,7 +224,8 @@ class DiplomacyScreen:CameraStageBaseScreen() {
|
|||||||
}
|
}
|
||||||
diplomacyTable.add(demandsButton).row()
|
diplomacyTable.add(demandsButton).row()
|
||||||
|
|
||||||
diplomacyTable.add(getRelationshipTable(otherCivDiplomacyManager)).row()
|
if(!otherCiv.isPlayerCivilization())
|
||||||
|
diplomacyTable.add(getRelationshipTable(otherCivDiplomacyManager)).row()
|
||||||
|
|
||||||
val diplomacyModifiersTable = Table()
|
val diplomacyModifiersTable = Table()
|
||||||
for (modifier in otherCivDiplomacyManager.diplomaticModifiers) {
|
for (modifier in otherCivDiplomacyManager.diplomaticModifiers) {
|
||||||
|
@ -186,7 +186,7 @@ class WorldScreen : CameraStageBaseScreen() {
|
|||||||
private fun updateDiplomacyButton(civInfo: CivilizationInfo) {
|
private fun updateDiplomacyButton(civInfo: CivilizationInfo) {
|
||||||
diplomacyButtonWrapper.clear()
|
diplomacyButtonWrapper.clear()
|
||||||
if(civInfo.getKnownCivs()
|
if(civInfo.getKnownCivs()
|
||||||
.filterNot { it.isDefeated() || it.isPlayerCivilization() || it.isBarbarianCivilization() }
|
.filterNot { it.isDefeated() || it.isBarbarianCivilization() }
|
||||||
.any()) {
|
.any()) {
|
||||||
displayTutorials("OtherCivEncountered")
|
displayTutorials("OtherCivEncountered")
|
||||||
val btn = TextButton("Diplomacy".tr(), skin)
|
val btn = TextButton("Diplomacy".tr(), skin)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user