fix: fixes #325 Budget calculation and enemy reinforcement calculation now takes into account the destroyed buildings

This commit is contained in:
Ignacio Muñoz Fernandez 2020-11-20 12:38:06 +01:00
parent 1553e5efd5
commit 5695cf4ac5

View File

@ -151,7 +151,7 @@ class Game:
reward = PLAYER_BUDGET_BASE * len(self.theater.player_points())
for cp in self.theater.player_points():
for g in cp.ground_objects:
if g.category in REWARDS.keys():
if g.category in REWARDS.keys() and not g.is_dead:
reward = reward + REWARDS[g.category]
return reward
else:
@ -274,7 +274,7 @@ class Game:
production = 0.0
for enemy_point in self.theater.enemy_points():
for g in enemy_point.ground_objects:
if g.category in REWARDS.keys():
if g.category in REWARDS.keys() and not g.is_dead:
production = production + REWARDS[g.category]
production = production * 0.75