Minor code reorg. Adjust tech trade value with game speed.

This commit is contained in:
Duan Tao
2019-09-25 23:27:55 +08:00
committed by Yair Morgenstern
parent 4ca32a0523
commit fc5c7235c5
4 changed files with 12 additions and 15 deletions

View File

@ -271,10 +271,8 @@ class CityInfo {
getCenterTile().improvement="City ruins"
}
fun annexCity(conqueringCiv: CivilizationInfo) {
puppetCity(conqueringCiv)
if(!conqueringCiv.policies.isAdopted("Police State")) {
fun annexCity() {
if(!civInfo.policies.isAdopted("Police State")) {
expansion.cultureStored = 0
expansion.reset()
}
@ -327,7 +325,8 @@ class CityInfo {
/* Liberating is returning a city to its founder - makes you LOSE warmongering points **/
fun liberateCity(conqueringCiv: CivilizationInfo) {
if (foundingCiv == "") { // this should never happen but just in case...
annexCity(conqueringCiv)
puppetCity(conqueringCiv)
annexCity()
return
}

View File

@ -117,7 +117,9 @@ class TradeEvaluation{
return 50 * amountToBuyInOffer
}
TradeType.Technology -> return sqrt(GameBasics.Technologies[offer.name]!!.cost.toDouble()).toInt()*20
TradeType.Technology ->
return (sqrt(GameBasics.Technologies[offer.name]!!.cost.toDouble())
* civInfo.gameInfo.gameParameters.gameSpeed.getModifier()).toInt()*20
TradeType.Introduction -> return 250
TradeType.WarDeclaration -> {
val nameOfCivToDeclareWarOn = offer.name.removePrefix("Declare war on ")

View File

@ -168,13 +168,7 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
val annexCityButton = TextButton("Annex city".tr(), skin)
annexCityButton.labelCell.pad(10f)
annexCityButton.onClick {
if(!city.civInfo.policies.isAdopted("Police State")) {
city.expansion.cultureStored = 0
city.expansion.reset()
}
city.isPuppet=false
city.isBeingRazed=false
city.annexCity()
update()
}
razeCityButtonHolder.add(annexCityButton).colspan(cityPickerTable.columns)

View File

@ -72,7 +72,8 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu
}).row()
}
add(TextButton("Annex".tr(), skin).onClick {
city.annexCity(conqueringCiv)
city.puppetCity(conqueringCiv)
city.annexCity()
worldScreen.shouldUpdate=true
close()
}).row()
@ -82,7 +83,8 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu
close()
}).row()
add(TextButton("Raze".tr(), skin).onClick {
city.annexCity(conqueringCiv)
city.puppetCity(conqueringCiv)
city.annexCity()
city.isBeingRazed = true
worldScreen.shouldUpdate=true
close()