Replaced bomb/rupee logic with pseudo locations/items
This commit is contained in:
157
BaseClasses.py
157
BaseClasses.py
@@ -1087,150 +1087,14 @@ class CollectionState(object):
|
||||
return self.has_Boots(player) or (self.has_sword(player) and self.has('Quake', player))
|
||||
|
||||
def can_farm_rupees(self, player):
|
||||
tree_pulls = ['Lost Woods East Area',
|
||||
'Snitch Lady (East)',
|
||||
'Turtle Rock Area',
|
||||
'Pyramid Area',
|
||||
'Hype Cave Area',
|
||||
'Dark South Pass Area',
|
||||
'Bumper Cave Area']
|
||||
pre_aga_tree_pulls = ['Hyrule Castle Courtyard', 'Mountain Entry Area']
|
||||
post_aga_tree_pulls = ['Statues Area', 'Eastern Palace Area']
|
||||
return self.has('Farmable Rupees', player)
|
||||
|
||||
rupee_farms = ['Archery Game', '50 Rupee Cave', '20 Rupee Cave']
|
||||
|
||||
bush_crabs = ['Lost Woods East Area', 'Mountain Entry Area']
|
||||
pre_aga_bush_crabs = ['Lumberjack Area', 'South Pass Area']
|
||||
rock_crabs = ['Desert Pass Area']
|
||||
|
||||
def can_reach_non_bunny(regionname):
|
||||
region = self.world.get_region(regionname, player)
|
||||
return region.can_reach(self) and ((self.world.mode[player] != 'inverted' and region.is_light_world) or (self.world.mode[player] == 'inverted' and region.is_dark_world) or self.has_Pearl(player))
|
||||
|
||||
for region in rupee_farms if self.world.pottery[player] in ['none', 'keys', 'dungeon'] else ['Archery Game']:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
|
||||
# tree pulls
|
||||
if self.can_kill_most_things(player) and any(i in [0xda, 0xdb] for i in self.world.prizes[player]['pull']):
|
||||
for region in tree_pulls:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
if not self.has_beaten_aga(player):
|
||||
for region in pre_aga_tree_pulls:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
else:
|
||||
for region in post_aga_tree_pulls:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
|
||||
# bush crabs (final item isn't considered)
|
||||
if self.world.enemy_shuffle[player] == 'none':
|
||||
if self.world.prizes[player]['crab'][0] in [0xda, 0xdb]:
|
||||
for region in bush_crabs:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
if not self.has_beaten_aga(player):
|
||||
for region in pre_aga_bush_crabs:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
if self.can_lift_rocks(player) and self.world.prizes[player]['crab'][0] in [0xda, 0xdb]:
|
||||
for region in rock_crabs:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def can_farm_bombs(self, player):
|
||||
if self.world.mode[player] == 'standard' and not self.has('Zelda Delivered', player):
|
||||
return True
|
||||
|
||||
bush_bombs = ['Flute Boy Approach Area',
|
||||
'Kakariko Area',
|
||||
'Village of Outcasts Area',
|
||||
'Forgotten Forest Area',
|
||||
'Bat Cave Ledge',
|
||||
'East Dark Death Mountain (Bottom)']
|
||||
rock_bombs = ['Links House Area',
|
||||
'Dark Chapel Area',
|
||||
'Wooden Bridge Area',
|
||||
'Ice Cave Area',
|
||||
'Eastern Nook Area',
|
||||
'West Death Mountain (Bottom)',
|
||||
'Kakariko Fortune Area',
|
||||
'Skull Woods Forest',
|
||||
'Catfish Area',
|
||||
'Dark Fortune Area',
|
||||
'Qirn Jump Area',
|
||||
'Shield Shop Area',
|
||||
'Palace of Darkness Nook Area',
|
||||
'Swamp Nook Area',
|
||||
'Dark South Pass Area']
|
||||
bonk_bombs = ['Kakariko Fortune Area', 'Dark Graveyard Area'] #TODO: Flute Boy Approach Area and Bonk Rock Ledge are available post-Aga
|
||||
bomb_caves = ['Graveyard Cave', 'Light World Bomb Hut']
|
||||
|
||||
tree_pulls = ['Lost Woods East Area',
|
||||
'Snitch Lady (East)',
|
||||
'Turtle Rock Area',
|
||||
'Pyramid Area',
|
||||
'Hype Cave Area',
|
||||
'Dark South Pass Area',
|
||||
'Bumper Cave Area']
|
||||
pre_aga_tree_pulls = ['Hyrule Castle Courtyard', 'Mountain Entry Area']
|
||||
post_aga_tree_pulls = ['Statues Area', 'Eastern Palace Area']
|
||||
|
||||
bush_crabs = ['Lost Woods East Area', 'Mountain Entry Area']
|
||||
pre_aga_bush_crabs = ['Lumberjack Area', 'South Pass Area']
|
||||
rock_crabs = ['Desert Pass Area']
|
||||
|
||||
def can_reach_non_bunny(regionname):
|
||||
region = self.world.get_region(regionname, player)
|
||||
return region.can_reach(self) and ((self.world.mode[player] != 'inverted' and region.is_light_world) or (self.world.mode[player] == 'inverted' and region.is_dark_world) or self.has_Pearl(player))
|
||||
|
||||
# bomb pickups
|
||||
for region in bush_bombs + (bomb_caves if self.world.pottery[player] in ['none', 'keys', 'dungeon'] else []):
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
|
||||
if self.can_lift_rocks(player):
|
||||
for region in rock_bombs:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
|
||||
if not self.world.shuffle_bonk_drops[player] and self.can_collect_bonkdrops(player):
|
||||
for region in bonk_bombs:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
|
||||
# tree pulls
|
||||
if self.can_kill_most_things(player) and any(i in [0xdc, 0xdd, 0xde] for i in self.world.prizes[player]['pull']):
|
||||
for region in tree_pulls:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
if not self.has_beaten_aga(player):
|
||||
for region in pre_aga_tree_pulls:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
else:
|
||||
for region in post_aga_tree_pulls:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
|
||||
# bush crabs (final item isn't considered)
|
||||
if self.world.enemy_shuffle[player] == 'none':
|
||||
if self.world.prizes[player]['crab'][0] in [0xdc, 0xdd, 0xde]:
|
||||
for region in bush_crabs:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
if not self.has_beaten_aga(player):
|
||||
for region in pre_aga_bush_crabs:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
if self.can_lift_rocks(player) and self.world.prizes[player]['crab'][0] in [0xdc, 0xdd, 0xde]:
|
||||
for region in rock_crabs:
|
||||
if can_reach_non_bunny(region):
|
||||
return True
|
||||
if self.has('Farmable Bombs', player):
|
||||
return True
|
||||
|
||||
# stun prize
|
||||
if self.can_stun_enemies(player) and self.world.prizes[player]['stun'] in [0xdc, 0xdd, 0xde]:
|
||||
@@ -1239,6 +1103,7 @@ class CollectionState(object):
|
||||
# bomb purchases
|
||||
if self.can_farm_rupees(player) and (self.can_buy_unlimited('Bombs (10)', player) or self.can_reach('Big Bomb Shop', None, player)):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def item_count(self, item, player):
|
||||
@@ -1391,7 +1256,7 @@ class CollectionState(object):
|
||||
if self.has_Pearl(player):
|
||||
return True
|
||||
|
||||
return region.is_light_world if self.world.mode[player] != 'inverted' else region.is_dark_world
|
||||
return not region.can_cause_bunny(player)
|
||||
|
||||
def can_reach_light_world(self, player):
|
||||
if True in [i.is_light_world for i in self.reachable_regions[player]]:
|
||||
@@ -1635,6 +1500,12 @@ class Region(object):
|
||||
|
||||
return True
|
||||
|
||||
def can_cause_bunny(self, player):
|
||||
if 'Moon Pearl' in list(map(str, [i for i in self.world.precollected_items if i.player == player])):
|
||||
return False
|
||||
|
||||
return self.is_dark_world if self.world.mode[player] != 'inverted' else self.is_light_world
|
||||
|
||||
def __str__(self):
|
||||
return str(self.__unicode__())
|
||||
|
||||
@@ -1830,6 +1701,9 @@ class Entrance(object):
|
||||
|
||||
return found
|
||||
|
||||
def can_cause_bunny(self, player):
|
||||
return self.parent_region.can_cause_bunny(player)
|
||||
|
||||
def connect(self, region, addresses=None, target=None, vanilla=None):
|
||||
self.connected_region = region
|
||||
self.target = target
|
||||
@@ -2681,6 +2555,9 @@ class Location(object):
|
||||
name += f' ({world.get_player_names(self.player)})'
|
||||
return name
|
||||
|
||||
def can_cause_bunny(self, player):
|
||||
return self.parent_region.can_cause_bunny(player)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.__unicode__())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user