revert some changes

This commit is contained in:
yairm210
2024-06-28 17:31:15 +03:00
parent 98a3ec7805
commit 4bf62888c0
2 changed files with 6 additions and 7 deletions

View File

@ -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,

View File

@ -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)
} }
} }