Great merchant trade mission gold increases with era (as per original civ)

Added Great People actions translations
This commit is contained in:
Yair Morgenstern 2018-12-05 13:48:23 +02:00
parent d530740d35
commit 67625321b8
10 changed files with 499 additions and 452 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 779 KiB

After

Width:  |  Height:  |  Size: 786 KiB

View File

@ -347,6 +347,8 @@
Spanish:"Cargar datos copiados"
}
"Could not load game from clipboard!":{}
// New game screen
"Start game!":{
@ -2751,10 +2753,14 @@
French:"Peut créer des améliorations de ressources maritimes"
}
"Create [improvementName]":{ // for unit action button - also used for "create fishing boats" and "create oil well"
}
"Can start an 8-turn golden age":{
Italian:"Può avviare un'Età dell'Oro di 8 turni"
French:"Peut commencer un âge d'or de 8 tours"
}
"Start Golden Age":{} // for unit action button
"Can build improvement: Landmark":{
Italian:"Può costruire il miglioramento: Punto di Riferimento"
French:"Peut construire l'amélioration suivante: Point de repère"
@ -2763,6 +2769,7 @@
Italian:"Può scoprire una tecnologia"
French:"Peut découvrir une technologie"
}
"Discover Technology":{} // for unit action button
"Can build improvement: Academy":{
Italian:"Può costruire il miglioramento: Accademia"
French:"Peut construire l'amélioration suivante: Académie"
@ -2771,6 +2778,8 @@
Italian:"Può compiere missioni commerciali, donando grandi quantità di Oro"
French:"Peut entreprendre une mission commerciale qui donne une large somme en or"
}
"Conduct Trade Mission":{} // for unit action button
"Your trade mission has earned you [goldGained] gold!":{}
"Can build improvement: Customs House":{
Italian:"Può costruire il miglioramento: Dogana"
French:"Peut construire l'amélioration suivante: Douanes"
@ -2779,6 +2788,7 @@
Italian:"Può accelerare la costruzione di una Meraviglia"
French:"Peut accélérer la construction d'une Merveille"
}
"Hurry Wonder":{} // for unit action button
"Can build improvement: Manufactory":{
Italian:"Può costruire il miglioramento: Manifattura"
French:"Peut construire l'amélioration suivante: Manufacture"

View File

@ -43,8 +43,9 @@ class WorkerAutomation(val unit: MapUnit) {
fun tryConnectingCities():Boolean{ // returns whether we actually did anything
val citiesThatNeedConnecting = unit.civInfo.cities.filter { it.population.population>3 && !it.isCapital()
&& !it.cityStats.isConnectedToCapital(RoadStatus.Road) }
val citiesThatNeedConnecting = unit.civInfo.cities
.filter { it.population.population>3 && !it.isCapital()
&& !it.cityStats.isConnectedToCapital(RoadStatus.Road) }
if(citiesThatNeedConnecting.isEmpty()) return false // do nothing.
val citiesThatNeedConnectingBfs = citiesThatNeedConnecting
@ -147,22 +148,19 @@ class WorkerAutomation(val unit: MapUnit) {
// Either generalize or delete
fun constructRoadTo(destination:TileInfo) {
val currentTile = unit.getTile()
if (currentTile.roadStatus == RoadStatus.None) {
currentTile.startWorkingOnImprovement(GameBasics.TileImprovements["Road"]!!, unit.civInfo)
return
}
if (currentTile.roadStatus == RoadStatus.None)
return currentTile.startWorkingOnImprovement(GameBasics.TileImprovements["Road"]!!, unit.civInfo)
val pathToDestination = unit.movementAlgs().getShortestPath(destination)
val destinationThisTurn = pathToDestination.first()
val fullPathToCurrentDestination = unit.movementAlgs().getFullPathToCloseTile(destinationThisTurn)
val firstTileWithoutRoad = fullPathToCurrentDestination.firstOrNull { it.roadStatus == RoadStatus.None && unit.canMoveTo(it) }
if (firstTileWithoutRoad == null) {
unit.moveToTile(destinationThisTurn)
return
}
if (firstTileWithoutRoad == null)
return unit.moveToTile(destinationThisTurn)
unit.moveToTile(firstTileWithoutRoad)
if (unit.currentMovement > 0)
firstTileWithoutRoad.startWorkingOnImprovement(GameBasics.TileImprovements["Road"]!!, unit.civInfo)
}
}

View File

@ -37,19 +37,19 @@ open class SpecialConstruction(override var name: String, override val descripti
override fun getProductionCost(adoptedPolicies: HashSet<String>): Int {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
throw Exception("Impossible!")
}
override fun getGoldCost(adoptedPolicies: HashSet<String>): Int {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
throw Exception("Impossible!")
}
override fun isBuildable(construction: CityConstructions): Boolean {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
throw Exception("Impossible!")
}
override fun postBuildEvent(construction: CityConstructions) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
throw Exception("Impossible!")
}
}

View File

@ -97,7 +97,7 @@ class TechManager {
.firstOrNull { it.isCityCenter() }
if (closestCityTile != null) {
civInfo.addNotification("{"+revealedResource.name + "} {revealed near} "
+ closestCityTile.getCity()!!.name, tileInfo.position, Color.BLUE)
+ closestCityTile.getCity()!!.name, tileInfo.position, Color.BLUE) // todo change to [] notation
break
}
}

View File

@ -66,7 +66,7 @@ class LoadScreen : PickerScreen() {
loadedGame.setTransients()
UnCivGame.Current.loadGame(loadedGame)
}catch (ex:Exception){
errorLabel.setText("Could not load game from clipboard!")
errorLabel.setText("Could not load game from clipboard!".tr())
}
}

