Pokemon Pinball wrapper

class pyboy.plugins.game_wrapper_pokemon_pinball.Stage(*values)[source]

Bases: Enum

The stage values in the game.

class pyboy.plugins.game_wrapper_pokemon_pinball.Pokemon(*values)[source]

Bases: Enum

The Pokemon values in the game.

class pyboy.plugins.game_wrapper_pokemon_pinball.Maps(*values)[source]

Bases: Enum

The map values in the game.

class pyboy.plugins.game_wrapper_pokemon_pinball.SpecialMode(*values)[source]

Bases: Enum

class pyboy.plugins.game_wrapper_pokemon_pinball.BallType(*values)[source]

Bases: Enum

class pyboy.plugins.game_wrapper_pokemon_pinball.BallSize(*values)[source]

Bases: Enum

class pyboy.plugins.game_wrapper_pokemon_pinball.GameWrapperPokemonPinball(*args, **kwargs)[source]

Bases: PyBoyGameWrapper

This class wraps Pokemon Pinball, and provides access to game info for AIs.

shape

The shape of the game area

score

The score provided by the game

balls_left

The lives remaining provided by the game

ball_type

The current ball type

multiplier

The current multiplier

current_stage

The current stage

ball_saver_seconds_left

The current ball saver seconds left

ball_x

The x position of the ball

ball_y

The y position of the ball

ball_x_velocity

The x velocity of the ball

ball_y_velocity

The y velocity of the ball

special_mode

The special mode state value

Example:

>>> from pyboy.plugins.game_wrapper_pokemon_pinball import SpecialMode
>>> pyboy = PyBoy(pokemon_pinball_rom)
>>> pyboy.game_wrapper.special_mode == SpecialMode.CATCH.value
True
special_mode_active

The special mode active state

evolution_failure_count

The number of times an evolution has failed

evolution_success_count

The number of times an evolution has succeeded

diglett_stages_completed

The number of Diglett stages completed

diglett_stages_visited

The number of Diglett stages visited

gengar_stages_completed

The number of Gengar stages completed

gengar_stages_visited

The number of Gengar stages visited

meowth_stages_completed

The number of Meowth stages completed

meowth_stages_visited

The number of Meowth stages visited

mewtwo_stages_completed

The number of Mewtwo stages completed

mewtwo_stages_visited

The number of Mewtwo stages visited

seel_stages_completed

The number of Seel stages completed

seel_stages_visited

The number of Seel stages visited

pikachu_saver_charge

The charge of the Pikachu saver, ranges from 0 to 15

pikachu_saver_increments

The number of times the Pikachu saver charge has incremented

pikachu_saver_used

The number of times the Pikachu saver has been used

current_map

The current map

Example:

>>> from pyboy.plugins.game_wrapper_pokemon_pinball import Maps
>>> pyboy = PyBoy(pokemon_pinball_rom)
>>> pyboy.game_wrapper.current_map == Maps.PALLET_TOWN.value
True
map_change_attempts

The number of times a map change has been attempted

map_change_successes

The number of times a map change has been successful

pokemon_caught_in_session

The number of pokemon caught in the current session

pokemon_seen_in_session

The number of pokemon seen in the current session

great_ball_upgrades

The number of Great Ball upgrades obtained

ultra_ball_upgrades

The number of Ultra Ball upgrades obtained

master_ball_upgrades

The number of Master Ball upgrades obtained

extra_balls_added

The number of extra balls added, not including those rewarded via roulette

lost_ball_during_saver

The number of balls lost during a saver mode

roulette_slots_opened

The number of roulette slots opened

roulette_slots_entered

The number of roulette slots entered

has_pokemon(pokemon)[source]

Check if the player has caught the given pokemon

Parameters:

pokemon (Pokemon) – The pokemon to check for

set_unlimited_saver(unlimited_saver=True)[source]

Sets the unlimited saver mode in the game.

This function allows for an unlimited saver option in the game.

Parameters: unlimited_saver (bool, optional): If True, the saver mode in the game is unlimited. Defaults to True.

Returns: None

start_catch_mode(pokemon=Pokemon.BULBASAUR, unlimited_time=False)[source]

Starts the catch mode in the game. NOTE: This method does not change stage specific values and may need a top/bottom stage change to work properly.

This function sets up the game state for catch mode, including the Pokemon to catch and the game timer.

Parameters: pokemon (Pokemon, optional): The Pokemon to catch in this mode. Defaults to Pokemon.BULBASAUR. unlimited_time (bool, optional): If True, the game timer is not activated, giving unlimited time in catch mode. Defaults to False.

Returns: None

enable_evolve_hack(unlimited_time=False)[source]

Enables the evolution hack in the game.

This function replaces the pause button with the evolution start method. It also allows for an unlimited time option.

Parameters: unlimited_time (bool, optional): If True, the game timer is disabled, giving unlimited time in the game. Defaults to False.

Returns: None

current_map_completed()[source]

Determines if all Pokemon in the current map have been caught.

This function checks whether all Pokemon, both common and rare, in the current stage’s map have been caught. It supports both Red and Blue stages. If any Pokemon in the map has not been caught, the function returns False. If all Pokemon have been caught, it returns True.

Returns: bool: True if all Pokemon in the current map have been caught, False otherwise.

start_game(timer_div=None, stage=None)[source]

Starts the game with optional timer division and stage parameters.

This function sets up the game state, sends the necessary inputs to start the game, and saves the initial game state.

Parameters: timer_div (int, optional): The division value for the game timer. Defaults to None. stage (int, optional): The stage to start the game at. Defaults to None.

Returns: None

reset_game(timer_div=None)[source]

After calling start_game, use this method to reset the beginning of the game.

Kwargs:

timer_div (int): Replace timer’s DIV register with this value. Use None to randomize.

reset_tracking()[source]

Resets all tracking values to 0.

get_unique_pokemon_caught()[source]

Get the number of unique pokemon caught in the current session based off the in game pokedex

pyboy.plugins.game_wrapper_pokemon_pinball.MAX_SCORE

The maximum score possible, multiplied by ten to add the implied extra 0 the game uses

pyboy.plugins.game_wrapper_pokemon_pinball.BANK_OFFSET_BALL_SAVED_BLUE

The wild Pokemon that can be found in each map in the Red stage, along with their encounter rates

pyboy.plugins.game_wrapper_pokemon_pinball.RedStageMapWildMonsRare

The wild Pokemon that can be found in each map in the Blue stage, along with their encounter rates