diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-09-12 22:57:45 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-09-12 22:57:45 -0500 |
commit | 30afb173f5ce0b490dbc59d9b38272377c6741db (patch) | |
tree | b931e128badcf1a22901e3677bf8732d7f95ab44 | |
parent | 10360d114f1f2cd9c16ec426b188991e4f7b2457 (diff) |
pretty_print_trainer_id_constants to trainers.py
-rw-r--r-- | pokemontools/crystal.py | 25 | ||||
-rw-r--r-- | pokemontools/trainers.py | 25 |
2 files changed, 25 insertions, 25 deletions
diff --git a/pokemontools/crystal.py b/pokemontools/crystal.py index 71f66b6..64d45de 100644 --- a/pokemontools/crystal.py +++ b/pokemontools/crystal.py @@ -3824,31 +3824,6 @@ def make_trainer_group_name_trainer_ids(trainer_group_table, debug=True): if debug: logging.info("done improving trainer names") -def pretty_print_trainer_id_constants(): - """ - Prints out some constants for trainer ids, for "constants.asm". - - make_trainer_group_name_trainer_ids must be called prior to this. - """ - assert trainer_group_table != None, "must make trainer_group_table first" - assert trainers.trainer_group_names != None, "must have trainers.trainer_group_names available" - assert "trainer_names" in trainers.trainer_group_names[1].keys(), "trainer_names must be set in trainers.trainer_group_names" - - output = "" - for (key, value) in trainers.trainer_group_names.items(): - if "uses_numeric_trainer_ids" in trainers.trainer_group_names[key].keys(): - continue - id = key - group = value - header = group["header"] - name = group["name"] - trainer_names = group["trainer_names"] - output += "; " + name + "\n" - for (id, name) in enumerate(trainer_names): - output += name.upper() + " EQU $%.2x"%(id+1) + "\n" - output += "\n" - return output - class PeopleEvent(Command): size = people_event_byte_size macro_name = "person_event" diff --git a/pokemontools/trainers.py b/pokemontools/trainers.py index cf17b98..f636025 100644 --- a/pokemontools/trainers.py +++ b/pokemontools/trainers.py @@ -104,5 +104,30 @@ def remove_parentheticals_from_trainer_group_names(): i += 1 return trainer_group_names +def pretty_print_trainer_id_constants(trainer_group_table, trainers): + """ + Prints out some constants for trainer ids, for "constants.asm". + + make_trainer_group_name_trainer_ids must be called prior to this. + """ + assert trainer_group_table != None, "must make trainer_group_table first" + assert trainers.trainer_group_names != None, "must have trainers.trainer_group_names available" + assert "trainer_names" in trainers.trainer_group_names[1].keys(), "trainer_names must be set in trainers.trainer_group_names" + + output = "" + for (key, value) in trainers.trainer_group_names.items(): + if "uses_numeric_trainer_ids" in trainers.trainer_group_names[key].keys(): + continue + id = key + group = value + header = group["header"] + name = group["name"] + trainer_names = group["trainer_names"] + output += "; " + name + "\n" + for (id, name) in enumerate(trainer_names): + output += name.upper() + " EQU $%.2x"%(id+1) + "\n" + output += "\n" + return output + # remove [Blue] from each trainer group name remove_parentheticals_from_trainer_group_names() |