View File

@ -0,0 +1,35 @@
package com.unciv.ui.utils
import com.badlogic.gdx.scenes.scene2d.Group
import com.badlogic.gdx.scenes.scene2d.ui.Image
import com.unciv.logic.map.MapUnit
class UnitImage(val unit: MapUnit, val size: Float): Group() {
init {
val unitBaseImage = ImageGetter.getUnitIcon(unit.name, unit.civInfo.getNation().getSecondaryColor())
.apply { setSize(size * 0.75f, size * 0.75f) }
val background = getBackgroundImageForUnit(unit)
background.apply {
this.color = unit.civInfo.getNation().getColor()
setSize(size, size)
}
setSize(size, size)
addActor(background)
unitBaseImage.center(this)
addActor(unitBaseImage)
if (unit.health < 100) { // add health bar
addActor(ImageGetter.getHealthBar(unit.health.toFloat(), 100f, size))
}
}
fun getBackgroundImageForUnit(unit: MapUnit): Image {
return when {
unit.isEmbarked() -> ImageGetter.getImage("OtherIcons/Banner")
unit.isFortified() -> ImageGetter.getImage("OtherIcons/Shield.png")
else -> ImageGetter.getCircle()
}
}
}

View File

@ -1,5 +1,6 @@
package com.unciv.ui.worldscreen.unit
import com.badlogic.gdx.graphics.Color
import com.unciv.UnCivGame
import com.unciv.logic.automation.UnitAutomation
import com.unciv.logic.automation.WorkerAutomation
@ -131,7 +132,7 @@ class UnitActions {
&& tile.getTileResource().improvement == improvement
&& unit.civInfo.tech.isResearched(GameBasics.TileImprovements[improvement]!!.techRequired!!)
)
actionList += UnitAction("Create $improvement", unit.currentMovement != 0f) {
actionList += UnitAction("Create [$improvement]", unit.currentMovement != 0f) {
tile.improvement = improvement
unit.destroy()
}
@ -139,7 +140,7 @@ class UnitActions {
for(unique in unit.getUniques().filter { it.startsWith("Can build improvement: ") }){
val improvementName = unique.replace("Can build improvement: ","")
actionList += UnitAction("Construct $improvementName",
actionList += UnitAction("Create [$improvementName]",
unit.currentMovement != 0f && !tile.isCityCenter(),
constructImprovementAndDestroyUnit(unit, improvementName))
}
@ -177,7 +178,10 @@ class UnitActions {
if (unit.name == "Great Merchant" && !unit.isEmbarked()) {
actionList += UnitAction("Conduct Trade Mission", unit.currentMovement != 0f
) {
unit.civInfo.gold += 350 // + 50 * era_number - todo!
// http://civilization.wikia.com/wiki/Great_Merchant_(Civ5)
val goldGained = 350 + 50 * unit.civInfo.getEra().ordinal
unit.civInfo.gold += goldGained
unit.civInfo.addNotification("Your trade mission has earned you [$goldGained] gold!",null, Color.GOLD)
unit.destroy()
}
}