Fix world copy in HMG/NL
This commit is contained in:
5
Main.py
5
Main.py
@@ -28,7 +28,7 @@ from Fill import distribute_items_restrictive, promote_dungeon_items, fill_dunge
|
|||||||
from Fill import dungeon_tracking
|
from Fill import dungeon_tracking
|
||||||
from Fill import sell_potions, sell_keys, balance_multiworld_progression, balance_money_progression, lock_shop_locations, set_prize_drops
|
from Fill import sell_potions, sell_keys, balance_multiworld_progression, balance_money_progression, lock_shop_locations, set_prize_drops
|
||||||
from ItemList import generate_itempool, difficulties, fill_prizes, customize_shops, fill_specific_items, create_farm_locations
|
from ItemList import generate_itempool, difficulties, fill_prizes, customize_shops, fill_specific_items, create_farm_locations
|
||||||
from UnderworldGlitchRules import create_hybridmajor_connections, create_hybridmajor_connectors
|
from UnderworldGlitchRules import create_hybridmajor_connections, create_hybridmajor_connectors, get_hybridmajor_connector_entrances
|
||||||
from Utils import output_path, parse_player_names
|
from Utils import output_path, parse_player_names
|
||||||
|
|
||||||
from source.item.District import init_districts
|
from source.item.District import init_districts
|
||||||
@@ -656,6 +656,7 @@ def copy_world(world):
|
|||||||
|
|
||||||
# connect copied world
|
# connect copied world
|
||||||
copied_locations = {(loc.name, loc.player): loc for loc in ret.get_locations()} # caches all locations
|
copied_locations = {(loc.name, loc.player): loc for loc in ret.get_locations()} # caches all locations
|
||||||
|
hmg_entrances = get_hybridmajor_connector_entrances()
|
||||||
for region in world.regions:
|
for region in world.regions:
|
||||||
copied_region = ret.get_region(region.name, region.player)
|
copied_region = ret.get_region(region.name, region.player)
|
||||||
copied_region.is_light_world = region.is_light_world
|
copied_region.is_light_world = region.is_light_world
|
||||||
@@ -665,6 +666,8 @@ def copy_world(world):
|
|||||||
for location in copied_region.locations:
|
for location in copied_region.locations:
|
||||||
location.parent_region = copied_region
|
location.parent_region = copied_region
|
||||||
for entrance in region.entrances:
|
for entrance in region.entrances:
|
||||||
|
if entrance.name in hmg_entrances:
|
||||||
|
continue
|
||||||
ret.get_entrance(entrance.name, entrance.player).connect(copied_region)
|
ret.get_entrance(entrance.name, entrance.player).connect(copied_region)
|
||||||
for exit in region.exits:
|
for exit in region.exits:
|
||||||
if exit.connected_region:
|
if exit.connected_region:
|
||||||
|
|||||||
@@ -6,12 +6,11 @@ kikiskip_spots = [
|
|||||||
("Kiki Skip", "Spectacle Rock Cave (Bottom)", "Palace of Darkness Portal")
|
("Kiki Skip", "Spectacle Rock Cave (Bottom)", "Palace of Darkness Portal")
|
||||||
]
|
]
|
||||||
|
|
||||||
mireheraswamp_spots = [
|
mirehera_spots = [("Mire to Hera Clip", "Mire Torches Top", "Hera Portal")]
|
||||||
("Mire to Hera Clip", "Mire Torches Top", "Hera Portal"),
|
|
||||||
("Hera to Swamp Clip", "Mire Torches Top", "Swamp Portal"),
|
|
||||||
]
|
|
||||||
|
|
||||||
icepalace_spots = [("Ice Lobby Clip", "Ice Portal", "Ice Bomb Drop")]
|
heraswamp_spots = [("Hera to Swamp Clip", "Mire Torches Top", "Swamp Portal")]
|
||||||
|
|
||||||
|
icepalace_spots = [("Ice Lobby Clip", "Ice Portal", "Ice Bomb Drop - Top")]
|
||||||
|
|
||||||
thievesdesert_spots = [
|
thievesdesert_spots = [
|
||||||
("Thieves to Desert West Clip", "Thieves Attic", "Desert West Portal"),
|
("Thieves to Desert West Clip", "Thieves Attic", "Desert West Portal"),
|
||||||
@@ -34,12 +33,12 @@ kikiskip_connectors = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
mireheraswamp_connectors = [
|
mirehera_connectors = [
|
||||||
("Mire to Hera Connector", "Mire Torches Top", "Tower of Hera Exit"),
|
("Mire to Hera Connector", "Mire Torches Top", "Tower of Hera Exit")
|
||||||
("Mire to Swamp Connector", "Mire Torches Top", "Swamp Palace Exit"),
|
]
|
||||||
|
heraswamp_connectors = [
|
||||||
|
("Mire to Swamp Connector", "Mire Torches Top", "Swamp Palace Exit")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
thievesdesert_connectors = [
|
thievesdesert_connectors = [
|
||||||
("Thieves to Desert West Connector", "Thieves Attic", "Desert Palace Exit (West)"),
|
("Thieves to Desert West Connector", "Thieves Attic", "Desert Palace Exit (West)"),
|
||||||
(
|
(
|
||||||
@@ -49,7 +48,6 @@ thievesdesert_connectors = [
|
|||||||
),
|
),
|
||||||
("Thieves to Desert East Connector", "Thieves Attic", "Desert Palace Exit (East)"),
|
("Thieves to Desert East Connector", "Thieves Attic", "Desert Palace Exit (East)"),
|
||||||
]
|
]
|
||||||
|
|
||||||
specrock_connectors = [
|
specrock_connectors = [
|
||||||
(
|
(
|
||||||
"Spec Rock Top Connector",
|
"Spec Rock Top Connector",
|
||||||
@@ -68,7 +66,8 @@ specrock_connectors = [
|
|||||||
def create_hybridmajor_connections(world, player):
|
def create_hybridmajor_connections(world, player):
|
||||||
for spots in [
|
for spots in [
|
||||||
kikiskip_spots,
|
kikiskip_spots,
|
||||||
mireheraswamp_spots,
|
mirehera_spots,
|
||||||
|
heraswamp_spots,
|
||||||
icepalace_spots,
|
icepalace_spots,
|
||||||
thievesdesert_spots,
|
thievesdesert_spots,
|
||||||
specrock_spots,
|
specrock_spots,
|
||||||
@@ -81,7 +80,8 @@ def create_hybridmajor_connections(world, player):
|
|||||||
def create_hybridmajor_connectors(world, player):
|
def create_hybridmajor_connectors(world, player):
|
||||||
for connectors in [
|
for connectors in [
|
||||||
kikiskip_connectors,
|
kikiskip_connectors,
|
||||||
mireheraswamp_connectors,
|
mirehera_connectors,
|
||||||
|
heraswamp_connectors,
|
||||||
thievesdesert_connectors,
|
thievesdesert_connectors,
|
||||||
specrock_connectors,
|
specrock_connectors,
|
||||||
]:
|
]:
|
||||||
@@ -97,6 +97,19 @@ def create_hybridmajor_connectors(world, player):
|
|||||||
create_no_logic_connections(player, world, new_connectors)
|
create_no_logic_connections(player, world, new_connectors)
|
||||||
|
|
||||||
|
|
||||||
|
def get_hybridmajor_connector_entrances():
|
||||||
|
connectors = []
|
||||||
|
for connector in (
|
||||||
|
kikiskip_connectors
|
||||||
|
+ mirehera_connectors
|
||||||
|
+ heraswamp_connectors
|
||||||
|
+ thievesdesert_connectors
|
||||||
|
+ specrock_connectors
|
||||||
|
):
|
||||||
|
connectors.append(connector[0])
|
||||||
|
return set(connectors)
|
||||||
|
|
||||||
|
|
||||||
# For some entrances, we need to fake having pearl, because we're in fake DW/LW.
|
# For some entrances, we need to fake having pearl, because we're in fake DW/LW.
|
||||||
# This creates a copy of the input state that has Moon Pearl.
|
# This creates a copy of the input state that has Moon Pearl.
|
||||||
def fake_pearl_state(state, player):
|
def fake_pearl_state(state, player):
|
||||||
|
|||||||
Reference in New Issue
Block a user