mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 17:28:57 +07:00
Buying techs now enables their uniques immediately - kudos ingvart!
This commit is contained in:
@ -31,7 +31,8 @@ class GameStarter{
|
|||||||
for (nationName in GameBasics.Nations.keys.filterNot { it=="Barbarians" || it==newGameParameters.nation }.shuffled()
|
for (nationName in GameBasics.Nations.keys.filterNot { it=="Barbarians" || it==newGameParameters.nation }.shuffled()
|
||||||
.take(newGameParameters.numberOfEnemies)) {
|
.take(newGameParameters.numberOfEnemies)) {
|
||||||
val civ = CivilizationInfo(nationName)
|
val civ = CivilizationInfo(nationName)
|
||||||
civ.tech.techsResearched.addAll(gameInfo.getDifficulty().aiFreeTechs)
|
for (tech in gameInfo.getDifficulty().aiFreeTechs)
|
||||||
|
civ.tech.addTechnology(tech)
|
||||||
gameInfo.civilizations.add(civ)
|
gameInfo.civilizations.add(civ)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ class TechManager {
|
|||||||
addTechnology(techName)
|
addTechnology(techName)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addTechnology(techName:String) {
|
fun addTechnology(techName:String) {
|
||||||
if(techName!="Future Tech")
|
if(techName!="Future Tech")
|
||||||
techsToResearch.remove(techName)
|
techsToResearch.remove(techName)
|
||||||
|
|
||||||
|
@ -182,10 +182,7 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
|
|||||||
from.gold -= offer.amount
|
from.gold -= offer.amount
|
||||||
}
|
}
|
||||||
if (offer.type == TradeType.Technology) {
|
if (offer.type == TradeType.Technology) {
|
||||||
to.tech.techsResearched.add(offer.name)
|
to.tech.addTechnology(offer.name)
|
||||||
if (to.tech.techsToResearch.contains(offer.name)) {
|
|
||||||
to.tech.techsToResearch.remove(offer.name)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(offer.type== TradeType.City){
|
if(offer.type== TradeType.City){
|
||||||
val city = from.cities.first { it.name==offer.name }
|
val city = from.cities.first { it.name==offer.name }
|
||||||
|
Reference in New Issue
Block a user