From f9f46391ea10efc9647978509df8188c350fc76b Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 18 Oct 2018 22:57:45 +0300 Subject: [PATCH] Fixed lighthouse & trireme problems --- Credits.md | 6 ++++-- android/assets/jsons/Buildings.json | 2 +- android/assets/jsons/Techs.json | 1 + core/src/com/unciv/models/gamebasics/Building.kt | 3 +++ core/src/com/unciv/models/gamebasics/unit/UnitType.kt | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Credits.md b/Credits.md index dba04deec5..cfc0f72d4c 100644 --- a/Credits.md +++ b/Credits.md @@ -17,7 +17,7 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc * [Bow And Arrow](https://thenounproject.com/search/?q=Bow%20and%20Arrow&i=338261) By Viktor Ostrovsky for Archer * [Bow](https://thenounproject.com/search/?q=bow&i=101736) By Arthur Shlain for Bowman * [Fishing Vessel](https://thenounproject.com/term/fishing-vessel/23815/) By Luis Prado for Work Boats -* [Greek Trireme](https://thenounproject.com/search/?q=ancient%20boat&i=1626303) By Zachary McCune for Trireme +* [Greek Trireme](https://thenounproject.com/search/?q=ancient%20boat&i=1626303) By Zachary McCune for Triremehos * [Chariot](https://thenounproject.com/search/?q=Chariot&i=1189930) By Andrew Doane for Chariot Archer * [Spear](https://thenounproject.com/search/?q=Spear&i=11432) By Stephen Copinger for Spearman @@ -118,6 +118,7 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc ### Classical Era +* [Lighthouse](https://thenounproject.com/search/?q=lighthouse&i=866966) By Dolly Holmes * [Temple](https://thenounproject.com/term/temple/1808407/) By 1516 * [Anubis](https://thenounproject.com/term/anubis/1080090/) By Carpe Diem for Burial Tomb * [Parthenon](https://thenounproject.com/term/parthenon/493272/) By Christopher T. Howlett for The Oracle @@ -284,7 +285,8 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc * [Mallet](https://thenounproject.com/term/mallet/1306669/) By Ben Avery for Bronze Working ### Classical -* [Horse Riding](https://thenounproject.com/term/horse-riding/583093/) By Hea Poh Lin +* [Telescope](https://thenounproject.com/term/telescope/1932888/) for Optics +* [Horse Riding](https://thenounproject.com/term/horse-riding/583093/) By Hea Poh Lin for Horseback Riding * [Abacus](https://thenounproject.com/term/abacus/1943303/) By Yo! Baba for Mathematics * [Arch](https://thenounproject.com/term/arch/1174168/) By Andrejs Kirma for Construction * [Brain](https://thenounproject.com/term/brain/64073/) By Tony Gines for Philosophy diff --git a/android/assets/jsons/Buildings.json b/android/assets/jsons/Buildings.json index ccb9915c41..6837651da3 100644 --- a/android/assets/jsons/Buildings.json +++ b/android/assets/jsons/Buildings.json @@ -108,7 +108,7 @@ hurryCostModifier:25, maintenance:1, resourceBonusStats:{food:1}, - uniques:["+1 food from Ocean and Coast tiles"] + uniques:["Can only be built in coastal cities","+1 food from Ocean and Coast tiles"] requiredTech:"Optics" }, { diff --git a/android/assets/jsons/Techs.json b/android/assets/jsons/Techs.json index af6a76fb18..df92b6d986 100644 --- a/android/assets/jsons/Techs.json +++ b/android/assets/jsons/Techs.json @@ -90,6 +90,7 @@ techs:[ { name:"Optics", + cost:85, row:1, prerequisites:["Sailing"], }, diff --git a/core/src/com/unciv/models/gamebasics/Building.kt b/core/src/com/unciv/models/gamebasics/Building.kt index 9a6791bbcd..b8f355c693 100644 --- a/core/src/com/unciv/models/gamebasics/Building.kt +++ b/core/src/com/unciv/models/gamebasics/Building.kt @@ -177,6 +177,9 @@ class Building : NamedStats(), IConstruction{ if ("Must be next to desert" in uniques && !construction.cityInfo.getCenterTile().getTilesInDistance(1).any { it.baseTerrain == "Desert" }) return false + if("Can only be built in coastal cities" in uniques + && construction.cityInfo.getCenterTile().neighbors.none { it.baseTerrain=="Coast" }) + return false if (requiredResource != null && !civInfo.getCivResources().containsKey(GameBasics.TileResources[requiredResource!!])) return false diff --git a/core/src/com/unciv/models/gamebasics/unit/UnitType.kt b/core/src/com/unciv/models/gamebasics/unit/UnitType.kt index fde49b14ce..1a5c1adfd3 100644 --- a/core/src/com/unciv/models/gamebasics/unit/UnitType.kt +++ b/core/src/com/unciv/models/gamebasics/unit/UnitType.kt @@ -37,6 +37,6 @@ enum class UnitType{ } fun isWaterUnit(): Boolean { - return this == WaterCivilian + return !isLandUnit() // if we ever get air units, this'll have to change } } \ No newline at end of file