mirror of https://github.com/pret/pokecrystal.git
extract trainer group id and trainer id from TrainerFragment objects
This commit is contained in:
parent
a17ef09e10
commit
a6efb7f0fb
extras
|
@ -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 = ""
|
||||
|
|
Loading…
Reference in New Issue