New fantasy hex layering works well with natural wonders

This commit is contained in:
Yair Morgenstern
2021-04-04 19:32:16 +03:00
parent c1844fb58e
commit 8ff2a79e9b
7 changed files with 1222 additions and 1048 deletions

View File

Before

Width:  |  Height:  |  Size: 800 B

After

Width:  |  Height:  |  Size: 800 B

View File

Before

Width:  |  Height:  |  Size: 959 B

After

Width:  |  Height:  |  Size: 959 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 KiB

After

Width:  |  Height:  |  Size: 887 KiB

View File

@ -12,10 +12,9 @@ import com.unciv.models.ruleset.unit.BaseUnit
import com.unciv.models.stats.Stat import com.unciv.models.stats.Stat
import com.unciv.models.stats.StatMap import com.unciv.models.stats.StatMap
import com.unciv.models.stats.Stats import com.unciv.models.stats.Stats
import com.unciv.models.translations.equalsPlaceholderText
import com.unciv.models.translations.getPlaceholderParameters
import java.util.* import java.util.*
import kotlin.collections.HashSet import kotlin.collections.HashSet
import kotlin.math.ceil
import kotlin.math.min import kotlin.math.min
import kotlin.math.roundToInt import kotlin.math.roundToInt
@ -277,9 +276,9 @@ class CityInfo {
for (unique in civInfo.getMatchingUniques("[] is earned []% faster")) { for (unique in civInfo.getMatchingUniques("[] is earned []% faster")) {
val unit = civInfo.gameInfo.ruleSet.units[unique.params[0]] val unit = civInfo.gameInfo.ruleSet.units[unique.params[0]]
if (unit == null) continue if (unit == null) continue
val greatUnitUnique = unit.uniques.firstOrNull { it.equalsPlaceholderText("Great Person - []") } val greatUnitUnique = unit.uniqueObjects.firstOrNull { it.placeholderText == "Great Person - []" }
if (greatUnitUnique == null) continue if (greatUnitUnique == null) continue
val statName = greatUnitUnique.getPlaceholderParameters()[0] val statName = greatUnitUnique.params[0]
val stat = Stat.values().firstOrNull { it.name == statName } val stat = Stat.values().firstOrNull { it.name == statName }
// this is not very efficient, and if it causes problems we can try and think of a way of improving it // this is not very efficient, and if it causes problems we can try and think of a way of improving it
if (stat != null) entry.value.add(stat, entry.value.get(stat) * unique.params[1].toFloat() / 100) if (stat != null) entry.value.add(stat, entry.value.get(stat) * unique.params[1].toFloat() / 100)