diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-11-11 21:22:15 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-11-11 21:22:15 -0600 |
commit | 4c6a904db191c182c3b9cecdcbc0d5ea3b5c2173 (patch) | |
tree | 4d0bbdfadd78c5ee298ac2eb499c24476743de93 /pokemontools/vba/vba.py | |
parent | 7b1be358d8564f85f483d2b8a45cf9caf92c1d53 (diff) |
a quick function to set pokemon hp in battle
Diffstat (limited to 'pokemontools/vba/vba.py')
-rw-r--r-- | pokemontools/vba/vba.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pokemontools/vba/vba.py b/pokemontools/vba/vba.py index 10513c6..47cadd7 100644 --- a/pokemontools/vba/vba.py +++ b/pokemontools/vba/vba.py @@ -523,6 +523,13 @@ class crystal(object): self.vba.write_memory_at(0xd216, 0) self.vba.write_memory_at(0xd217, 1) + def set_battle_mon_hp(self, hp): + """ + Set the BattleMonHP variable to the given hp. + """ + self.vba.write_memory_at(0xc63c, hp / 0x100) + self.vba.write_memory_at(0xc63c + 1, hp % 0x100) + def nstep(self, steplimit=500): """ Steps the CPU forward and calls some functions in between each step. |