Added Fish, Pearls and Whale resources, Work Boats unit, Sailing tech and Fishing Boats impovement
BIN
android/Images/ImprovementIcons/Fishing Boats.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.7 KiB |
BIN
android/Images/TechIcons/Sailing.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
android/Images/UnitIcons/Work Boats.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 892 KiB After Width: | Height: | Size: 897 KiB |
|
@ -44,12 +44,12 @@
|
|||
buildingCost:75,
|
||||
wonderCost:185,
|
||||
techs:[
|
||||
/*{
|
||||
{
|
||||
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",
|
||||
row:2,
|
||||
|
|
|
@ -71,6 +71,13 @@
|
|||
improvingTech:"Chemistry",
|
||||
improvingTechStats:{production:1}
|
||||
},
|
||||
{
|
||||
name:"Fishing Boats",
|
||||
food:1,
|
||||
techRequired:"Sailing",
|
||||
improvingTech:"Compass",
|
||||
improvingTechStats:{gold:1}
|
||||
},
|
||||
|
||||
// Transportation
|
||||
{
|
||||
|
|
|
@ -63,6 +63,15 @@
|
|||
uniqueTo:"Babylon",
|
||||
upgradesTo:"Crossbowman"
|
||||
},
|
||||
{
|
||||
name:"Work Boats",
|
||||
unitType:"WaterCivilian",
|
||||
baseDescription: "May create improvements on water resources",
|
||||
movement:4,
|
||||
cost: 30,
|
||||
requiredTech:"Sailing",
|
||||
hurryCostModifier:20
|
||||
},
|
||||
{
|
||||
name:"Chariot Archer",
|
||||
unitType:"Ranged",
|
||||
|
|
|
@ -17,7 +17,7 @@ class UnCivGame : Game() {
|
|||
* This exists so that when debugging we can see the entire map.
|
||||
* Remember to turn this to false before commit and upload!
|
||||
*/
|
||||
val viewEntireMapForDebug = false
|
||||
val viewEntireMapForDebug = true
|
||||
|
||||
lateinit var worldScreen: WorldScreen
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class HexMath {
|
|||
|
||||
fun GetVectorsInDistance(origin: Vector2, distance: Int): List<Vector2> {
|
||||
val hexesToReturn = mutableListOf<Vector2>()
|
||||
for (i in 0 until distance + 1) {
|
||||
for (i in 0 .. distance) {
|
||||
hexesToReturn.addAll(GetVectorsAtDistance(origin, i))
|
||||
}
|
||||
return hexesToReturn
|
||||
|
|
|
@ -307,7 +307,9 @@ class UnitAutomation{
|
|||
val top5Tiles = tileInfo.neighbors.union(bestTilesFromOuterLayer)
|
||||
.sortedByDescending { nearbyTileRankings[it] }
|
||||
.take(5)
|
||||
return top5Tiles.map { nearbyTileRankings[it]!! }.sum()
|
||||
var rank = top5Tiles.map { nearbyTileRankings[it]!! }.sum()
|
||||
if(tileInfo.neighbors.any{it.baseTerrain == "Coast"}) rank += 5
|
||||
return rank
|
||||
}
|
||||
|
||||
private fun automateSettlerActions(unit: MapUnit) {
|
||||
|
|
|
@ -105,6 +105,8 @@ class MapUnit {
|
|||
val tileOwner = tile.getOwner()
|
||||
if(tile.getBaseTerrain().type==TerrainType.Water && baseUnit.unitType.isLandUnit())
|
||||
return false
|
||||
if(tile.getBaseTerrain().type==TerrainType.Land && baseUnit.unitType.isWaterUnit())
|
||||
return false
|
||||
if(tileOwner!=null && tileOwner.civName!=owner
|
||||
&& (tile.isCityCenter() || !civInfo.canEnterTiles(tileOwner))) return false
|
||||
|
||||
|
|
|
@ -89,20 +89,18 @@ class BaseUnit : INamed, IConstruction, ICivilopedia {
|
|||
return (cost / 10).toInt() * 10 // rounded down o nearest ten
|
||||
}
|
||||
|
||||
fun isBuildable(civInfo:CivilizationInfo): Boolean {
|
||||
override fun isBuildable(construction: CityConstructions): Boolean {
|
||||
val civInfo = construction.cityInfo.civInfo
|
||||
if (unbuildable) return false
|
||||
if (requiredTech!=null && !civInfo.tech.isResearched(requiredTech!!)) return false
|
||||
if (obsoleteTech!=null && civInfo.tech.isResearched(obsoleteTech!!)) return false
|
||||
if (uniqueTo!=null && uniqueTo!=civInfo.civName) return false
|
||||
if (GameBasics.Units.values.any { it.uniqueTo==civInfo.civName && it.replaces==name }) return false
|
||||
if (requiredResource!=null && !civInfo.getCivResources().keys.any { it.name == requiredResource }) return false
|
||||
if(unitType.isWaterUnit() && construction.cityInfo.getCenterTile().neighbors.none { it.baseTerrain=="Coast" })
|
||||
return true
|
||||
}
|
||||
|
||||
override fun isBuildable(construction: CityConstructions): Boolean {
|
||||
return isBuildable(construction.cityInfo.civInfo)
|
||||
}
|
||||
|
||||
override fun postBuildEvent(construction: CityConstructions) {
|
||||
val unit = construction.cityInfo.civInfo.placeUnitNearTile(construction.cityInfo.location, name)
|
||||
unit.promotions.XP += construction.getBuiltBuildings().sumBy { it.xpForNewUnits }
|
||||
|
|
|
@ -7,6 +7,7 @@ enum class UnitType{
|
|||
Ranged,
|
||||
Scout,
|
||||
Mounted,
|
||||
WaterCivilian,
|
||||
Siege;
|
||||
|
||||
fun isMelee(): Boolean {
|
||||
|
@ -27,4 +28,7 @@ enum class UnitType{
|
|||
|| this == Ranged
|
||||
|| this == Siege
|
||||
}
|
||||
fun isWaterUnit(): Boolean {
|
||||
return this == WaterCivilian
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import com.unciv.logic.automation.WorkerAutomation
|
|||
import com.unciv.logic.map.MapUnit
|
||||
import com.unciv.models.gamebasics.Building
|
||||
import com.unciv.models.gamebasics.GameBasics
|
||||
import com.unciv.models.gamebasics.tile.TerrainType
|
||||
import com.unciv.models.gamebasics.unit.UnitType
|
||||
import com.unciv.ui.pickerscreens.ImprovementPickerScreen
|
||||
import com.unciv.ui.pickerscreens.PromotionPickerScreen
|
||||
|
@ -33,13 +34,6 @@ class UnitActions {
|
|||
val unitTable = worldScreen.bottomBar.unitTable
|
||||
val actionList = ArrayList<UnitAction>()
|
||||
|
||||
// if (unitTable.currentlyExecutingAction != "moveTo"
|
||||
// && (unit.action==null || !unit.action!!.startsWith("moveTo") )){
|
||||
// actionList += UnitAction("Move unit", {
|
||||
// unitTable.currentlyExecutingAction = "moveTo"
|
||||
// }, unit.currentMovement != 0f )
|
||||
// }
|
||||
//
|
||||
if(unit.action!=null && unit.action!!.startsWith("moveTo")){
|
||||
actionList +=
|
||||
UnitAction("Stop movement", {
|
||||
|
@ -136,13 +130,19 @@ class UnitActions {
|
|||
}
|
||||
}
|
||||
|
||||
if(unit.name == "Work Boats" && tile.improvement==null && tile.resource!=null
|
||||
&& tile.getBaseTerrain().type==TerrainType.Water)
|
||||
actionList += UnitAction("Create Fishing Boats",{
|
||||
tile.improvement = "Fishing Boats"
|
||||
unit.destroy()
|
||||
}, unit.currentMovement != 0f)
|
||||
|
||||
if (unit.name == "Great Scientist") {
|
||||
actionList += UnitAction( "Discover Technology",
|
||||
{
|
||||
unit.civInfo.tech.freeTechs += 1
|
||||
unit.destroy()
|
||||
worldScreen.game.screen = TechPickerScreen(true, unit.civInfo)
|
||||
|
||||
},unit.currentMovement != 0f)
|
||||
actionList += UnitAction("Construct Academy",
|
||||
constructImprovementAndDestroyUnit(unit, "Academy"),
|
||||
|
|
|
@ -39,6 +39,7 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table(){
|
|||
"Sleep" -> return ImageGetter.getImage("OtherIcons/Sleep.png")
|
||||
"Explore" -> return ImageGetter.getUnitIcon("Scout")
|
||||
"Stop exploration" -> return ImageGetter.getImage("OtherIcons/Stop.png")
|
||||
"Create Fishing Boats" -> return ImageGetter.getImprovementIcon("Fishing Boats")
|
||||
else -> return ImageGetter.getImage("OtherIcons/Star.png")
|
||||
}
|
||||
}
|
||||
|
|