mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-04 14:44:10 +07:00
Bump kotlin language version to latest 1.6.21 (#6744)
Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
This commit is contained in:
parent
816e542e1c
commit
457b20d2de
@ -1,7 +1,7 @@
|
||||
package com.unciv.build
|
||||
|
||||
object BuildConfig {
|
||||
const val kotlinVersion = "1.5.30"
|
||||
const val kotlinVersion = "1.6.21"
|
||||
const val appName = "Unciv"
|
||||
const val appCodeNumber = 709
|
||||
const val appVersion = "4.0.16"
|
||||
|
@ -653,16 +653,19 @@ class QuestManager {
|
||||
when (personality) {
|
||||
CityStatePersonality.Friendly -> weight *= 2f
|
||||
CityStatePersonality.Hostile -> weight *= .2f
|
||||
else -> {}
|
||||
}
|
||||
when (trait) {
|
||||
CityStateType.Maritime -> weight *= 1.2f
|
||||
CityStateType.Mercantile -> weight *= 1.5f
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
QuestName.ConnectResource.value -> {
|
||||
when (trait) {
|
||||
CityStateType.Maritime -> weight *= 2f
|
||||
CityStateType.Mercantile -> weight *= 3f
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
QuestName.ConstructWonder.value -> {
|
||||
@ -679,12 +682,14 @@ class QuestManager {
|
||||
when (personality) {
|
||||
CityStatePersonality.Hostile -> weight *= 2f
|
||||
CityStatePersonality.Neutral -> weight *= .4f
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
QuestName.FindPlayer.value -> {
|
||||
when (trait) {
|
||||
CityStateType.Maritime -> weight *= 3f
|
||||
CityStateType.Mercantile -> weight *= 2f
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
QuestName.FindNaturalWonder.value -> {
|
||||
@ -717,6 +722,7 @@ class QuestManager {
|
||||
CityStatePersonality.Hostile -> weight *= 2f
|
||||
CityStatePersonality.Irrational -> weight *= 1.5f
|
||||
CityStatePersonality.Friendly -> weight *= .3f
|
||||
CityStatePersonality.Neutral -> {}
|
||||
}
|
||||
}
|
||||
QuestName.DenounceCiv.value -> {
|
||||
|
@ -826,12 +826,12 @@ class DiplomacyManager() {
|
||||
for (thirdCiv in getCommonKnownCivs()
|
||||
.filter { it.getDiplomacyManager(civInfo).hasFlag(DiplomacyFlags.DeclarationOfFriendship) }) {
|
||||
val otherCivRelationshipWithThirdCiv = otherCiv().getDiplomacyManager(thirdCiv).relationshipLevel()
|
||||
@Suppress("NON_EXHAUSTIVE_WHEN") // Better readability
|
||||
when (otherCivRelationshipWithThirdCiv) {
|
||||
RelationshipLevel.Unforgivable -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurEnemies, -15f)
|
||||
RelationshipLevel.Enemy -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurEnemies, -5f)
|
||||
RelationshipLevel.Friend -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurAllies, 5f)
|
||||
RelationshipLevel.Ally -> addModifier(DiplomaticModifiers.DeclaredFriendshipWithOurAllies, 15f)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -849,12 +849,12 @@ class DiplomacyManager() {
|
||||
thirdCiv.addNotification("[${civInfo.civName}] has denounced [$otherCivName]!", civInfo.civName, NotificationIcon.Diplomacy, otherCivName)
|
||||
val thirdCivRelationshipWithOtherCiv = thirdCiv.getDiplomacyManager(otherCiv()).relationshipLevel()
|
||||
val thirdCivDiplomacyManager = thirdCiv.getDiplomacyManager(civInfo)
|
||||
@Suppress("NON_EXHAUSTIVE_WHEN") // Better readability
|
||||
when (thirdCivRelationshipWithOtherCiv) {
|
||||
RelationshipLevel.Unforgivable -> thirdCivDiplomacyManager.addModifier(DiplomaticModifiers.DenouncedOurEnemies, 15f)
|
||||
RelationshipLevel.Enemy -> thirdCivDiplomacyManager.addModifier(DiplomaticModifiers.DenouncedOurEnemies, 5f)
|
||||
RelationshipLevel.Friend -> thirdCivDiplomacyManager.addModifier(DiplomaticModifiers.DenouncedOurAllies, -5f)
|
||||
RelationshipLevel.Ally -> thirdCivDiplomacyManager.addModifier(DiplomaticModifiers.DenouncedOurAllies, -15f)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -600,6 +600,8 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
||||
if (!civInfo.gameInfo.gameParameters.victoryTypes.contains(unique.params[0]))
|
||||
rejectionReasons.add(RejectionReason.HiddenWithoutVictory.toInstance(unique.text))
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,6 +237,7 @@ class Milestone(val uniqueDescription: String, private val parentVictory: Victor
|
||||
buttons.add(getMilestoneButton(milestoneText, milestoneMet))
|
||||
}
|
||||
}
|
||||
null -> {}
|
||||
}
|
||||
return buttons
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ object UniqueTriggerActivation {
|
||||
else Random(-550) // Very random indeed
|
||||
val ruleSet = civInfo.gameInfo.ruleSet
|
||||
|
||||
@Suppress("NON_EXHAUSTIVE_WHEN") // Yes we're not treating all types here
|
||||
when (unique.type) {
|
||||
OneTimeFreeUnit -> {
|
||||
val unitName = unique.params[0]
|
||||
@ -465,6 +464,8 @@ object UniqueTriggerActivation {
|
||||
|
||||
FreeStatBuildings, FreeSpecificBuildings ->
|
||||
civInfo.civConstructions.tryAddFreeBuildings()
|
||||
|
||||
else -> {}
|
||||
}
|
||||
return false
|
||||
}
|
||||
@ -475,7 +476,6 @@ object UniqueTriggerActivation {
|
||||
unit: MapUnit,
|
||||
notification: String? = null
|
||||
): Boolean {
|
||||
@Suppress("NON_EXHAUSTIVE_WHEN") // Yes we're not treating all types here
|
||||
when (unique.type) {
|
||||
OneTimeUnitHeal -> {
|
||||
unit.healBy(unique.params[0].toInt())
|
||||
@ -515,7 +515,7 @@ object UniqueTriggerActivation {
|
||||
unit.civInfo.addNotification(notification, unit.getTile().position, unit.name)
|
||||
return true
|
||||
}
|
||||
else -> return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
@ -365,7 +365,6 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
||||
}
|
||||
val civInfo = cityConstructions.cityInfo.civInfo
|
||||
for (unique in uniqueObjects) {
|
||||
@Suppress("NON_EXHAUSTIVE_WHEN")
|
||||
when (unique.type) {
|
||||
UniqueType.OnlyAvailableWhen -> if (!unique.conditionalsApply(civInfo, cityConstructions.cityInfo))
|
||||
rejectionReasons.add(RejectionReason.ShouldNotBeDisplayed)
|
||||
@ -379,6 +378,8 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
||||
|
||||
UniqueType.RequiresPopulation -> if (unique.params[0].toInt() > cityConstructions.cityInfo.population.population)
|
||||
rejectionReasons.add(RejectionReason.PopulationRequirement.toInstance(unique.text))
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -407,7 +408,6 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
||||
rejectionReasons.add(RejectionReason.DisabledBySetting)
|
||||
|
||||
for (unique in uniqueObjects) {
|
||||
@Suppress("NON_EXHAUSTIVE_WHEN") // Yes we want to implement only a few here
|
||||
when (unique.type) {
|
||||
UniqueType.Unbuildable ->
|
||||
rejectionReasons.add(RejectionReason.Unbuildable)
|
||||
@ -436,6 +436,8 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
||||
|
||||
UniqueType.MaxNumberBuildable -> if (civInfo.civConstructions.countConstructedObjects(this) >= unique.params[0].toInt())
|
||||
rejectionReasons.add(RejectionReason.MaxNumberBuildable)
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,12 +227,12 @@ class MapEditorEditTab(
|
||||
tile.getTilesInDistance(brushSize - 1)
|
||||
}
|
||||
tiles.forEach {
|
||||
@Suppress("NON_EXHAUSTIVE_WHEN") // other cases can't reach here
|
||||
when (brushHandlerType) {
|
||||
BrushHandlerType.Direct -> directPaintTile(it)
|
||||
BrushHandlerType.Tile -> paintTile(it)
|
||||
BrushHandlerType.Road -> roadPaintTile(it)
|
||||
BrushHandlerType.River -> riverPaintTile(it)
|
||||
else -> {} // other cases can't reach here
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user