summaryrefslogtreecommitdiff
path: root/pokemontools/trainers.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-09-12 21:45:01 -0700
committerBryan Bishop <kanzure@gmail.com>2013-09-12 21:45:01 -0700
commit6809c951acb22ddecbeec492ae344e1a2165f942 (patch)
tree3317d767c7c75aaed83d104c4c0f0b9a66ccd98c /pokemontools/trainers.py
parent0a9ccaebbbb7853034b3b0b22fc645e8b4af30b0 (diff)
parentb9955a5e40a2c517d50a9f84ee47d3c12ce23e9a (diff)
Merge pull request #30 from kanzure/cleanup-again
More cleanup of crystal.py
Diffstat (limited to 'pokemontools/trainers.py')
-rw-r--r--pokemontools/trainers.py25
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()