diff options
author | yenatch <yenatch@gmail.com> | 2013-11-05 14:11:04 -0500 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2013-11-05 14:11:04 -0500 |
commit | da7b863b8e20d5d8da07d9eb44e0fd4f5f0848d0 (patch) | |
tree | 09a02add28a0d34589fce85ec2fde3da81c8eb05 /pokemontools/trainers.py | |
parent | 4a7373d8e79d17f10ebafa3ccef7b822a5b139af (diff) | |
parent | dafb5518df768f93ac94c59d4bf5981e95f7aba0 (diff) |
Merge branch 'master' of github.com:kanzure/pokemon-reverse-engineering-tools
Diffstat (limited to 'pokemontools/trainers.py')
-rw-r--r-- | pokemontools/trainers.py | 25 |
1 files changed, 25 insertions, 0 deletions
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() |