Skip to content

Commit

Permalink
Add throw type to threw_pokeball message (#4199)
Browse files Browse the repository at this point in the history
  • Loading branch information
congito authored and solderzzc committed Aug 18, 2016
1 parent 8ca4874 commit b060c02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def _register_events(self):
self.event_manager.register_event(
'threw_pokeball',
parameters=(
'throw_type',
'ball_name',
'success_percentage',
'count_left'
Expand Down
6 changes: 3 additions & 3 deletions pokemongo_bot/cell_workers/pokemon_catch_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,15 @@ def _do_catch(self, pokemon, encounter_id, catch_rate_by_ball, is_vip=False):
self.generate_throw_quality_parameters(throw_parameters)

# try to catch pokemon!
# TODO : Log which type of throw we selected
ball_count[current_ball] -= 1
self.inventory.get(current_ball).remove(1)
# Take some time to throw the ball from config options
action_delay(self.catchsim_catch_wait_min, self.catchsim_catch_wait_max)
self.emit_event(
'threw_pokeball',
formatted='Used {ball_name}, with chance {success_percentage} ({count_left} left)',
formatted='{throw_type}! Used {ball_name}, with chance {success_percentage} ({count_left} left)',
data={
'throw_type': throw_parameters['throw_type_label'],
'ball_name': self.inventory.get(current_ball).name,
'success_percentage': self._pct(catch_rate_by_ball[current_ball]),
'count_left': ball_count[current_ball]
Expand Down Expand Up @@ -548,4 +548,4 @@ def generate_throw_quality_parameters(self, throw_parameters):
# Here the reticle size doesn't matter, we scored out of it
throw_parameters['normalized_reticle_size'] = 1.25 + 0.70 * random()
throw_parameters['normalized_hit_position'] = 0.0
throw_parameters['throw_type_label'] = 'Normal'
throw_parameters['throw_type_label'] = 'OK'

0 comments on commit b060c02

Please sign in to comment.