Add bomb-only mode and random ganon vulnerability item

This commit is contained in:
2021-06-29 22:16:08 -07:00
parent a4e3ed1e4f
commit 078ea13cac
26 changed files with 540 additions and 164 deletions

View File

@@ -1,5 +1,5 @@
import logging
import random
import RaceRandom as random
from BaseClasses import Boss
from Fill import FillError
@@ -16,38 +16,47 @@ def BossFactory(boss, player):
def ArmosKnightsDefeatRule(state, player):
# Magic amounts are probably a bit overkill
return (
state.has_blunt_weapon(player) or
return (state.bomb_mode_check(player, 1) and
(state.has_blunt_weapon(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 Byrna', player) and state.can_extend_magic(player, 16)) or
(state.has('Ice Rod', player) and state.can_extend_magic(player, 32)) or
(state.has('Fire Rod', player) and state.can_extend_magic(player, 32)) or
state.has('Blue Boomerang', player) or
state.has('Red Boomerang', player))
state.has('Red Boomerang', player) or
state.has_bomb_level(player, 1)))
def LanmolasDefeatRule(state, player):
return (
state.has_blunt_weapon(player) or
return (state.bomb_mode_check(player, 1) and
(state.has_blunt_weapon(player) or
state.has('Fire Rod', player) or
state.has('Ice Rod', player) or
state.has('Cane of Somaria', player) or
state.has('Cane of Byrna', player) or
state.can_shoot_arrows(player))
state.can_shoot_arrows(player) or
state.has_bomb_level(player, 1)))
def MoldormDefeatRule(state, player):
return state.has_blunt_weapon(player)
return (state.bomb_mode_check(player, 1) and
(state.has_blunt_weapon(player) or state.has_bomb_level(player, 1)))
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.bomb_mode_check(player, 2) and
(state.has('Hammer', player) or state.can_use_bombs(player)) and
(state.has_sword(player) or state.can_shoot_arrows(player) or state.has_bomb_level(player, 2)))
def ArrghusDefeatRule(state, player):
if not state.has('Hookshot', player):
return False
if not state.bomb_mode_check(player, 2):
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) or state.has_bomb_level(player, 2):
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
@@ -55,31 +64,33 @@ def ArrghusDefeatRule(state, player):
def MothulaDefeatRule(state, player):
return (
state.has_blunt_weapon(player) or
return (state.bomb_mode_check(player, 1) and
(state.has_blunt_weapon(player) 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
# to non-vanilla locations, so are harder to test, so sticking with what VT has for now:
(state.has('Cane of Somaria', player) and state.can_extend_magic(player, 16)) or
(state.has('Cane of Byrna', player) and state.can_extend_magic(player, 16)) or
state.can_get_good_bee(player)
)
state.can_get_good_bee(player) or
state.has_bomb_level(player, 1)))
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.bomb_mode_check(player, 1) and
(state.has_blunt_weapon(player) or state.has('Cane of Somaria', player) or
state.has('Cane of Byrna', player) or state.has_bomb_level(player, 1)))
def KholdstareDefeatRule(state, player):
return (
return (state.bomb_mode_check(player, 2) and
(
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')
(state.can_use_medallions(player) or state.world.swords[player] == 'swordless')
)
) and
(
state.has_blunt_weapon(player) or
state.has_bomb_level(player, 2) or state.has_blunt_weapon(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
(
@@ -88,20 +99,26 @@ def KholdstareDefeatRule(state, player):
state.world.swords[player] == 'swordless' and
state.can_extend_magic(player, 16)
)
)
)
))
def VitreousDefeatRule(state, player):
return state.can_shoot_arrows(player) or state.has_blunt_weapon(player)
return (state.bomb_mode_check(player, 2) and
(state.can_shoot_arrows(player) or state.has_blunt_weapon(player) or
state.has_bomb_level(player, 2)))
def TrinexxDefeatRule(state, player):
if not (state.has('Fire Rod', player) and state.has('Ice Rod', player)):
return False
if not state.bomb_mode_check(player, 2):
return False
return (state.has('Hammer', player) or
state.has('Golden Sword', player) or
state.has('Tempered Sword', player) 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_bomb_level(player, 4) or
((state.has('Master Sword', player) or state.has_bomb_level(player, 3))
and state.can_extend_magic(player, 16)) or
((state.has_sword(player) or state.has_bomb_level(player, 2))
and state.can_extend_magic(player, 32)))
def AgahnimDefeatRule(state, player):
return state.has_sword(player) or state.has('Hammer', player) or state.has('Bug Catching Net', player)
@@ -126,20 +143,20 @@ def can_place_boss(world, player, boss, dungeon_name, level=None):
return False
if dungeon_name == 'Ganons Tower' and level == 'top':
if boss in ["Armos Knights", "Arrghus", "Blind", "Trinexx", "Lanmolas"]:
if boss in ["Armos Knights", "Arrghus", "Blind", "Trinexx", "Lanmolas"]:
return False
if dungeon_name == 'Ganons Tower' and level == 'middle':
if boss in ["Blind"]:
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
if dungeon_name == 'Skull Woods' and boss in ["Trinexx"]:
return False
if boss in ["Agahnim", "Agahnim2", "Ganon"]:
if boss in ["Agahnim", "Agahnim2", "Ganon"]:
return False
return True