feat: More strict requirment for some bosses on ice
This commit is contained in:
109
Bosses.py
109
Bosses.py
@@ -5,11 +5,12 @@ from BaseClasses import Boss, FillError
|
|||||||
from source.enemizer.Bossmizer import boss_adjust
|
from source.enemizer.Bossmizer import boss_adjust
|
||||||
|
|
||||||
|
|
||||||
def BossFactory(boss, player):
|
def BossFactory(boss, player, on_ice=False):
|
||||||
if boss is None:
|
if boss is None:
|
||||||
return None
|
return None
|
||||||
if boss in boss_table:
|
if boss in boss_table:
|
||||||
enemizer_name, defeat_rule = boss_table[boss]
|
enemizer_name, normal_defeat_rule, ice_defeat_rule = boss_table[boss]
|
||||||
|
defeat_rule = ice_defeat_rule if on_ice else normal_defeat_rule
|
||||||
return Boss(boss, enemizer_name, defeat_rule, player)
|
return Boss(boss, enemizer_name, defeat_rule, player)
|
||||||
|
|
||||||
logging.getLogger('').error('Unknown Boss: %s', boss)
|
logging.getLogger('').error('Unknown Boss: %s', boss)
|
||||||
@@ -42,16 +43,21 @@ def MoldormDefeatRule(state, player):
|
|||||||
def HelmasaurKingDefeatRule(state, player):
|
def HelmasaurKingDefeatRule(state, player):
|
||||||
return (state.has('Hammer', player) or state.can_use_bombs(player)) and (state.has_sword(player) or state.can_shoot_arrows(player))
|
return (state.has('Hammer', player) or state.can_use_bombs(player)) and (state.has_sword(player) or state.can_shoot_arrows(player))
|
||||||
|
|
||||||
|
|
||||||
|
def IceHelmasaurKingDefeatRule(state, player):
|
||||||
|
return state.can_use_bombs(player) and (state.has_sword(player) or state.can_shoot_arrows(player))
|
||||||
|
|
||||||
|
|
||||||
def ArrghusDefeatRule(state, player):
|
def ArrghusDefeatRule(state, player):
|
||||||
if not state.has('Hookshot', player):
|
if not state.has('Hookshot', player):
|
||||||
return False
|
return False
|
||||||
# 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
|
|
||||||
# makes this complicated
|
|
||||||
if state.has_blunt_weapon(player):
|
if state.has_blunt_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
|
if state.can_shoot_arrows(player) and state.has('Silver Arrows', player) and state.world.difficulty_adjustments[player] not in ['hard', 'expert']:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return ((state.has('Fire Rod', player) and (state.can_shoot_arrows(player) or state.can_extend_magic(player, 12))) or # assuming mostly getting two puffs with one shot
|
||||||
(state.has('Ice Rod', player) and state.can_use_bombs(player) and (state.can_shoot_arrows(player) or state.can_extend_magic(player, 16))))
|
(state.has('Ice Rod', player) and state.can_use_bombs(player) and (state.can_shoot_arrows(player) or state.can_extend_magic(player, 16))))
|
||||||
|
|
||||||
|
|
||||||
@@ -65,9 +71,27 @@ def MothulaDefeatRule(state, player):
|
|||||||
(state.has('Cane of Byrna', player) and state.can_extend_magic(player, 16))
|
(state.has('Cane of Byrna', player) and state.can_extend_magic(player, 16))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
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_blunt_weapon(player) or state.has('Cane of Somaria', player) or state.has('Cane of Byrna', player)
|
||||||
|
|
||||||
|
|
||||||
|
def IceBlindDefeatRule(state, player):
|
||||||
|
return (
|
||||||
|
(
|
||||||
|
# weapon
|
||||||
|
state.has_beam_sword(player) or
|
||||||
|
state.has('Cane of Somaria', player) or
|
||||||
|
(state.has('Cane of Byrna', player) and state.can_extend_magic(player, 16))
|
||||||
|
) and
|
||||||
|
(
|
||||||
|
# protection
|
||||||
|
state.has('Red Shield', player) or
|
||||||
|
(state.has('Cane of Byrna', player) and state.world.difficulty_adjustments[player] not in ['hard', 'expert'])
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def KholdstareDefeatRule(state, player):
|
def KholdstareDefeatRule(state, player):
|
||||||
return (
|
return (
|
||||||
(
|
(
|
||||||
@@ -91,9 +115,39 @@ def KholdstareDefeatRule(state, player):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def IceKholdstareDefeatRule(state, player):
|
||||||
|
return (
|
||||||
|
(
|
||||||
|
state.has('Fire Rod', player) or
|
||||||
|
(
|
||||||
|
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[player] == 'swordless')
|
||||||
|
)
|
||||||
|
) and
|
||||||
|
(
|
||||||
|
state.has_beam_sword(player) 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
|
||||||
|
(
|
||||||
|
state.has('Fire Rod', player) and
|
||||||
|
state.has('Bombos', player) and
|
||||||
|
(state.has_sword(player) or state.world.swords[player] == 'swordless') and
|
||||||
|
state.can_extend_magic(player, 16)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def VitreousDefeatRule(state, player):
|
def VitreousDefeatRule(state, player):
|
||||||
return (state.can_shoot_arrows(player) and state.can_use_bombs(player)) or state.has_blunt_weapon(player)
|
return (state.can_shoot_arrows(player) and state.can_use_bombs(player)) or state.has_blunt_weapon(player)
|
||||||
|
|
||||||
|
|
||||||
|
def IceVitreousDefeatRule(state, player):
|
||||||
|
return (state.can_shoot_arrows(player) and state.can_use_bombs(player)) or state.has_beam_sword(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)):
|
||||||
return False
|
return False
|
||||||
@@ -103,24 +157,36 @@ def TrinexxDefeatRule(state, player):
|
|||||||
(state.has('Master Sword', player) and state.can_extend_magic(player, 16)) or
|
(state.has('Master Sword', player) and state.can_extend_magic(player, 16)) or
|
||||||
(state.has_sword(player) and state.can_extend_magic(player, 32)))
|
(state.has_sword(player) and state.can_extend_magic(player, 32)))
|
||||||
|
|
||||||
|
|
||||||
|
def IceTrinexxDefeatRule(state, player):
|
||||||
|
if not (state.has('Fire Rod', player) and state.has('Ice Rod', player) and state.has_Boots(player)):
|
||||||
|
return False
|
||||||
|
return (state.has('Golden Sword', player) or
|
||||||
|
(state.has('Tempered Sword', player) and state.can_extend_magic(player, 16)) or
|
||||||
|
((state.has('Hammer', player) or
|
||||||
|
state.has('Master Sword', player)) and state.can_extend_magic(player, 32))) # rod spam rule
|
||||||
|
|
||||||
|
|
||||||
def AgahnimDefeatRule(state, player):
|
def AgahnimDefeatRule(state, player):
|
||||||
return state.has_sword(player) or state.has('Hammer', player) or state.has('Bug Catching Net', player)
|
return state.has_sword(player) or state.has('Hammer', player) or state.has('Bug Catching Net', player)
|
||||||
|
|
||||||
|
|
||||||
boss_table = {
|
boss_table = {
|
||||||
'Armos Knights': ('Armos', ArmosKnightsDefeatRule),
|
'Armos Knights': ('Armos', ArmosKnightsDefeatRule, ArmosKnightsDefeatRule),
|
||||||
'Lanmolas': ('Lanmola', LanmolasDefeatRule),
|
'Lanmolas': ('Lanmola', LanmolasDefeatRule, LanmolasDefeatRule),
|
||||||
'Moldorm': ('Moldorm', MoldormDefeatRule),
|
'Moldorm': ('Moldorm', MoldormDefeatRule, MoldormDefeatRule),
|
||||||
'Helmasaur King': ('Helmasaur', HelmasaurKingDefeatRule),
|
'Helmasaur King': ('Helmasaur', HelmasaurKingDefeatRule, IceHelmasaurKingDefeatRule),
|
||||||
'Arrghus': ('Arrghus', ArrghusDefeatRule),
|
'Arrghus': ('Arrghus', ArrghusDefeatRule, ArrghusDefeatRule),
|
||||||
'Mothula': ('Mothula', MothulaDefeatRule),
|
'Mothula': ('Mothula', MothulaDefeatRule, MothulaDefeatRule),
|
||||||
'Blind': ('Blind', BlindDefeatRule),
|
'Blind': ('Blind', BlindDefeatRule, IceBlindDefeatRule),
|
||||||
'Kholdstare': ('Kholdstare', KholdstareDefeatRule),
|
'Kholdstare': ('Kholdstare', KholdstareDefeatRule, IceKholdstareDefeatRule),
|
||||||
'Vitreous': ('Vitreous', VitreousDefeatRule),
|
'Vitreous': ('Vitreous', VitreousDefeatRule, IceVitreousDefeatRule),
|
||||||
'Trinexx': ('Trinexx', TrinexxDefeatRule),
|
'Trinexx': ('Trinexx', TrinexxDefeatRule, IceTrinexxDefeatRule),
|
||||||
'Agahnim': ('Agahnim', AgahnimDefeatRule),
|
'Agahnim': ('Agahnim', AgahnimDefeatRule, AgahnimDefeatRule),
|
||||||
'Agahnim2': ('Agahnim2', AgahnimDefeatRule)
|
'Agahnim2': ('Agahnim2', AgahnimDefeatRule, AgahnimDefeatRule)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def can_place_boss(world, player, boss, dungeon_name, level=None):
|
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':
|
if world.swords[player] in ['swordless'] and boss == 'Kholdstare' and dungeon_name != 'Ice Palace':
|
||||||
return False
|
return False
|
||||||
@@ -133,6 +199,11 @@ def can_place_boss(world, player, boss, dungeon_name, level=None):
|
|||||||
if boss in ["Blind"]:
|
if boss in ["Blind"]:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# no Trinexx on Ice in doors without doing some health modelling
|
||||||
|
if world.doorShuffle[player] != 'vanilla' and boss == 'Trinexx':
|
||||||
|
if dungeon_name == 'Ganons Tower' and level == 'bottom':
|
||||||
|
return False
|
||||||
|
|
||||||
if dungeon_name == 'Tower of Hera' and boss in ["Armos Knights", "Arrghus", "Blind", "Trinexx", "Lanmolas"]:
|
if dungeon_name == 'Tower of Hera' and boss in ["Armos Knights", "Arrghus", "Blind", "Trinexx", "Lanmolas"]:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -248,4 +319,4 @@ def place_boss(boss, level, loc, loc_text, world, player):
|
|||||||
loc = [x.name for x in world.dungeons if x.player == player and level in x.bosses.keys()][0]
|
loc = [x.name for x in world.dungeons if x.player == player and level in x.bosses.keys()][0]
|
||||||
loc_text = loc + ' (' + level + ')'
|
loc_text = loc + ' (' + level + ')'
|
||||||
logging.getLogger('').debug('Placing boss %s at %s', boss, loc_text)
|
logging.getLogger('').debug('Placing boss %s at %s', boss, loc_text)
|
||||||
world.get_dungeon(loc, player).bosses[level] = BossFactory(boss, player)
|
world.get_dungeon(loc, player).bosses[level] = BossFactory(boss, player, level == 'bottom')
|
||||||
|
|||||||
@@ -142,8 +142,22 @@ These are now independent of retro mode and have three options: None, Random, an
|
|||||||
# Bug Fixes and Notes
|
# Bug Fixes and Notes
|
||||||
|
|
||||||
* 1.4.1.0v
|
* 1.4.1.0v
|
||||||
* Glitched modes: Aga 1 should be vulnerable in rain state for glitched modes
|
* Logic: New logic for some bosses on ice
|
||||||
|
* Helmasaur on Ice: Bombs for mask, sword or arrows for 2nd phase
|
||||||
|
* Blind on Ice: Beam sword, Somaria, or Byrna plus magic extension for damage. Red shield or Byrna for protection.
|
||||||
|
* Kholdstare on Ice: Three options (after cracking the shell)
|
||||||
|
* Beam sword
|
||||||
|
* Fire Rod with 1.5 magic extensions
|
||||||
|
* Fire Rod & Bombos & any Sword & 1 Magic Extension
|
||||||
|
* Vitreous on Ice: Arrows and Bombs or a Beam Sword
|
||||||
|
* Trinexx on Ice: Boots always required for dodging. Damage options:
|
||||||
|
* Gold sword
|
||||||
|
* Tempered with magic extension
|
||||||
|
* Hammer or Master Sword with 3 magic extensions (Rod spam for elemental heads, non ideal for last phase)
|
||||||
|
* Trinexx on Ice forbidden in doors seeds until we can model some health requirements. Low health Trinexx still isn't realistically feasible (bascially playing OHKO)
|
||||||
|
* Logic: Added silver arrows as Arrghus damage option when item functionality is not set to hard or expert
|
||||||
* Logic: Byrna not in logic for laser bridge when item functionality is set to hard or expert
|
* Logic: Byrna not in logic for laser bridge when item functionality is set to hard or expert
|
||||||
|
* Glitched modes: Aga 1 should be vulnerable in rain state for glitched modes
|
||||||
* Enemy AI: Terrorpin AI code removed. May help with unusual enemy behavior?
|
* Enemy AI: Terrorpin AI code removed. May help with unusual enemy behavior?
|
||||||
* 1.4.0.1v
|
* 1.4.0.1v
|
||||||
* Key logic: Vanilla key logic fixes. Statically set some HC logic and PoD front door
|
* Key logic: Vanilla key logic fixes. Statically set some HC logic and PoD front door
|
||||||
|
|||||||
Reference in New Issue
Block a user