From 4a649b9124d4019ec9facb7dc5f1f3c2a07fa9cd Mon Sep 17 00:00:00 2001 From: Thefeli73 Date: Thu, 8 Oct 2020 03:50:44 +0200 Subject: [PATCH] mall/charger fix --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 0db1d89..b79dea3 100644 --- a/main.py +++ b/main.py @@ -256,12 +256,12 @@ def calculate_best_upgrade(current_building): lifetime_energy = (base_energy_need + effect.base_energy_mwh_increase + average_heating_energy - effect.mwh_production) * rounds_left old_lifetime_energy = (base_energy_need + old_average_heating_energy) * rounds_left - upgrade_co2 = (effect.co2_per_pop_increase * 0.03) * current_pop * rounds_left + (0.1 * lifetime_energy / 1000) + upgrade_co2 = (effect.co2_per_pop_increase + 0.03) * current_pop * rounds_left + (0.1 * lifetime_energy / 1000) + if "Mall.2" in current_building.effects and upgrade.name == "Charger": + upgrade_co2 = (effect.co2_per_pop_increase - 0.009 + 0.03) * current_pop * rounds_left + (0.1 * lifetime_energy / 1000) old_co2 = 0.03 * current_pop * rounds_left + (0.1 * old_lifetime_energy / 1000) co2 = upgrade_co2 - old_co2 max_happiness = effect.max_happiness_increase * current_pop * rounds_left - if "Charger" in current_building.effects and upgrade.name == "Mall.2": - co2 = 0 score = max_happiness/10 - co2 # score = score / upgrade.cost best_upgrade.append((score, upgrade.name))