summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2014-02-06 20:22:02 -0600
committerBryan Bishop <kanzure@gmail.com>2014-02-06 20:22:02 -0600
commitc9f9d7f280e177855e8120f50f770630b881ca74 (patch)
tree3f3a4e25225ad54bea4c3cd064bda8a8b75a2943
parent6e6028ae3e1b03be66f3ea083e6c1d33a20f1f98 (diff)
parent657a27badb90f98976020821ca0a83b3b48866e9 (diff)
Merge pull request #68 from yenatch/master
crystal: use a 16-bit PokemonParam for event scripting command `cry`
-rw-r--r--pokemontools/crystal.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pokemontools/crystal.py b/pokemontools/crystal.py
index 7cfab85..72d08a1 100644
--- a/pokemontools/crystal.py
+++ b/pokemontools/crystal.py
@@ -1124,6 +1124,14 @@ class PokemonParam(SingleByteParam):
else:
return str(self.byte)
+class PokemonWordParam(MultiByteParam):
+ def to_asm(self):
+ pokemon_constant = get_pokemon_constant_by_id(self.parsed_number)
+ if pokemon_constant:
+ return pokemon_constant
+ else:
+ return str(self.parsed_number)
+
class PointerParamToItemAndLetter(MultiByteParam):
# [2F][2byte pointer to item no + 0x20 bytes letter text]
@@ -2349,7 +2357,7 @@ pksv_crystal_more = {
0x81: ["musicfadeout", ["music", MultiByteParam], ["fadetime", SingleByteParam]],
0x82: ["playmapmusic"],
0x83: ["reloadmapmusic"],
- 0x84: ["cry", ["cry_id", PokemonParam]],
+ 0x84: ["cry", ["cry_id", PokemonWordParam]],
0x85: ["playsound", ["sound_pointer", MultiByteParam]],
0x86: ["waitbutton"],
0x87: ["warpsound"],