def test_change_enemy_third_pokemon_to_articuno(self): pyboy_instance = PyBoy('../ROMs/gamerom.gbc') altered_state = open("altered_save_state.state", "r+b") pokemon_editor = PokemonEditor(pyboy_instance) pokemon_editor.edit_opponent_pokemon(2, 'ARTICUNO') pyboy_instance.save_state(altered_state) actual_hex = pyboy_instance.get_memory_value(56765) altered_state.close() self.assertEqual(actual_hex, 144)
def test_change_enemy_second_pokemon_to_chansey(self): pyboy_instance = PyBoy('../ROMs/gamerom.gbc') altered_state = open("altered_save_state.state", "r+b") pokemon_editor = PokemonEditor(pyboy_instance) pokemon_editor.edit_opponent_pokemon(1, 'CHANSEY') pyboy_instance.save_state(altered_state) actual_hex = pyboy_instance.get_memory_value(56717) altered_state.close() self.assertEqual(actual_hex, 113)
def test_change_opponent_pokemon_first_move_to_ice_beam(self): pyboy_instance = PyBoy('../ROMs/gamerom.gbc') altered_state = open("altered_save_state.state", "r+b") pokemon_editor = PokemonEditor(pyboy_instance) pokemon_editor.edit_opponent_pokemon(0, 'ARTICUNO') pokemon_editor.edit_opponent_pokemon_move(0, 0, 'ICE_BEAM') pyboy_instance.save_state(altered_state) actual_hex = pyboy_instance.get_memory_value(56671) altered_state.close() self.assertEqual(actual_hex, 58)
def test_change_enemy_pokemon_to_mew(self): pyboy_instance = PyBoy('../ROMs/gamerom.gbc') altered_state = open("altered_save_state.state", "r+b") pokemon_editor = PokemonEditor(pyboy_instance) pokemon_editor.edit_opponent_pokemon(0, 'MEW') pyboy_instance.save_state(altered_state) opponent_pokemon_getter = OpponentPokemonGetter(pyboy_instance) actual_hex = opponent_pokemon_getter.read_opponent_pokemon_species_hex( ) altered_state.close() self.assertEqual(actual_hex, 151)