Beispiel #1
0
#  (at your option) any later version.
# 
#  SkyTemple is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
# 
#  You should have received a copy of the GNU General Public License
#  along with SkyTemple.  If not, see <https://www.gnu.org/licenses/>.
# mypy: ignore-errors
import os

from ndspy.rom import NintendoDSRom

from skytemple_files.common.util import get_ppmdu_config_for_rom, get_binary_from_rom_ppmdu
from skytemple_files.hardcoded.monster_sprite_data_table import HardcodedMonsterSpriteDataTable

base_dir = os.path.join(os.path.dirname(__file__), '..', '..', '..', '..')
rom_us = NintendoDSRom.fromFile(os.path.join(base_dir, 'skyworkcopy_us.nds'))
ppmdu_us = get_ppmdu_config_for_rom(rom_us)
arm9_us = get_binary_from_rom_ppmdu(rom_us, ppmdu_us.binaries['arm9.bin'])

entries = HardcodedMonsterSpriteDataTable.get(arm9_us, ppmdu_us)

for i, entry in enumerate(entries):
    print(i, entry)
    
# Try setting and see if still same.
HardcodedMonsterSpriteDataTable.set(entries, arm9_us, ppmdu_us)
assert entries == HardcodedMonsterSpriteDataTable.get(arm9_us, ppmdu_us)
Beispiel #2
0
 def get_pokemon_sprite_data_table(self):
     """Returns the recruitment lists: species, levels, locations"""
     arm9 = self.project.get_binary(BinaryName.ARM9)
     static_data = self.project.get_rom_module().get_static_data()
     return HardcodedMonsterSpriteDataTable.get(arm9, static_data)