Archipelago/worlds/hk/templates/RulesTemplate.pyt

27 lines
932 B
Plaintext
Raw Normal View History

# This module is written by Extractor.py, do not edit manually!.
from functools import partial
2022-04-01 02:14:51 +00:00
def set_generated_rules(hk_world, hk_set_rule):
2022-04-01 02:14:51 +00:00
player = hk_world.player
fn = partial(hk_set_rule, hk_world)
2022-04-01 02:14:51 +00:00
# Events
{% for location, rule_text in event_rules.items() %}
fn("{{location}}", lambda state: {{rule_text}})
2022-04-01 02:14:51 +00:00
{%- endfor %}
# Locations
{% for location, rule_text in location_rules.items() %}
fn("{{location}}", lambda state: {{rule_text}})
2022-04-01 02:14:51 +00:00
{%- endfor %}
# Connectors
{% for entrance, rule_text in connectors_rules.items() %}
rule = lambda state: {{rule_text}}
entrance = world.get_entrance("{{entrance}}", player)
entrance.access_rule = rule
{%- if entrance not in one_ways %}
world.get_entrance("{{entrance}}_R", player).access_rule = lambda state, entrance= entrance: \
rule(state) and entrance.can_reach(state)
{%- endif %}
{%- endfor %}