Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add throw type to threw_pokeball message #4199

Merged
merged 1 commit into from
Aug 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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]
Expand Down Expand Up @@ -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'