From f360eda0476f84b10d28d27b66e529721a875e42 Mon Sep 17 00:00:00 2001 From: itanasi <44038014+itanasi@users.noreply.github.com> Date: Mon, 28 Feb 2022 09:41:13 -0800 Subject: [PATCH] Align (reduce) Embarked Defense Strength per Era (#6231) * Change Embarked Defending Strength per era. Update Tutorial a little * Use JSON implementation of EmbarkDefense Co-authored-by: itanasi --- android/assets/jsons/Civ V - Gods & Kings/Eras.json | 9 +++++++++ android/assets/jsons/Civ V - Vanilla/Eras.json | 9 +++++++++ android/assets/jsons/Tutorials.json | 3 ++- core/src/com/unciv/logic/battle/MapUnitCombatant.kt | 3 ++- core/src/com/unciv/models/ruleset/Era.kt | 1 + 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/android/assets/jsons/Civ V - Gods & Kings/Eras.json b/android/assets/jsons/Civ V - Gods & Kings/Eras.json index ec911a107f..42afb67cf8 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Eras.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Eras.json @@ -11,6 +11,7 @@ "startingMilitaryUnit": "Warrior", "settlerPopulation": 1, "baseUnitBuyCost": 200, + "embarkDefense": 3, "startPercent": 0, "friendBonus": { "Cultured": ["Provides [+3 Culture] per turn"], @@ -39,6 +40,7 @@ "startingCulture": 100, "settlerPopulation": 1, "baseUnitBuyCost": 200, + "embarkDefense": 4, "startPercent": 10, "friendBonus": { "Cultured": ["Provides [+3 Culture] per turn"], @@ -69,6 +71,7 @@ "settlerBuildings": ["Shrine","Monument"], "startingObsoleteWonders": ["Temple of Artemis", "Stonehenge", "The Great Library", "Mausoleum of Halicarnassus", "The Pyramids", "Statue of Zeus"], "baseUnitBuyCost": 200, + "embarkDefense": 6, "startPercent": 25, "friendBonus": { "Cultured": ["Provides [+6 Culture] per turn"], @@ -100,6 +103,7 @@ "startingObsoleteWonders": ["Temple of Artemis", "Stonehenge", "The Great Library", "Mausoleum of Halicarnassus", "The Pyramids", "Statue of Zeus", "The Great Lighthouse", "Hanging Gardens", "Terracotta Army", "The Oracle", "Petra", "Great Wall", "Colossus"], "baseUnitBuyCost": 300, + "embarkDefense": 8, "startPercent": 37, "friendBonus": { "Cultured": ["Provides [+6 Culture] per turn"], @@ -132,6 +136,7 @@ "The Great Lighthouse", "Hanging Gardens", "Terracotta Army", "The Oracle", "Petra", "Great Wall", "Colossus", "Hagia Sophia", "Chichen Itza", "Machu Picchu", "Angkor Wat", "Alhambra", "Notre Dame"], "baseUnitBuyCost": 400, + "embarkDefense": 10, "startPercent": 50, "friendBonus": { "Cultured": ["Provides [+13 Culture] per turn"], @@ -169,6 +174,7 @@ "Hagia Sophia", "Chichen Itza", "Machu Picchu", "Angkor Wat", "Alhambra", "Notre Dame", "Sistine Chapel", "Forbidden Palace", "Leaning Tower of Pisa", "Himeji Castle", "Taj Mahal", "Porcelain Tower", "Kremlin"], "baseUnitBuyCost": 600, + "embarkDefense": 13, "startPercent": 65, "friendBonus": { "Cultured": ["Provides [+13 Culture] per turn"], @@ -207,6 +213,7 @@ "Sistine Chapel", "Forbidden Palace", "Leaning Tower of Pisa", "Himeji Castle", "Taj Mahal", "Porcelain Tower", "Kremlin", "The Louvre", "Big Ben", "Brandenburg Gate"], "baseUnitBuyCost": 800, + "embarkDefense": 16, "startPercent": 65, "friendBonus": { "Cultured": ["Provides [+13 Culture] per turn"], @@ -246,6 +253,7 @@ "The Louvre", "Big Ben", "Brandenburg Gate", "Eiffel Tower", "Statue of Liberty", "Neuschwanstein", "Cristo Redentor"], "baseUnitBuyCost": 1000, + "embarkDefense": 20, "startPercent": 80, // So theoretically this is always just all the wonders at least 2 eras old. So we could just use that. // But where is the modularity? The excluding of very specific wonders? That is no fun. @@ -291,6 +299,7 @@ "The Louvre", "Big Ben", "Brandenburg Gate", "Eiffel Tower", "Statue of Liberty", "Neuschwanstein", "Cristo Redentor"], "baseUnitBuyCost": 1000, + "embarkDefense": 25, "startPercent": 80, "friendBonus": { "Cultured": ["Provides [+13 Culture] per turn"], diff --git a/android/assets/jsons/Civ V - Vanilla/Eras.json b/android/assets/jsons/Civ V - Vanilla/Eras.json index cb9edf1010..42dc6efd2b 100644 --- a/android/assets/jsons/Civ V - Vanilla/Eras.json +++ b/android/assets/jsons/Civ V - Vanilla/Eras.json @@ -11,6 +11,7 @@ "startingMilitaryUnit": "Warrior", "settlerPopulation": 1, "baseUnitBuyCost": 200, + "embarkDefense": 3, "startPercent": 0, "friendBonus": { "Cultured": ["Provides [+3 Culture] per turn"], @@ -39,6 +40,7 @@ "startingCulture": 100, "settlerPopulation": 1, "baseUnitBuyCost": 200, + "embarkDefense": 4, "startPercent": 10, "friendBonus": { "Cultured": ["Provides [+3 Culture] per turn"], @@ -69,6 +71,7 @@ "settlerBuildings": ["Monument"], "startingObsoleteWonders": ["Temple of Artemis", "Stonehenge", "The Great Library", "Mausoleum of Halicarnassus", "The Pyramids", "Statue of Zeus"], "baseUnitBuyCost": 200, + "embarkDefense": 6, "startPercent": 25, "friendBonus": { "Cultured": ["Provides [+6 Culture] per turn"], @@ -100,6 +103,7 @@ "startingObsoleteWonders": ["Temple of Artemis", "Stonehenge", "The Great Library", "Mausoleum of Halicarnassus", "The Pyramids", "Statue of Zeus", "The Great Lighthouse", "Hanging Gardens", "The Oracle", "Great Wall", "Colossus"], "baseUnitBuyCost": 300, + "embarkDefense": 8, "startPercent": 37, "friendBonus": { "Cultured": ["Provides [+6 Culture] per turn"], @@ -132,6 +136,7 @@ "The Great Lighthouse", "Hanging Gardens", "The Oracle", "Great Wall", "Colossus", "Hagia Sophia", "Chichen Itza", "Machu Picchu", "Angkor Wat", "Notre Dame"], "baseUnitBuyCost": 400, + "embarkDefense": 10, "startPercent": 50, "friendBonus": { "Cultured": ["Provides [+13 Culture] per turn"], @@ -165,6 +170,7 @@ "Hagia Sophia", "Chichen Itza", "Machu Picchu", "Angkor Wat", "Notre Dame", "Sistine Chapel", "Forbidden Palace", "Himeji Castle", "Taj Mahal", "Porcelain Tower", "Kremlin"], "baseUnitBuyCost": 600, + "embarkDefense": 13, "startPercent": 65, "friendBonus": { "Cultured": ["Provides [+13 Culture] per turn"], @@ -199,6 +205,7 @@ "Sistine Chapel", "Forbidden Palace", "Himeji Castle", "Taj Mahal", "Porcelain Tower", "Kremlin", "The Louvre", "Big Ben", "Brandenburg Gate"], "baseUnitBuyCost": 800, + "embarkDefense": 16, "startPercent": 65, "friendBonus": { "Cultured": ["Provides [+13 Culture] per turn"], @@ -234,6 +241,7 @@ "The Louvre", "Big Ben", "Brandenburg Gate", "Eiffel Tower", "Statue of Liberty", "Cristo Redentor"], "baseUnitBuyCost": 1000, + "embarkDefense": 20, "startPercent": 80, // So theoretically this is always just all the wonders at least 2 eras old. So we could just use that. // But where is the modularity? The excluding of very specific wonders? That is no fun. @@ -275,6 +283,7 @@ "The Louvre", "Big Ben", "Brandenburg Gate", "Eiffel Tower", "Statue of Liberty", "Cristo Redentor"], "baseUnitBuyCost": 1000, + "embarkDefense": 25, "startPercent": 80, "friendBonus": { "Cultured": ["Provides [+13 Culture] per turn"], diff --git a/android/assets/jsons/Tutorials.json b/android/assets/jsons/Tutorials.json index 2e94268602..45ea953cdc 100644 --- a/android/assets/jsons/Tutorials.json +++ b/android/assets/jsons/Tutorials.json @@ -85,7 +85,8 @@ "Siege units are extremely powerful against cities, but need to be Set Up before they can attack.\nOnce your siege unit is set up, it can attack from the current tile,\n but once moved to another tile, it will need to be set up again." ], Embarking: [ - "Once a certain tech is researched, your land units can embark, allowing them to traverse water tiles.\nEntering or leaving water takes the entire turn.\nUnits are defenseless while embarked (cannot use modifiers) and have a fixed Defending Strength based on your tech Era, so be careful!\nRanged Units can't attack, Melee Units have a Strength penalty, and all have limited vision." + "Once a certain tech is researched, your land units can embark, allowing them to traverse water tiles.\nEntering or leaving water takes the entire turn.", + "Units are defenseless while embarked (cannot use modifiers), and have a fixed Defending Strength based on your tech Era, so be careful!\nRanged Units can't attack, Melee Units have a Strength penalty, and all have limited vision." ], Idle_Units: [ "If you don't want to move a unit this turn, you can skip it by clicking 'Next unit' again.\nIf you won't be moving it for a while, you can have the unit enter Fortify or Sleep mode - \n units in Fortify or Sleep are not considered idle units.\nIf you want to disable the 'Next unit' feature entirely, you can toggle it in Menu -> Check for idle units." diff --git a/core/src/com/unciv/logic/battle/MapUnitCombatant.kt b/core/src/com/unciv/logic/battle/MapUnitCombatant.kt index 6a97aedf4d..fbb6c4f6a3 100644 --- a/core/src/com/unciv/logic/battle/MapUnitCombatant.kt +++ b/core/src/com/unciv/logic/battle/MapUnitCombatant.kt @@ -35,7 +35,8 @@ class MapUnitCombatant(val unit: MapUnit) : ICombatant { } override fun getDefendingStrength(): Int { - return if (unit.isEmbarked() && !isCivilian()) 5 * getCivInfo().getEraNumber() + return if (unit.isEmbarked() && !isCivilian()) + unit.civInfo.getEra().embarkDefense else unit.baseUnit().strength } diff --git a/core/src/com/unciv/models/ruleset/Era.kt b/core/src/com/unciv/models/ruleset/Era.kt index 2f295e4d5a..4df2286776 100644 --- a/core/src/com/unciv/models/ruleset/Era.kt +++ b/core/src/com/unciv/models/ruleset/Era.kt @@ -23,6 +23,7 @@ class Era : RulesetObject(), IHasUniques { var settlerBuildings = ArrayList() var startingObsoleteWonders = ArrayList() var baseUnitBuyCost = 200 + var embarkDefense = 3 var startPercent = 0 var friendBonus = HashMap>()