mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
great scienstist does the job like original game (#1453)
This commit is contained in:
parent
e937ea0af1
commit
418a4968a4
@ -2127,29 +2127,32 @@
|
|||||||
"Songhai":{
|
"Songhai":{
|
||||||
Italian:"Songhai"
|
Italian:"Songhai"
|
||||||
French:"Songhaï"
|
French:"Songhaï"
|
||||||
Traditional_Chinese:"桑海帝國"
|
|
||||||
Portuguese:"Songhai" //not sure but will do
|
Portuguese:"Songhai" //not sure but will do
|
||||||
Czech:"Songhajská říše"
|
Czech:"Songhajská říše"
|
||||||
// same in German
|
// same in German
|
||||||
Polish:"Songhaj"
|
Polish:"Songhaj"
|
||||||
|
Simplified_Chinese:"桑海"
|
||||||
|
Traditional_Chinese:"桑海"
|
||||||
Korean:"송가이"
|
Korean:"송가이"
|
||||||
}
|
}
|
||||||
|
|
||||||
"Askia":{
|
"Askia":{
|
||||||
Traditional_Chinese:"阿斯基亞"
|
|
||||||
Italian:"Askia"
|
Italian:"Askia"
|
||||||
|
Simplified_Chinese:"阿斯基亚"
|
||||||
|
Traditional_Chinese:"阿斯基亞"
|
||||||
Korean:"아스키아"
|
Korean:"아스키아"
|
||||||
French:"Askia"
|
French:"Askia"
|
||||||
}
|
}
|
||||||
|
|
||||||
"Receive triple Gold from Barbarian encampments and pillaging Cities. Embarked units can defend themselves.":{
|
"Receive triple Gold from Barbarian encampments and pillaging Cities. Embarked units can defend themselves.":{
|
||||||
Traditional_Chinese:"能從蠻族營地與掠奪城市中獲得三倍金錢。單位船運時有自衛能力。"
|
|
||||||
Italian:"Saccheggiare città o conquistare accampamenti barbari frutta una quantità tripla di Oro. Le unità imbarcate possono difendersi da sole."
|
Italian:"Saccheggiare città o conquistare accampamenti barbari frutta una quantità tripla di Oro. Le unità imbarcate possono difendersi da sole."
|
||||||
Portuguese:"Receba 3x mais ouro de campos bárbaros e ao pilhar cidades. Unidades embarcadas podem se defender."
|
Portuguese:"Receba 3x mais ouro de campos bárbaros e ao pilhar cidades. Unidades embarcadas podem se defender."
|
||||||
French:"Reçoit 3 fois plus d'or lors des pillages de campement barbare et de villes. Les unités embarquées peuvent se défendre."
|
French:"Reçoit 3 fois plus d'or lors des pillages de campement barbare et de villes. Les unités embarquées peuvent se défendre."
|
||||||
Czech:"Získává trojnásobek zlata z Barbarských táborů a drancování měst. Jednotky při naloďování se můžou bránit."
|
Czech:"Získává trojnásobek zlata z Barbarských táborů a drancování měst. Jednotky při naloďování se můžou bránit."
|
||||||
German:"Erhalte dreimal soviel Gold von Barbaren-Camps und plündern von Städten. Eingeschiffte Einheiten können sich selbst verteidigen."
|
German:"Erhalte dreimal soviel Gold von Barbaren-Camps und plündern von Städten. Eingeschiffte Einheiten können sich selbst verteidigen."
|
||||||
Polish:"Odtrymaj potrojone Złoto od Barbażyńskich obozowisk i plądrowanych Miast. Zaokrętowane jednostki mogą same się bronić"
|
Polish:"Odtrymaj potrojone Złoto od Barbażyńskich obozowisk i plądrowanych Miast. Zaokrętowane jednostki mogą same się bronić"
|
||||||
|
Simplified_Chinese:"摧毁蛮族营地及劫掠城市时获得三倍金钱,单位船运时拥有攻击能力"
|
||||||
|
Traditional_Chinese:"摧毀蠻族營地及劫掠城市時獲得三倍金錢,單位船運时擁有攻擊能力"
|
||||||
Korean:"야만인 주둔지나 도시 약탈에서 얻는 금이 세 배가 됩니다. 승선한 유닛들이 스스로를 방어할 수 있습니다."
|
Korean:"야만인 주둔지나 도시 약탈에서 얻는 금이 세 배가 됩니다. 승선한 유닛들이 스스로를 방어할 수 있습니다."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@
|
|||||||
French:"[cityName] - Un [greatPerson] est né!",
|
French:"[cityName] - Un [greatPerson] est né!",
|
||||||
Romanian:"[cityName] - S-a născut un [greatPerson]!",
|
Romanian:"[cityName] - S-a născut un [greatPerson]!",
|
||||||
Spanish:"¡[cityName] - Un [greatPerson] ha nacido!",
|
Spanish:"¡[cityName] - Un [greatPerson] ha nacido!",
|
||||||
Simplified_Chinese:"[cityName] - 一个[greatPerson]已经出现!",
|
Simplified_Chinese:"一个[greatPerson]在[cityName]诞生了!",
|
||||||
Traditional_Chinese:"[cityName] - 一個[greatPerson]已經出現!",
|
Traditional_Chinese:"一個[greatPerson]在[cityName]誕生了!",
|
||||||
Portuguese:"[cityName] - Um [greatPerson] nasceu!",
|
Portuguese:"[cityName] - Um [greatPerson] nasceu!",
|
||||||
German:"[cityName] - Ein [greatPerson] wurde geboren!",
|
German:"[cityName] - Ein [greatPerson] wurde geboren!",
|
||||||
Dutch:"[cityName] - Een [greatPerson] is geboren!",
|
Dutch:"[cityName] - Een [greatPerson] is geboren!",
|
||||||
|
@ -1975,19 +1975,9 @@
|
|||||||
|
|
||||||
// for unit action button
|
// for unit action button
|
||||||
|
|
||||||
"Discover Technology":{
|
"Hurry Research":{
|
||||||
Romanian:"Descoperă tehnologie"
|
Simplified_Chinese:"加速科技研究"
|
||||||
Spanish:"Descubrir Tecnologia"
|
Traditional_Chinese:"加速科技研究"
|
||||||
Simplified_Chinese:"发现科技"
|
|
||||||
Traditional_Chinese:"發現科技"
|
|
||||||
Italian:"Scopri tecnologia"
|
|
||||||
German:"Entdecke Technologie"
|
|
||||||
Portuguese:"Descobrir uma tecnologia" //do you mean discover "a" tecnology?
|
|
||||||
Russian:"Откройте для себя технологию"
|
|
||||||
French:"Découvrir une technologie"
|
|
||||||
Czech:"Objevit technologii"
|
|
||||||
Ukrainian:"Відкрийте для себе технологію"
|
|
||||||
Korean:"무료 기술 발견"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// for unit action button
|
// for unit action button
|
||||||
|
@ -1996,7 +1996,9 @@
|
|||||||
Czech:"Atomová bomba"
|
Czech:"Atomová bomba"
|
||||||
German:"Atombombe"
|
German:"Atombombe"
|
||||||
French:"Bombardier Atomique"
|
French:"Bombardier Atomique"
|
||||||
Polish:"Bomba atomowa"
|
Simplified_Chinese:"原子弹"
|
||||||
|
Traditional_Chinese:"原子彈"
|
||||||
|
Polish:"Bomba atomowa"
|
||||||
Ukrainian:"Ядерна бомба"
|
Ukrainian:"Ядерна бомба"
|
||||||
Korean:"원자폭탄"
|
Korean:"원자폭탄"
|
||||||
}
|
}
|
||||||
@ -2145,20 +2147,9 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"Can discover a technology":{
|
"Can gain a large sum of science immediately to hurry technology research":{
|
||||||
Spanish:"Puede descubrir una tecnologia"
|
Simplified_Chinese:"可以立即获得大量科研以加速科技研究",
|
||||||
Italian:"Può scoprire una tecnologia"
|
Traditional_Chinese:"可以立即獲得大量科研以加速科技研究",
|
||||||
French:"Peut découvrir une technologie"
|
|
||||||
Romanian:"Poate descoperi o tehnologie"
|
|
||||||
Simplified_Chinese:"可以发现1项科技",
|
|
||||||
Traditional_Chinese:"可以發現1項科技",
|
|
||||||
Portuguese:"Pode descobrir uma tecnologia"
|
|
||||||
German:"Kann eine Technologie entdecken"
|
|
||||||
Russian:"Может открыть технологию"
|
|
||||||
Czech:"Může vyzkoumat technologii"
|
|
||||||
Polish:"Może odkryć technologię"
|
|
||||||
Ukrainian:"Може відкрити технологію"
|
|
||||||
Korean:"기술 하나를 무료로 발견 가능"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"Can build improvement: Academy":{
|
"Can build improvement: Academy":{
|
||||||
|
@ -1268,7 +1268,7 @@
|
|||||||
name:"Great Scientist",
|
name:"Great Scientist",
|
||||||
unbuildable:true,
|
unbuildable:true,
|
||||||
unitType:"Civilian",
|
unitType:"Civilian",
|
||||||
uniques:["Can discover a technology","Can build improvement: Academy"]
|
uniques:["Can gain a large sum of science immediately to hurry technology research","Can build improvement: Academy"]
|
||||||
movement:2
|
movement:2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,7 @@ import kotlin.collections.ArrayList
|
|||||||
import kotlin.collections.HashSet
|
import kotlin.collections.HashSet
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
import kotlin.math.min
|
||||||
|
|
||||||
class TechManager {
|
class TechManager {
|
||||||
@Transient lateinit var civInfo: CivilizationInfo
|
@Transient lateinit var civInfo: CivilizationInfo
|
||||||
@ -27,6 +28,7 @@ class TechManager {
|
|||||||
@Transient var movementSpeedOnRoadsImproved=false
|
@Transient var movementSpeedOnRoadsImproved=false
|
||||||
|
|
||||||
var freeTechs = 0
|
var freeTechs = 0
|
||||||
|
var recently8turnsScience = IntArray(8){0}
|
||||||
var techsResearched = HashSet<String>()
|
var techsResearched = HashSet<String>()
|
||||||
/* 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>()
|
||||||
@ -40,6 +42,8 @@ class TechManager {
|
|||||||
toReturn.freeTechs=freeTechs
|
toReturn.freeTechs=freeTechs
|
||||||
toReturn.techsInProgress.putAll(techsInProgress)
|
toReturn.techsInProgress.putAll(techsInProgress)
|
||||||
toReturn.techsToResearch.addAll(techsToResearch)
|
toReturn.techsToResearch.addAll(techsToResearch)
|
||||||
|
toReturn.recently8turnsScience=recently8turnsScience.clone()
|
||||||
|
toReturn.overflowScience=overflowScience
|
||||||
return toReturn
|
return toReturn
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +121,43 @@ class TechManager {
|
|||||||
return prerequisites.sortedBy { it.column!!.columnNumber }.map { it.name }
|
return prerequisites.sortedBy { it.column!!.columnNumber }.map { it.name }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun greatscientistgetScience(): Int {
|
||||||
|
// https://civilization.fandom.com/wiki/Great_Scientist_(Civ5)
|
||||||
|
return (recently8turnsScience.sum() * civInfo.gameInfo.gameParameters.gameSpeed.getModifier()).toInt()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun recently8turnsScience() {
|
||||||
|
// Science greatscientist gets does not include Science from Polocies, Trade routes and City States.
|
||||||
|
var allcitiesScience = 0f
|
||||||
|
civInfo.cities.forEach{
|
||||||
|
val m= it.cityStats.baseStatList.values.map { it.science }.sum()
|
||||||
|
val n= it.cityStats.statPercentBonusList.filter { it.key!="Policies" }.values.map { it.science }.sum()
|
||||||
|
allcitiesScience += m*(1+n/100)
|
||||||
|
}
|
||||||
|
recently8turnsScience[civInfo.gameInfo.turns%8] = allcitiesScience.toInt()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun hurryResearch() {
|
||||||
|
val currentTechnology = currentTechnologyName()
|
||||||
|
if (currentTechnology == null) return
|
||||||
|
techsInProgress[currentTechnology] = researchOfTech(currentTechnology) + greatscientistgetScience()
|
||||||
|
if (techsInProgress[currentTechnology]!! < costOfTech(currentTechnology))
|
||||||
|
return
|
||||||
|
|
||||||
|
// We finished it!
|
||||||
|
// http://www.civclub.net/bbs/forum.php?mod=viewthread&tid=123976
|
||||||
|
var overflowscience = techsInProgress[currentTechnology]!! - costOfTech(currentTechnology)
|
||||||
|
overflowScience += overflowScience(overflowscience)
|
||||||
|
addTechnology(currentTechnology)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun overflowScience(overflowscience: Int): Int {
|
||||||
|
// http://www.civclub.net/bbs/forum.php?mod=viewthread&tid=123976
|
||||||
|
return min(overflowscience, max(civInfo.statsForNextTurn.science.toInt() * 5, getRuleset().Technologies[currentTechnologyName()]!!.cost))
|
||||||
|
}
|
||||||
|
|
||||||
fun nextTurn(scienceForNewTurn: Int) {
|
fun nextTurn(scienceForNewTurn: Int) {
|
||||||
|
recently8turnsScience()
|
||||||
val currentTechnology = currentTechnologyName()
|
val currentTechnology = currentTechnologyName()
|
||||||
if (currentTechnology == null) return
|
if (currentTechnology == null) return
|
||||||
techsInProgress[currentTechnology] = researchOfTech(currentTechnology) + scienceForNewTurn
|
techsInProgress[currentTechnology] = researchOfTech(currentTechnology) + scienceForNewTurn
|
||||||
@ -125,15 +165,14 @@ class TechManager {
|
|||||||
val techsResearchedKnownCivs = civInfo.getKnownCivs().count { it.isMajorCiv() && it.tech.isResearched(currentTechnologyName()!!) }
|
val techsResearchedKnownCivs = civInfo.getKnownCivs().count { it.isMajorCiv() && it.tech.isResearched(currentTechnologyName()!!) }
|
||||||
val undefeatedCivs = UncivGame.Current.gameInfo.civilizations.count { it.isMajorCiv() && !it.isDefeated() }
|
val undefeatedCivs = UncivGame.Current.gameInfo.civilizations.count { it.isMajorCiv() && !it.isDefeated() }
|
||||||
techsInProgress[currentTechnology] = techsInProgress[currentTechnology]!! + ((1 + techsResearchedKnownCivs / undefeatedCivs.toFloat() * 0.3f)* overflowScience).toInt()
|
techsInProgress[currentTechnology] = techsInProgress[currentTechnology]!! + ((1 + techsResearchedKnownCivs / undefeatedCivs.toFloat() * 0.3f)* overflowScience).toInt()
|
||||||
|
overflowScience = 0
|
||||||
}
|
}
|
||||||
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
|
val overflowscience = techsInProgress[currentTechnology]!! - costOfTech(currentTechnology)
|
||||||
overflowScience = techsInProgress[currentTechnology]!! - costOfTech(currentTechnology)
|
overflowScience = overflowScience(overflowscience)
|
||||||
if(overflowScience > max(scienceForNewTurn * 5, getRuleset().Technologies[currentTechnology]!!.cost))
|
|
||||||
overflowScience = max(scienceForNewTurn * 5, getRuleset().Technologies[currentTechnology]!!.cost)
|
|
||||||
addTechnology(currentTechnology)
|
addTechnology(currentTechnology)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ import com.unciv.models.ruleset.Building
|
|||||||
import com.unciv.models.ruleset.tr
|
import com.unciv.models.ruleset.tr
|
||||||
import com.unciv.ui.pickerscreens.ImprovementPickerScreen
|
import com.unciv.ui.pickerscreens.ImprovementPickerScreen
|
||||||
import com.unciv.ui.pickerscreens.PromotionPickerScreen
|
import com.unciv.ui.pickerscreens.PromotionPickerScreen
|
||||||
import com.unciv.ui.pickerscreens.TechPickerScreen
|
|
||||||
import com.unciv.ui.worldscreen.WorldScreen
|
import com.unciv.ui.worldscreen.WorldScreen
|
||||||
import com.unciv.ui.worldscreen.optionstable.YesNoPopupTable
|
import com.unciv.ui.worldscreen.optionstable.YesNoPopupTable
|
||||||
import java.util.*
|
import java.util.*
|
||||||
@ -196,11 +195,11 @@ class UnitActions {
|
|||||||
|
|
||||||
|
|
||||||
if (unit.name == "Great Scientist" && !unit.isEmbarked()) {
|
if (unit.name == "Great Scientist" && !unit.isEmbarked()) {
|
||||||
actionList += UnitAction("Discover Technology", unit.currentMovement >0
|
actionList += UnitAction("Hurry Research", unit.civInfo.tech.currentTechnologyName() != null
|
||||||
|
&& unit.currentMovement >0
|
||||||
) {
|
) {
|
||||||
unit.civInfo.tech.freeTechs += 1
|
unit.civInfo.tech.hurryResearch()
|
||||||
unit.destroy()
|
unit.destroy()
|
||||||
worldScreen.game.setScreen(TechPickerScreen(true, unit.civInfo))
|
|
||||||
}.sound("chimes")
|
}.sound("chimes")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table(){
|
|||||||
"Automate" -> return ImageGetter.getUnitIcon("Great Engineer")
|
"Automate" -> return ImageGetter.getUnitIcon("Great Engineer")
|
||||||
"Stop automation" -> return ImageGetter.getImage("OtherIcons/Stop")
|
"Stop automation" -> return ImageGetter.getImage("OtherIcons/Stop")
|
||||||
"Found city" -> return ImageGetter.getUnitIcon(Constants.settler)
|
"Found city" -> return ImageGetter.getUnitIcon(Constants.settler)
|
||||||
"Discover Technology" -> return ImageGetter.getUnitIcon("Great Scientist")
|
"Hurry Research" -> return ImageGetter.getUnitIcon("Great Scientist")
|
||||||
"Construct Academy" -> return ImageGetter.getImprovementIcon("Academy")
|
"Construct Academy" -> return ImageGetter.getImprovementIcon("Academy")
|
||||||
"Start Golden Age" -> return ImageGetter.getUnitIcon("Great Artist")
|
"Start Golden Age" -> return ImageGetter.getUnitIcon("Great Artist")
|
||||||
"Construct Landmark" -> return ImageGetter.getImprovementIcon("Landmark")
|
"Construct Landmark" -> return ImageGetter.getImprovementIcon("Landmark")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user