Skip to content

Commit

Permalink
show what kind of egg is being hatched (#4219)
Browse files Browse the repository at this point in the history
  • Loading branch information
rawgni authored and solderzzc committed Aug 18, 2016
1 parent 8eba07a commit d32b984
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def _register_events(self):
)
self.event_manager.register_event(
'next_egg_incubates',
parameters=('distance_in_km',)
parameters=('km_needed', 'distance_in_km',)
)
self.event_manager.register_event('incubator_already_used')
self.event_manager.register_event('egg_already_incubating')
Expand Down
8 changes: 6 additions & 2 deletions pokemongo_bot/cell_workers/incubate_eggs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def work(self):
else:
self.emit_event(
'next_egg_incubates',
formatted='Next egg incubates in {distance_in_km:.2f} km',
formatted='Next egg ({km_needed} km) incubates in {distance_in_km:.2f} km',
data={
'km_needed': self.used_incubators[0]['km_needed'],
'distance_in_km': km_left
}
)
Expand Down Expand Up @@ -118,9 +119,12 @@ def _check_inventory(self, lookup_ids=[]):
incubators = [incubators]
for incubator in incubators:
if 'pokemon_id' in incubator:
start_km = incubator.get('start_km_walked', 9001)
km_walked = incubator.get('target_km_walked', 9001)
temp_used_incubators.append({
"id": incubator.get('id', -1),
"km": incubator.get('target_km_walked', 9001)
"km": km_walked,
"km_needed": (km_walked - start_km)
})
else:
temp_ready_incubators.append({
Expand Down

0 comments on commit d32b984

Please sign in to comment.