Files
dockipelago/worlds/clair_obscur/Rules.py
Jonathan Tinney 7971961166
Some checks failed
Analyze modified files / flake8 (push) Failing after 2m28s
Build / build-win (push) Has been cancelled
Build / build-ubuntu2204 (push) Has been cancelled
ctest / Test C++ ubuntu-latest (push) Has been cancelled
ctest / Test C++ windows-latest (push) Has been cancelled
Analyze modified files / mypy (push) Has been cancelled
Build and Publish Docker Images / Push Docker image to Docker Hub (push) Successful in 5m4s
Native Code Static Analysis / scan-build (push) Failing after 5m2s
type check / pyright (push) Successful in 1m7s
unittests / Test Python 3.11.2 ubuntu-latest (push) Failing after 16m23s
unittests / Test Python 3.12 ubuntu-latest (push) Failing after 28m19s
unittests / Test Python 3.13 ubuntu-latest (push) Failing after 14m49s
unittests / Test hosting with 3.13 on ubuntu-latest (push) Successful in 5m0s
unittests / Test Python 3.13 macos-latest (push) Has been cancelled
unittests / Test Python 3.11 windows-latest (push) Has been cancelled
unittests / Test Python 3.13 windows-latest (push) Has been cancelled
add schedule I, sonic 1/frontiers/heroes, spirit island
2026-04-02 23:46:36 -07:00

105 lines
5.1 KiB
Python

from BaseClasses import Region
from worlds.clair_obscur.Data import data
from worlds.generic.Rules import add_rule
def set_rules(world):
player = world.player
mw = world.multiworld
goal = world.options.goal
goal_reg = ""
match goal:
case 0:
goal_reg = "The Monolith"
case 1:
goal_reg = "Lumiere"
case 2:
goal_reg = "Endless Tower Stage 11"
case 3:
goal_reg = "Renoir's Drafts"
case 4:
goal_reg = "Flying Manor"
mw.completion_condition[player] = (
lambda state: state.can_reach_region(goal_reg, player)
)
#Major map connections- the playthrough will always go through these.
major_connection_1 = mw.get_entrance("WM: First Continent South -> WM: South Sea", player)
major_connection_2 = mw.get_entrance("WM: South Sea -> WM: North Sea", player)
major_connections_3 = [mw.get_entrance("WM: North Sea -> The Monolith", player),
mw.get_entrance("WM: North Sea -> WM: Sky", player)]
#broad transition reqs: FCS -> SS, SS -> NS
# % of area tickets based on settings, character reqs
# area tickets need to be in distinct groups for major areas in each section of the game; giving the player
# Flying Manor won't ensure they have the level range to do Visages for instance
if world.options.area_logic > 0:
add_rule(major_connection_1, lambda state: state.has_from_list([
"Area - Flying Waters",
"Area - Ancient Sanctuary",
"Area - Yellow Harvest",
"Area - Stone Wave Cliffs"
], player, 4 / world.options.area_logic))
add_rule(major_connection_2, lambda state: state.has_from_list([
"Area - Forgotten Battlefield",
"Area - Old Lumiere"
], player, 2 / world.options.area_logic))
for conn in major_connections_3:
add_rule(conn, lambda state: state.has_from_list([
"Area - Visages",
"Area - Sirene"
], player, 2 / world.options.area_logic))
if world.options.char_shuffle:
add_rule(major_connection_1, lambda state: state.has_group("Character", player, 3))
add_rule(major_connection_2, lambda state: state.has_group("Character", player, 4))
if not world.options.gestral_shuffle:
#2 gestrals in First Continent North
add_rule(mw.get_location("Lost Gestral reward 1", player),
lambda state: state.has_any_count({"Progressive Rock": 2, "Area - Flying Waters": 1}, player))
add_rule(mw.get_location("Lost Gestral reward 1", player),
lambda state: state.has_any_count({"Progressive Rock": 2, "Area - Flying Waters": 1}, player))
add_rule(mw.get_location("Lost Gestral reward 2", player),
lambda state: state.has_any_count({"Progressive Rock": 2, "Area - Flying Waters": 1}, player))
#1 gestral in South Sea
add_rule(mw.get_location("Lost Gestral reward 3", player),
lambda state: state.has("Progressive Rock", player, 2))
#1 in Second Continent South
add_rule(mw.get_location("Lost Gestral reward 4", player),
lambda state: (state.has("Progressive Rock", player, 3) or
state.has_all_counts({"Progressive Rock": 2, "Area - Forgotten Battlefield": 1},
player)))
#2 in North Sea
add_rule(mw.get_location("Lost Gestral reward 5", player),
lambda state: state.has("Progressive Rock", player, 3))
add_rule(mw.get_location("Lost Gestral reward 6", player),
lambda state: state.has("Progressive Rock", player, 3))
#3 in Sky
add_rule(mw.get_location("Lost Gestral reward 7", player),
lambda state: state.has("Progressive Rock", player, 4))
add_rule(mw.get_location("Lost Gestral reward 8", player),
lambda state: state.has("Progressive Rock", player, 4))
add_rule(mw.get_location("Lost Gestral reward 9", player),
lambda state: state.has("Progressive Rock", player, 4))
#Character specific access rules- can't be added to conditions due to shuffle char option
if world.options.char_shuffle:
add_rule(mw.get_location("Sacred River: Golgra", player),
lambda state: state.has("Monoco", player))
add_rule(mw.get_entrance("WM: Sky -> The Reacher", player),
lambda state: state.has("Maelle", player))
add_rule(mw.get_entrance("WM: Sky -> Sirene's Dress", player),
lambda state: state.has("Sciel", player))
add_rule(mw.get_entrance("WM: Sky -> The Chosen Path", player),
lambda state: state.has_all(["Lune", "Sciel", "Monoco", "Maelle", "Verso"], player))
else:
add_rule(mw.get_entrance("WM: Sky -> The Chosen Path", player),
lambda state: state.has_all(["Area - Flying Waters", "Area - Gestral Village",
"Area - Stone Wave Cliffs", "Area - Monoco's Station"], player))