@@ -314,24 +314,30 @@ class TileImprovementFunctions(val tile: Tile) {
314
314
var stats = Stats ()
315
315
for (unique in tile.getTerrainMatchingUniques(UniqueType .ProductionBonusWhenRemoved )) {
316
316
stats.add(unique.stats)
317
+ if (stats.isEmpty()) return
317
318
}
318
319
val ruleset = civ.gameInfo.ruleset
319
- val choppingYieldsIncreaseWithGameProgress = ruleset.modOptions.constants.choppingYieldsIncreaseWithGameProgress
320
+ val choppingYieldsIncreaseWithGameProgress =
321
+ ruleset.modOptions.constants.choppingYieldsIncreaseWithGameProgress
320
322
// Civ6 yields increase with game progression: https://www.reddit.com/r/civ/comments/gvx44v/comment/fsrifc2/
321
323
if (choppingYieldsIncreaseWithGameProgress) {
322
- val gameProgress = max(civ.tech.researchedTechnologies.size.toFloat() / ruleset.technologies.size, civ.policies.adoptedPolicies.size.toFloat() / ruleset.policies.size)
324
+ val gameProgress = max(
325
+ civ.tech.researchedTechnologies.size.toFloat() / ruleset.technologies.size,
326
+ civ.policies.adoptedPolicies.size.toFloat() / ruleset.policies.size
327
+ )
323
328
stats * = (1 + 9 * gameProgress)
324
329
}
325
- if (distance != 1 ) stats * = (6 - distance)/ 4
326
- if (tile.owningCity == null || tile.owningCity!! .civ != civ) stats * = 2 / 3
330
+ if (distance > 5 ) stats * = 0
331
+ else if (distance != 1 ) stats * = (6 - distance) / 4
332
+ if (tile.owningCity == null || tile.owningCity!! .civ != civ) stats * = 2 / 3f
327
333
stats * = civ.gameInfo.speed.productionCostModifier
334
+ if (closestCity != null ) {
328
335
for ((stat, value) in stats) {
329
- if (closestCity != null ) {
330
- closestCity.addStat(stat, value.toInt())
331
- }
336
+ closestCity.addStat(stat, value.toInt())
337
+ }
332
338
val locations = LocationAction (tile.position, closestCity.location)
333
339
civ.addNotification(
334
- " Clearing a [$removedTerrainFeature ] has created [${stats.toStringWithoutIcons ()} ] for [${closestCity.name} ]" ,
340
+ " Clearing a [$removedTerrainFeature ] has created [${stats.toStringForNotifications ()} ] for [${closestCity.name} ]" ,
335
341
locations, NotificationCategory .Production , NotificationIcon .Construction
336
342
)
337
343
}
0 commit comments