Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alwaysintreble committed Nov 23, 2023
1 parent d0e317e commit 005b303
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 103 deletions.
8 changes: 4 additions & 4 deletions test/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from worlds.AutoWorld import call_all

from BaseClasses import Location, MultiWorld, CollectionState, ItemClassification, Item
from worlds.alttp.Items import ItemFactory
from worlds.alttp.Items import item_factory


class TestBase(unittest.TestCase):
Expand Down Expand Up @@ -89,15 +89,15 @@ def _get_items(self, item_pool, all_except):
items = self.multiworld.itempool[:]
items = [item for item in items if
item.name not in all_except and not ("Bottle" in item.name and "AnyBottle" in all_except)]
items.extend(ItemFactory(item_pool[0], self.multiworld.worlds[1]))
items.extend(item_factory(item_pool[0], self.multiworld.worlds[1]))
else:
items = ItemFactory(item_pool[0], self.multiworld.worlds[1])
items = item_factory(item_pool[0], self.multiworld.worlds[1])
return self.get_state(items)

def _get_items_partial(self, item_pool, missing_item):
new_items = item_pool[0].copy()
new_items.remove(missing_item)
items = ItemFactory(new_items, self.multiworld.worlds[1])
items = item_factory(new_items, self.multiworld.worlds[1])
return self.get_state(items)


Expand Down
86 changes: 43 additions & 43 deletions worlds/alttp/Dungeons.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from Fill import fill_restrictive

from .Bosses import BossFactory, Boss
from .Items import ItemFactory
from .Items import item_factory
from .Regions import lookup_boss_drops, key_drop_data
from .Options import smallkey_shuffle

