diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-01-27 16:24:28 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-01-27 16:27:41 -0600 |
commit | f8b1695b548403e5db7e65d22e10cde81be66861 (patch) | |
tree | d4ada2c948f7627a06172b576946a0e7f276cec0 /extras/item_constants.py | |
parent | c7755935fa281a633f85c1c79effa66ddf50796f (diff) |
split out more item_constants stuff
Some of the item_constants functions are now placed in
item_constants.py, and the unit tests now import from that file rather
than from crystal.py for those functions.
Diffstat (limited to 'extras/item_constants.py')
-rw-r--r-- | extras/item_constants.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/extras/item_constants.py b/extras/item_constants.py index d60dfb1f3..a0506375d 100644 --- a/extras/item_constants.py +++ b/extras/item_constants.py @@ -1,4 +1,7 @@ -item_constants = {1: 'MASTER_BALL', +# -*- coding: utf-8 -*- + +item_constants = { +1: 'MASTER_BALL', 2: 'ULTRA_BALL', 3: 'BRIGHTPOWDER', 4: 'GREAT_BALL', @@ -219,4 +222,20 @@ item_constants = {1: 'MASTER_BALL', 246: 'HM_04', 247: 'HM_05', 248: 'HM_06', -249: 'HM_07'} +249: 'HM_07', +} + +def find_item_label_by_id(id): + if id in item_constants.keys(): + return item_constants[id] + else: return None + +def generate_item_constants(): + """make a list of items to put in constants.asm""" + output = "" + for (id, item) in item_constants.items(): + val = ("$%.2x"%id).upper() + while len(item)<13: item+= " " + output += item + " EQU " + val + "\n" + return output + |