mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-19 12:18:53 +07:00
Better work actions. Improvement time scales with game speed.
This commit is contained in:

committed by
Yair Morgenstern

parent
c751d5a670
commit
c4263867ff
@ -140,7 +140,7 @@ class WorkerAutomation(val unit: MapUnit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun tileCanBeImproved(tile: TileInfo, civInfo: CivilizationInfo): Boolean {
|
private fun tileCanBeImproved(tile: TileInfo, civInfo: CivilizationInfo): Boolean {
|
||||||
if (!tile.isLand || tile.getBaseTerrain().impassable)
|
if (!tile.isLand || tile.getBaseTerrain().impassable || tile.isCityCenter())
|
||||||
return false
|
return false
|
||||||
val city=tile.getCity()
|
val city=tile.getCity()
|
||||||
if (city == null || city.civInfo != civInfo)
|
if (city == null || city.civInfo != civInfo)
|
||||||
@ -149,11 +149,12 @@ class WorkerAutomation(val unit: MapUnit) {
|
|||||||
if(tile.improvement==null){
|
if(tile.improvement==null){
|
||||||
if(tile.improvementInProgress!=null) return true
|
if(tile.improvementInProgress!=null) return true
|
||||||
val chosenImprovement = chooseImprovement(tile, civInfo)
|
val chosenImprovement = chooseImprovement(tile, civInfo)
|
||||||
if(chosenImprovement!=null) return true
|
if(chosenImprovement!=null && tile.canBuildImprovement(chosenImprovement, civInfo)) return true
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(!tile.containsGreatImprovement() && tile.hasViewableResource(civInfo)
|
if(!tile.containsGreatImprovement() && tile.hasViewableResource(civInfo)
|
||||||
&& tile.getTileResource().improvement != tile.improvement)
|
&& tile.getTileResource().improvement != tile.improvement
|
||||||
|
&& tile.canBuildImprovement(chooseImprovement(tile, civInfo)!!, civInfo))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class TileImprovement : NamedStats(), ICivilopedia {
|
|||||||
|
|
||||||
|
|
||||||
fun getTurnsToBuild(civInfo: CivilizationInfo): Int {
|
fun getTurnsToBuild(civInfo: CivilizationInfo): Int {
|
||||||
var realTurnsToBuild = turnsToBuild.toFloat()
|
var realTurnsToBuild = turnsToBuild.toFloat() * civInfo.gameInfo.gameParameters.gameSpeed.getModifier()
|
||||||
if (civInfo.containsBuildingUnique("Worker construction increased 25%"))
|
if (civInfo.containsBuildingUnique("Worker construction increased 25%"))
|
||||||
realTurnsToBuild *= 0.75f
|
realTurnsToBuild *= 0.75f
|
||||||
if (civInfo.policies.isAdopted("Citizenship"))
|
if (civInfo.policies.isAdopted("Citizenship"))
|
||||||
|
Reference in New Issue
Block a user