From dde01738de03bf18f02e4e6348305d38e2ef1dd0 Mon Sep 17 00:00:00 2001 From: Jack Rainy Date: Wed, 1 Apr 2020 20:12:25 +0300 Subject: [PATCH] New wonders: Mausoleum of Halicarnassus, Statue of Zeus (#2301) * New wonder: Mausoleum of Halicarnassus * New wonder: Statue of Zeus * Obsolete tests are removed --- .../Mausoleum of Halicarnassus.png | Bin 0 -> 1506 bytes .../Images/BuildingIcons/Statue of Zeus.png | Bin 0 -> 3124 bytes android/assets/jsons/Buildings.json | 6 ++-- .../jsons/translations/Ukrainian.properties | 1 + .../jsons/translations/template.properties | 1 + .../com/unciv/logic/battle/BattleDamage.kt | 4 +++ core/src/com/unciv/logic/map/TileInfo.kt | 27 +++++++++------- .../unciv/ui/worldscreen/unit/UnitActions.kt | 17 ++++++++++ docs/Credits.md | 2 ++ .../src/com/unciv/testing/TranslationTests.kt | 30 ------------------ 10 files changed, 43 insertions(+), 45 deletions(-) create mode 100644 android/Images/BuildingIcons/Mausoleum of Halicarnassus.png create mode 100644 android/Images/BuildingIcons/Statue of Zeus.png diff --git a/android/Images/BuildingIcons/Mausoleum of Halicarnassus.png b/android/Images/BuildingIcons/Mausoleum of Halicarnassus.png new file mode 100644 index 0000000000000000000000000000000000000000..9ed0bd5daea684aa19609a69a27eee68ce4d4918 GIT binary patch literal 1506 zcmeAS@N?(olHy`uVBq!ia0vp^DIm;e!oi}gZ{Q2`2FJ8QS`SKMjR;*sV zdd-?OK(~#8(GZ|%2t3?2?-4KyFq8!O1^*w}fFbxhyDBiSISV`@iy0XB4ude`@%$B_ zl0>4!HKHUqKdq!Zu_%?HATcwqL@zJ3M8QPQP|q+~YmPTC5IsCy978gk-(I<%$7Cqb znmF05>b>G#r>al?&YN|f4K&F)_NMB(wC1hPu?os{=Dts@_p*H+m*flUH!n{@?G5EP{$z-<(`ZlgGC0HE_$T7 zJ=r#seNA9b$Nn*;VuwEdo}Qk*zP^EhfuW(Hk&%(Hv9XDXiK(gS z`Sa&5T)1FnW@c_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AXa7;LvA(wchAV`1 z=$|ECW)k{MKsT_|r=tm_dZ#a_{pQL=+L(%xm44y)-JUJNo1_&dWsX%d-?M`Z&AyXgn+5FQ@Qdg)teM&h+M zsfFvP9llEH@~DUI2m3CJ(*h86*FthLM&YSkN!_zXd%tQ6Cj@EH2EAW#BSTWPLYpFD zooEG@;wRCUrHTa{6~96PRu-iT(p%d05_L(_55u>ddOFw|im<*@H60J{HN!lwibj9u zAUR(d=AWLIKfm@w{;o=f7`QOdY-ep?XJo7MeSd_WPK4yxB z&hD~FPYY$492k=PSIFXiw)8f!u*YZ-$_yJLYPCxAc9yL~aXQbGsQ?*g36e`YN62%I z7UUM6{6{rEr$a6fw~M*IZGP$)b6=T5*}paVhj)-p0mi;{dIf(sX&4`oNz00aX?!&g z1qtz7e=PS{D#La+UR&a&N?!NvDep&jV!>lxc{<*dPBGtPTNH_+gn09KCh146ex7L4 zgWN|04;ff)(_=6%QbVyY=V*jM5?VLh{YXbOugScp_wZ>m()9P$MxkCWKV)D5%wWgP z{SVcBU8%Ek9yuj_K`h^EWeb57+t@+zf2y_BJHaAT&$5B6g*&DL_XJxSM+Gw0mqT{` zSSsYi6zO+-a_a(cF{xOjk>}TMZxNxdo?3*z;>~;K!XdPg zW{#5p{VU8%uGS4v)-!d5$oFSD6hcNdG3phH8ia8^gK78NT$_aPXhH*aW&!w|%fQ^W znJ|V`G``!XUbzV0VhS=R#t|Klq^paVnoqgnaOjE@GlM!Iluh2|0h zrde@dS33GkbGd0Ht7QgHF0QLucthAFR#Q0_Y5?WUvF`M{zy< zZ)7d)-5OjRXzm|#^a(Fk-XwN^7=Fs#!1{`yG$pcChG2a&B1pp?j4~`d=*Qe__TA?P zAMt-zfE$=zF2%n$dRV}zaY~8zlm0!sT3*gYrR(|RK0c{jph5!Hn literal 0 HcmV?d00001 diff --git a/android/assets/jsons/Buildings.json b/android/assets/jsons/Buildings.json index 3538dc09..9fcc851d 100644 --- a/android/assets/jsons/Buildings.json +++ b/android/assets/jsons/Buildings.json @@ -144,12 +144,11 @@ "uniques": ["Culture and Gold costs of acquiring new tiles reduced by 25% in this city"], "requiredTech": "Bronze Working" }, - /* { "name": "Statue of Zeus", "culture": 1, "isWonder": true, - "uniques": ["+15% Combat Strenght when attacking Cities."], + "uniques": ["+15% Combat Strength for all units when attacking Cities"], "requiredTech": "Bronze Working" "quote": "'He spoke, the son of Kronos, and nodded his head with the dark brows, and the immortally anointed hair of the great god swept from his divine head, and all Olympos was shaken' - The Iliad" }, @@ -158,11 +157,10 @@ "culture": 1, "greatPersonPoints": {"gold": 1}, "isWonder": true, - "uniques": ["Gain 100 Gold when you use a Great Person.","+2 Gold from every source of Marble and Stone"], + "uniques": ["Provides a sum of gold each time you spend a Great Person", "+2 Gold for each source of Marble and Stone"], "requiredTech": "Masonry" "quote": "'The whole earth is the tomb of heroic men and their story is not given only on stone over their clay but abides everywhere without visible symbol woven into the stuff of other men's lives.' - Pericles" }, - */ // Classical Era diff --git a/android/assets/jsons/translations/Ukrainian.properties b/android/assets/jsons/translations/Ukrainian.properties index 98800c7c..89478529 100644 --- a/android/assets/jsons/translations/Ukrainian.properties +++ b/android/assets/jsons/translations/Ukrainian.properties @@ -481,6 +481,7 @@ Received [goldAmount] Gold for capturing [cityName] = Отримано [goldAmou Our proposed trade request is no longer relevant! = Наша торгівельна пропозиція більше не дійсна! [defender] could not withdraw from a [attacker] - blocked. = [defender] не зміг втекти від [attacker], бо був заблокований. [defender] withdrew from a [attacker] = [defender] втік від [attacker] +[building] has provided [amount] Gold! = [building] приносить [amount] золота! # World Screen UI diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index 853de792..efd9d890 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -481,6 +481,7 @@ Received [goldAmount] Gold for capturing [cityName] = Our proposed trade request is no longer relevant! = [defender] could not withdraw from a [attacker] - blocked. = [defender] withdrew from a [attacker] = +[building] has provided [amount] Gold! = # World Screen UI diff --git a/core/src/com/unciv/logic/battle/BattleDamage.kt b/core/src/com/unciv/logic/battle/BattleDamage.kt index c60d5e0f..d0233fac 100644 --- a/core/src/com/unciv/logic/battle/BattleDamage.kt +++ b/core/src/com/unciv/logic/battle/BattleDamage.kt @@ -142,6 +142,10 @@ class BattleDamage{ if (policies.isAdopted("Autocracy Complete") && (policies.autocracyCompletedTurns > 0)) modifiers["Autocracy Complete"] = 0.2f + + if (defender is CityCombatant && + attacker.getCivInfo().containsBuildingUnique("+15% Combat Strength for all units when attacking Cities")) + modifiers["Statue of Zeus"] = 0.15f } else if (attacker is CityCombatant) { diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 060c7e02..04a6d372 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -189,18 +189,23 @@ open class TileInfo { val resourceBuilding = tileMap.gameInfo.ruleSet.buildings[resource.building!!]!! stats.add(resourceBuilding.resourceBonusStats!!) // resource-specific building (eg forge, stable) bonus } - if(resource.resourceType==ResourceType.Strategic + if (resource.resourceType==ResourceType.Strategic && observingCiv.nation.unique == UniqueAbility.SIBERIAN_RICHES) - stats.production+=1 - if(resource.name=="Oil" && city!=null - && city.containsBuildingUnique("+2 Gold for each source of Oil and oasis")) - stats.gold += 2 - if(city!=null && isWater){ - if(city.containsBuildingUnique("+1 production from all sea resources worked by the city")) - stats.production+=1 - if(city.containsBuildingUnique("+1 production and gold from all sea resources worked by the city")){ - stats.production+=1 - stats.gold+=1 + stats.production += 1 + if (city != null) { + if (resource.name == "Oil" + && city.containsBuildingUnique("+2 Gold for each source of Oil and oasis")) + stats.gold += 2 + if ((resource.name == "Marble" || resource.name == "Stone") + && city.containsBuildingUnique("+2 Gold for each source of Marble and Stone")) + stats.gold += 2 + if (isWater) { + if(city.containsBuildingUnique("+1 production from all sea resources worked by the city")) + stats.production += 1 + if(city.containsBuildingUnique("+1 production and gold from all sea resources worked by the city")){ + stats.production += 1 + stats.gold += 1 + } } } } diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt index 3ef970b7..34a3f354 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActions.kt @@ -5,6 +5,7 @@ import com.unciv.Constants import com.unciv.UncivGame import com.unciv.logic.automation.UnitAutomation import com.unciv.logic.automation.WorkerAutomation +import com.unciv.logic.civilization.CivilizationInfo import com.unciv.logic.map.MapUnit import com.unciv.logic.map.RoadStatus import com.unciv.logic.map.TileInfo @@ -277,6 +278,7 @@ object UnitActions { uncivSound = UncivSound.Chimes, action = { unit.civInfo.tech.hurryResearch() + addGoldPerGreatPersonUsage(unit.civInfo) unit.destroy() }.takeIf { unit.civInfo.tech.currentTechnologyName() != null && unit.currentMovement > 0 }) } @@ -287,6 +289,7 @@ object UnitActions { uncivSound = UncivSound.Chimes, action = { unit.civInfo.goldenAges.enterGoldenAge() + addGoldPerGreatPersonUsage(unit.civInfo) unit.destroy() }.takeIf { unit.currentMovement > 0 }) } @@ -306,6 +309,7 @@ object UnitActions { addProductionPoints(300 + 30 * tile.getCity()!!.population.population) //http://civilization.wikia.com/wiki/Great_engineer_(Civ5) constructIfEnough() } + addGoldPerGreatPersonUsage(unit.civInfo) unit.destroy() }.takeIf { canHurryWonder }) } @@ -327,6 +331,7 @@ object UnitActions { val influenceEarned = Regex("\\d+").find(relevantUnique)!!.value.toInt() tile.owningCity!!.civInfo.getDiplomacyManager(unit.civInfo).influence += influenceEarned unit.civInfo.addNotification("Your trade mission to [${tile.owningCity!!.civInfo}] has earned you [${goldEarned.toInt()}] gold and [$influenceEarned] influence!", null, Color.GOLD) + addGoldPerGreatPersonUsage(unit.civInfo) unit.destroy() }.takeIf { canConductTradeMission }) } @@ -354,12 +359,24 @@ object UnitActions { city.cityStats.update() city.civInfo.updateDetailedCivResources() } + addGoldPerGreatPersonUsage(unit.civInfo) unit.destroy() }.takeIf { unit.currentMovement > 0f && !tile.isWater && !tile.isCityCenter() && !tile.getLastTerrain().impassable }) } return null } + private fun addGoldPerGreatPersonUsage(civInfo: CivilizationInfo) { + val uniqueText = "Provides a sum of gold each time you spend a Great Person" + val cityWithMausoleum = civInfo.cities.firstOrNull { it.containsBuildingUnique(uniqueText) } + ?: return + val goldEarned = (100 * civInfo.gameInfo.gameParameters.gameSpeed.modifier).toInt() + civInfo.gold += goldEarned + + val mausoleum = cityWithMausoleum.cityConstructions.getBuiltBuildings().first { it.uniques.contains(uniqueText) } + civInfo.addNotification("[${mausoleum.name}] has provided [$goldEarned] Gold!", cityWithMausoleum.location, Color.GOLD) + } + private fun addFortifyActions(actionList: ArrayList, unit: MapUnit, unitTable: UnitTable) { val action = UnitAction( diff --git a/docs/Credits.md b/docs/Credits.md index 97ecd13e..b69ab1a3 100644 --- a/docs/Credits.md +++ b/docs/Credits.md @@ -169,6 +169,8 @@ Unless otherwise specified, all the following are from [the Noun Project](https: * [Paper](https://thenounproject.com/term/paper/1443472/) By anam * [Circus](https://thenounproject.com/term/circus/743734/) By Ralph Schmitzer * [Stonehenge](https://thenounproject.com/term/stonehenge/543289/) By icon 54 +* [Ho Chi Minh mausoleum](https://thenounproject.com/thanhloc1009/collection/asia-landmark/?i=2412921) By Phạm Thanh Lộc for Mausoleum of Halicarnassus +* Icon for Statue of Zeus made by [JackRainy](https://github.com/JackRainy), based on [King](https://thenounproject.com/eucalyp/collection/game-elements-glyph1/?i=3155251) By Eucalyp ### Classical Era diff --git a/tests/src/com/unciv/testing/TranslationTests.kt b/tests/src/com/unciv/testing/TranslationTests.kt index 12cd57f1..2da10c3a 100644 --- a/tests/src/com/unciv/testing/TranslationTests.kt +++ b/tests/src/com/unciv/testing/TranslationTests.kt @@ -45,36 +45,6 @@ class TranslationTests { allUnitActionsHaveTranslation) } - @Test - fun allBuildingsHaveTranslation() { - val allBuildingsHaveTranslation = allStringAreTranslated(ruleset.buildings.keys) - Assert.assertTrue("This test will only pass when there is a translation for all buildings", - allBuildingsHaveTranslation) - } - - @Test - fun allBuildingUniquesHaveTranslation() { - val strings: MutableSet = HashSet() - for (building in ruleset.buildings.values) { - strings.addAll(building.uniques) - } - val allStringsHaveTranslation = allStringAreTranslated(strings) - Assert.assertTrue("This test will only pass when there is a translation for all building uniques", - allStringsHaveTranslation) - } - - @Test - fun allBuildingQuotesHaveTranslation() { - val strings: MutableSet = HashSet() - for (building in ruleset.buildings.values) { - if (building.quote == "") continue - strings.add(building.quote) - } - val allStringsHaveTranslation = allStringAreTranslated(strings) - Assert.assertTrue("This test will only pass when there is a translation for all building quotes", - allStringsHaveTranslation) - } - @Test fun allTerrainsHaveTranslation() { val strings: Set = ruleset.terrains.keys