LADX: shuffle instruments (#2804)
* ladx: shuffle instruments * set correct default for shuffled instruments
This commit is contained in:
parent
5a4d88d554
commit
37add8ee59
|
@ -179,6 +179,22 @@ class ShuffleStoneBeaks(DungeonItemShuffle):
|
||||||
display_name = "Shuffle Stone Beaks"
|
display_name = "Shuffle Stone Beaks"
|
||||||
ladxr_item = "STONE_BEAK"
|
ladxr_item = "STONE_BEAK"
|
||||||
|
|
||||||
|
class ShuffleInstruments(DungeonItemShuffle):
|
||||||
|
"""
|
||||||
|
Shuffle Instruments
|
||||||
|
[Original Dungeon] The item will be within its original dungeon
|
||||||
|
[Own Dungeons] The item will be within a dungeon in your world
|
||||||
|
[Own World] The item will be somewhere in your world
|
||||||
|
[Any World] The item could be anywhere
|
||||||
|
[Different World] The item will be somewhere in another world
|
||||||
|
[Vanilla] The item will be in its vanilla location in your world
|
||||||
|
"""
|
||||||
|
display_name = "Shuffle Instruments"
|
||||||
|
ladxr_item = "INSTRUMENT"
|
||||||
|
default = 100
|
||||||
|
option_vanilla = 100
|
||||||
|
alias_false = 100
|
||||||
|
|
||||||
class Goal(Choice, LADXROption):
|
class Goal(Choice, LADXROption):
|
||||||
"""
|
"""
|
||||||
The Goal of the game
|
The Goal of the game
|
||||||
|
@ -465,6 +481,7 @@ links_awakening_options: typing.Dict[str, typing.Type[Option]] = {
|
||||||
'shuffle_compasses': ShuffleCompasses,
|
'shuffle_compasses': ShuffleCompasses,
|
||||||
'shuffle_stone_beaks': ShuffleStoneBeaks,
|
'shuffle_stone_beaks': ShuffleStoneBeaks,
|
||||||
'music': Music,
|
'music': Music,
|
||||||
|
'shuffle_instruments': ShuffleInstruments,
|
||||||
'music_change_condition': MusicChangeCondition,
|
'music_change_condition': MusicChangeCondition,
|
||||||
'nag_messages': NagMessages,
|
'nag_messages': NagMessages,
|
||||||
'ap_title_screen': APTitleScreen,
|
'ap_title_screen': APTitleScreen,
|
||||||
|
|
|
@ -23,7 +23,7 @@ from .LADXR.settings import Settings as LADXRSettings
|
||||||
from .LADXR.worldSetup import WorldSetup as LADXRWorldSetup
|
from .LADXR.worldSetup import WorldSetup as LADXRWorldSetup
|
||||||
from .Locations import (LinksAwakeningLocation, LinksAwakeningRegion,
|
from .Locations import (LinksAwakeningLocation, LinksAwakeningRegion,
|
||||||
create_regions_from_ladxr, get_locations_to_id)
|
create_regions_from_ladxr, get_locations_to_id)
|
||||||
from .Options import DungeonItemShuffle, links_awakening_options
|
from .Options import DungeonItemShuffle, links_awakening_options, ShuffleInstruments
|
||||||
from .Rom import LADXDeltaPatch
|
from .Rom import LADXDeltaPatch
|
||||||
|
|
||||||
DEVELOPER_MODE = False
|
DEVELOPER_MODE = False
|
||||||
|
@ -184,7 +184,7 @@ class LinksAwakeningWorld(World):
|
||||||
self.pre_fill_items = []
|
self.pre_fill_items = []
|
||||||
# For any and different world, set item rule instead
|
# For any and different world, set item rule instead
|
||||||
|
|
||||||
for option in ["maps", "compasses", "small_keys", "nightmare_keys", "stone_beaks"]:
|
for option in ["maps", "compasses", "small_keys", "nightmare_keys", "stone_beaks", "instruments"]:
|
||||||
option = "shuffle_" + option
|
option = "shuffle_" + option
|
||||||
option = self.player_options[option]
|
option = self.player_options[option]
|
||||||
|
|
||||||
|
@ -224,7 +224,10 @@ class LinksAwakeningWorld(World):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if isinstance(item.item_data, DungeonItemData):
|
if isinstance(item.item_data, DungeonItemData):
|
||||||
if item.item_data.dungeon_item_type == DungeonItemType.INSTRUMENT:
|
item_type = item.item_data.ladxr_id[:-1]
|
||||||
|
shuffle_type = dungeon_item_types[item_type]
|
||||||
|
|
||||||
|
if item.item_data.dungeon_item_type == DungeonItemType.INSTRUMENT and shuffle_type == ShuffleInstruments.option_vanilla:
|
||||||
# Find instrument, lock
|
# Find instrument, lock
|
||||||
# TODO: we should be able to pinpoint the region we want, save a lookup table please
|
# TODO: we should be able to pinpoint the region we want, save a lookup table please
|
||||||
found = False
|
found = False
|
||||||
|
@ -240,10 +243,8 @@ class LinksAwakeningWorld(World):
|
||||||
found = True
|
found = True
|
||||||
break
|
break
|
||||||
if found:
|
if found:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
item_type = item.item_data.ladxr_id[:-1]
|
|
||||||
shuffle_type = dungeon_item_types[item_type]
|
|
||||||
if shuffle_type == DungeonItemShuffle.option_original_dungeon:
|
if shuffle_type == DungeonItemShuffle.option_original_dungeon:
|
||||||
self.prefill_original_dungeon[item.item_data.dungeon_index - 1].append(item)
|
self.prefill_original_dungeon[item.item_data.dungeon_index - 1].append(item)
|
||||||
self.pre_fill_items.append(item)
|
self.pre_fill_items.append(item)
|
||||||
|
|
Loading…
Reference in New Issue