Expand Down Expand Up @@ -81,90 +81,90 @@ def make_dungeon(name, default_boss, dungeon_regions, big_key, small_keys, dunge
return dungeon

ES = make_dungeon('Hyrule Castle', None, ['Hyrule Castle', 'Sewers', 'Sewer Drop', 'Sewers (Dark)', 'Sanctuary'],
ItemFactory('Big Key (Hyrule Castle)', world),
ItemFactory(['Small Key (Hyrule Castle)'] * 4, world),
[ItemFactory('Map (Hyrule Castle)', world)])
item_factory('Big Key (Hyrule Castle)', world),
item_factory(['Small Key (Hyrule Castle)'] * 4, world),
[item_factory('Map (Hyrule Castle)', world)])
EP = make_dungeon('Eastern Palace', 'Armos Knights', ['Eastern Palace'],
ItemFactory('Big Key (Eastern Palace)', world),
ItemFactory(['Small Key (Eastern Palace)'] * 2, world),
ItemFactory(['Map (Eastern Palace)', 'Compass (Eastern Palace)'], world))
item_factory('Big Key (Eastern Palace)', world),
item_factory(['Small Key (Eastern Palace)'] * 2, world),
item_factory(['Map (Eastern Palace)', 'Compass (Eastern Palace)'], world))
DP = make_dungeon('Desert Palace', 'Lanmolas',
['Desert Palace North', 'Desert Palace Main (Inner)', 'Desert Palace Main (Outer)',
'Desert Palace East'], ItemFactory('Big Key (Desert Palace)', world),
ItemFactory(['Small Key (Desert Palace)'] * 4, world),
ItemFactory(['Map (Desert Palace)', 'Compass (Desert Palace)'], world))
'Desert Palace East'], item_factory('Big Key (Desert Palace)', world),
item_factory(['Small Key (Desert Palace)'] * 4, world),
item_factory(['Map (Desert Palace)', 'Compass (Desert Palace)'], world))
ToH = make_dungeon('Tower of Hera', 'Moldorm',
['Tower of Hera (Bottom)', 'Tower of Hera (Basement)', 'Tower of Hera (Top)'],
ItemFactory('Big Key (Tower of Hera)', world),
[ItemFactory('Small Key (Tower of Hera)', world)],
ItemFactory(['Map (Tower of Hera)', 'Compass (Tower of Hera)'], world))
item_factory('Big Key (Tower of Hera)', world),
[item_factory('Small Key (Tower of Hera)', world)],
item_factory(['Map (Tower of Hera)', 'Compass (Tower of Hera)'], world))
PoD = make_dungeon('Palace of Darkness', 'Helmasaur King',
['Palace of Darkness (Entrance)', 'Palace of Darkness (Center)',
'Palace of Darkness (Big Key Chest)', 'Palace of Darkness (Bonk Section)',
'Palace of Darkness (North)', 'Palace of Darkness (Maze)',
'Palace of Darkness (Harmless Hellway)', 'Palace of Darkness (Final Section)'],
ItemFactory('Big Key (Palace of Darkness)', world),
ItemFactory(['Small Key (Palace of Darkness)'] * 6, world),
ItemFactory(['Map (Palace of Darkness)', 'Compass (Palace of Darkness)'], world))
item_factory('Big Key (Palace of Darkness)', world),
item_factory(['Small Key (Palace of Darkness)'] * 6, world),
item_factory(['Map (Palace of Darkness)', 'Compass (Palace of Darkness)'], world))
TT = make_dungeon('Thieves Town', 'Blind', ['Thieves Town (Entrance)', 'Thieves Town (Deep)', 'Blind Fight'],
ItemFactory('Big Key (Thieves Town)', world),
ItemFactory(['Small Key (Thieves Town)'] * 3, world),
ItemFactory(['Map (Thieves Town)', 'Compass (Thieves Town)'], world))
item_factory('Big Key (Thieves Town)', world),
item_factory(['Small Key (Thieves Town)'] * 3, world),
item_factory(['Map (Thieves Town)', 'Compass (Thieves Town)'], world))
SW = make_dungeon('Skull Woods', 'Mothula', ['Skull Woods Final Section (Entrance)', 'Skull Woods First Section',
'Skull Woods Second Section', 'Skull Woods Second Section (Drop)',
'Skull Woods Final Section (Mothula)',
'Skull Woods First Section (Right)',
'Skull Woods First Section (Left)', 'Skull Woods First Section (Top)'],
ItemFactory('Big Key (Skull Woods)', world),
ItemFactory(['Small Key (Skull Woods)'] * 5, world),
ItemFactory(['Map (Skull Woods)', 'Compass (Skull Woods)'], world))
item_factory('Big Key (Skull Woods)', world),
item_factory(['Small Key (Skull Woods)'] * 5, world),
item_factory(['Map (Skull Woods)', 'Compass (Skull Woods)'], world))
SP = make_dungeon('Swamp Palace', 'Arrghus',
['Swamp Palace (Entrance)', 'Swamp Palace (First Room)', 'Swamp Palace (Starting Area)',
'Swamp Palace (West)', 'Swamp Palace (Center)', 'Swamp Palace (North)'],
ItemFactory('Big Key (Swamp Palace)', world),
ItemFactory(['Small Key (Swamp Palace)'] * 6, world),
ItemFactory(['Map (Swamp Palace)', 'Compass (Swamp Palace)'], world))
item_factory('Big Key (Swamp Palace)', world),
item_factory(['Small Key (Swamp Palace)'] * 6, world),
item_factory(['Map (Swamp Palace)', 'Compass (Swamp Palace)'], world))
IP = make_dungeon('Ice Palace', 'Kholdstare',
['Ice Palace (Entrance)', 'Ice Palace (Second Section)', 'Ice Palace (Main)', 'Ice Palace (East)',
'Ice Palace (East Top)', 'Ice Palace (Kholdstare)'], ItemFactory('Big Key (Ice Palace)', world),
ItemFactory(['Small Key (Ice Palace)'] * 6, world),
ItemFactory(['Map (Ice Palace)', 'Compass (Ice Palace)'], world))
'Ice Palace (East Top)', 'Ice Palace (Kholdstare)'], item_factory('Big Key (Ice Palace)', world),
item_factory(['Small Key (Ice Palace)'] * 6, world),
item_factory(['Map (Ice Palace)', 'Compass (Ice Palace)'], world))
MM = make_dungeon('Misery Mire', 'Vitreous',
['Misery Mire (Entrance)', 'Misery Mire (Main)', 'Misery Mire (West)', 'Misery Mire (Final Area)',
'Misery Mire (Vitreous)'], ItemFactory('Big Key (Misery Mire)', world),
ItemFactory(['Small Key (Misery Mire)'] * 6, world),
ItemFactory(['Map (Misery Mire)', 'Compass (Misery Mire)'], world))
'Misery Mire (Vitreous)'], item_factory('Big Key (Misery Mire)', world),
item_factory(['Small Key (Misery Mire)'] * 6, world),
item_factory(['Map (Misery Mire)', 'Compass (Misery Mire)'], world))
TR = make_dungeon('Turtle Rock', 'Trinexx',
['Turtle Rock (Entrance)', 'Turtle Rock (First Section)', 'Turtle Rock (Chain Chomp Room)',
'Turtle Rock (Pokey Room)',
'Turtle Rock (Second Section)', 'Turtle Rock (Big Chest)', 'Turtle Rock (Crystaroller Room)',
'Turtle Rock (Dark Room)', 'Turtle Rock (Eye Bridge)', 'Turtle Rock (Trinexx)'],
ItemFactory('Big Key (Turtle Rock)', world),
ItemFactory(['Small Key (Turtle Rock)'] * 6, world),
ItemFactory(['Map (Turtle Rock)', 'Compass (Turtle Rock)'], world))
item_factory('Big Key (Turtle Rock)', world),
item_factory(['Small Key (Turtle Rock)'] * 6, world),
item_factory(['Map (Turtle Rock)', 'Compass (Turtle Rock)'], world))

