Retro to match Bonta solution

Minor gui updates
This commit is contained in:
aerinon
2020-01-06 15:56:14 -07:00
6 changed files with 71 additions and 39 deletions

View File

@@ -3,6 +3,8 @@ from enum import Enum, unique
import logging
import json
from collections import OrderedDict, deque
from EntranceShuffle import door_addresses
from _vendor.collections_extended import bag
from Utils import int16_as_bytes
from Tables import normal_offset_table, spiral_offset_table
@@ -1307,10 +1309,9 @@ class ShopType(Enum):
UpgradeShop = 2
class Shop(object):
def __init__(self, region, room_id, default_door_id, type, shopkeeper_config, replaceable):
def __init__(self, region, room_id, type, shopkeeper_config, replaceable):
self.region = region
self.room_id = room_id
self.default_door_id = default_door_id
self.type = type
self.inventory = [None, None, None]
self.shopkeeper_config = shopkeeper_config
@@ -1328,10 +1329,8 @@ class Shop(object):
# [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
elif self.default_door_id is not None:
door_id = self.default_door_id
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