How the logic of Pokemon works