rename has_blunt_weapon to has_melee_weapon

This commit is contained in:
Fabian Dill 2020-04-20 19:17:10 +02:00
parent 860faf6ef5
commit 1a53b0e69b
3 changed files with 38 additions and 38 deletions

View File

@ -523,7 +523,7 @@ class CollectionState(object):
return basemagic >= smallmagic return basemagic >= smallmagic
def can_kill_most_things(self, player: int, enemies=5) -> bool: def can_kill_most_things(self, player: int, enemies=5) -> bool:
return (self.has_blunt_weapon(player) return (self.has_melee_weapon(player)
or self.has('Cane of Somaria', player) or self.has('Cane of Somaria', player)
or (self.has('Cane of Byrna', player) and (enemies < 6 or self.can_extend_magic(player))) or (self.has('Cane of Byrna', player) and (enemies < 6 or self.can_extend_magic(player)))
or self.can_shoot_arrows(player) or self.can_shoot_arrows(player)
@ -554,7 +554,7 @@ class CollectionState(object):
def has_beam_sword(self, player: int) -> bool: def has_beam_sword(self, player: int) -> bool:
return self.has('Master Sword', player) or self.has('Tempered Sword', player) or self.has('Golden Sword', player) return self.has('Master Sword', player) or self.has('Tempered Sword', player) or self.has('Golden Sword', player)
def has_blunt_weapon(self, player: int) -> bool: def has_melee_weapon(self, player: int) -> bool:
return self.has_sword(player) or self.has('Hammer', player) return self.has_sword(player) or self.has('Hammer', player)
def has_Mirror(self, player: int) -> bool: def has_Mirror(self, player: int) -> bool:

View File

@ -17,7 +17,7 @@ def BossFactory(boss, player):
def ArmosKnightsDefeatRule(state, player): def ArmosKnightsDefeatRule(state, player):
# Magic amounts are probably a bit overkill # Magic amounts are probably a bit overkill
return ( return (
state.has_blunt_weapon(player) or state.has_melee_weapon(player) or
state.can_shoot_arrows(player) or state.can_shoot_arrows(player) or
(state.has('Cane of Somaria', player) and state.can_extend_magic(player, 10)) or (state.has('Cane of Somaria', player) and state.can_extend_magic(player, 10)) or
(state.has('Cane of Byrna', player) and state.can_extend_magic(player, 16)) or (state.has('Cane of Byrna', player) and state.can_extend_magic(player, 16)) or
@ -28,7 +28,7 @@ def ArmosKnightsDefeatRule(state, player):
def LanmolasDefeatRule(state, player): def LanmolasDefeatRule(state, player):
return ( return (
state.has_blunt_weapon(player) or state.has_melee_weapon(player) or
state.has('Fire Rod', player) or state.has('Fire Rod', player) or
state.has('Ice Rod', player) or state.has('Ice Rod', player) or
state.has('Cane of Somaria', player) or state.has('Cane of Somaria', player) or
@ -36,7 +36,7 @@ def LanmolasDefeatRule(state, player):
state.can_shoot_arrows(player)) state.can_shoot_arrows(player))
def MoldormDefeatRule(state, player): def MoldormDefeatRule(state, player):
return state.has_blunt_weapon(player) return state.has_melee_weapon(player)
def HelmasaurKingDefeatRule(state, player): def HelmasaurKingDefeatRule(state, player):
# TODO: technically possible with the hammer # TODO: technically possible with the hammer
@ -48,7 +48,7 @@ def ArrghusDefeatRule(state, player):
# TODO: ideally we would have a check for bow and silvers, which combined with the # TODO: ideally we would have a check for bow and silvers, which combined with the
# hookshot is enough. This is not coded yet because the silvers that only work in pyramid feature # hookshot is enough. This is not coded yet because the silvers that only work in pyramid feature
# makes this complicated # makes this complicated
if state.has_blunt_weapon(player): if state.has_melee_weapon(player):
return True return True
return ((state.has('Fire Rod', player) and (state.can_shoot_arrows(player) or state.can_extend_magic(player, 12))) or #assuming mostly gitting two puff with one shot return ((state.has('Fire Rod', player) and (state.can_shoot_arrows(player) or state.can_extend_magic(player, 12))) or #assuming mostly gitting two puff with one shot
@ -57,7 +57,7 @@ def ArrghusDefeatRule(state, player):
def MothulaDefeatRule(state, player): def MothulaDefeatRule(state, player):
return ( return (
state.has_blunt_weapon(player) or state.has_melee_weapon(player) or
(state.has('Fire Rod', player) and state.can_extend_magic(player, 10)) or (state.has('Fire Rod', player) and state.can_extend_magic(player, 10)) or
# TODO: Not sure how much (if any) extend magic is needed for these two, since they only apply # TODO: Not sure how much (if any) extend magic is needed for these two, since they only apply
# to non-vanilla locations, so are harder to test, so sticking with what VT has for now: # to non-vanilla locations, so are harder to test, so sticking with what VT has for now:
@ -67,7 +67,7 @@ def MothulaDefeatRule(state, player):
) )
def BlindDefeatRule(state, player): def BlindDefeatRule(state, player):
return state.has_blunt_weapon(player) or state.has('Cane of Somaria', player) or state.has('Cane of Byrna', player) return state.has_melee_weapon(player) or state.has('Cane of Somaria', player) or state.has('Cane of Byrna', player)
def KholdstareDefeatRule(state, player): def KholdstareDefeatRule(state, player):
return ( return (
@ -80,7 +80,7 @@ def KholdstareDefeatRule(state, player):
) )
) and ) and
( (
state.has_blunt_weapon(player) or state.has_melee_weapon(player) or
(state.has('Fire Rod', player) and state.can_extend_magic(player, 20)) or (state.has('Fire Rod', player) and state.can_extend_magic(player, 20)) or
# FIXME: this actually only works for the vanilla location for swordless # FIXME: this actually only works for the vanilla location for swordless
( (
@ -93,7 +93,7 @@ def KholdstareDefeatRule(state, player):
) )
def VitreousDefeatRule(state, player): def VitreousDefeatRule(state, player):
return state.can_shoot_arrows(player) or state.has_blunt_weapon(player) return state.can_shoot_arrows(player) or state.has_melee_weapon(player)
def TrinexxDefeatRule(state, player): def TrinexxDefeatRule(state, player):
if not (state.has('Fire Rod', player) and state.has('Ice Rod', player)): if not (state.has('Fire Rod', player) and state.has('Ice Rod', player)):

View File

@ -194,7 +194,7 @@ def generate_itempool(world, player):
for item in precollected_items: for item in precollected_items:
world.push_precollected(ItemFactory(item, player)) world.push_precollected(ItemFactory(item, player))
if world.mode[player] == 'standard' and not world.state.has_blunt_weapon(player): if world.mode[player] == 'standard' and not world.state.has_melee_weapon(player):
if "Link's Uncle" not in placed_items: if "Link's Uncle" not in placed_items:
found_sword = False found_sword = False
found_bow = False found_bow = False