Separate OWG and HMG connection code

Split making HMG entrances and connecting them
Correctly link IP lobby (not portal)
This commit is contained in:
KrisDavie
2024-12-23 15:55:44 +01:00
committed by aerinon
parent d2f4271a87
commit e5f38b2d01
3 changed files with 49 additions and 50 deletions

22
Main.py
View File

@@ -27,7 +27,7 @@ from Fill import distribute_items_restrictive, promote_dungeon_items, fill_dunge
from Fill import dungeon_tracking
from Fill import sell_potions, sell_keys, balance_multiworld_progression, balance_money_progression, lock_shop_locations
from ItemList import generate_itempool, difficulties, fill_prizes, customize_shops, fill_specific_items
from UnderworldGlitchRules import create_hybridmajor_connections, get_hybridmajor_connection_entrances
from UnderworldGlitchRules import connect_hmg_entrances_regions, create_hmg_entrances_regions
from Utils import output_path, parse_player_names
from source.item.FillUtil import create_item_pool_config, massage_item_pool, district_item_pool_config, verify_item_pool_config
@@ -282,7 +282,8 @@ def main(args, seed=None, fish=None):
for player in range(1, world.players + 1):
if world.logic[player] in ('nologic', 'hybridglitches'):
create_hybridmajor_connections(world, player)
create_hmg_entrances_regions(world, player)
connect_hmg_entrances_regions(world, player)
generate_itempool(world, player)
verify_item_pool_config(world)
@@ -544,6 +545,10 @@ def copy_world(world):
connection = Entrance(player, 'Uncle S&Q', parent)
parent.exits.append(connection)
connection.connect(target)
# This makes the regions for HMG only
# we'll connect them later after all other connections are made (OW <=> UW, Portals)
if world.logic[player] in ('nologic', 'hybridglitches'):
create_hmg_entrances_regions(ret, player)
# copy bosses
for dungeon in world.dungeons:
@@ -560,7 +565,6 @@ def copy_world(world):
# We have to skip these for now. They require both the rest of the entrances _and_ the dungeon portals to be copied first
# We will connect them later
hmg_entrances = get_hybridmajor_connection_entrances()
for region in world.regions:
copied_region = ret.get_region(region.name, region.player)
@@ -571,8 +575,6 @@ def copy_world(world):
for location in copied_region.locations:
location.parent_region = copied_region
for entrance in region.entrances:
if entrance.name in hmg_entrances:
continue
ret.get_entrance(entrance.name, entrance.player).connect(copied_region)
# fill locations
@@ -620,15 +622,15 @@ def copy_world(world):
for player in range(1, world.players + 1):
if world.logic[player] in ('nologic', 'hybridglitches'):
create_hybridmajor_connections(ret, player)
connect_hmg_entrances_regions(ret, player)
for region in world.regions:
copied_region = ret.get_region(region.name, region.player)
for entrance in region.entrances:
if entrance.name not in hmg_entrances:
continue
ret.get_entrance(entrance.name, entrance.player).connect(copied_region)
ent = ret.get_entrance(entrance.name, entrance.player)
if (ent.connected_region != copied_region):
ent.connect(copied_region)
for player in range(1, world.players + 1):
set_rules(ret, player)