optimize set_shop_rules
This commit is contained in:
parent
f952ad5913
commit
4e84b20925
|
@ -92,6 +92,8 @@ def set_rules(ootworld):
|
||||||
# is_child = ootworld.parser.parse_rule('is_child')
|
# is_child = ootworld.parser.parse_rule('is_child')
|
||||||
guarantee_hint = ootworld.parser.parse_rule('guarantee_hint')
|
guarantee_hint = ootworld.parser.parse_rule('guarantee_hint')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for location in ootworld.get_locations():
|
for location in ootworld.get_locations():
|
||||||
if ootworld.shuffle_song_items == 'song':
|
if ootworld.shuffle_song_items == 'song':
|
||||||
if location.type == 'Song':
|
if location.type == 'Song':
|
||||||
|
@ -157,8 +159,8 @@ def set_shop_rules(ootworld):
|
||||||
found_bombchus = ootworld.parser.parse_rule('found_bombchus')
|
found_bombchus = ootworld.parser.parse_rule('found_bombchus')
|
||||||
wallet = ootworld.parser.parse_rule('Progressive_Wallet')
|
wallet = ootworld.parser.parse_rule('Progressive_Wallet')
|
||||||
wallet2 = ootworld.parser.parse_rule('(Progressive_Wallet, 2)')
|
wallet2 = ootworld.parser.parse_rule('(Progressive_Wallet, 2)')
|
||||||
for location in ootworld.world.get_filled_locations():
|
|
||||||
if location.player == ootworld.player and location.item.type == 'Shop':
|
for location in filter(lambda location: location.item and location.item.type == 'Shop', ootworld.get_locations()):
|
||||||
# Add wallet requirements
|
# Add wallet requirements
|
||||||
if location.item.name in ['Buy Arrows (50)', 'Buy Fish', 'Buy Goron Tunic', 'Buy Bombchu (20)', 'Buy Bombs (30)']:
|
if location.item.name in ['Buy Arrows (50)', 'Buy Fish', 'Buy Goron Tunic', 'Buy Bombchu (20)', 'Buy Bombs (30)']:
|
||||||
add_rule(location, wallet)
|
add_rule(location, wallet)
|
||||||
|
@ -167,8 +169,7 @@ def set_shop_rules(ootworld):
|
||||||
|
|
||||||
# Add adult only checks
|
# Add adult only checks
|
||||||
if location.item.name in ['Buy Goron Tunic', 'Buy Zora Tunic']:
|
if location.item.name in ['Buy Goron Tunic', 'Buy Zora Tunic']:
|
||||||
is_adult = ootworld.parser.parse_rule('is_adult', location)
|
add_rule(location, ootworld.parser.parse_rule('is_adult', location))
|
||||||
add_rule(location, is_adult)
|
|
||||||
|
|
||||||
# Add item prerequisite checks
|
# Add item prerequisite checks
|
||||||
if location.item.name in ['Buy Blue Fire',
|
if location.item.name in ['Buy Blue Fire',
|
||||||
|
|
Loading…
Reference in New Issue