mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Merge branch 'master' of https://github.com/yairm210/Unciv
This commit is contained in:
commit
ad4bc86d52
@ -255,7 +255,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Commerce Complete",
|
name:"Commerce Complete",
|
||||||
description:"+1 gold from each specialist"
|
description:"+1 gold from every trading post, double gold from Great Merchant trade missions"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -1569,7 +1569,7 @@
|
|||||||
French:"+5% de production pour chaque routes commerciales connectées à une Cité état"
|
French:"+5% de production pour chaque routes commerciales connectées à une Cité état"
|
||||||
Polish:"+5% do produkcji za każdy szlak handlowy z państwem-miastem"
|
Polish:"+5% do produkcji za każdy szlak handlowy z państwem-miastem"
|
||||||
Simplified_Chinese:"每条通往城邦的贸易路线+5%产能"
|
Simplified_Chinese:"每条通往城邦的贸易路线+5%产能"
|
||||||
Traditional_Chinese:"每調通往城邦的貿易路線+5%產能"
|
Traditional_Chinese:"每條通往城邦的貿易路線+5%產能"
|
||||||
Russian:"+5% Производство за каждый торговый маршрут с городом-государством"
|
Russian:"+5% Производство за каждый торговый маршрут с городом-государством"
|
||||||
Czech:"+5% produkce pro každou obchodní stezku s hlavním městem říše"
|
Czech:"+5% produkce pro každou obchodní stezku s hlavním městem říše"
|
||||||
German:"+5% Produktion für jeden Handelsweg mit einem Stadtstaat innerhalb des Imperiums"
|
German:"+5% Produktion für jeden Handelsweg mit einem Stadtstaat innerhalb des Imperiums"
|
||||||
@ -2064,8 +2064,8 @@
|
|||||||
German:"Neue Sozialpolitiken erfordern 10% weniger Kultur"
|
German:"Neue Sozialpolitiken erfordern 10% weniger Kultur"
|
||||||
Dutch:"Aanschaffingskosten nieuwe sociaal beleiden verlaagd met 10%"
|
Dutch:"Aanschaffingskosten nieuwe sociaal beleiden verlaagd met 10%"
|
||||||
Spanish:"Coste de cultura para adoptar nuevas políticas se reduce 10%"
|
Spanish:"Coste de cultura para adoptar nuevas políticas se reduce 10%"
|
||||||
Simplified_Chinese:"推行新的社会政策所需的文化点数-10%"
|
Simplified_Chinese:"推行新的社会政策所需的文化-10%"
|
||||||
Traditional_Chinese:"推行新的社會政策所需的文化點數-10%"
|
Traditional_Chinese:"推行新的社會政策所需的文化-10%"
|
||||||
Portuguese:"Custo cultural de adotar novas políticas reduzido em 10%"
|
Portuguese:"Custo cultural de adotar novas políticas reduzido em 10%"
|
||||||
Polish:"Wdrożenie nowych ustrojów społecznych zmniejszone o 10% kultury"
|
Polish:"Wdrożenie nowych ustrojów społecznych zmniejszone o 10% kultury"
|
||||||
Czech:"Počet Kulturních bodů na získání nové sociální politiky se sníží o 10%"
|
Czech:"Počet Kulturních bodů na získání nové sociální politiky se sníží o 10%"
|
||||||
|
@ -1848,8 +1848,8 @@
|
|||||||
Italian:"Conduci missione commerciale"
|
Italian:"Conduci missione commerciale"
|
||||||
Romanian:"Dirijează misiunea comercială"
|
Romanian:"Dirijează misiunea comercială"
|
||||||
Spanish:"Tomar mision De Comercio"
|
Spanish:"Tomar mision De Comercio"
|
||||||
Simplified_Chinese:"开展贸易"
|
Simplified_Chinese:"拓展贸易"
|
||||||
Traditional_Chinese:"發展貿易"
|
Traditional_Chinese:"拓展貿易"
|
||||||
German:"Handelsmission durchführen"
|
German:"Handelsmission durchführen"
|
||||||
French:"Faire une mission commerciale"
|
French:"Faire une mission commerciale"
|
||||||
Portuguese:"Realizar uma missão comercial"
|
Portuguese:"Realizar uma missão comercial"
|
||||||
@ -1859,18 +1859,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// for unit action button
|
// for unit action button
|
||||||
"Your trade mission has earned you [goldGained] gold!":{
|
"Your trade mission to [civName] has earned you [goldAmount] gold and [influenceAmount] influence!":{
|
||||||
Italian:"La tua missione commerciale ti ha fruttato [goldGained] Oro!"
|
Simplified_Chinese:"您与[civName]拓展贸易获得[goldAmount]金钱和[influenceAmount]影响力!"
|
||||||
Romanian:"Misuiunea comercială ți-a adus [goldGained] aur!"
|
Traditional_Chinese:"您與[civName]拓展貿易獲得[goldAmount]金錢和[influenceAmount]影響力!"
|
||||||
Spanish:"¡La mision de comercio ha generado [goldGained] de oro!"
|
|
||||||
Simplified_Chinese:"您开展贸易赚了[goldGained]金钱"
|
|
||||||
Traditional_Chinese:"您發展貿易賺了[goldGained]金錢"
|
|
||||||
Portuguese:"Sua missão comercial deu-lhe [goldGained] ouro!"
|
|
||||||
German:"Die Handelsmission hat [goldGained] Gold eingebracht!"
|
|
||||||
French:"Votre mission commerciale vous a rapporté [goldGained] ors"
|
|
||||||
Russian:"Ваша торговая сделка принесла вам [goldGained] золота!",
|
|
||||||
Czech:"Obchodní mise vynesla [goldGained] zlata!"
|
|
||||||
Ukrainian:"Ваша угода принесла вам [goldGained] золота"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"Hurry Wonder":{
|
"Hurry Wonder":{
|
||||||
|
@ -1044,17 +1044,9 @@
|
|||||||
Czech:"Kompletní Kupectví"
|
Czech:"Kompletní Kupectví"
|
||||||
}
|
}
|
||||||
|
|
||||||
"+1 gold from each specialist":{
|
"+1 gold from every trading post, double gold from Great Merchant trade missions":{
|
||||||
Italian:"+1 Oro per ogni specialista"
|
Simplified_Chinese:"每处贸易站+1金钱,大商业家拓展贸易获得的金钱加倍"
|
||||||
Russian:"+1 золота от каждого специалиста"
|
Traditional_Chinese:"每處貿易站+1金錢,大商業家拓展貿易獲得的金錢加倍"
|
||||||
Romanian:"+1 aur de la fiecare specialist"
|
|
||||||
Spanish:"+1 oro por cada especialista"
|
|
||||||
Simplified_Chinese:"每个专业人员+1金钱"
|
|
||||||
Traditional_Chinese:"每個專業人員+1金錢"
|
|
||||||
Portuguese:"+1 ouro por cada especialista"
|
|
||||||
German:"+1 Gold für jede(n) Spezialistin"
|
|
||||||
French:"+1 or pour chaque spécialiste"
|
|
||||||
Czech:"+1 zlato za každého specialistu"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////Rationalism branch
|
//////Rationalism branch
|
||||||
@ -1156,7 +1148,7 @@
|
|||||||
Romanian:"+1 știință de la fiecare punct comercial, +17% știință de la universități"
|
Romanian:"+1 știință de la fiecare punct comercial, +17% știință de la universități"
|
||||||
Spanish:"+1 ciencia por cada puesto comercial, +17% ciencia de las universidades"
|
Spanish:"+1 ciencia por cada puesto comercial, +17% ciencia de las universidades"
|
||||||
Simplified_Chinese:"每处贸易站+1科研,大学+17%科研产出"
|
Simplified_Chinese:"每处贸易站+1科研,大学+17%科研产出"
|
||||||
Traditional_Chinese:"每個貿易站+1科研,大學+17%科研產出"
|
Traditional_Chinese:"每處貿易站+1科研,大學+17%科研產出"
|
||||||
Portuguese:"+1 ciência por cada posto mercantil, +17% ciência de todas as universidades"
|
Portuguese:"+1 ciência por cada posto mercantil, +17% ciência de todas as universidades"
|
||||||
German:"+1 Wissenschaft durch jeden Handelsposten; +17% Wissenschaft von Universitäten"
|
German:"+1 Wissenschaft durch jeden Handelsposten; +17% Wissenschaft von Universitäten"
|
||||||
French:"Comptoirs commerciaux : science +1 et science +17% grâce aux universités",
|
French:"Comptoirs commerciaux : science +1 et science +17% grâce aux universités",
|
||||||
@ -1650,8 +1642,8 @@
|
|||||||
Spanish:"+15% a la produccion cuando se esta construyendo unidades militares, las unidades militares comienzan con 15 de PX"
|
Spanish:"+15% a la produccion cuando se esta construyendo unidades militares, las unidades militares comienzan con 15 de PX"
|
||||||
Italian:"+15% Produzione per le unità militari, e +15 esperienza per le nuove unità militari"
|
Italian:"+15% Produzione per le unità militari, e +15 esperienza per le nuove unità militari"
|
||||||
Romanian:"+15% producție când se construiesc unități militare, iar noile unități militare au 15 experiență din start"
|
Romanian:"+15% producție când se construiesc unități militare, iar noile unități militare au 15 experiență din start"
|
||||||
Simplified_Chinese:"组建军事单位时产能积累速率+15%,新的军事单位初始有15点经验值"
|
Simplified_Chinese:"组建军事单位时产能积累速率+15%,新的军事单位初始经验值为15"
|
||||||
Traditional_Chinese:"訓練軍事單位時產能累積速率+15%,新的軍事單位初始經驗值為15點"
|
Traditional_Chinese:"訓練軍事單位時產能累積速率+15%,新的軍事單位初始經驗值為15"
|
||||||
Portuguese:"+15% produção ao construir unidades militares e novas unidades militares começam com 15 experiencia"
|
Portuguese:"+15% produção ao construir unidades militares e novas unidades militares começam com 15 experiencia"
|
||||||
Russian:"+15% К производству военных юнитов, Военные юниты создаются с 15 опыта"
|
Russian:"+15% К производству военных юнитов, Военные юниты создаются с 15 опыта"
|
||||||
German:"+15% Produktion beim Bauen von Militäreinheiten; neue Militäreinheiten starten mit 15 Erfahrung (EP)"
|
German:"+15% Produktion beim Bauen von Militäreinheiten; neue Militäreinheiten starten mit 15 Erfahrung (EP)"
|
||||||
|
@ -939,8 +939,8 @@
|
|||||||
Italian:"Cura [amountHealed] PF quando uccide un'unità nemica"
|
Italian:"Cura [amountHealed] PF quando uccide un'unità nemica"
|
||||||
French:"Soigne [amountHealed] dégâts si il tue une unité"
|
French:"Soigne [amountHealed] dégâts si il tue une unité"
|
||||||
Russian:"Восстаналивает [amountHealed] здоровья при уничтожении юнита"
|
Russian:"Восстаналивает [amountHealed] здоровья при уничтожении юнита"
|
||||||
Simplified_Chinese:"消灭敌方单位后回复[amountHealed]点生命值",
|
Simplified_Chinese:"消灭敌方单位后回复[amountHealed]生命值",
|
||||||
Traditional_Chinese:"消滅敵方單位後回復[amountHealed]點生命值",
|
Traditional_Chinese:"消滅敵方單位後回復[amountHealed]生命值",
|
||||||
Czech:"Léčí [amountHealed] zranění pokud zabije jednotku"
|
Czech:"Léčí [amountHealed] zranění pokud zabije jednotku"
|
||||||
German:"Heilt [amountHealed] Schaden beim Töten einer Einheit"
|
German:"Heilt [amountHealed] Schaden beim Töten einer Einheit"
|
||||||
}
|
}
|
||||||
@ -1663,17 +1663,9 @@
|
|||||||
Czech:"Velký Obchodník"
|
Czech:"Velký Obchodník"
|
||||||
}
|
}
|
||||||
|
|
||||||
"Can undertake a trade mission, giving a large sum of gold":{
|
"Can undertake a trade mission with City-State, giving a large sum of gold and [influenceAmount] Influence":{
|
||||||
Spanish:"Puede tomar una mision de comercio, generando una gran suma de Oro"
|
Simplified_Chinese:"可以拓展与城邦的贸易,获得大笔金钱和[influenceAmount]影响力",
|
||||||
Italian:"Può compiere missioni commerciali, donando grandi quantità di Oro"
|
Traditional_Chinese:"可以拓展與城邦的貿易,獲得大筆金錢和[influenceAmount]影響力",
|
||||||
French:"Peut entreprendre une mission commerciale qui donne une large somme en or"
|
|
||||||
Romanian:"Poate iniția o misiune comercială, oferind o sumă considerabilă de aur"
|
|
||||||
Simplified_Chinese:"可以开展贸易获得大笔金钱",
|
|
||||||
Traditional_Chinese:"可以開展貿易獲得大筆金錢",
|
|
||||||
Portuguese:"Pode entrar em uma missão comercial, dando grande quantidades de ouro"
|
|
||||||
German:"Kann eine Handelsmission durchführen, die viel Gold einbringt"
|
|
||||||
Russian:"Может провести торговую сделку, получив много золота"
|
|
||||||
Czech:"Může být vyslán na obchodní misi, která přinese velké množství zlata"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"Can build improvement: Customs house":{
|
"Can build improvement: Customs house":{
|
||||||
|
@ -1275,7 +1275,7 @@
|
|||||||
name:"Great Merchant",
|
name:"Great Merchant",
|
||||||
unbuildable:true,
|
unbuildable:true,
|
||||||
unitType:"Civilian",
|
unitType:"Civilian",
|
||||||
uniques:["Can undertake a trade mission, giving a large sum of gold","Can build improvement: Customs house"]
|
uniques:["Can undertake a trade mission with City-State, giving a large sum of gold and [30] Influence","Can build improvement: Customs house"]
|
||||||
movement:2
|
movement:2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -239,7 +239,6 @@ class CityStats {
|
|||||||
if (stat == Stat.Culture || stat == Stat.Science) stats.add(stat, 3f)
|
if (stat == Stat.Culture || stat == Stat.Science) stats.add(stat, 3f)
|
||||||
else stats.add(stat, 2f) // science and gold specialists
|
else stats.add(stat, 2f) // science and gold specialists
|
||||||
|
|
||||||
if (policies.contains("Commerce Complete")) stats.gold += 1
|
|
||||||
if (policies.contains("Secularism")) stats.science += 2
|
if (policies.contains("Secularism")) stats.science += 2
|
||||||
if (cityInfo.civInfo.containsBuildingUnique("+1 Production from specialists"))
|
if (cityInfo.civInfo.containsBuildingUnique("+1 Production from specialists"))
|
||||||
stats.production += 1
|
stats.production += 1
|
||||||
|
@ -12,6 +12,7 @@ import com.unciv.ui.utils.withItem
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.collections.ArrayList
|
import kotlin.collections.ArrayList
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
import kotlin.math.max
|
||||||
|
|
||||||
class TechManager {
|
class TechManager {
|
||||||
@Transient lateinit var civInfo: CivilizationInfo
|
@Transient lateinit var civInfo: CivilizationInfo
|
||||||
@ -30,6 +31,7 @@ class TechManager {
|
|||||||
/* When moving towards a certain tech, the user doesn't have to manually pick every one. */
|
/* When moving towards a certain tech, the user doesn't have to manually pick every one. */
|
||||||
var techsToResearch = ArrayList<String>()
|
var techsToResearch = ArrayList<String>()
|
||||||
private var techsInProgress = HashMap<String, Int>()
|
private var techsInProgress = HashMap<String, Int>()
|
||||||
|
var overflowScience = 0
|
||||||
|
|
||||||
//region state-changing functions
|
//region state-changing functions
|
||||||
fun clone(): TechManager {
|
fun clone(): TechManager {
|
||||||
@ -79,8 +81,7 @@ class TechManager {
|
|||||||
fun remainingScienceToTech(techName: String) = costOfTech(techName) - researchOfTech(techName)
|
fun remainingScienceToTech(techName: String) = costOfTech(techName) - researchOfTech(techName)
|
||||||
|
|
||||||
fun turnsToTech(techName: String): Int {
|
fun turnsToTech(techName: String): Int {
|
||||||
return ceil( remainingScienceToTech(techName).toDouble()
|
return max(1, ceil( remainingScienceToTech(techName).toDouble() / civInfo.statsForNextTurn.science).toInt())
|
||||||
/ civInfo.statsForNextTurn.science).toInt()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isResearched(TechName: String): Boolean = techsResearched.contains(TechName)
|
fun isResearched(TechName: String): Boolean = techsResearched.contains(TechName)
|
||||||
@ -118,10 +119,19 @@ class TechManager {
|
|||||||
val currentTechnology = currentTechnologyName()
|
val currentTechnology = currentTechnologyName()
|
||||||
if (currentTechnology == null) return
|
if (currentTechnology == null) return
|
||||||
techsInProgress[currentTechnology] = researchOfTech(currentTechnology) + scienceForNewTurn
|
techsInProgress[currentTechnology] = researchOfTech(currentTechnology) + scienceForNewTurn
|
||||||
|
if (overflowScience != 0){ // https://forums.civfanatics.com/threads/the-mechanics-of-overflow-inflation.517970/
|
||||||
|
val techsResearchedKnownCivs = civInfo.getKnownCivs().count { it.isMajorCiv() && it.tech.isResearched(currentTechnologyName()!!) }
|
||||||
|
val undefeatedCivs = UncivGame.Current.gameInfo.civilizations.count { it.isMajorCiv() && !it.isDefeated() }
|
||||||
|
techsInProgress[currentTechnology] = techsInProgress[currentTechnology]!! + ((1 + techsResearchedKnownCivs / undefeatedCivs.toFloat() * 0.3f)* overflowScience).toInt()
|
||||||
|
}
|
||||||
if (techsInProgress[currentTechnology]!! < costOfTech(currentTechnology))
|
if (techsInProgress[currentTechnology]!! < costOfTech(currentTechnology))
|
||||||
return
|
return
|
||||||
|
|
||||||
// We finished it!
|
// We finished it!
|
||||||
|
// http://www.civclub.net/bbs/forum.php?mod=viewthread&tid=123976
|
||||||
|
overflowScience = techsInProgress[currentTechnology]!! - costOfTech(currentTechnology)
|
||||||
|
if(overflowScience > max(scienceForNewTurn * 5, GameBasics.Technologies[currentTechnology]!!.cost))
|
||||||
|
overflowScience = max(scienceForNewTurn * 5, GameBasics.Technologies[currentTechnology]!!.cost)
|
||||||
addTechnology(currentTechnology)
|
addTechnology(currentTechnology)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,6 +186,8 @@ open class TileInfo {
|
|||||||
if (improvement.improvingTech != null && observingCiv.tech.isResearched(improvement.improvingTech!!)) stats.add(improvement.improvingTechStats!!) // eg Chemistry for mines
|
if (improvement.improvingTech != null && observingCiv.tech.isResearched(improvement.improvingTech!!)) stats.add(improvement.improvingTechStats!!) // eg Chemistry for mines
|
||||||
if (improvement.name == "Trading post" && city != null && city.civInfo.policies.isAdopted("Free Thought"))
|
if (improvement.name == "Trading post" && city != null && city.civInfo.policies.isAdopted("Free Thought"))
|
||||||
stats.science += 1f
|
stats.science += 1f
|
||||||
|
if (improvement.name == "Trading post" && city != null && city.civInfo.policies.isAdopted("Commerce Complete"))
|
||||||
|
stats.gold += 1f
|
||||||
if (containsGreatImprovement() && observingCiv.policies.isAdopted("Freedom Complete"))
|
if (containsGreatImprovement() && observingCiv.policies.isAdopted("Freedom Complete"))
|
||||||
stats.add(improvement) // again, for the double effect
|
stats.add(improvement) // again, for the double effect
|
||||||
if (containsGreatImprovement() && city != null && city.civInfo.nation.unique == "+2 Science for all specialists and Great Person tile improvements")
|
if (containsGreatImprovement() && city != null && city.civInfo.nation.unique == "+2 Science for all specialists and Great Person tile improvements")
|
||||||
|
@ -205,7 +205,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
|
|||||||
val tileSetStrings = TileSetStrings()
|
val tileSetStrings = TileSetStrings()
|
||||||
val cityTileGroups = cityInfo.getCenterTile().getTilesInDistance(5)
|
val cityTileGroups = cityInfo.getCenterTile().getTilesInDistance(5)
|
||||||
.filter { city.civInfo.exploredTiles.contains(it.position) }
|
.filter { city.civInfo.exploredTiles.contains(it.position) }
|
||||||
.map { CityTileGroup(cityInfo, it, tileSetStrings) }
|
.map { CityTileGroup(cityInfo, it, tileSetStrings).apply { unitLayerGroup.isVisible = false } }
|
||||||
|
|
||||||
for (tileGroup in cityTileGroups) {
|
for (tileGroup in cityTileGroups) {
|
||||||
val tileInfo = tileGroup.tileInfo
|
val tileInfo = tileGroup.tileInfo
|
||||||
|
@ -232,12 +232,19 @@ class UnitActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (unit.name == "Great Merchant" && !unit.isEmbarked()) {
|
if (unit.name == "Great Merchant" && !unit.isEmbarked()) {
|
||||||
actionList += UnitAction("Conduct Trade Mission", unit.currentMovement >0
|
val canConductTradeMission = tile.owningCity?.civInfo?.isCityState()== true
|
||||||
|
&& tile.owningCity?.civInfo?.isAtWarWith(unit.civInfo)== false
|
||||||
|
&& unit.currentMovement >0
|
||||||
|
actionList += UnitAction("Conduct Trade Mission", canConductTradeMission
|
||||||
) {
|
) {
|
||||||
// http://civilization.wikia.com/wiki/Great_Merchant_(Civ5)
|
// http://civilization.wikia.com/wiki/Great_Merchant_(Civ5)
|
||||||
val goldGained = 350 + 50 * unit.civInfo.getEra().ordinal
|
var goldEarned = (350 + 50 * unit.civInfo.getEra().ordinal) * unit.civInfo.gameInfo.gameParameters.gameSpeed.getModifier()
|
||||||
unit.civInfo.gold += goldGained
|
if (unit.civInfo.policies.isAdopted("Commerce Complete"))
|
||||||
unit.civInfo.addNotification("Your trade mission has earned you [$goldGained] gold!",null, Color.GOLD)
|
goldEarned *= 2
|
||||||
|
unit.civInfo.gold += goldEarned.toInt()
|
||||||
|
val influenceEarned=Regex("\\d+").find(unit.getUniques()[0])!!.value.toInt()
|
||||||
|
tile.owningCity!!.civInfo.getDiplomacyManager(unit.civInfo).influence += influenceEarned
|
||||||
|
unit.civInfo.addNotification("Your trade mission to [${tile.owningCity!!.civInfo}] has earned you [${goldEarned.toInt()}] gold and [$influenceEarned] influence!",null, Color.GOLD)
|
||||||
unit.destroy()
|
unit.destroy()
|
||||||
}.sound("chimes")
|
}.sound("chimes")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user