Added Shop ID constant and forfeit values
This commit is contained in:
parent
6d28978480
commit
4250004f11
4
Main.py
4
Main.py
|
@ -11,7 +11,7 @@ import concurrent.futures
|
|||
|
||||
from BaseClasses import World, CollectionState, Item, Region, Location, PlandoItem
|
||||
from Items import ItemFactory, item_table, item_name_groups
|
||||
from Regions import create_regions, create_shops, mark_light_world_regions, lookup_vanilla_location_to_entrance
|
||||
from Regions import create_regions, create_shops, mark_light_world_regions, lookup_vanilla_location_to_entrance, SHOP_ID_START
|
||||
from InvertedRegions import create_inverted_regions, mark_dark_world_regions
|
||||
from EntranceShuffle import link_entrances, link_inverted_entrances, plando_connect
|
||||
from Rom import patch_rom, patch_race_rom, patch_enemizer, apply_rom_settings, LocalRom, get_hash_string
|
||||
|
@ -409,7 +409,7 @@ def main(args, seed=None):
|
|||
main_entrance = get_entrance_to_region(region)
|
||||
for location in region.locations:
|
||||
if type(location.address) == int: # skips events and crystals
|
||||
if location.address >= 0x400000: continue
|
||||
if location.address >= SHOP_ID_START: continue
|
||||
if lookup_vanilla_location_to_entrance[location.address] != main_entrance.name:
|
||||
er_hint_data[region.player][location.address] = main_entrance.name
|
||||
|
||||
|
|
|
@ -1154,7 +1154,7 @@ async def track_locations(ctx : Context, roomid, roomdata):
|
|||
if roomid in location_shop_ids:
|
||||
misc_data = await snes_read(ctx, SHOP_ADDR, len(location_shop_order)*3)
|
||||
for cnt, b in enumerate(misc_data):
|
||||
my_check = Regions.shop_table_by_location_id[0x400000 + cnt]
|
||||
my_check = Regions.shop_table_by_location_id[Regions.SHOP_ID_START + cnt]
|
||||
if int(b) > 0 and my_check not in ctx.locations_checked:
|
||||
new_check(my_check)
|
||||
except Exception as e:
|
||||
|
|
|
@ -475,6 +475,7 @@ def send_new_items(ctx: Context):
|
|||
def forfeit_player(ctx: Context, team: int, slot: int):
|
||||
all_locations = {values[0] for values in Regions.location_table.values() if type(values[0]) is int}
|
||||
all_locations.update({values[1] for values in Regions.key_drop_data.values()})
|
||||
all_locations.update({values for values in range(Regions.SHOP_ID_START, Regions.SHOP_ID_START + 256)})
|
||||
ctx.notify_all("%s (Team #%d) has forfeited" % (ctx.player_names[(team, slot)], team + 1))
|
||||
register_location_checks(ctx, team, slot, all_locations)
|
||||
|
||||
|
|
|
@ -442,7 +442,8 @@ shop_table = {
|
|||
'Capacity Upgrade': (0x0115, ShopType.UpgradeShop, 0x04, True, True, [('Bomb Upgrade (+5)', 100, 7), ('Arrow Upgrade (+5)', 100, 7)])
|
||||
}
|
||||
|
||||
shop_table_by_location_id = {0x400000 + cnt: s for cnt, s in enumerate(
|
||||
SHOP_ID_START = 0x400000
|
||||
shop_table_by_location_id = {SHOP_ID_START + cnt: s for cnt, s in enumerate(
|
||||
[item for sublist in [["{} Slot {}".format(name, num + 1) for num in range(3)] for name in shop_table] for item in
|
||||
sublist])}
|
||||
shop_table_by_location = {y: x for x, y in shop_table_by_location_id.items()}
|
||||
|
|
Loading…
Reference in New Issue