From 13f2ef9e178898cadebf71aa935a9a1482c28681 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 17 Aug 2016 20:02:31 -0700 Subject: [PATCH] Add throw type to threw_pokeball message --- pokemongo_bot/__init__.py | 1 + pokemongo_bot/cell_workers/pokemon_catch_worker.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index 4be7777c32..e05dffdb9e 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -283,6 +283,7 @@ def _register_events(self): self.event_manager.register_event( 'threw_pokeball', parameters=( + 'throw_type', 'ball_name', 'success_percentage', 'count_left' diff --git a/pokemongo_bot/cell_workers/pokemon_catch_worker.py b/pokemongo_bot/cell_workers/pokemon_catch_worker.py index 0ef63168b8..59b214fa41 100644 --- a/pokemongo_bot/cell_workers/pokemon_catch_worker.py +++ b/pokemongo_bot/cell_workers/pokemon_catch_worker.py @@ -363,15 +363,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] @@ -504,4 +504,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'