Пример #1
0
 def get_bytes(self) -> List[int]:
     # [id][roomID-low][roomID-high][doorID][zero][shop_config][shopkeeper_config][sram_index]
     entrances = self.region.entrances
     config = self.item_count
     if len(entrances) == 1 and entrances[0].name in door_addresses:
         door_id = door_addresses[entrances[0].name][0] + 1
     else:
         door_id = 0
         config |= 0x40  # ignore door id
     if self.type == ShopType.TakeAny:
         config |= 0x80
     elif self.type == ShopType.UpgradeShop:
         config |= 0x10  # Alt. VRAM
     return [0x00] + int16_as_bytes(self.room_id) + [door_id, 0x00, config, self.shopkeeper_config, 0x00]
Пример #2
0
 def get_bytes(self):
     # [id][roomID-low][roomID-high][doorID][zero][shop_config][shopkeeper_config][sram_index]
     entrances = self.region.entrances
     config = self.item_count
     if len(entrances) == 1 and entrances[0].addresses:
         door_id = entrances[0].addresses + 1
     else:
         door_id = 0
         config |= 0x40  # ignore door id
     if self.type == ShopType.TakeAny:
         config |= 0x80
     return [0x00] + int16_as_bytes(self.room_id) + [
         door_id, 0x00, config, self.shopkeeper_config, 0x00
     ]