Merged in DR v0.5.1.2
This commit is contained in:
27
Fill.py
27
Fill.py
@@ -245,7 +245,11 @@ def valid_key_placement(item, location, itempool, world):
|
||||
return True
|
||||
key_logic = world.key_logic[item.player][dungeon.name]
|
||||
unplaced_keys = len([x for x in itempool if x.name == key_logic.small_key_name and x.player == item.player])
|
||||
return key_logic.check_placement(unplaced_keys, location if item.bigkey else None)
|
||||
prize_loc = None
|
||||
if key_logic.prize_location:
|
||||
prize_loc = world.get_location(key_logic.prize_location, location.player)
|
||||
cr_count = world.crystals_needed_for_gt[location.player]
|
||||
return key_logic.check_placement(unplaced_keys, location if item.bigkey else None, prize_loc, cr_count)
|
||||
else:
|
||||
inside_dungeon_item = ((item.smallkey and not world.keyshuffle[item.player])
|
||||
or (item.bigkey and not world.bigkeyshuffle[item.player]))
|
||||
@@ -644,7 +648,7 @@ def balance_money_progression(world):
|
||||
base_value = sum(rupee_rooms.values())
|
||||
available_money = {player: base_value for player in range(1, world.players+1)}
|
||||
for loc in world.get_locations():
|
||||
if loc.item.name in rupee_chart:
|
||||
if loc.item and loc.item.name in rupee_chart:
|
||||
available_money[loc.item.player] += rupee_chart[loc.item.name]
|
||||
|
||||
total_price = {player: 0 for player in range(1, world.players+1)}
|
||||
@@ -709,7 +713,7 @@ def balance_money_progression(world):
|
||||
slot = shop_to_location_table[location.parent_region.name].index(location.name)
|
||||
shop = location.parent_region.shop
|
||||
shop_item = shop.inventory[slot]
|
||||
if interesting_item(location, location.item, world, location.item.player):
|
||||
if location.item and interesting_item(location, location.item, world, location.item.player):
|
||||
if location.item.name.startswith('Rupee') and loc_player == location.item.player:
|
||||
if shop_item['price'] < rupee_chart[location.item.name]:
|
||||
wallet[loc_player] -= shop_item['price'] # will get picked up in the location_free block
|
||||
@@ -729,14 +733,15 @@ def balance_money_progression(world):
|
||||
if location_free and location.item:
|
||||
state.collect(location.item, True, location)
|
||||
unchecked_locations.remove(location)
|
||||
if location.item.name.startswith('Rupee'):
|
||||
wallet[location.item.player] += rupee_chart[location.item.name]
|
||||
if location.item.name != 'Rupees (300)':
|
||||
if location.item:
|
||||
if location.item.name.startswith('Rupee'):
|
||||
wallet[location.item.player] += rupee_chart[location.item.name]
|
||||
if location.item.name != 'Rupees (300)':
|
||||
balance_locations[location.item.player].add(location)
|
||||
if interesting_item(location, location.item, world, location.item.player):
|
||||
checked_locations.append(location)
|
||||
elif location.item.name in acceptable_balancers:
|
||||
balance_locations[location.item.player].add(location)
|
||||
if interesting_item(location, location.item, world, location.item.player):
|
||||
checked_locations.append(location)
|
||||
elif location.item.name in acceptable_balancers:
|
||||
balance_locations[location.item.player].add(location)
|
||||
for room, income in rupee_rooms.items():
|
||||
for player in range(1, world.players+1):
|
||||
if room not in rooms_visited[player] and world.get_region(room, player) in state.reachable_regions[player]:
|
||||
@@ -801,7 +806,7 @@ def balance_money_progression(world):
|
||||
else:
|
||||
state.collect(location.item, True, location)
|
||||
unchecked_locations.remove(location)
|
||||
if location.item.name.startswith('Rupee'):
|
||||
if location.item and location.item.name.startswith('Rupee'):
|
||||
wallet[location.item.player] += rupee_chart[location.item.name]
|
||||
|
||||
def set_prize_drops(world, player):
|
||||
|
||||
Reference in New Issue
Block a user