Fixed issue with 2 extra SP keys in pool for HMG (codemann)
This commit is contained in:
31
Fill.py
31
Fill.py
@@ -57,6 +57,37 @@ def fill_dungeons_restrictive(world, shuffled_locations):
|
||||
fill_restrictive(world, base_state, shuffled_locations, items, key_pool, True)
|
||||
|
||||
all_state_base = world.get_all_state()
|
||||
for player in range(1, world.players + 1):
|
||||
if world.logic[player] == 'hybridglitches' and world.keyshuffle[i.player] in ['none', 'nearby'] \
|
||||
and world.pottery[player] not in ['none', 'cave']:
|
||||
# remove 2 keys from main pool
|
||||
count_to_remove = 2
|
||||
to_remove = []
|
||||
for wix, wi in enumerate(smalls):
|
||||
if wi.name == 'Small Key (Swamp Palace)' and wi.player == player:
|
||||
to_remove.append(wix)
|
||||
if count_to_remove == len(to_remove):
|
||||
break
|
||||
for wix in reversed(to_remove):
|
||||
del smalls[wix]
|
||||
# remove 2 swamp locations from pool
|
||||
hybrid_locations = []
|
||||
to_remove = []
|
||||
for i, loc in enumerate(shuffled_locations):
|
||||
if loc.name in ['Swamp Palace - Trench 1 Pot Key', 'Swamp Palace - Pot Row Pot Key'] and loc.player == player:
|
||||
to_remove.append(i)
|
||||
hybrid_locations.append(loc)
|
||||
if count_to_remove == len(to_remove):
|
||||
break
|
||||
for i in reversed(to_remove):
|
||||
shuffled_locations.pop(i)
|
||||
# place 2 HMG keys
|
||||
hybrid_state_base = all_state_base.copy()
|
||||
for x in bigs + smalls + prizes + others:
|
||||
hybrid_state_base.collect(x, True)
|
||||
hybrid_smalls = [ItemFactory('Small Key (Swamp Palace)', player)] * 2
|
||||
fill(hybrid_state_base, hybrid_smalls, hybrid_locations, unplaced_smalls)
|
||||
|
||||
big_state_base = all_state_base.copy()
|
||||
for x in smalls + others:
|
||||
big_state_base.collect(x, True)
|
||||
|
||||
10
ItemList.py
10
ItemList.py
@@ -368,16 +368,6 @@ def generate_itempool(world, player):
|
||||
or (item.map and world.mapshuffle[player])
|
||||
or (item.compass and world.compassshuffle[player]))])
|
||||
|
||||
if world.logic[player] == 'hybridglitches' and world.pottery[player] not in ['none', 'cave']:
|
||||
keys_to_remove = 2
|
||||
to_remove = []
|
||||
for wix, wi in enumerate(world.itempool):
|
||||
if wi.name == 'Small Key (Swamp Palace)' and wi.player == player:
|
||||
to_remove.append(wix)
|
||||
if keys_to_remove == len(to_remove):
|
||||
break
|
||||
for wix in reversed(to_remove):
|
||||
del world.itempool[wix]
|
||||
|
||||
# logic has some branches where having 4 hearts is one possible requirement (of several alternatives)
|
||||
# rather than making all hearts/heart pieces progression items (which slows down generation considerably)
|
||||
|
||||
Reference in New Issue
Block a user