Skip to content

Commit

Permalink
Add missing locations and cleanup indirect conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
korydondzila committed Oct 1, 2024
1 parent 8cdecd1 commit 878e3e0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 30 deletions.
36 changes: 17 additions & 19 deletions worlds/shivers/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ def get_rules_lookup(world: "ShiversWorld", player: int):
"To Janitor Closet": lambda state: state.has("Key for Janitor Closet", player),
"To Shaman From Burial": lambda state: state.has("Key for Shaman Room", player),
"To Burial From Shaman": lambda state: state.has("Key for Shaman Room", player),
"To Norse Stone From Gods Room": lambda state: state.has("Aligned Planets", player),
"To Inventions From UFO": lambda state: state.has("Key for UFO Room", player),
"To UFO From Inventions": lambda state: state.has("Key for UFO Room", player),
"To Orrery From UFO": lambda state: state.has("Viewed Fortune", player),
"To Torture From Inventions": lambda state: state.has("Key for Torture Room", player),
"To Inventions From Torture": lambda state: state.has("Key for Torture Room", player),
"To Torture": lambda state: state.has("Key for Puzzle Room", player),
Expand Down Expand Up @@ -162,14 +164,10 @@ def get_rules_lookup(world: "ShiversWorld", player: int):
"Ixupi Captured Crystal": lambda state: crystal_capturable(state, player),
"Ixupi Captured Sand": lambda state: sand_capturable(state, player),
"Ixupi Captured Metal": lambda state: metal_capturable(state, player),
"Final Riddle: Planets Aligned": lambda state: state.can_reach_region("Fortune Teller", player),
"Final Riddle: Norse God Stone Message": lambda state: state.can_reach_region("Fortune Teller", player) and state.can_reach_region("UFO", player),
"Puzzle Solved Skull Dial Door": lambda state: all_skull_dials_set(state, player),
"Jukebox": lambda state: state.can_reach_region("Clock Tower", player),
},
"puzzle_hints_required": {
"Puzzle Solved Clock Tower Door": lambda state: state.can_reach_region("Three Floor Elevator", player),
"Jukebox": lambda state: state.can_reach_region("Anansi", player),
"Puzzle Solved Shaman Drums": lambda state: state.can_reach_region("Clock Tower", player),
"Puzzle Solved Red Door": lambda state: state.can_reach_region("Maintenance Tunnels", player),
"Puzzle Solved UFO Symbols": lambda state: state.can_reach_region("Library", player),
Expand Down Expand Up @@ -212,10 +210,7 @@ def set_rules(world: "ShiversWorld") -> None:
multiworld.get_region("Beth's Body", player),
"To Beth's Body From Generator",
lambda state: beths_body_available(state, world, player) and (
(state.can_reach_region("Fortune Teller", player) and
state.can_reach_region("UFO", player) and
state.can_reach_region("Gods Room", player) and
state.can_reach_region("Theater", player))
(state.has("Viewed Norse Stone", player) and state.can_reach_region("Theater", player))
if world.options.puzzle_hints_required.value else True
)
)
Expand All @@ -233,6 +228,13 @@ def set_rules(world: "ShiversWorld") -> None:
for location_name, rule in rules_lookup["locations_required"].items():
multiworld.get_location(location_name, player).access_rule = rule

multiworld.get_location("Jukebox", player).access_rule = lambda state: (
state.can_reach_region("Clock Tower", player) and (
state.can_reach_region("Anansi", player)
if world.options.puzzle_hints_required.value else True
)
)

# Set option location rules
if world.options.puzzle_hints_required.value:
for location_name, rule in rules_lookup["puzzle_hints_required"].items():
Expand All @@ -248,10 +250,12 @@ def set_rules(world: "ShiversWorld") -> None:
world.get_entrance("To Clock Tower Staircase From Theater Back Hallway")
)

