From 211da4dcb3ac2d8ca370d6b840e2368f59b5114d Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Sat, 2 Nov 2013 14:41:48 -0500 Subject: attempt to start a trainer battle --- pokemontools/vba/vba.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pokemontools/vba/vba.py') 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) -- cgit v1.2.3