3.11.16-patch1

Fixed x100 combat modifier for units in rough/open terrain
This commit is contained in:
Yair Morgenstern 2020-12-01 22:07:10 +02:00
parent b30e6e6fdd
commit 07cee7e679
3 changed files with 15 additions and 23 deletions

View File

@ -3,8 +3,8 @@ package com.unciv.build
object BuildConfig { object BuildConfig {
const val kotlinVersion = "1.3.71" const val kotlinVersion = "1.3.71"
const val appName = "Unciv" const val appName = "Unciv"
const val appCodeNumber = 503 const val appCodeNumber = 504
const val appVersion = "3.11.16" const val appVersion = "3.11.16-patch1"
const val gdxVersion = "1.9.12" const val gdxVersion = "1.9.12"
const val roboVMVersion = "2.3.1" const val roboVMVersion = "2.3.1"

View File

@ -6,7 +6,6 @@ import com.unciv.logic.map.TileInfo
import com.unciv.models.Counter import com.unciv.models.Counter
import com.unciv.models.ruleset.unit.UnitType import com.unciv.models.ruleset.unit.UnitType
import java.util.* import java.util.*
import kotlin.collections.HashMap
import kotlin.collections.set import kotlin.collections.set
import kotlin.math.max import kotlin.math.max
import kotlin.math.pow import kotlin.math.pow
@ -262,19 +261,13 @@ object BattleDamage {
for (BDM in getBattleDamageModifiersOfUnit(unit.unit)) { for (BDM in getBattleDamageModifiersOfUnit(unit.unit)) {
val text = BDM.getText() val text = BDM.getText()
// this will change when we change over everything to ints // this will change when we change over everything to ints
if (BDM.vs == "units in open terrain" && !isRoughTerrain) modifiers.add(text, (BDM.modificationAmount*100).toInt()) if (BDM.vs == "units in open terrain" && !isRoughTerrain) modifiers.add(text, (BDM.modificationAmount).toInt())
if (BDM.vs == "units in rough terrain" && isRoughTerrain) modifiers.add(text, (BDM.modificationAmount*100).toInt()) if (BDM.vs == "units in rough terrain" && isRoughTerrain) modifiers.add(text, (BDM.modificationAmount).toInt())
} }
return modifiers return modifiers
} }
fun Counter<String>.toOldModifiers(): HashMap<String, Float> {
val modifiers = HashMap<String,Float>()
for((key,value) in this) modifiers[key] = value.toFloat()/100
return modifiers
}
private fun modifiersToMultiplicationBonus(modifiers: Counter<String>): Float { private fun modifiersToMultiplicationBonus(modifiers: Counter<String>): Float {
var finalModifier = 1f var finalModifier = 1f
for (modifierValue in modifiers.values) finalModifier *= (1 + modifierValue/100f) // so 25 will result in *= 1.25 for (modifierValue in modifiers.values) finalModifier *= (1 + modifierValue/100f) // so 25 will result in *= 1.25

View File

@ -255,12 +255,11 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
} }
} catch (ex: Exception) { } catch (ex: Exception) {
Gdx.app.postRunnable {
val couldntDownloadLatestGame = Popup(this) val couldntDownloadLatestGame = Popup(this)
couldntDownloadLatestGame.addGoodSizedLabel("Couldn't download the latest game state!").row() couldntDownloadLatestGame.addGoodSizedLabel("Couldn't download the latest game state!").row()
couldntDownloadLatestGame.addCloseButton() couldntDownloadLatestGame.addCloseButton()
couldntDownloadLatestGame.addAction(Actions.delay(5f, Actions.run { couldntDownloadLatestGame.close() })) couldntDownloadLatestGame.addAction(Actions.delay(5f, Actions.run { couldntDownloadLatestGame.close() }))
Gdx.app.postRunnable {
loadingGamePopup.close() loadingGamePopup.close()
couldntDownloadLatestGame.open() couldntDownloadLatestGame.open()
} }