remove lamps_needed_for_dark_rooms variable

This commit is contained in:
Fabian Dill 2020-08-01 06:26:30 +02:00
parent 86025745ac
commit 615192f65b
4 changed files with 7 additions and 14 deletions

View File

@ -75,7 +75,6 @@ class World(object):
self.dynamic_regions = []
self.dynamic_locations = []
self.spoiler = Spoiler(self)
self.lamps_needed_for_dark_rooms = 1
for player in range(1, players + 1):
def set_player_attr(attr, val):

View File

@ -219,12 +219,12 @@ def generate_itempool(world, player):
# set up item pool
if world.custom:
(pool, placed_items, precollected_items, clock_mode, treasure_hunt_count, treasure_hunt_icon,
lamps_needed_for_dark_rooms) = make_custom_item_pool(world, player)
(pool, placed_items, precollected_items, clock_mode, treasure_hunt_count,
treasure_hunt_icon) = make_custom_item_pool(world, player)
world.rupoor_cost = min(world.customitemarray[69], 9999)
else:
(pool, placed_items, precollected_items, clock_mode, treasure_hunt_count, treasure_hunt_icon,
lamps_needed_for_dark_rooms) = get_pool_core(world, player)
(pool, placed_items, precollected_items, clock_mode, treasure_hunt_count, treasure_hunt_icon) = get_pool_core(
world, player)
for item in precollected_items:
world.push_precollected(ItemFactory(item, player))
@ -258,8 +258,6 @@ def generate_itempool(world, player):
items = ItemFactory(pool, player)
world.lamps_needed_for_dark_rooms = lamps_needed_for_dark_rooms
if clock_mode is not None:
world.clock_mode[player] = clock_mode
@ -474,8 +472,6 @@ def get_pool_core(world, player: int):
else:
pool.extend(basicgloves)
lamps_needed_for_dark_rooms = 1
# insanity shuffle doesn't have fake LW/DW logic so for now guaranteed Mirror and Moon Pearl at the start
if shuffle == 'insanity_legacy':
place_item('Link\'s House', 'Magic Mirror')
@ -580,7 +576,7 @@ def get_pool_core(world, player: int):
place_item(key_location, 'Small Key (Universal)')
else:
pool.extend(['Small Key (Universal)'])
return (pool, placed_items, precollected_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms)
return (pool, placed_items, precollected_items, clock_mode, treasure_hunt_count, treasure_hunt_icon)
def make_custom_item_pool(world, player):
@ -681,7 +677,6 @@ def make_custom_item_pool(world, player):
diff = difficulties[difficulty]
lamps_needed_for_dark_rooms = 1
# expert+ difficulties produce the same contents for
# all bottles, since only one bottle is available
@ -741,4 +736,4 @@ def make_custom_item_pool(world, player):
if itemtotal < total_items_to_place:
pool.extend(['Nothing'] * (total_items_to_place - itemtotal))
return (pool, placed_items, precollected_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms)
return (pool, placed_items, precollected_items, clock_mode, treasure_hunt_count, treasure_hunt_icon)

View File

@ -332,7 +332,6 @@ def copy_world(world):
ret.can_take_damage = world.can_take_damage
ret.difficulty_requirements = world.difficulty_requirements.copy()
ret.fix_fake_world = world.fix_fake_world.copy()
ret.lamps_needed_for_dark_rooms = world.lamps_needed_for_dark_rooms
ret.mapshuffle = world.mapshuffle.copy()
ret.compassshuffle = world.compassshuffle.copy()
ret.keyshuffle = world.keyshuffle.copy()

View File

@ -120,7 +120,7 @@ def add_rule(spot, rule, combine='and'):
def add_lamp_requirement(spot, player):
add_rule(spot, lambda state: state.has('Lamp', player, state.world.lamps_needed_for_dark_rooms))
add_rule(spot, lambda state: state.has('Lamp', player))
def forbid_item(location, item, player: int):