diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-05-18 21:31:51 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-05-18 21:31:51 -0500 |
commit | a6efb7f0fbc5dd791feebb21c497caa328125224 (patch) | |
tree | 9b049cad33680ffdbc4f99fca1673146fc764de9 | |
parent | a17ef09e100c5a570adbc7a55e84d69e55370af6 (diff) |
extract trainer group id and trainer id from TrainerFragment objects
-rw-r--r-- | extras/crystal.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/extras/crystal.py b/extras/crystal.py index 0df8b4b5c..dca98f612 100644 --- a/extras/crystal.py +++ b/extras/crystal.py @@ -3313,6 +3313,7 @@ class ItemFragmentParam(PointerLabelParam): global_dependencies.add(self.itemfrag) return self.dependencies +trainer_group_maximums = {} class TrainerFragment(Command): """used by TrainerFragmentParam and PeopleEvent for trainer data @@ -3376,6 +3377,20 @@ class TrainerFragment(Command): self.dependencies = deps return deps + def parse(self): + Command.parse(self) + + # get the trainer group id + trainer_group = self.params[1].byte + + # get the trainer id + trainer_id = self.params[2].byte + + if not trainer_group in trainer_group_maximums.keys(): + trainer_group_maximums[trainer_group] = trainer_id + elif trainer_group_maximums[trainer_group] < trainer_id: + trainer_group_maximums[trainer_group] = trainer_id + def to_asm(self): xspacing = "" output = "" |