diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-11-02 14:41:48 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-11-02 14:41:48 -0500 |
commit | 211da4dcb3ac2d8ca370d6b840e2368f59b5114d (patch) | |
tree | c6ee934ff6620b0ba9416b5b6921f0f099a77bb4 | |
parent | 185856adb4a10c66a1fc206c13862ffa6958cec6 (diff) |
attempt to start a trainer battle
-rw-r--r-- | pokemontools/vba/vba.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pokemontools/vba/vba.py b/pokemontools/vba/vba.py index 81ffe4e..1af2364 100644 --- a/pokemontools/vba/vba.py +++ b/pokemontools/vba/vba.py @@ -577,3 +577,17 @@ class crystal(object): """ hp = ((self.vba.memory[0xd218] << 8) | self.vba.memory[0xd217]) return hp + + def start_trainer_battle(self, trainer_group, trainer_id): + memory = self.vba.memory + + # setup the battle + memory[0xd459] = 0x81 + memory[0xd22f] = trainer_group + memory[0xd231] = trainer_id + + self.vba.memory = memory + + Script_startbattle_address = 0x97436 + + self.call(0x25, Script_startbattle_address) |