Skip to content

Commit

Permalink
Item Location mismatch + Check options against rules
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbrq committed Sep 17, 2024
1 parent 22dcf8a commit 0c21fa5
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 56 deletions.
4 changes: 2 additions & 2 deletions worlds/mlss/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1176,15 +1176,15 @@ class MLSSLocation(Location):
+ fungitownBeanstar
+ fungitownBirdo
+ bowsers
+ bowsersMini
+ jokesEntrance
+ jokesMain
+ postJokes
+ theater
+ oasis
+ gwarharMain
+ bowsersMini
+ baseUltraRocks
+ coins
)

location_table: typing.Dict[str, int] = {locData.name: locData.id for locData in all_locations}
location_table: typing.Dict[str, int] = {location.name: location.id for location in all_locations}
96 changes: 49 additions & 47 deletions worlds/mlss/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,58 @@ def set_rules(world: "MLSSWorld", excluded):
)

if world.options.randomize_bosses.value != 0:
if world.options.chuckle_beans != 0:
add_rule(
world.get_location(LocationName.HoohooMountainHoohoorosRoomDigspot1),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainPastHoohoorosDigspot),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainPastHoohoorosConnectorRoomDigspot1),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainBelowSummitDigspot),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainSummitDigspot),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
if world.options.chuckle_beans == 2:
add_rule(
world.get_location(LocationName.HoohooMountainHoohoorosRoomDigspot2),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainPastHoohoorosConnectorRoomDigspot2),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainHoohoorosRoomDigspot1),
world.get_location(LocationName.HoohooVillageHammers),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainHoohoorosRoomDigspot2),
world.get_location(LocationName.HoohooMountainPeasleysRose),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
Expand All @@ -483,42 +527,6 @@ def set_rules(world: "MLSSWorld", excluded):
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainPastHoohoorosDigspot),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainPastHoohoorosBlock1),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainPastHoohoorosBlock2),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainPastHoohoorosConnectorRoomBlock),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainPastHoohoorosConnectorRoomDigspot1),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainPastHoohoorosConnectorRoomDigspot2),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainBelowSummitBlock1),
lambda state: StateLogic.hammers(state, world.player)
Expand All @@ -538,25 +546,19 @@ def set_rules(world: "MLSSWorld", excluded):
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainBelowSummitDigspot),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainSummitDigspot),
world.get_location(LocationName.HoohooMountainPastHoohoorosBlock1),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooVillageHammers),
world.get_location(LocationName.HoohooMountainPastHoohoorosBlock2),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
)
add_rule(
world.get_location(LocationName.HoohooMountainPeasleysRose),
world.get_location(LocationName.HoohooMountainPastHoohoorosConnectorRoomBlock),
lambda state: StateLogic.hammers(state, world.player)
or StateLogic.fire(state, world.player)
or StateLogic.thunder(state, world.player),
Expand Down
18 changes: 11 additions & 7 deletions worlds/mlss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,24 @@ class MLSSWorld(World):

def generate_early(self) -> None:
self.disabled_locations = []
if self.options.chuckle_beans == 0:
self.disabled_locations += [location.name for location in all_locations if "Digspot" in location.name]
if self.options.castle_skip:
self.disabled_locations += [location.name for location in all_locations if "Bowser" in location.name]
if self.options.chuckle_beans == 1:
self.disabled_locations = [location.name for location in all_locations if location.id in hidden]
if self.options.skip_minecart:
self.disabled_locations += [LocationName.HoohooMountainBaseMinecartCaveDigspot]
if self.options.disable_surf:
self.disabled_locations += [LocationName.SurfMinigame]
if self.options.disable_harhalls_pants:
self.disabled_locations += [LocationName.HarhallsPants]
if self.options.chuckle_beans == 0:
self.disabled_locations += [location.name for location in all_locations if "Digspot" in location.name
and location.name not in self.disabled_locations]
if self.options.chuckle_beans == 1:
self.disabled_locations = [location.name for location in all_locations if location.id in hidden
and location.name not in self.disabled_locations]
if self.options.castle_skip:
self.disabled_locations += [location.name for location in bowsers + bowsersMini
if location.name not in self.disabled_locations]
if not self.options.coins:
self.disabled_locations += [location.name for location in all_locations if location in coins]
self.disabled_locations += [location.name for location in coins
if location.name not in self.disabled_locations]

def create_regions(self) -> None:
create_regions(self, self.disabled_locations)
Expand Down

0 comments on commit 0c21fa5

Please sign in to comment.