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