remove special rules for pinball room

This commit is contained in:
Fabian Dill 2020-07-09 16:16:31 +02:00
parent baa1f1d2ba
commit 57fe16ab60
5 changed files with 6 additions and 25 deletions

View File

@ -952,11 +952,11 @@ class Location(object):
self.item_rule = lambda item: True
self.player = player
def can_fill(self, state, item, check_access=True) -> bool:
def can_fill(self, state: CollectionState, item: Item, check_access=True) -> bool:
return self.always_allow(state, item) or (self.parent_region.can_fill(item) and self.item_rule(item) and (
not check_access or self.can_reach(state)))
def can_reach(self, state) -> bool:
def can_reach(self, state: CollectionState) -> bool:
if self.parent_region.can_reach(state) and self.access_rule(state):
return True
return False

View File

@ -50,15 +50,6 @@ def fill_dungeons(world):
all_state_base = world.get_all_state()
for player in range(1, world.players + 1):
if not world.retro[player] and world.logic == "noglitches" and not world.keyshuffle[player]:
skull_woods = world.get_dungeon('Skull Woods', player)
skull_woods.small_keys.pop()
pinball_room = world.get_location('Skull Woods - Pinball Room', player)
world.push_item(pinball_room, ItemFactory('Small Key (Skull Woods)', player), False)
pinball_room.event = True
pinball_room.locked = True
dungeons = [(list(dungeon.regions), dungeon.big_key, list(dungeon.small_keys), list(dungeon.dungeon_items)) for dungeon in world.dungeons]
loopcnt = 0
@ -129,16 +120,6 @@ def get_dungeon_item_pool(world):
def fill_dungeons_restrictive(world, shuffled_locations):
all_state_base = world.get_all_state()
for player in range(1, world.players + 1):
if not world.retro[player] and world.logic == "noglitches" and not world.keyshuffle[player]:
skull_woods = world.get_dungeon('Skull Woods', player)
skull_woods.small_keys.pop()
pinball_room = world.get_location('Skull Woods - Pinball Room', player)
world.push_item(pinball_room, ItemFactory('Small Key (Skull Woods)', player), False)
pinball_room.event = True
pinball_room.locked = True
shuffled_locations.remove(pinball_room)
# with shuffled dungeon items they are distributed as part of the normal item pool
for item in world.get_items():
if (item.smallkey and world.keyshuffle[item.player]) or (item.bigkey and world.bigkeyshuffle[item.player]):

View File

@ -281,14 +281,14 @@ def distribute_items_restrictive(world, gftower_trash=False, fill_locations=None
if any(
localprioitempool.values() or localrestitempool.values()): # we need to make sure some fills are limited to certain worlds
for player, items in localprioitempool.items(): # already shuffled
for player, items in localprioitempool.items(): # items already shuffled
local_locations = [location for location in fill_locations if location.player == player]
random.shuffle(local_locations)
for item_to_place in items:
spot_to_fill = local_locations.pop()
world.push_item(spot_to_fill, item_to_place, False)
fill_locations.remove(spot_to_fill)
for player, items in localrestitempool.items(): # already shuffled
for player, items in localrestitempool.items(): # items already shuffled
local_locations = [location for location in fill_locations if location.player == player]
random.shuffle(local_locations)
for item_to_place in items:

View File

@ -149,7 +149,7 @@ boss_shuffle:
random: 0 # Any boss can appear any amount of times
enemy_shuffle:
none: 1 # Vanilla enemy placement
shuffled: 0 # Enemies are randomized
chaos: 0 # Enemies are randomized
random: 0 # also shuffle bush enemies, random tile rooms and random bush enemy spawn chance
chaosthieves: 0 # random + thieves may not be killable
enemy_damage:

View File

@ -69,7 +69,7 @@ for script, scriptname in scripts.items():
import datetime
buildtime = datetime.datetime.now()
buildtime = datetime.datetime.utcnow()
cx_Freeze.setup(
name="BerserkerMultiWorld",