From 87356ad8bd6574777f1e4e9664f80d5c7c15e14c Mon Sep 17 00:00:00 2001 From: Thefeli73 Date: Wed, 7 Oct 2020 17:58:03 +0200 Subject: [PATCH] =?UTF-8?q?f=C3=B6rb=C3=A4ttra=20loq=20health=20detection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 8397eb5..4e07f5b 100644 --- a/main.py +++ b/main.py @@ -150,7 +150,8 @@ def something_needs_attention(): # check if need for maintenance maintain = (False, 0) for i in range(len(state.residences)): - if state.residences[i].health < 35+rounds_between_energy*game_layer.get_residence_blueprint(state.residences[i].building_name).decay_rate: + blueprint = game_layer.get_residence_blueprint(state.residences[i].building_name) + if state.residences[i].health < 40+(max(((blueprint.maintenance_cost- state.funds) / (1+total_income())), 1) * blueprint.decay_rate): maintain = (True, i) if (state.turn % rounds_between_energy == i) and not state.residences[i].build_progress < 100: edit_temp = (True, i)