multiworld.get_entrance("To Gods Room", player).access_rule = lambda state: state.can_reach_region(
multiworld.get_entrance("To Gods Room From Shaman", player).access_rule = lambda state: state.can_reach_region(
"Clock Tower", player
)
multiworld.register_indirect_condition(world.get_region("Clock Tower"), world.get_entrance("To Gods Room"))
multiworld.register_indirect_condition(
world.get_region("Clock Tower"), world.get_entrance("To Gods Room From Shaman")
)

multiworld.get_entrance("To Anansi From Gods Room", player).access_rule = lambda state: state.can_reach_region(
"Maintenance Tunnels", player
Expand All @@ -267,12 +271,12 @@ def set_rules(world: "ShiversWorld") -> None:
)

multiworld.register_indirect_condition(
world.get_region("Underground Lake"), world.get_entrance("To Guillotine From Torture")
world.get_region("Bedroom"), world.get_entrance("To Clock Chains From Clock Tower Staircase")
)

multiworld.register_indirect_condition(
world.get_region("Bedroom"), world.get_entrance("To Clock Chains From Clock Tower Staircase")
world.get_region("Theater"), world.get_entrance("To Beth's Body From Generator")
)

if world.options.elevators_stay_solved.value:
for location_name, rule in rules_lookup["elevators"].items():
multiworld.get_location(location_name, player).access_rule = rule
Expand All @@ -281,12 +285,6 @@ def set_rules(world: "ShiversWorld") -> None:
multiworld.get_location(location_name, player).access_rule = rule

# Register indirect conditions
multiworld.register_indirect_condition(world.get_region("Burial"), world.get_entrance("To Slide Room"))
multiworld.register_indirect_condition(world.get_region("Egypt"), world.get_entrance("To Slide Room"))
multiworld.register_indirect_condition(world.get_region("Gods Room"), world.get_entrance("To Slide Room"))
multiworld.register_indirect_condition(world.get_region("Prehistoric"), world.get_entrance("To Slide Room"))
multiworld.register_indirect_condition(world.get_region("Tar River"), world.get_entrance("To Slide Room"))
multiworld.register_indirect_condition(world.get_region("Werewolf"), world.get_entrance("To Slide Room"))
multiworld.register_indirect_condition(world.get_region("Prehistoric"), world.get_entrance("To Tar River From Lobby"))

# forbid cloth in janitor closet and oil in tar river
Expand Down
3 changes: 3 additions & 0 deletions worlds/shivers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ def create_regions(self) -> None:
self.create_event_location("Projector Room", "Viewed Theater Movie")
self.create_event_location("Clock Chains", "Clock Chains", "Set Time")
self.create_event_location("Clock Tower", "Jukebox", "Set Song")
self.create_event_location("Fortune Teller", "Viewed Fortune")
self.create_event_location("Orrery", "Orrery", "Aligned Planets")
self.create_event_location("Norse Stone", "Norse Stone", "Viewed Norse Stone")
self.create_event_location("Beth's Body", "Beth's Body", "Viewed Page 17")
self.create_event_location("Windlenot's Body", "Windlenot's Body", "Viewed Egyptian Hieroglyphics Explained")
self.create_event_location("Guillotine", "Guillotine", "Lost Your Head")
Expand Down
18 changes: 13 additions & 5 deletions worlds/shivers/data/locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"Final Riddle: Norse God Stone Message",
"Final Riddle: Beth's Body Page 17",
"Final Riddle: Guillotine Dropped",
"Puzzle Hint Found: Combo Lock in Mailbox",
"Puzzle Hint Found: Mailbox",
"Puzzle Hint Found: Orange Symbol",
"Puzzle Hint Found: Silver Symbol",
"Puzzle Hint Found: Green Symbol",
Expand Down Expand Up @@ -114,15 +114,18 @@
"Puzzle Solved Bedroom Elevator",
"Puzzle Solved Three Floor Elevator",
"Ixupi Captured Lightning",
"Puzzle Solved Combination Lock",
"Puzzle Hint Found: Beth's Note",
"Mystery Solved"
],
"locations_by_region": {
"Outside": [
"Puzzle Solved Gear Combination",
"Puzzle Solved Gears",
"Puzzle Solved Stone Henge",
"Puzzle Solved Office Elevator",
"Puzzle Solved Three Floor Elevator",
"Puzzle Hint Found: Combo Lock in Mailbox",
"Puzzle Hint Found: Mailbox",
"Puzzle Hint Found: Orange Symbol",
"Puzzle Hint Found: Silver Symbol",
"Puzzle Hint Found: Green Symbol",
Expand Down Expand Up @@ -181,7 +184,8 @@
"Final Riddle: Beth's Body Page 17"
],
"Theater": [
"Storage: Theater"
"Storage: Theater",
"Puzzle Hint Found: Beth's Note"
],
"Theater Back Hallway": [
"Puzzle Solved Clock Tower Door"
Expand Down Expand Up @@ -256,7 +260,6 @@
"Puzzle Solved Lyre",
"Puzzle Solved Red Door",
"Storage: Lyre",
"Final Riddle: Norse God Stone Message",
"Information Plaque: (Gods) Fisherman's Canoe God",
"Information Plaque: (Gods) Mayan Gods",
"Information Plaque: (Gods) Thor",
Expand All @@ -265,6 +268,9 @@
"Information Plaque: (Gods) Sumerian Lyre",
"Information Plaque: (Gods) Chuen"
],
"Norse Stone": [
"Final Riddle: Norse God Stone Message"
],
"Blue Maze": [
"Puzzle Solved Fortune Teller Door"
],
Expand All @@ -279,12 +285,14 @@
"UFO": [
"Puzzle Solved UFO Symbols",
"Storage: UFO",
"Final Riddle: Planets Aligned",
"Information Plaque: (UFO) Coincidence or Extraterrestrial Visits?",
"Information Plaque: (UFO) Planets",
"Information Plaque: (UFO) Astronomical Construction",
"Information Plaque: (UFO) Aliens"
],
"Orrery": [
"Final Riddle: Planets Aligned"
],
"Janitor Closet": [
"Storage: Janitor Closet"
],
Expand Down
18 changes: 12 additions & 6 deletions worlds/shivers/data/regions.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@
["Tar River", ["To Maze From Tar River", "To Lobby From Tar River", "To Oil Capture From Tar River"]],
["Egypt", ["To Lobby From Egypt", "To Burial From Egypt", "To Blue Maze From Egypt", "To Cloth Capture From Egypt"]],
["Burial", ["To Egypt From Burial", "To Shaman From Burial", "To Ash Capture From Burial", "To Cloth Capture From Burial"]],
["Shaman", ["To Burial From Shaman", "To Gods Room", "To Wax Capture From Shaman"]],
["Gods Room", ["To Shaman From Gods Room", "To Anansi From Gods Room", "To Wood Capture From Gods Room"]],
["Shaman", ["To Burial From Shaman", "To Gods Room From Shaman", "To Wax Capture From Shaman"]],
["Gods Room", ["To Shaman From Gods Room", "To Anansi From Gods Room", "To Wood Capture From Gods Room", "To Norse Stone From Gods Room"]],
["Norse Stone", ["To Gods Room From Norse Stone"]],
["Anansi", ["To Gods Room From Anansi", "To Pegasus From Anansi", "To Wax Capture From Anansi"]],
["Pegasus", ["To Anansi From Pegasus", "To Werewolf From Pegasus", "To Wood Capture From Pegasus"]],
["Werewolf", ["To Pegasus From Werewolf", "To Night Staircase From Werewolf"]],
["Night Staircase", ["To Werewolf From Night Staircase", "To Janitor Closet", "To UFO"]],
["Night Staircase", ["To Werewolf From Night Staircase", "To Janitor Closet", "To UFO From Night Staircase"]],
["Janitor Closet", ["To Night Staircase From Janitor Closet", "To Water Capture From Janitor Closet", "To Cloth Capture From Janitor Closet"]],
["UFO", ["To Night Staircase From UFO", "To Inventions From UFO"]],
["UFO", ["To Night Staircase From UFO", "To Orrery From UFO", "To Inventions From UFO"]],
["Orrery", ["To UFO From Orrery"]],
["Blue Maze", ["To Egypt From Blue Maze", "To Three Floor Elevator From Blue Maze Bottom", "To Three Floor Elevator From Blue Maze Top", "To Fortune Teller", "To Inventions From Blue Maze", "To Wood Capture From Blue Maze"]],
["Three Floor Elevator", ["To Maintenance Tunnels From Three Floor Elevator", "To Blue Maze From Three Floor Elevator"]],
["Fortune Teller", ["To Blue Maze From Fortune Teller"]],
Expand Down Expand Up @@ -135,8 +137,10 @@
["To Blue Maze From Egypt", "Blue Maze"],
["To Shaman From Burial", "Shaman"],
["To Shaman From Gods Room", "Shaman"],
["To Gods Room", "Gods Room" ],
["To Gods Room From Shaman", "Gods Room" ],
["To Gods Room From Norse Stone", "Gods Room" ],
["To Gods Room From Anansi", "Gods Room"],
["To Norse Stone From Gods Room", "Norse Stone" ],
["To Anansi From Gods Room", "Anansi"],
["To Anansi From Pegasus", "Anansi"],
["To Pegasus From Anansi", "Pegasus"],
Expand All @@ -147,8 +151,10 @@
["To Night Staircase From Janitor Closet", "Night Staircase"],
["To Night Staircase From UFO", "Night Staircase"],
["To Janitor Closet", "Janitor Closet"],
["To UFO", "UFO"],
["To UFO From Night Staircase", "UFO"],
["To UFO From Orrery", "UFO"],
["To UFO From Inventions", "UFO"],
["To Orrery From UFO", "Orrery"],
["To Inventions From UFO", "Inventions"],
["To Inventions From Blue Maze", "Inventions"],
["To Inventions From Torture", "Inventions"],
Expand Down

0 comments on commit 878e3e0

Please sign in to comment.