def save_dungeon_list(self, dungeons: List[DungeonDefinition]): self.project.modify_binary( BinaryName.ARM9, lambda binary: HardcodedDungeons.set_dungeon_list( dungeons, binary, self.project.get_rom_module().get_static_data())) self._cached_dungeon_list = None
# mappa floor = Current floor + (ID - 0xB4) * 5 # } else if ID == 0xBE { # mappa entry = 35h # mappa floor = Current floor + 32h # } else if ID >= 0xBF && ID <= 0xD3 { # mappa entry = 35h # mappa floor = Current floor + 33h # } else { # mappa entry = (whatever the arm9.bin table says) # mappa floor = Current floor + (whatever the arm9.bin table says) # } # No, I forgot to say: The function that gets the mappa entry given a dungeon ID returns 0x35 if the ID is >= 0xB4, # and the one that returns the mappa floor number returns 0 if the ID is >= 0xB4 # Try setting and see if still same. HardcodedDungeons.set_dungeon_list(dungeon_list, arm9_us, ppmdu_us) assert dungeon_list == HardcodedDungeons.get_dungeon_list(arm9_us, ppmdu_us) # DungeonRestrictions lst = HardcodedDungeons.get_dungeon_restrictions(arm9_us, ppmdu_us) for e in lst: print(e) HardcodedDungeons.set_dungeon_restrictions(lst, arm9_us, ppmdu_us) assert lst == HardcodedDungeons.get_dungeon_restrictions(arm9_us, ppmdu_us) # SecondaryTerrains lst = HardcodedDungeons.get_secondary_terrains(arm9_us, ppmdu_us) for e in lst: print(e) HardcodedDungeons.set_secondary_terrains(lst, arm9_us, ppmdu_us) assert lst == HardcodedDungeons.get_secondary_terrains(arm9_us, ppmdu_us)