change energy return (wasted wait())
This commit is contained in:
parent
a830dd5d81
commit
638ebcfd72
8
main.py
8
main.py
@ -160,8 +160,7 @@ def something_needs_attention():
|
|||||||
game_layer.maintenance((state.residences[maintain[1]].X, state.residences[maintain[1]].Y))
|
game_layer.maintenance((state.residences[maintain[1]].X, state.residences[maintain[1]].Y))
|
||||||
return True
|
return True
|
||||||
elif edit_temp[0]: # adjust temp of buildings
|
elif edit_temp[0]: # adjust temp of buildings
|
||||||
adjustEnergy(state.residences[edit_temp[1]])
|
return adjust_energy(state.residences[edit_temp[1]])
|
||||||
return True
|
|
||||||
elif building_under_construction is not None: # finish construction
|
elif building_under_construction is not None: # finish construction
|
||||||
if (len(state.residences)-1 >= building_under_construction[2]) and (state.residences[building_under_construction[2]].build_progress < 100):
|
if (len(state.residences)-1 >= building_under_construction[2]) and (state.residences[building_under_construction[2]].build_progress < 100):
|
||||||
game_layer.build((building_under_construction[0], building_under_construction[1]))
|
game_layer.build((building_under_construction[0], building_under_construction[1]))
|
||||||
@ -199,11 +198,12 @@ def adjust_energy(current_building):
|
|||||||
|
|
||||||
if effectiveEnergyIn > blueprint.base_energy_need:
|
if effectiveEnergyIn > blueprint.base_energy_need:
|
||||||
game_layer.adjust_energy_level((current_building.X, current_building.Y), effectiveEnergyIn)
|
game_layer.adjust_energy_level((current_building.X, current_building.Y), effectiveEnergyIn)
|
||||||
|
return True
|
||||||
elif effectiveEnergyIn < blueprint.base_energy_need:
|
elif effectiveEnergyIn < blueprint.base_energy_need:
|
||||||
game_layer.adjust_energy_level((current_building.X, current_building.Y), blueprint.base_energy_need + 0.01)
|
game_layer.adjust_energy_level((current_building.X, current_building.Y), blueprint.base_energy_need + 0.01)
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
print("you did it!")
|
return False
|
||||||
game_layer.wait()
|
|
||||||
|
|
||||||
|
|
||||||
def optimize_available_tiles():
|
def optimize_available_tiles():
|
||||||
|
Reference in New Issue
Block a user