Example #1
0
 def define(self, version=game.Version(4, 0)):
     self.game = version
     if self.game.is_hgss():
         self.uint8('walkrate')
         self.uint8('surfrate')
         self.uint8('rocksmashrate')
         self.uint8('oldrodrate')
         self.uint8('goodroodrate')
         self.uint8('superrodrate')
         self.uint16('padding')
     elif self.game.is_gen(5):
         self.uint8('walkrate')
         self.uint8('doublesrate')
         self.uint8('walkspecialrate')
         self.uint8('surfrate')
         self.uint8('surfspecialrate')
         self.uint8('superrodrate')
         self.uint8('superrodspecialrate')
         self.uint8('unknown2rate')
     self.struct('walking', Walking(version).base_struct)
     if version in game.GEN_V:
         water_types = ('surf', 'superrod')
     else:
         water_types = ('surf', 'rocksmash', 'oldrod', 'goodrod',
                        'superrod')
     for water in water_types:
         self.struct(water, Water(water, version).base_struct)
     if game.Version(4, 3) <= version < game.GEN_V:
         self.array('radio',
                    WalkEncouter(version, False).base_struct,
                    length=2)
Example #2
0
 def define(self, name, version):
     self.name = 'Water_' + name
     if version < game.Version(4, 3):
         self.uint32('rate')
     num_pokemon = 5
     if version >= game.Version(4, 3) and name == 'rocksmash':
         num_pokemon = 2
     self.array('normal',
                WaterEncouter(version).base_struct,
                length=num_pokemon)
     if version in game.GEN_V:
         self.array('special',
                    WaterEncouter(version).base_struct,
                    length=num_pokemon)
Example #3
0
    def define(self, version=game.Version(4, 0)):
        self.version = version
        self.uint16('price')
        self.uint8('battleeffect')
        self.uint8('gain')
        self.uint8('berry')
        self.uint8('flingeffect')
        self.uint8('flingpower')
        self.uint8('naturalgiftpower')
        self.uint8('flag')
        self.uint8('pocket')
        self.uint8('type')
        self.uint8('category')
        self.uint16('category2')  # Not aligned ? If it were, use the uint32
        self.uint8('index')
        self.struct('statboosts', Boosts().base_struct)
        self.struct('evs', EVStats().base_struct)
        self.uint8('hprestore')
        self.int8('pprestore')
        self.array('happy', self.int8, length=3)
        self.uint16('padding')  # I swear this is aligned on the wrong byte

        if version in game.GEN_V:
            with self.after('category2'):
                self.uint8('category3')
            with self.after('index'):
                self.uint8('antiindex')
Example #4
0
 def define(self, version=game.Version(4, 0)):
     self.uint32('offset')
     self.uint32('charcount')
     if version > game.GEN_IV:
         with self.replace('charcount'):
             self.uint16('charcount')
             self.uint16('flags')
Example #5
0
 def define(self, version=game.Version(4, 0)):
     self.version = version
     if version in game.GEN_IV:
         self.uint16('num')
         self.uint16('seed')
         load_table()
     else:
         self.uint16('numblocks')
         self.uint16('num')
         self.uint32('filesize')
         self.uint32('null')
Example #6
0
 def define(self, version, level=True):
     if version < game.Version(4, 3):
         if level:
             self.uint32('level')
         self.uint32('natid')
     elif version < game.GEN_V:
         self.uint16('natid')
     else:
         self.uint16('natid', width=15)
         self.uint16('forme', width=1)
         self.uint8('minlevel')
         self.uint8('maxlevel')
Example #7
0
 def define(self, version):
     if version < game.Version(4, 3):
         self.uint8('maxlevel')
         self.uint8('minlevel')
         self.uint16('padding')
         self.uint32('natid')
     elif version < game.GEN_V:
         self.uint8('maxlevel')
         self.uint8('minlevel')
         self.uint16('natid')
     else:
         self.uint16('natid', width=11)
         self.uint16('forme', width=5)
         self.uint8('minlevel')
         self.uint8('maxlevel')
Example #8
0
 def define(self, version):
     self.game = version
     natid_only_s = WalkEncouter(version, False).base_struct
     num_pokemon = 12
     if version < game.Version(4, 3):
         self.uint32('rate')
         self.array('normal',
                    WalkEncouter(version).base_struct,
                    length=num_pokemon)
         for time in ('morning', 'day', 'night'):
             self.array(time, natid_only_s, length=2)
         self.array('radar', natid_only_s, length=4)
         self.array('unknown', self.uint32,
                    length=2)  # two identical. 0 or 100
         self.array('padding', self.uint32, length=3)
         self.uint32('unown')
         for name in ('ruby', 'sapphire', 'emerald', 'firered',
                      'leafgreen'):
             self.array(name, natid_only_s, length=2)
     elif version < game.GEN_V:
         self.array('levels', self.uint8, length=num_pokemon)
         self.array('morning', natid_only_s, length=num_pokemon)
         self.array('day', natid_only_s, length=num_pokemon)
         self.array('night', natid_only_s, length=num_pokemon)
         self.array('hoenn', natid_only_s, length=2)
         self.array('sinnoh', natid_only_s, length=2)
     else:
         self.array('normal',
                    WalkEncouter(version).base_struct,
                    length=num_pokemon)
         self.array('doubles',
                    WalkEncouter(version).base_struct,
                    length=num_pokemon)
         self.array('special',
                    WalkEncouter(version).base_struct,
                    length=num_pokemon)
Example #9
0
 def define(self, version=game.Version(4, 0)):
     self.version = version
     self.methods = {}