Easy mode lamp update

You can find all 3 lamps before dark rooms for easy mode.
This commit is contained in:
Kevin Cathcart 2018-02-24 16:16:50 -05:00
parent eb8cff4d5a
commit 5989718586
4 changed files with 21 additions and 10 deletions

View File

@ -61,6 +61,7 @@ class World(object):
self.difficulty_requirements = None
self.fix_fake_world = True
self.spoiler = Spoiler(self)
self.lamps_needed_for_dark_rooms = 1
def intialize_regions(self):
for region in self.regions:

View File

@ -40,7 +40,7 @@ hardbaseitems = (['Silver Arrows', 'Single Arrow', 'Single Bomb'] + ['Rupees (30
['Boss Heart Container'] * 5 + ['Piece of Heart'] * 24)
hardfirst20extra = ['Single Bomb'] * 7 + ['Rupees (5)'] * 8 + ['Rupee (1)'] * 2 + ['Rupees (20)'] * 2 + ['Arrows (10)']
hardsecond10extra = ['Rupees (5)'] * 7 + ['Rupee (1)'] * 3
hardthird10extra = ['Arrows (10)'] * 4 + ['Rupees (20)'] * 3 + ['Single Bomb'] * 3
hardthird10extra = ['Arrows (10)'] * 4 + ['Rupees (20)'] * 3 + ['Single Bomb'] * 3
hardfourth10extra = ['Rupees (5)'] * 3 + ['Single Arrow'] * 5 + ['Single Bomb'] * 2
hardfinal20extra = ['Single Bomb'] * 4 + ['Rupees (5)'] * 2 + ['Single Arrow'] * 14
@ -217,14 +217,15 @@ def generate_itempool(world):
# set up item pool
if world.custom:
(pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon) = make_custom_item_pool(world.progressive, world.shuffle, world.difficulty, world.timer, world.goal, world.mode, world.customitemarray)
(pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms) = make_custom_item_pool(world.progressive, world.shuffle, world.difficulty, world.timer, world.goal, world.mode, world.customitemarray)
world.rupoor_cost = min(world.customitemarray[67], 9999)
else:
(pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon) = get_pool_core(world.progressive, world.shuffle, world.difficulty, world.timer, world.goal, world.mode)
(pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms) = get_pool_core(world.progressive, world.shuffle, world.difficulty, world.timer, world.goal, world.mode)
world.itempool = ItemFactory(pool)
for (location, item) in placed_items:
world.push_item(location, ItemFactory(item), False)
world.get_location(location).event = True
world.lamps_needed_for_dark_rooms = lamps_needed_for_dark_rooms
if clock_mode is not None:
world.clock_mode = clock_mode
if treasure_hunt_count is not None:
@ -299,6 +300,10 @@ def get_pool_core(progressive, shuffle, difficulty, timer, goal, mode):
else:
pool.extend(basicgloves)
lamps_needed_for_dark_rooms = 1
if difficulty == 'easy':
lamps_needed_for_dark_rooms = 3
# insanity shuffle doesn't have fake LW/DW logic so for now guaranteed Mirror and Moon Pearl at the start
if shuffle == 'insanity_legacy':
placed_items.append(('Link\'s House', 'Magic Mirror'))
@ -377,7 +382,7 @@ def get_pool_core(progressive, shuffle, difficulty, timer, goal, mode):
if goal == 'pedestal':
placed_items.append(('Master Sword Pedestal', 'Triforce'))
return (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon)
return (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms)
def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, customitemarray):
pool = []
@ -461,6 +466,10 @@ def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, c
diff = difficulties[difficulty]
lamps_needed_for_dark_rooms = 1
if difficulty == 'easy':
lamps_needed_for_dark_rooms = customitemarray[12]
# expert+ difficulties produce the same contents for
# all bottles, since only one bottle is available
if diff.same_bottle:
@ -515,7 +524,7 @@ def make_custom_item_pool(progressive, shuffle, difficulty, timer, goal, mode, c
if itemtotal < total_items_to_place:
pool.extend(['Nothing'] * (total_items_to_place - itemtotal))
return (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon)
return (pool, placed_items, clock_mode, treasure_hunt_count, treasure_hunt_icon, lamps_needed_for_dark_rooms)
# A quick test to ensure all combinations generate the correct amount of items.
def test():

View File

@ -146,7 +146,8 @@ def copy_world(world):
ret.can_access_trock_eyebridge = world.can_access_trock_eyebridge
ret.can_take_damage = world.can_take_damage
ret.difficulty_requirements = world.difficulty_requirements
ret.fix_fake_world = ret.fix_fake_world
ret.fix_fake_world = world.fix_fake_world
ret.lamps_needed_for_dark_rooms = world.lamps_needed_for_dark_rooms
create_regions(ret)
create_dungeons(ret)

View File

@ -53,7 +53,7 @@ def add_rule(spot, rule, combine='and'):
def add_lamp_requirement(spot):
add_rule(spot, lambda state: state.has('Lamp'))
add_rule(spot, lambda state: state.has('Lamp', state.world.lamps_needed_for_dark_rooms))
def forbid_item(location, item):
@ -437,9 +437,9 @@ def no_glitches_rules(world):
add_conditional_lamp('Eastern Palace - Prize', 'Eastern Palace', 'Location')
if not world.sewer_light_cone:
add_rule(world.get_location('Sewers - Dark Cross'), lambda state: state.has('Lamp'))
add_rule(world.get_entrance('Sewers Back Door'), lambda state: state.has('Lamp'))
add_rule(world.get_entrance('Throne Room'), lambda state: state.has('Lamp'))
add_lamp_requirement(world.get_location('Sewers - Dark Cross'))
add_lamp_requirement(world.get_entrance('Sewers Back Door'))
add_lamp_requirement(world.get_entrance('Throne Room'))
def open_rules(world):