From 3f20e9b82ecb9af06b684f96d5199758a1a70e27 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 21 Dec 2017 20:32:33 +0200 Subject: [PATCH] Added worker automation Solved multiple small bugs --- .../TerrainIcons/Desert_(Civ5).png.meta | 74 --------------- .../TerrainIcons/Flood_plains_(Civ5).png.meta | 74 --------------- .../TerrainIcons/Forest_(Civ5).png.meta | 74 --------------- .../TerrainIcons/Grassland_(Civ5).png.meta | 74 --------------- .../assets/TerrainIcons/Hill_(Civ5).png.meta | 74 --------------- .../TerrainIcons/Jungle_(Civ5).png.meta | 74 --------------- .../assets/TerrainIcons/Lakes_(Civ5).png.meta | 74 --------------- .../assets/TerrainIcons/Marsh_(Civ5).png.meta | 74 --------------- .../TerrainIcons/Mountain_(Civ5).png.meta | 74 --------------- .../assets/TerrainIcons/Oasis_(Civ5).png.meta | 74 --------------- .../TerrainIcons/Plains_(Civ5).png.meta | 74 --------------- android/assets/TerrainIcons/road.png | Bin 145 -> 0 bytes core/src/com/unciv/civinfo/MapUnit.java | 84 +++++++++++++++++- core/src/com/unciv/civinfo/TileInfo.java | 46 ++++------ core/src/com/unciv/civinfo/TileMap.java | 2 +- core/src/com/unciv/game/CityScreen.java | 30 +++++++ core/src/com/unciv/game/WorldScreen.java | 29 +++--- .../ImprovementPickerScreen.java | 14 +-- .../game/pickerscreens/TechPickerScreen.java | 2 +- .../models/gamebasics/TileImprovement.java | 8 +- 20 files changed, 159 insertions(+), 870 deletions(-) delete mode 100644 android/assets/TerrainIcons/Desert_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/Flood_plains_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/Forest_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/Grassland_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/Hill_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/Jungle_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/Lakes_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/Marsh_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/Mountain_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/Oasis_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/Plains_(Civ5).png.meta delete mode 100644 android/assets/TerrainIcons/road.png diff --git a/android/assets/TerrainIcons/Desert_(Civ5).png.meta b/android/assets/TerrainIcons/Desert_(Civ5).png.meta deleted file mode 100644 index ec9e8eac..00000000 --- a/android/assets/TerrainIcons/Desert_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: 6a3167ea11aabe149b48ccf74d32522d -timeCreated: 1504549534 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/Flood_plains_(Civ5).png.meta b/android/assets/TerrainIcons/Flood_plains_(Civ5).png.meta deleted file mode 100644 index 70aecb12..00000000 --- a/android/assets/TerrainIcons/Flood_plains_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: 321bb463467bd11479afff2e8f1e8808 -timeCreated: 1504555636 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/Forest_(Civ5).png.meta b/android/assets/TerrainIcons/Forest_(Civ5).png.meta deleted file mode 100644 index 36b7eab3..00000000 --- a/android/assets/TerrainIcons/Forest_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: 62dca01c03840c54f80ccef8f8b2842e -timeCreated: 1504549534 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/Grassland_(Civ5).png.meta b/android/assets/TerrainIcons/Grassland_(Civ5).png.meta deleted file mode 100644 index 1100fe40..00000000 --- a/android/assets/TerrainIcons/Grassland_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: c956af91abda1954db1d833fa9126aec -timeCreated: 1504549534 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/Hill_(Civ5).png.meta b/android/assets/TerrainIcons/Hill_(Civ5).png.meta deleted file mode 100644 index b0c224a5..00000000 --- a/android/assets/TerrainIcons/Hill_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: cb19f36509e59214994bd6042a2af70f -timeCreated: 1504549534 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/Jungle_(Civ5).png.meta b/android/assets/TerrainIcons/Jungle_(Civ5).png.meta deleted file mode 100644 index 0e61267a..00000000 --- a/android/assets/TerrainIcons/Jungle_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: a5af63bfa8d4a824cb7de3cff9de012c -timeCreated: 1504549534 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/Lakes_(Civ5).png.meta b/android/assets/TerrainIcons/Lakes_(Civ5).png.meta deleted file mode 100644 index a360d6f3..00000000 --- a/android/assets/TerrainIcons/Lakes_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: 61f4b1c3f3eff644587595005c3ac16c -timeCreated: 1504549534 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/Marsh_(Civ5).png.meta b/android/assets/TerrainIcons/Marsh_(Civ5).png.meta deleted file mode 100644 index 111ebb0e..00000000 --- a/android/assets/TerrainIcons/Marsh_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: bae63480532174c4fa7b6645e23912f4 -timeCreated: 1504555636 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/Mountain_(Civ5).png.meta b/android/assets/TerrainIcons/Mountain_(Civ5).png.meta deleted file mode 100644 index e49368d6..00000000 --- a/android/assets/TerrainIcons/Mountain_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: 47d0fd593edb3cc40a5b295d521d5f9b -timeCreated: 1504549534 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/Oasis_(Civ5).png.meta b/android/assets/TerrainIcons/Oasis_(Civ5).png.meta deleted file mode 100644 index dc3d11aa..00000000 --- a/android/assets/TerrainIcons/Oasis_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: 18ee547cb3112564494e8da9c87efb9f -timeCreated: 1504555636 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/Plains_(Civ5).png.meta b/android/assets/TerrainIcons/Plains_(Civ5).png.meta deleted file mode 100644 index f031d4b5..00000000 --- a/android/assets/TerrainIcons/Plains_(Civ5).png.meta +++ /dev/null @@ -1,74 +0,0 @@ -fileFormatVersion: 2 -guid: c8fd49106bc29284ba9e26df5f5e6e0e -timeCreated: 1504549534 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/android/assets/TerrainIcons/road.png b/android/assets/TerrainIcons/road.png deleted file mode 100644 index caed4bfb99fb7c2a2adba832ecee22c5a7158a74..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^wm{6y!2~3om4*0#6k~CayA#8@b22Z19F}xPUq=Rp zjs4tz5?O(K&H|6fVg?2=RS;(M3{v?36jbwcaSZYBPQDQ-YA14W#qO8gZg+j-O tilesWithCity = CivilizationInfo.current().tileMap.getTilesInDistance(tile.position, i).where(new Predicate() { + @Override + public boolean evaluate(TileInfo arg0) { + return arg0.isCityCenter(); + } + }); + if(tilesWithCity.isEmpty()) continue; + notification+=" near "+tilesWithCity.get(0).workingCity; + break; + } + } + CivilizationInfo.current().notifications.add(notification+"!"); + tile.improvementInProgress = null; + } + } + + private void doAutomatedAction(TileInfo tile){ + if(tile.owner!=null && tile.improvement==null // We'll be working this tile + && (tile.workingCity!=null || tile.resource!=null || tile.improvementInProgress!=null) + && tile.canBuildImprovement(GameBasics.TileImprovements.get(chooseImprovement(tile)))) + { + if(tile.improvementInProgress==null) tile.startWorkingOnImprovement(chooseImprovement(tile)); // and stay put. + return; + } + + // We'll search for a tile that needs our help in the reachable area + LinqHashMap distanceToTiles = + CivilizationInfo.current().tileMap.getUnitDistanceToTiles(tile.position,currentMovement); + TileInfo tileWithinDistance = new LinqCollection(distanceToTiles.keySet()).first(new Predicate() { + @Override + public boolean evaluate(TileInfo tile) { + return tile.owner!=null && tile.improvement==null && tile.unit==null + && (tile.workingCity!=null || tile.resource!=null || tile.improvementInProgress!=null) + && tile.canBuildImprovement(GameBasics.TileImprovements.get(chooseImprovement(tile))); + } + }); + if(tileWithinDistance!=null){ + tile.moveUnitToTile(tileWithinDistance,distanceToTiles.get(tileWithinDistance)); // go there + doAction(tileWithinDistance); // And do the same from there + } + // If not, then we don't know what to do. Oh well. + } + + + private String chooseImprovement(final TileInfo tile){ + if(tile.improvementInProgress!=null) return tile.improvementInProgress; + if("Forest".equals(tile.terrainFeature)) return "Lumber mill"; + if("Jungle".equals(tile.terrainFeature)) return "Trading post"; + if("Marsh".equals(tile.terrainFeature)) return "Remove Marsh"; + + if(tile.resource!=null) return tile.getTileResource().improvement; + if(tile.baseTerrain.equals("Hill")) return "Mine"; + if(tile.baseTerrain.equals("Grassland") || tile.baseTerrain.equals("Desert") || tile.baseTerrain.equals("Plains")) + return "Farm"; + if(tile.baseTerrain.equals("Tundra")) return "Trading post"; + return null; + } +} \ No newline at end of file diff --git a/core/src/com/unciv/civinfo/TileInfo.java b/core/src/com/unciv/civinfo/TileInfo.java index 27fd0013..67d9ab00 100644 --- a/core/src/com/unciv/civinfo/TileInfo.java +++ b/core/src/com/unciv/civinfo/TileInfo.java @@ -100,7 +100,7 @@ public class TileInfo public boolean canBuildImprovement(TileImprovement improvement) { - if(improvement.name.equals(this.improvement)) return false; + if(isCityCenter() || improvement.name.equals(this.improvement)) return false; Terrain topTerrain = terrainFeature ==null ? getBaseTerrain() : getTerrainFeature(); if (improvement.techRequired != null && !isResearched(improvement.techRequired)) return false; if (improvement.terrainsCanBeBuiltOn.contains(topTerrain.name)) return true; @@ -111,10 +111,10 @@ public class TileInfo return hasViewableResource() && getTileResource().improvement.equals(improvement.name); } - public void startWorkingOnImprovement(String improvementName,int turnsToBuild) + public void startWorkingOnImprovement(String improvementName) { improvementInProgress = improvementName; - turnsToImprovement = turnsToBuild; + turnsToImprovement = GameBasics.TileImprovements.get(improvementName).getTurnsToBuild(); } public void stopWorkingOnImprovement() @@ -124,35 +124,13 @@ public class TileInfo public void nextTurn() { - if(unit !=null) unit.currentMovement = unit.maxMovement; + if(unit !=null) { + unit.currentMovement = unit.maxMovement; - if (improvementInProgress == null || unit ==null || !unit.name.equals("Worker")) return; - turnsToImprovement -= 1; - if(turnsToImprovement == 0) - { - if (improvementInProgress.startsWith("Remove")) terrainFeature = null; - else if(improvementInProgress.equals("Road")) roadStatus = RoadStatus.Road; - else if(improvementInProgress.equals("Railroad")) roadStatus = RoadStatus.Railroad; - else improvement = improvementInProgress; + if (!unit.name.equals("Worker")) + return; - String notification = improvementInProgress+" has been completed"; - if(workingCity!=null) notification+=" for "+getCity().name; - else { - for (int i = 1; i < 3; i++) { - LinqCollection tilesWithCity = CivilizationInfo.current().tileMap.getTilesInDistance(position, i).where(new Predicate() { - @Override - public boolean evaluate(TileInfo arg0) { - return arg0.isCityCenter(); - } - }); - if(tilesWithCity.isEmpty()) continue; - notification+=" near "+tilesWithCity.get(0).workingCity; - break; - } - } - notification+="!"; - CivilizationInfo.current().notifications.add(notification); - improvementInProgress = null; + unit.doAction(this); } } @@ -179,4 +157,12 @@ public class TileInfo if (unit.name.equals("Worker") && improvementInProgress != null) return false; return true; } + + public void moveUnitToTile(TileInfo otherTile, float movementDistance){ + if(otherTile.unit!=null) return; // Fail. + unit.currentMovement -= movementDistance; + if(unit.currentMovement < 0.1) unit.currentMovement =0; // silly floats which are "almost zero" + otherTile.unit = unit; + unit = null; + } } \ No newline at end of file diff --git a/core/src/com/unciv/civinfo/TileMap.java b/core/src/com/unciv/civinfo/TileMap.java index a87a0af8..c2605573 100644 --- a/core/src/com/unciv/civinfo/TileMap.java +++ b/core/src/com/unciv/civinfo/TileMap.java @@ -84,7 +84,7 @@ public class TileMap{ return tiles; } - public LinqHashMap getDistanceToTiles(Vector2 origin, float maximumMovement){ + public LinqHashMap getUnitDistanceToTiles(Vector2 origin, float maximumMovement){ LinqHashMap distanceToTiles = new LinqHashMap(); distanceToTiles.put(get(origin), 0f); LinqCollection tilesToCheck = new LinqCollection(); diff --git a/core/src/com/unciv/game/CityScreen.java b/core/src/com/unciv/game/CityScreen.java index ef8c5fa6..bca57973 100644 --- a/core/src/com/unciv/game/CityScreen.java +++ b/core/src/com/unciv/game/CityScreen.java @@ -14,15 +14,19 @@ import com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.scenes.scene2d.utils.Drawable; import com.badlogic.gdx.utils.Align; +import com.badlogic.gdx.utils.Predicate; import com.unciv.civinfo.CityInfo; import com.unciv.civinfo.CivilizationInfo; import com.unciv.civinfo.IConstruction; import com.unciv.civinfo.TileInfo; import com.unciv.game.pickerscreens.ConstructionPickerScreen; +import com.unciv.game.pickerscreens.ImprovementPickerScreen; import com.unciv.game.utils.CameraStageBaseScreen; import com.unciv.game.utils.HexMath; import com.unciv.game.utils.ImageGetter; import com.unciv.models.gamebasics.Building; +import com.unciv.models.gamebasics.GameBasics; +import com.unciv.models.gamebasics.TileImprovement; import com.unciv.models.stats.FullStats; import java.util.ArrayList; @@ -370,6 +374,32 @@ public class CityScreen extends CameraStageBaseScreen { TileTable.row(); } + +// TextButton actionButton = new TextButton("Request improvement", skin); +// actionButton.getLabel().setFontScale(buttonScale); +// actionButton.addListener(action); +// if (selectedTile.unit.currentMovement == 0 || !canAct) { +// actionButton.setColor(Color.GRAY); +// actionButton.setTouchable(Touchable.disabled); +// } +// +// tileTable.row(); +// tileTable.add(actionButton).colspan(2) +// .size(actionButton.getWidth() * buttonScale, actionButton.getHeight() * buttonScale); +// +// addUnitAction(tileTable,improvementButtonText, !selectedTile.isCityCenter() || +// GameBasics.TileImprovements.linqValues().any(new Predicate() { +// @Override +// public boolean evaluate(TileImprovement arg0) { +// return selectedTile.canBuildImprovement(arg0); +// } +// }) +// ,new ClickListener() { +// +// @Override +// public void clicked(InputEvent event, float x, float y) {game.setScreen(new ImprovementPickerScreen(game, selectedTile));} +// } ); + TileTable.pack(); TileTable.setPosition(stage.getWidth()-10- TileTable.getWidth(), 10); diff --git a/core/src/com/unciv/game/WorldScreen.java b/core/src/com/unciv/game/WorldScreen.java index a5283916..bc4cc922 100644 --- a/core/src/com/unciv/game/WorldScreen.java +++ b/core/src/com/unciv/game/WorldScreen.java @@ -305,13 +305,9 @@ public class WorldScreen extends CameraStageBaseScreen { public void clicked(InputEvent event, float x, float y) { selectedTile = tileInfo; if(unitTile != null && group.tileInfo.unit == null ) { - LinqHashMap distanceToTiles = game.civInfo.tileMap.getDistanceToTiles(unitTile.position,unitTile.unit.currentMovement); + LinqHashMap distanceToTiles = game.civInfo.tileMap.getUnitDistanceToTiles(unitTile.position,unitTile.unit.currentMovement); if(distanceToTiles.containsKey(selectedTile)) { - unitTile.unit.currentMovement -= distanceToTiles.get(selectedTile); - //unitTile.unit.currentMovement = round(unitTile.unit.currentMovement,3); - if(unitTile.unit.currentMovement < 0.1) unitTile.unit.currentMovement =0; // silly floats which are "almost zero" - group.tileInfo.unit = unitTile.unit; - unitTile.unit = null; + unitTile.moveUnitToTile(group.tileInfo,distanceToTiles.get(selectedTile)); unitTile = null; selectedTile = group.tileInfo; } @@ -420,7 +416,7 @@ public class WorldScreen extends CameraStageBaseScreen { // Set all tiles transparent except those in unit range for(TileGroup TG : tileGroups.linqValues()) TG.setColor(0,0,0,0.3f); - for(TileInfo tile : game.civInfo.tileMap.getDistanceToTiles(unitTile.position,unitTile.unit.currentMovement).keySet()){ + for(TileInfo tile : game.civInfo.tileMap.getUnitDistanceToTiles(unitTile.position,unitTile.unit.currentMovement).keySet()){ tileGroups.get(tile.position.toString()).setColor(Color.WHITE); } @@ -465,6 +461,16 @@ public class WorldScreen extends CameraStageBaseScreen { @Override public void clicked(InputEvent event, float x, float y) {game.setScreen(new ImprovementPickerScreen(game, selectedTile));} } ); + addUnitAction(tileTable, "automation".equals(selectedTile.unit.action)? "Stop automation" : "Automate", true, + new ClickListener(){ + @Override + public void clicked(InputEvent event, float x, float y) { + if ("automation".equals(selectedTile.unit.action)) + selectedTile.unit.action = null; + else selectedTile.unit.action = "automation"; + update(); + } + }); } if(selectedTile.unit.name.equals("Great Scientist")){ @@ -510,14 +516,14 @@ public class WorldScreen extends CameraStageBaseScreen { } if(selectedTile.unit.name.equals("Great Engineer")){ - final CityConstructions cityConstructions = selectedTile.getCity().cityConstructions; addUnitAction(tileTable, "Hurry Wonder",selectedTile.isCityCenter() && - cityConstructions.getCurrentConstruction() instanceof Building && - ((Building)cityConstructions.getCurrentConstruction()).isWonder, + selectedTile.getCity().cityConstructions.getCurrentConstruction() instanceof Building && + + ((Building)selectedTile.getCity().cityConstructions.getCurrentConstruction()).isWonder, new ClickListener(){ @Override public void clicked(InputEvent event, float x, float y) { - cityConstructions.addConstruction(300 + (30 * selectedTile.getCity().population)); //http://civilization.wikia.com/wiki/Great_engineer_(Civ5) + selectedTile.getCity().cityConstructions.addConstruction(300 + (30 * selectedTile.getCity().population)); //http://civilization.wikia.com/wiki/Great_engineer_(Civ5) selectedTile.unit=null; // destroy! update(); } @@ -533,7 +539,6 @@ public class WorldScreen extends CameraStageBaseScreen { }); } if(selectedTile.unit.name.equals("Great Merchant")){ - final CityConstructions cityConstructions = selectedTile.getCity().cityConstructions; addUnitAction(tileTable, "Conduct Trade Mission",true, new ClickListener(){ @Override diff --git a/core/src/com/unciv/game/pickerscreens/ImprovementPickerScreen.java b/core/src/com/unciv/game/pickerscreens/ImprovementPickerScreen.java index d1a8937b..e589d360 100644 --- a/core/src/com/unciv/game/pickerscreens/ImprovementPickerScreen.java +++ b/core/src/com/unciv/game/pickerscreens/ImprovementPickerScreen.java @@ -6,25 +6,22 @@ import com.badlogic.gdx.scenes.scene2d.Touchable; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; -import com.unciv.civinfo.CivilizationInfo; import com.unciv.civinfo.TileInfo; import com.unciv.game.UnCivGame; import com.unciv.models.gamebasics.GameBasics; import com.unciv.models.gamebasics.TileImprovement; public class ImprovementPickerScreen extends PickerScreen { - String SelectedImprovement; - int TurnsToImprovement; + private String SelectedImprovement; public ImprovementPickerScreen(final UnCivGame game, final TileInfo tileInfo) { super(game); - rightSideButton.setText("Pick improvement"); rightSideButton.addListener(new ClickListener(){ @Override public void clicked(InputEvent event, float x, float y) { - tileInfo.startWorkingOnImprovement(SelectedImprovement, TurnsToImprovement); + tileInfo.startWorkingOnImprovement(SelectedImprovement); game.setWorldScreen(); dispose(); } @@ -37,15 +34,12 @@ public class ImprovementPickerScreen extends PickerScreen { regularImprovements.space(10); for(final TileImprovement improvement : GameBasics.TileImprovements.values()) { if(!tileInfo.canBuildImprovement(improvement) || improvement.name.equals(tileInfo.improvement)) continue; - int turnsToBuild = improvement.turnsToBuild; - if(CivilizationInfo.current().getBuildingUniques().contains("WorkerConstruction")) turnsToBuild= (int) Math.round(0.75*turnsToBuild); - TextButton TB = new TextButton(improvement.name +"\r\n"+turnsToBuild +" turns", skin); - final int finalTurnsToBuild = turnsToBuild; + TextButton TB = new TextButton(improvement.name +"\r\n"+improvement.getTurnsToBuild()+" turns", skin); + TB.addListener(new ClickListener(){ @Override public void clicked(InputEvent event, float x, float y) { SelectedImprovement = improvement.name; - TurnsToImprovement = finalTurnsToBuild; rightSideButton.setTouchable(Touchable.enabled); rightSideButton.setText(improvement.name); rightSideButton.setColor(Color.WHITE); diff --git a/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java b/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java index 4b8581ac..260cf554 100644 --- a/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java +++ b/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java @@ -132,7 +132,7 @@ public class TechPickerScreen extends PickerScreen { CheckPrerequisites.add(tech.name); while (!CheckPrerequisites.isEmpty()) { String techNameToCheck = CheckPrerequisites.pop(); - if (civTech.isResearched(techNameToCheck)) + if (civTech.isResearched(techNameToCheck) || Prerequisites.contains(techNameToCheck)) continue; //no need to add or check prerequisites Technology techToCheck = GameBasics.Technologies.get(techNameToCheck); for (String str : techToCheck.prerequisites) diff --git a/core/src/com/unciv/models/gamebasics/TileImprovement.java b/core/src/com/unciv/models/gamebasics/TileImprovement.java index fdec98e0..b180207b 100644 --- a/core/src/com/unciv/models/gamebasics/TileImprovement.java +++ b/core/src/com/unciv/models/gamebasics/TileImprovement.java @@ -1,5 +1,6 @@ package com.unciv.models.gamebasics; +import com.unciv.civinfo.CivilizationInfo; import com.unciv.models.stats.FullStats; import com.unciv.models.stats.NamedStats; @@ -14,7 +15,12 @@ public class TileImprovement extends NamedStats implements ICivilopedia { public String improvingTech; public FullStats improvingTechStats; - public int turnsToBuild; + private int turnsToBuild; // This is the base cost. + public int getTurnsToBuild(){ + int realTurnsToBuild = turnsToBuild; + if(CivilizationInfo.current().getBuildingUniques().contains("WorkerConstruction")) realTurnsToBuild = (int) Math.round(0.75*turnsToBuild); + return realTurnsToBuild; + } @Override public String getDescription() {