HK: skip for loop (#2390)

This commit is contained in:
Fabian Dill 2023-10-29 19:53:57 +01:00 committed by GitHub
parent 3e0d1d4e1c
commit 9c80a7c4ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 9 deletions

View File

@ -1,5 +1,4 @@
from ..generic.Rules import set_rule, add_rule
from BaseClasses import MultiWorld
from ..AutoWorld import World
from .GeneratedRules import set_generated_rules
from typing import NamedTuple
@ -39,14 +38,12 @@ def hk_set_rule(hk_world: World, location: str, rule):
def set_rules(hk_world: World):
player = hk_world.player
world = hk_world.multiworld
set_generated_rules(hk_world, hk_set_rule)
# Shop costs
for region in world.get_regions(player):
for location in region.locations:
if location.costs:
for term, amount in location.costs.items():
if term == "GEO": # No geo logic!
continue
add_rule(location, lambda state, term=term, amount=amount: state.count(term, player) >= amount)
for location in hk_world.multiworld.get_locations(player):
if location.costs:
for term, amount in location.costs.items():
if term == "GEO": # No geo logic!
continue
add_rule(location, lambda state, term=term, amount=amount: state.count(term, player) >= amount)