Individual settings: swords

This commit is contained in:
Bonta-kun
2019-12-16 14:31:47 +01:00
parent ab28858a8f
commit 9ca755d5b2
6 changed files with 21 additions and 23 deletions

View File

@@ -73,7 +73,7 @@ def KholdstareDefeatRule(state, player):
(
state.has('Bombos', player) and
# FIXME: the following only actually works for the vanilla location for swordless
(state.has_sword(player) or state.world.swords == 'swordless')
(state.has_sword(player) or state.world.swords[player] == 'swordless')
)
) and
(
@@ -83,7 +83,7 @@ def KholdstareDefeatRule(state, player):
(
state.has('Fire Rod', player) and
state.has('Bombos', player) and
state.world.swords == 'swordless' and
state.world.swords[player] == 'swordless' and
state.can_extend_magic(player, 16)
)
)
@@ -115,8 +115,8 @@ boss_table = {
'Agahnim2': ('Agahnim2', AgahnimDefeatRule)
}
def can_place_boss(world, boss, dungeon_name, level=None):
if world.swords in ['swordless'] and boss == 'Kholdstare' and dungeon_name != 'Ice Palace':
def can_place_boss(world, player, boss, dungeon_name, level=None):
if world.swords[player] in ['swordless'] and boss == 'Kholdstare' and dungeon_name != 'Ice Palace':
return False
if dungeon_name in ['Ganons Tower', 'Inverted Ganons Tower'] and level == 'top':
@@ -179,7 +179,7 @@ def place_bosses(world, player):
if world.boss_shuffle in ["basic", "normal"]:
# temporary hack for swordless kholdstare:
if world.swords == 'swordless':
if world.swords[player] == 'swordless':
world.get_dungeon('Ice Palace', player).boss = BossFactory('Kholdstare', player)
logging.getLogger('').debug('Placing boss Kholdstare at Ice Palace')
boss_locations.remove(['Ice Palace', None])
@@ -195,7 +195,7 @@ def place_bosses(world, player):
random.shuffle(bosses)
for [loc, level] in boss_locations:
loc_text = loc + (' ('+level+')' if level else '')
boss = next((b for b in bosses if can_place_boss(world, b, loc, level)), None)
boss = next((b for b in bosses if can_place_boss(world, player, b, loc, level)), None)
if not boss:
raise FillError('Could not place boss for location %s' % loc_text)
bosses.remove(boss)
@@ -206,7 +206,7 @@ def place_bosses(world, player):
for [loc, level] in boss_locations:
loc_text = loc + (' ('+level+')' if level else '')
try:
boss = random.choice([b for b in placeable_bosses if can_place_boss(world, b, loc, level)])
boss = random.choice([b for b in placeable_bosses if can_place_boss(world, player, b, loc, level)])
except IndexError:
raise FillError('Could not place boss for location %s' % loc_text)