mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +07:00
revert some changes
This commit is contained in:
@ -469,9 +469,7 @@ object UnitAutomation {
|
|||||||
// this can be sped up if we check each layer separately
|
// this can be sped up if we check each layer separately
|
||||||
val unitDistanceToTiles = unit.movement.getDistanceToTilesAtPosition(
|
val unitDistanceToTiles = unit.movement.getDistanceToTilesAtPosition(
|
||||||
unit.getTile().position,
|
unit.getTile().position,
|
||||||
unit.getMaxMovement() * CLOSE_ENEMY_TURNS_AWAY_LIMIT,
|
unit.getMaxMovement() * CLOSE_ENEMY_TURNS_AWAY_LIMIT
|
||||||
// Consider ZoC is expensive - we just want to find the closest, not the exact movement we'll need to get there
|
|
||||||
false,
|
|
||||||
)
|
)
|
||||||
var closeEnemies = TargetHelper.getAttackableEnemies(
|
var closeEnemies = TargetHelper.getAttackableEnemies(
|
||||||
unit,
|
unit,
|
||||||
|
@ -98,11 +98,11 @@ class TechManager : IsPartOfGameInfoSerialization {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getScienceModifier(techName: String): Float { // https://forums.civfanatics.com/threads/the-mechanics-of-overflow-inflation.517970/
|
private fun getScienceModifier(techName: String): Float { // https://forums.civfanatics.com/threads/the-mechanics-of-overflow-inflation.517970/
|
||||||
val techsResearchedKnownCivs = civInfo.getKnownCivs()
|
val numberOfCivsResearchedThisTech = civInfo.getKnownCivs()
|
||||||
.count { it.isMajorCiv() && it.tech.isResearched(techName) }
|
.count { it.isMajorCiv() && it.tech.isResearched(techName) }
|
||||||
val undefeatedCivs = civInfo.gameInfo.civilizations
|
val numberOfCivsRemaining = civInfo.gameInfo.civilizations
|
||||||
.count { it.isMajorCiv() && !it.isDefeated() }
|
.count { it.isMajorCiv() && !it.isDefeated() }
|
||||||
return 1 + techsResearchedKnownCivs / undefeatedCivs.toFloat() * 0.3f
|
return 1 + numberOfCivsResearchedThisTech / numberOfCivsRemaining.toFloat() * 0.3f
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getRuleset() = civInfo.gameInfo.ruleset
|
private fun getRuleset() = civInfo.gameInfo.ruleset
|
||||||
@ -264,7 +264,8 @@ class TechManager : IsPartOfGameInfoSerialization {
|
|||||||
val scienceSpent = researchOfTech(currentTechnology) + realOverflow
|
val scienceSpent = researchOfTech(currentTechnology) + realOverflow
|
||||||
if (scienceSpent >= costOfTech(currentTechnology)) {
|
if (scienceSpent >= costOfTech(currentTechnology)) {
|
||||||
overflowScience = 0
|
overflowScience = 0
|
||||||
addScience(realOverflow)
|
if (realOverflow != 0)
|
||||||
|
addScience(realOverflow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user