Added Optics and Lighthouse

This commit is contained in:
Yair Morgenstern
2018-10-16 21:13:29 +03:00
parent ae33818750
commit dea7775be5
11 changed files with 202 additions and 167 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 897 KiB

After

Width:  |  Height:  |  Size: 901 KiB

View File

@ -103,6 +103,14 @@
// Classical Era
{
name:"Lighthouse",
hurryCostModifier:25,
maintenance:1,
resourceBonusStats:{food:1},
uniques:["+1 food from Ocean and Coast tiles"]
requiredTech:"Optics"
},
{
name:"Stable",
maintenance:1,

View File

@ -48,7 +48,6 @@
name:"Sailing",
row:1,
prerequisites:["Pottery"],
baseDescription:"Does nothing since we have no sea tiles - In theory, Allows access to sea resources by building work boats"
},
{
name:"Calendar",
@ -89,13 +88,11 @@
buildingCost:100,
wonderCost:250,
techs:[
/*{
{
name:"Optics",
cost:95,
row:1,
prerequisites:["Sailing"],
baseDescription:"Does nothing since we have no sea tiles - In theory, Allows construction of lighthouses, providing more food for sea tiles"
},*/
},
{
name:"Horseback Riding",
row:5,

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.game"
minSdkVersion 14
targetSdkVersion 26
versionCode 146
versionName "2.9.0.1"
versionCode 147
versionName "2.9.1"
}
buildTypes {
release {

View File

@ -146,6 +146,10 @@ class MapUnit {
return range
}
fun isEmbarked(): Boolean {
return currentTile.baseTerrain=="Ocean"||currentTile.baseTerrain=="Coast"
}
//endregion
//region state-changing functions

View File

@ -111,6 +111,10 @@ open class TileInfo {
fun getTileStats(city: CityInfo?, observingCiv: CivilizationInfo): Stats {
var stats = getBaseTerrain().clone()
if((baseTerrain=="Ocean"||baseTerrain=="Coast") && city!=null
&& city.getBuildingUniques().contains("+1 food from Ocean and Coast tiles"))
stats.food += 1
if (terrainFeature != null) {
val terrainFeatureBase = getTerrainFeature()
if (terrainFeatureBase!!.overrideStats)
@ -118,6 +122,9 @@ open class TileInfo {
else
stats.add(terrainFeatureBase)
if (terrainFeature == "Jungle" && city != null
&& city.getBuildingUniques().contains("Jungles provide +2 science"))
stats.science += 2f
if(terrainFeature=="Oasis" && city!=null
&& city.getBuildingUniques().contains("+2 Gold for each source of Oil and oasis"))
stats.gold += 2
@ -156,14 +163,11 @@ open class TileInfo {
if (stats.production < 1) stats.production = 1f
}
if (stats.production < 0) stats.production = 0f
if ("Jungle" == terrainFeature && city != null
&& city.getBuildingUniques().contains("Jungles provide +2 science"))
stats.science += 2f
if (stats.gold != 0f && observingCiv.goldenAges.isGoldenAge())
stats.gold++
if (stats.production < 0) stats.production = 0f
return stats
}

View File

@ -15,6 +15,7 @@ enum class UnitType{
return this == Melee
|| this == Mounted
|| this == Scout
|| this==WaterMelee
}
fun isRanged(): Boolean {
return this == Ranged