Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
GodlFire committed Jan 1, 2024
1 parent 629028b commit bb08c3f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
23 changes: 1 addition & 22 deletions worlds/shivers/Options.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
from Options import Choice, DefaultOnToggle, Toggle, PerGameCommonOptions, Range
from Options import Choice, DefaultOnToggle, Toggle, PerGameCommonOptions
from dataclasses import dataclass


class IxupiCapturesNeeded(Range):
"""
Number of Ixupi Captures needed for goal condition.
"""
display_name = "Number of Ixupi Captures Needed"
range_start = 1
range_end = 10
default = 10

class LobbyAccess(Choice):
"""Chooses how keys needed to reach the lobby are placed.
- Normal: Keys are placed anywhere
Expand Down Expand Up @@ -47,25 +38,13 @@ class EarlyLightning(Toggle):
"""Allows lightning to be captured at any point in the game. You will still need to capture all ten Ixupi for victory."""
display_name = "Early Lightning"

class LocationPotPieces(Choice):
"""Chooses where pot pieces will be located within the multiworld.
- Own World: Pot pieces will be located within your own world
- Different World: Pot pieces will be located in another world
- Any World: Pot pieces will be located in any world"""
display_name = "Location of Pot Pieces"
option_own_world = 0
option_different_world = 1
option_any_world = 2


@dataclass
class ShiversOptions(PerGameCommonOptions):
ixupi_captures_needed: IxupiCapturesNeeded
lobby_access: LobbyAccess
puzzle_hints_required: PuzzleHintsRequired
include_information_plaques: InformationPlaques
front_door_usable: FrontDoorUsable
elevators_stay_solved: ElevatorsStaySolved
early_beth: EarlyBeth
early_lightning: EarlyLightning
location_pot_pieces: LocationPotPieces
8 changes: 2 additions & 6 deletions worlds/shivers/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get_rules_lookup(player: int):
"Puzzle Solved Underground Elevator": lambda state: ((state.can_reach("Underground Lake", "Region", player) or state.can_reach("Office", "Region", player)
and state.has("Key for Office Elevator", player))),
"Puzzle Solved Bedroom Elevator": lambda state: (state.can_reach("Office", "Region", player) and state.has_all({"Key for Bedroom Elevator","Crawling"}, player)),
"Puzzle Solved Three Floor Elevator": lambda state: (((state.can_reach("Maintenance Tunnels", "Region", player) or state.can_reach("Blue Maze", "Region", player))
"Puzzle Solved Three Floor Elevator": lambda state: ((state.can_reach("Maintenance Tunnels", "Region", player) or state.can_reach("Blue Maze", "Region", player)
and state.has("Key for Three Floor Elevator", player)))
},
"lightning": {
Expand Down Expand Up @@ -221,11 +221,7 @@ def set_rules(world: "ShiversWorld") -> None:
forbid_item(multiworld.get_location("Ixupi Captured Metal", player), "Metal Always Available in Prehistoric", player)

# Set completion condition
multiworld.completion_condition[player] = lambda state: ((
water_capturable(state, player) + wax_capturable(state, player) + ash_capturable(state, player) \
+ oil_capturable(state, player) + cloth_capturable(state, player) + wood_capturable(state, player) \
+ crystal_capturable(state, player) + sand_capturable(state, player) + metal_capturable(state, player) \
+ lightning_capturable(state, player)) >= world.options.ixupi_captures_needed.value)
multiworld.completion_condition[player] = lambda state: (first_nine_ixupi_capturable(state, player) and lightning_capturable(state, player))



Expand Down
7 changes: 0 additions & 7 deletions worlds/shivers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ def create_items(self) -> None:
elif lobby_access_keys == 2:
self.multiworld.local_early_items[self.player]["Key for Front Door"] = 1

#Pot piece shuffle location:
if self.options.location_pot_pieces == 0:
self.multiworld.local_items[self.player].value.update({name for name, data in item_table.items() if data.type == "pot"})
if self.options.location_pot_pieces == 1:
self.multiworld.non_local_items[self.player].value.update({name for name, data in item_table.items() if data.type == "pot"})

def pre_fill(self) -> None:
# Prefills event storage locations with duplicate pots
storagelocs = []
Expand Down Expand Up @@ -174,7 +168,6 @@ def fill_slot_data(self) -> dict:
return {
"storageplacements": self.storage_placements,
"excludedlocations": {str(excluded_location).replace('ExcludeLocations(', '').replace(')', '') for excluded_location in self.multiworld.exclude_locations.values()},
"ixupicapturesneeded": {self.options.ixupi_captures_needed.value},
"elevatorsstaysolved": {self.options.elevators_stay_solved.value},
"earlybeth": {self.options.early_beth.value},
"earlylightning": {self.options.early_lightning.value},
Expand Down

0 comments on commit bb08c3f

Please sign in to comment.