示例#1
0
 def get_dungeon_restrictions(self) -> List[DungeonRestriction]:
     # TODO: Cache?
     return HardcodedDungeons.get_dungeon_restrictions(
         self.project.get_binary(BinaryName.ARM9),
         self.project.get_rom_module().get_static_data())
示例#2
0
# } 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)

# MapMarkerPlacements - TODO: They don't line up with dungeon IDs at all!
lst = HardcodedDungeons.get_marker_placements(arm9_us, ppmdu_us)
str_blk = ppmdu_us.string_index_data.string_blocks['Dungeon Names (Selection)']