diff --git a/android/assets/jsons/Buildings.json b/android/assets/jsons/Buildings.json index 72dc447d07..d8020d21e6 100644 --- a/android/assets/jsons/Buildings.json +++ b/android/assets/jsons/Buildings.json @@ -715,7 +715,8 @@ culture:3, isWonder:true, uniques:["Defensive buildings in all cities are 25% more effective"], - requiredTech:"Railroad" + requiredTech:"Railroad", + quote:"'The Law is a fortress on a hill that armies cannot take or floods wash away.' –- The Prophet Muhammed" }, { name:"Neuschwanstein", diff --git a/android/assets/jsons/Nations_Italian.json b/android/assets/jsons/Nations_Italian.json index 4fd9abdce8..da705a2bad 100644 --- a/android/assets/jsons/Nations_Italian.json +++ b/android/assets/jsons/Nations_Italian.json @@ -440,7 +440,7 @@ startIntroPart2: "Grande cancelliere Bismarck, il popolo tedesco guarda a te per vivere nuovi giorni di gloria. Forte è la sua determinazione affinché tu, l'amato Cancelliere di Ferro, torni a guidare la nazione ancora una volta. Sceglierai di dominare con il suangue e l'acciaio o patrocinerai le arti e l'industria? Riuscirai a plasmare una civiltà in grado di superare la prova del tempo?" declaringWar:"Lascia che tu lo sappia: tu sei un nemico della Germania e come tale vai combattuto. Che Dio abbia pietà di te, perché io non ne avrò." - attacked:"Ho sconfitto nemici dieci volte più potennti di te. Tu ne sarai solo un altro per gli storici!" + attacked:"Ho sconfitto nemici dieci volte più potenti di te. Tu ne sarai solo un altro per gli storici!" defeated:"Eravamo gli augusti e i gloriosi... ma no, non importa. Hai vinto. Possa il tuo regno essere più pacifico di quanto fosse il mio." introduction:"Guten tag. Nel nome del grande popolo tedesco, vi diamo il benvenuto." diff --git a/android/assets/jsons/Translations/NewGame,SaveGame,LoadGame,Options.json b/android/assets/jsons/Translations/NewGame,SaveGame,LoadGame,Options.json index bb0c422060..e50e060de9 100644 --- a/android/assets/jsons/Translations/NewGame,SaveGame,LoadGame,Options.json +++ b/android/assets/jsons/Translations/NewGame,SaveGame,LoadGame,Options.json @@ -420,6 +420,7 @@ } "Show autosaves":{ + Italian:"Mostra autosalvataggi" Simplified_Chinese:"显示自动存档" } @@ -444,6 +445,7 @@ } "Copy saved game to clipboard":{//this button exsits in "Load game",it means that we have a "saved game" file, so we can copy its data to clipboard. + Italian:"Copia salvataggio su appunti" Simplified_Chinese:"复制游戏存档到剪贴板" } diff --git a/android/assets/jsons/Translations/Notifications.json b/android/assets/jsons/Translations/Notifications.json index c91899f2e9..7f12c32637 100644 --- a/android/assets/jsons/Translations/Notifications.json +++ b/android/assets/jsons/Translations/Notifications.json @@ -575,5 +575,9 @@ "[nation] agreed to stop settling cities near us!": { Italian:"[nation] ha promesso di smettere di fondare città vicino a noi!" }, + + "[nation] refused to stop settling cities near us!": { + Italian:"[nation] ha rifiutato di smettere di fondare città vicino a noi!" + }, } diff --git a/android/assets/jsons/Translations/Other.json b/android/assets/jsons/Translations/Other.json index fdcb4ed294..3c789a5181 100644 --- a/android/assets/jsons/Translations/Other.json +++ b/android/assets/jsons/Translations/Other.json @@ -1272,14 +1272,17 @@ } "Bombard":{ + Italian:"Bombarda" Simplified_Chinese:"轰击" } "Captured!":{ + Italian:"Cattura!" Simplified_Chinese:"可被俘虏!" } "defence vs ranged":{ + Italian:"difesa contro unità da tiro" Simplified_Chinese:"对方攻击类型为远程" } diff --git a/core/src/com/unciv/Constants.kt b/core/src/com/unciv/Constants.kt index 1cd91d051a..f1af11e7d5 100644 --- a/core/src/com/unciv/Constants.kt +++ b/core/src/com/unciv/Constants.kt @@ -23,6 +23,7 @@ class Constants{ val unitActionSleep = "Sleep" val unitActionAutomation = "automation" val unitActionExplore = "Explore" + val futureTech = "Future Tech" } } \ No newline at end of file diff --git a/core/src/com/unciv/logic/automation/ConstructionAutomation.kt b/core/src/com/unciv/logic/automation/ConstructionAutomation.kt index d602770e03..5f4d1f26ee 100644 --- a/core/src/com/unciv/logic/automation/ConstructionAutomation.kt +++ b/core/src/com/unciv/logic/automation/ConstructionAutomation.kt @@ -231,7 +231,8 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){ } private fun addFoodBuildingChoice() { - val foodBuilding = buildableNotWonders.filter { it.isStatRelated(Stat.Food) } // only stat related in unique + val foodBuilding = buildableNotWonders.filter { it.isStatRelated(Stat.Food) + || it.getBaseBuilding().name == "Aqueduct" || it.getBaseBuilding().name == "Medical Lab"} // only stat related in unique .minBy { it.cost } if (foodBuilding != null) { var modifier = 1f diff --git a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt index e489868047..28689e74be 100644 --- a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt @@ -174,7 +174,7 @@ class NextTurnAutomation{ val tech: Technology if (researchableTechs.isEmpty()) { // no non-researched techs available, go for future tech - civInfo.tech.techsToResearch.add("Future Tech") + civInfo.tech.techsToResearch.add(Constants.futureTech) return } diff --git a/core/src/com/unciv/logic/city/CityConstructions.kt b/core/src/com/unciv/logic/city/CityConstructions.kt index 8077797615..d37b9919ca 100644 --- a/core/src/com/unciv/logic/city/CityConstructions.kt +++ b/core/src/com/unciv/logic/city/CityConstructions.kt @@ -3,6 +3,8 @@ package com.unciv.logic.city import com.badlogic.gdx.graphics.Color import com.unciv.Constants import com.unciv.logic.automation.ConstructionAutomation +import com.unciv.logic.civilization.AlertType +import com.unciv.logic.civilization.PopupAlert import com.unciv.models.gamebasics.Building import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.tr @@ -192,6 +194,7 @@ class CityConstructions { inProgressConstructions.remove(currentConstruction) if (construction is Building && construction.isWonder) { + cityInfo.civInfo.popupAlerts.add(PopupAlert(AlertType.WonderBuilt, construction.name)) for (civ in cityInfo.civInfo.gameInfo.civilizations) { if (civ.exploredTiles.contains(cityInfo.location)) civ.addNotification("[$currentConstruction] has been built in [${cityInfo.name}]", cityInfo.location, Color.BROWN) diff --git a/core/src/com/unciv/logic/civilization/PopupAlert.kt b/core/src/com/unciv/logic/civilization/PopupAlert.kt index 0c6ce56b1b..fd0758f406 100644 --- a/core/src/com/unciv/logic/civilization/PopupAlert.kt +++ b/core/src/com/unciv/logic/civilization/PopupAlert.kt @@ -10,6 +10,7 @@ enum class AlertType{ CitiesSettledNearOtherCiv, DemandToStopSettlingCitiesNear, CitySettledNearOtherCivDespiteOurPromise, + WonderBuilt } class PopupAlert { diff --git a/core/src/com/unciv/logic/civilization/TechManager.kt b/core/src/com/unciv/logic/civilization/TechManager.kt index 856db0324d..5a7819e20c 100644 --- a/core/src/com/unciv/logic/civilization/TechManager.kt +++ b/core/src/com/unciv/logic/civilization/TechManager.kt @@ -2,6 +2,7 @@ package com.unciv.logic.civilization import com.badlogic.gdx.graphics.Color +import com.unciv.Constants import com.unciv.logic.map.RoadStatus import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.tech.Technology @@ -43,11 +44,14 @@ class TechManager { var techCost = GameBasics.Technologies[techName]!!.cost.toFloat() techCost *= civInfo.getDifficulty().researchCostModifier techCost *= civInfo.gameInfo.gameParameters.gameSpeed.getModifier() + techCost *= 1 + (civInfo.cities.size -1 ) * 0.02f // each city increases tech cost by 2%, as per https://civilization.fandom.com/wiki/Science_(Civ5) return techCost.toInt() } - fun currentTechnology(): Technology? = currentTechnologyName()?.let { - GameBasics.Technologies[it] + fun currentTechnology(): Technology? { + val currentTechnologyName = currentTechnologyName() + if (currentTechnologyName == null) return null + return GameBasics.Technologies[currentTechnologyName] } fun currentTechnologyName(): String? { @@ -86,7 +90,7 @@ class TechManager { val techNameToCheck = checkPrerequisites.pop() // future tech can have been researched even when we're researching it, // so...if we skip it we'll end up with 0 techs in the "required techs", which will mean that we don't have annything to research. Yeah. - if (techNameToCheck!="Future Tech" && + if (techNameToCheck!=Constants.futureTech && (isResearched(techNameToCheck) || prerequisites.contains(techNameToCheck)) ) continue //no need to add or check prerequisites val techToCheck = GameBasics.Technologies[techNameToCheck] @@ -116,7 +120,7 @@ class TechManager { } fun addTechnology(techName:String) { - if(techName!="Future Tech") + if(techName!= Constants.futureTech) techsToResearch.remove(techName) val previousEra = civInfo.getEra() diff --git a/core/src/com/unciv/models/gamebasics/Building.kt b/core/src/com/unciv/models/gamebasics/Building.kt index 3f282ded28..b5bc734785 100644 --- a/core/src/com/unciv/models/gamebasics/Building.kt +++ b/core/src/com/unciv/models/gamebasics/Building.kt @@ -38,6 +38,7 @@ class Building : NamedStats(), IConstruction{ var xpForNewUnits=0 var replaces:String?=null var uniqueTo:String?=null + var quote:String?=null // Uniques private var providesFreeBuilding: String? = null diff --git a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt index 401090acf5..99dd6ec284 100644 --- a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt @@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.ui.Label import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane +import com.unciv.Constants import com.unciv.UnCivGame import com.unciv.logic.civilization.CivilizationInfo import com.unciv.logic.civilization.TechManager @@ -121,11 +122,13 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec private fun setButtonsInfo() { for (techName in techNameToButton.keys) { val techButton = techNameToButton[techName]!! - when { - civTech.isResearched(techName) && techName!="Future Tech" -> techButton.color = researchedTechColor - tempTechsToResearch.isNotEmpty() && tempTechsToResearch.first() == techName -> techButton.color = currentTechColor - tempTechsToResearch.contains(techName) -> techButton.color = queuedTechColor - else -> techButton.color = Color.BLACK + techButton.color = when { + civTech.isResearched(techName) && techName != Constants.futureTech -> researchedTechColor + // if we're here to pick a free tech, show the current tech like the rest of the researchables so it'll be obvious what we can pick + tempTechsToResearch.firstOrNull() == techName && !isFreeTechPick -> currentTechColor + researchableTechs.contains(techName) && !civTech.isResearched(techName) -> researchableTechColor + tempTechsToResearch.contains(techName) -> queuedTechColor + else -> Color.BLACK } //the tech that can be selected to research immediately should be always researchableTechColor, it's very good when we pick a free tech. if (researchableTechs.contains(techName)&&!civTech.isResearched(techName)) techButton.color = researchableTechColor @@ -140,7 +143,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec text += " (" + tempTechsToResearch.indexOf(techName) + ")" } - if (!civTech.isResearched(techName) || techName=="Future Tech") + if (!civTech.isResearched(techName) || techName== Constants.futureTech) text += "\r\n" + turnsToTech[techName] + " {turns}".tr() techButton.text.setText(text) @@ -166,7 +169,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec return } - if (civTech.isResearched(tech.name) && tech.name != "Future Tech") { + if (civTech.isResearched(tech.name) && tech.name != Constants.futureTech) { rightSideButton.setText("Pick a tech".tr()) rightSideButton.disable() setButtonsInfo() diff --git a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt index f84623c336..954ca2c918 100644 --- a/core/src/com/unciv/ui/worldscreen/AlertPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/AlertPopup.kt @@ -5,10 +5,9 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextButton import com.unciv.logic.civilization.AlertType import com.unciv.logic.civilization.CivilizationInfo import com.unciv.logic.civilization.PopupAlert +import com.unciv.models.gamebasics.GameBasics import com.unciv.models.gamebasics.tr -import com.unciv.ui.utils.addSeparator -import com.unciv.ui.utils.onClick -import com.unciv.ui.utils.toLabel +import com.unciv.ui.utils.* import com.unciv.ui.worldscreen.optionstable.PopupTable class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): PopupTable(worldScreen){ @@ -95,6 +94,18 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu addGoodSizedLabel("We noticed your new city near our borders, despite your promise. This will have....implications.").row() add(getCloseButton("Very well.")) } + AlertType.WonderBuilt -> { + val wonder = GameBasics.Buildings[popupAlert.value]!! + addGoodSizedLabel(wonder.name) + addSeparator() + val centerTable = Table() + val wonderText = if(wonder.quote!=null) wonder.quote!! else "" + centerTable.add(wonderText.toLabel().apply { setWrap(true) }).width(worldScreen.stage.width/3) + centerTable.add(ImageGetter.getConstructionImage(wonder.name).surroundWithCircle(100f)).pad(20f) + centerTable.add(wonder.getShortDescription().toLabel().apply { setWrap(true) }).width(worldScreen.stage.width/3) + add(centerTable).row() + add(getCloseButton("Close")) + } } open() worldScreen.alertPopupIsOpen = true diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index f1c976b633..fab39f496d 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -246,7 +246,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() { val researchableTechs = GameBasics.Technologies.values.filter { !civInfo.tech.isResearched(it.name) && civInfo.tech.canBeResearched(it.name) } if (civInfo.tech.currentTechnology() == null && researchableTechs.isEmpty()) - civInfo.tech.techsToResearch.add("Future Tech") + civInfo.tech.techsToResearch.add(Constants.futureTech) if (civInfo.tech.currentTechnology() == null) { val buttonPic = Table()