Files
Grinch-AP/worlds/hk/templates/RulesTemplate.pyt
Daniel Grace 8870b577d0 Hollow Knight June 2022 Updates (#720)
This is a combined PR for assorted Hollow Knight updates for June 2022 that have cleared testing. It supersedes any HK-exclusive PRs open by myself or @Alchav unless stated otherwise.

Summary of changes below:

 * Implement Split Claw, Split Cloak, Split Superdash, Randomize Nail, Randomize Focus, Randomize Swim and Elevator 
 * Pass options (@Alchav)
 * Add support for Deathlink with three different modes (@dewiniaid)
 * Add customizable additional shop slots per-shop (@Alchav) and overall (@dewiniaid)
 * Overhaul shop cost output to be more generic and account for all locations with standard costs (such as Stag Stations, Cornifer, and Divine) (@dewiniaid)
 * Add "CostSanity", allowing random prices using any cost type to be chosen for any location with a cost. (e.g. a Stag station requiring 15 grubs to obtain an item)
 * Item classification fixes (Map and Journal items are fillter, Mask Shards/Pale Ore/Vessel Fragments are useful) (@Alchav)
 * Fix Ijii -> Jiji (@Alchav )
 * General code quality updates

The above changes are only for the HK world.
2022-07-03 17:10:10 +02:00

27 lines
932 B
Python

# This module is written by Extractor.py, do not edit manually!.
from functools import partial
def set_generated_rules(hk_world, hk_set_rule):
player = hk_world.player
fn = partial(hk_set_rule, hk_world)
# Events
{% for location, rule_text in event_rules.items() %}
fn("{{location}}", lambda state: {{rule_text}})
{%- endfor %}
# Locations
{% for location, rule_text in location_rules.items() %}
fn("{{location}}", lambda state: {{rule_text}})
{%- 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 %}