if multiworld.mode[player] != 'inverted':
AT = make_dungeon('Agahnims Tower', 'Agahnim', ['Agahnims Tower', 'Agahnim 1'], None,
ItemFactory(['Small Key (Agahnims Tower)'] * 4, world), [])
item_factory(['Small Key (Agahnims Tower)'] * 4, world), [])
GT = make_dungeon('Ganons Tower', 'Agahnim2',
['Ganons Tower (Entrance)', 'Ganons Tower (Tile Room)', 'Ganons Tower (Compass Room)',
'Ganons Tower (Hookshot Room)', 'Ganons Tower (Map Room)', 'Ganons Tower (Firesnake Room)',
'Ganons Tower (Teleport Room)', 'Ganons Tower (Bottom)', 'Ganons Tower (Top)',
'Ganons Tower (Before Moldorm)', 'Ganons Tower (Moldorm)', 'Agahnim 2'],
ItemFactory('Big Key (Ganons Tower)', world),
ItemFactory(['Small Key (Ganons Tower)'] * 8, world),
ItemFactory(['Map (Ganons Tower)', 'Compass (Ganons Tower)'], world))
item_factory('Big Key (Ganons Tower)', world),
item_factory(['Small Key (Ganons Tower)'] * 8, world),
item_factory(['Map (Ganons Tower)', 'Compass (Ganons Tower)'], world))
else:
AT = make_dungeon('Inverted Agahnims Tower', 'Agahnim', ['Inverted Agahnims Tower', 'Agahnim 1'], None,
ItemFactory(['Small Key (Agahnims Tower)'] * 4, world), [])
item_factory(['Small Key (Agahnims Tower)'] * 4, world), [])
GT = make_dungeon('Inverted Ganons Tower', 'Agahnim2',
['Inverted Ganons Tower (Entrance)', 'Ganons Tower (Tile Room)',
'Ganons Tower (Compass Room)', 'Ganons Tower (Hookshot Room)', 'Ganons Tower (Map Room)',
'Ganons Tower (Firesnake Room)', 'Ganons Tower (Teleport Room)', 'Ganons Tower (Bottom)',
'Ganons Tower (Top)', 'Ganons Tower (Before Moldorm)', 'Ganons Tower (Moldorm)',
'Agahnim 2'], ItemFactory('Big Key (Ganons Tower)', world),
ItemFactory(['Small Key (Ganons Tower)'] * 8, world),
ItemFactory(['Map (Ganons Tower)', 'Compass (Ganons Tower)'], world))
'Agahnim 2'], item_factory('Big Key (Ganons Tower)', world),
item_factory(['Small Key (Ganons Tower)'] * 8, world),
item_factory(['Map (Ganons Tower)', 'Compass (Ganons Tower)'], world))

GT.bosses['bottom'] = BossFactory('Armos Knights', player)
GT.bosses['middle'] = BossFactory('Lanmolas', player)
Expand Down Expand Up @@ -259,7 +259,7 @@ def fill_dungeons_restrictive(multiworld: MultiWorld):
if not key_drop_shuffle and player not in multiworld.groups:
for key_loc in key_drop_data:
key_data = key_drop_data[key_loc]
all_state_base.remove(ItemFactory(key_data[3], multiworld.worlds[player]))
all_state_base.remove(item_factory(key_data[3], multiworld.worlds[player]))
loc = multiworld.get_location(key_loc, player)

if loc in all_state_base.events:
Expand Down
Loading

0 comments on commit 005b303

Please sign in to comment.