From c1ff2e4ba777ee4a7804f70d2f618b46215add35 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 5 Jul 2021 21:06:54 +0300 Subject: [PATCH] Fixed Denmark's unique including also embarking instead of just disembarking --- android/assets/jsons/Civ V - Vanilla/Nations.json | 2 +- core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt | 5 +++-- core/src/com/unciv/models/ruleset/Nation.kt | 5 ++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/assets/jsons/Civ V - Vanilla/Nations.json b/android/assets/jsons/Civ V - Vanilla/Nations.json index 75b967baa1..60707f0f7a 100644 --- a/android/assets/jsons/Civ V - Vanilla/Nations.json +++ b/android/assets/jsons/Civ V - Vanilla/Nations.json @@ -662,7 +662,7 @@ "outerColor": [51,25,0], "innerColor": [255,255,102], "uniqueName": "Viking Fury", - "uniques": ["+1 Movement for all embarked units", "Units pay only 1 movement point to embark and disembark", + "uniques": ["+1 Movement for all embarked units", "Units pay only 1 movement point to disembark", "Melee units pay no movement cost to pillage"], "cities": ["Copenhagen","Aarhus","Kaupang","Ribe","Viborg","Tunsbers","Roskilde","Hedeby","Oslo","Jelling","Truso", "Bergen","Faeroerne","Reykjavik","Trondheim","Godthab","Helluland","Lillehammer","Markland","Elsinore", diff --git a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt index 3a13f7d0f2..169f53db28 100644 --- a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt +++ b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt @@ -10,8 +10,9 @@ class UnitMovementAlgorithms(val unit:MapUnit) { // This function is called ALL THE TIME and should be as time-optimal as possible! fun getMovementCostBetweenAdjacentTiles(from: TileInfo, to: TileInfo, civInfo: CivilizationInfo): Float { - if (from.isLand != to.isLand && !unit.civInfo.nation.embarkDisembarkCosts1 && unit.type.isLandUnit()) - return 100f // this is embarkment or disembarkment, and will take the entire turn + if (from.isLand != to.isLand && unit.type.isLandUnit()) + if (!unit.civInfo.nation.disembarkCosts1 && from.isWater && to.isLand) return 1f + else return 100f // this is embarkment or disembarkment, and will take the entire turn // land units will still spend all movement points to embark even with this unique if (unit.allTilesCosts1) diff --git a/core/src/com/unciv/models/ruleset/Nation.kt b/core/src/com/unciv/models/ruleset/Nation.kt index 4eaaae3c3b..cdb3bfe7ef 100644 --- a/core/src/com/unciv/models/ruleset/Nation.kt +++ b/core/src/com/unciv/models/ruleset/Nation.kt @@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Color import com.unciv.Constants import com.unciv.logic.civilization.CityStateType import com.unciv.models.stats.INamed -import com.unciv.models.translations.Translations import com.unciv.models.translations.tr import com.unciv.ui.utils.Fonts import com.unciv.ui.utils.colorFromRGB @@ -73,7 +72,7 @@ class Nation : INamed { var ignoreHillMovementCost = false @Transient - var embarkDisembarkCosts1 = false + var disembarkCosts1 = false fun setTransients() { outerColorObject = colorFromRGB(outerColor) @@ -83,7 +82,7 @@ class Nation : INamed { forestsAndJunglesAreRoads = uniques.contains("All units move through Forest and Jungle Tiles in friendly territory as if they have roads. These tiles can be used to establish City Connections upon researching the Wheel.") ignoreHillMovementCost = uniques.contains("Units ignore terrain costs when moving into any tile with Hills") - embarkDisembarkCosts1 = uniques.contains("Units pay only 1 movement point to embark and disembark") + disembarkCosts1 = uniques.contains("Units pay only 1 movement point to disembark") } lateinit var cities: ArrayList