diff --git a/core/src/com/unciv/logic/civilization/QuestManager.kt b/core/src/com/unciv/logic/civilization/QuestManager.kt index 0e59945d04..c1e7a2e468 100644 --- a/core/src/com/unciv/logic/civilization/QuestManager.kt +++ b/core/src/com/unciv/logic/civilization/QuestManager.kt @@ -341,7 +341,7 @@ class QuestManager { /** Increments [assignedQuest.assignee][AssignedQuest.assignee] influence on [civInfo] and adds a [Notification] */ private fun giveReward(assignedQuest: AssignedQuest) { - val rewardInfluence = civInfo.gameInfo.ruleSet.quests[assignedQuest.questName]!!.influece + val rewardInfluence = civInfo.gameInfo.ruleSet.quests[assignedQuest.questName]!!.influence val assignee = civInfo.gameInfo.getCivilization(assignedQuest.assignee) civInfo.getDiplomacyManager(assignedQuest.assignee).addInfluence(rewardInfluence) diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index 3a05547dc2..43e2cd46ca 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -910,7 +910,7 @@ class MapUnit { } } // Otherwise fall back to the defined standard damage - return tile.getAllTerrains().sumBy { it.damagePerTurn } + return tile.getAllTerrains().sumOf { it.damagePerTurn } } private fun doCitadelDamage() { diff --git a/core/src/com/unciv/models/ruleset/Quest.kt b/core/src/com/unciv/models/ruleset/Quest.kt index 0cae53893b..be97dfa02a 100644 --- a/core/src/com/unciv/models/ruleset/Quest.kt +++ b/core/src/com/unciv/models/ruleset/Quest.kt @@ -25,20 +25,20 @@ class Quest : INamed { /** Unique identifier name of the quest, it is also shown */ override var name: String = "" - /** Descrption of the quest shown to players */ + /** Description of the quest shown to players */ var description: String = "" /** [QuestType]: it is either Individual or Global */ var type: QuestType = QuestType.Individual /** Influence reward gained on quest completion */ - var influece: Float = 40f + var influence: Float = 40f /** Maximum number of turns to complete the quest, 0 if there's no turn limit */ var duration: Int = 0 - /**Minimum number of [CivInfo] needed to start the quest. It is meaningful only for [QuestType.Global] - * quests [type]. */ + /** Minimum number of [CivInfo] needed to start the quest. It is meaningful only for [QuestType.Global] + * quests [type]. */ var minimumCivs: Int = 1 /** Checks if [this] is a Global quest */ diff --git a/core/src/com/unciv/models/ruleset/tile/Terrain.kt b/core/src/com/unciv/models/ruleset/tile/Terrain.kt index a6bb8d737b..a0b325cd71 100644 --- a/core/src/com/unciv/models/ruleset/tile/Terrain.kt +++ b/core/src/com/unciv/models/ruleset/tile/Terrain.kt @@ -147,7 +147,7 @@ class Terrain : NamedStats(), ICivilopediaText, IHasUniques { } fun setTransients() { - damagePerTurn = uniqueObjects.sumBy { + damagePerTurn = uniqueObjects.sumOf { if (it.placeholderText == "Units ending their turn on this terrain take [] damage") it.params[0].toInt() else 0 } } diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index c0dfb0c1f7..3d66cfaac5 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -195,12 +195,12 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() { var friendBonusText = "{When Friends:} ".tr() val friendBonusObjects = eraInfo.getCityStateBonuses(otherCiv.cityStateType, RelationshipLevel.Friend) val friendBonusStrings = getAdjustedBonuses(friendBonusObjects) - friendBonusText += friendBonusStrings.joinToString(separator = ", ") { it.tr() } ?: "" + friendBonusText += friendBonusStrings.joinToString(separator = ", ") { it.tr() } var allyBonusText = "{When Allies:} ".tr() val allyBonusObjects = eraInfo.getCityStateBonuses(otherCiv.cityStateType, RelationshipLevel.Ally) val allyBonusStrings = getAdjustedBonuses(allyBonusObjects) - allyBonusText += allyBonusStrings.joinToString(separator = ", ") { it.tr() } ?: "" + allyBonusText += allyBonusStrings.joinToString(separator = ", ") { it.tr() } val relationLevel = otherCivDiplomacyManager.relationshipLevel() if (relationLevel >= RelationshipLevel.Friend) { @@ -263,6 +263,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() { improved = true } } + else -> Unit // To silence "exhaustive when" warning } } // No matching unique, add it unmodified @@ -540,7 +541,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() { val quest: Quest = viewingCiv.gameInfo.ruleSet.quests[assignedQuest.questName]!! val remainingTurns: Int = assignedQuest.getRemainingTurns() - val title = "[${quest.name}] (+[${quest.influece.toInt()}] influence)" + val title = "[${quest.name}] (+[${quest.influence.toInt()}] influence)" val description = assignedQuest.getDescription() questTable.add(title.toLabel(fontSize = 24)).row() diff --git a/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt b/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt index 91f835fe19..ee6edb2900 100644 --- a/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt +++ b/core/src/com/unciv/ui/worldscreen/mainmenu/OptionsPopup.kt @@ -3,7 +3,6 @@ package com.unciv.ui.worldscreen.mainmenu import com.badlogic.gdx.Application import com.badlogic.gdx.Gdx import com.badlogic.gdx.Input -import com.badlogic.gdx.files.FileHandle import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Actor import com.badlogic.gdx.scenes.scene2d.ui.* @@ -19,9 +18,7 @@ import com.unciv.models.ruleset.Ruleset.CheckModLinksStatus import com.unciv.models.ruleset.RulesetCache import com.unciv.models.tilesets.TileSetCache import com.unciv.models.translations.TranslationFileWriter -import com.unciv.models.translations.Translations import com.unciv.models.translations.tr -import com.unciv.ui.audio.MusicController import com.unciv.ui.audio.MusicTrackChooserFlags import com.unciv.ui.civilopedia.FormattedLine import com.unciv.ui.civilopedia.MarkupRenderer @@ -33,7 +30,6 @@ import com.unciv.ui.worldscreen.WorldScreen import java.util.* import kotlin.concurrent.thread import kotlin.math.floor -import kotlin.math.roundToInt import com.badlogic.gdx.utils.Array as GdxArray /**