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

Heal pokemon fix #6

Merged
merged 2 commits into from
Jul 17, 2017
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
2 changes: 2 additions & 0 deletions pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ def _register_events(self):
self.event_manager.register_event('catch_limit')
self.event_manager.register_event('spin_limit')
self.event_manager.register_event('show_best_pokemon', parameters=('pokemons'))
self.event_manager.register_event('revived_pokemon')
self.event_manager.register_event('healing_pokemon')

# level up stuff
self.event_manager.register_event(
Expand Down
5 changes: 4 additions & 1 deletion pokemongo_bot/event_handlers/logging_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ class LoggingHandler(EventHandler):
'threw_pokeball': 'none',
'used_lucky_egg': 'none',
'catch_limit_on': 'yellow',
'catch_limit_off': 'green'
'catch_limit_off': 'green',
'revived_pokemon': 'green',
'healing_pokemon': 'green'

}
COLOR_CODE = {
'gray': '\033[90m',
Expand Down
5 changes: 5 additions & 0 deletions pokemongo_bot/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,11 @@ def add(self, pokemon):
raise ValueError("Pokemon already present in the inventory")
self._data[pokemon.unique_id] = pokemon

def get_from_unique_id(self, pokemon_unique_id):
if pokemon_unique_id not in self._data:
raise ValueError("Pokemon not present in the inventory")
return self._data[pokemon_unique_id]

def remove(self, pokemon_unique_id):
if pokemon_unique_id not in self._data:
raise ValueError("Pokemon not present in the inventory")
Expand Down