This commit is contained in:
YueR 2019-09-10 06:26:57 +08:00
commit 68cfe8de2b
15 changed files with 54 additions and 19 deletions

View file

@ -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",

View file

@ -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."

View file

@ -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:"复制游戏存档到剪贴板"
}

View file

@ -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!"
},
}

View file

@ -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:"对方攻击类型为远程"
}

View file

@ -23,6 +23,7 @@ class Constants{
val unitActionSleep = "Sleep"
val unitActionAutomation = "automation"
val unitActionExplore = "Explore"
val futureTech = "Future Tech"
}
}

View file

@ -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

View file

@ -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
}

View file

@ -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)

View file

@ -10,6 +10,7 @@ enum class AlertType{
CitiesSettledNearOtherCiv,
DemandToStopSettlingCitiesNear,
CitySettledNearOtherCivDespiteOurPromise,
WonderBuilt
}
class PopupAlert {

View file

@ -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()

View file

@ -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

View file

@ -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()

View file

@ -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

View file

@ -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()