Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LADX: more item groups, location groups, keysanity preset #3936

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 134 additions & 2 deletions worlds/ladx/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DungeonItemData(ItemData):
@property
def dungeon_index(self):
return int(self.ladxr_id[-1])

@property
def dungeon_item_type(self):
s = self.ladxr_id[:-1]
Expand Down Expand Up @@ -175,7 +175,7 @@ class ItemName:
TRADING_ITEM_SCALE = "Scale"
TRADING_ITEM_MAGNIFYING_GLASS = "Magnifying Glass"

trade_item_prog = ItemClassification.progression
trade_item_prog = ItemClassification.progression

links_awakening_items = [
ItemData(ItemName.POWER_BRACELET, "POWER_BRACELET", ItemClassification.progression),
Expand Down Expand Up @@ -305,3 +305,135 @@ class ItemName:
links_awakening_items_by_name = {
item.item_name : item for item in links_awakening_items
}

links_awakening_item_name_groups: typing.Dict[str, typing.Set[str]] = {
"Instruments": {
"Full Moon Cello",
"Conch Horn",
"Sea Lily's Bell",
"Surf Harp",
"Wind Marimba",
"Coral Triangle",
"Organ of Evening Calm",
"Thunder Drum",
},
"Entrance Keys": {
"Tail Key",
"Angler Key",
"Face Key",
"Bird Key",
"Slime Key",
},
"Nightmare Keys": {
"Nightmare Key (Angler's Tunnel)",
"Nightmare Key (Bottle Grotto)",
"Nightmare Key (Catfish's Maw)",
"Nightmare Key (Color Dungeon)",
"Nightmare Key (Eagle's Tower)",
"Nightmare Key (Face Shrine)",
"Nightmare Key (Key Cavern)",
"Nightmare Key (Tail Cave)",
"Nightmare Key (Turtle Rock)",
},
"Small Keys": {
"Small Key (Angler's Tunnel)",
"Small Key (Bottle Grotto)",
"Small Key (Catfish's Maw)",
"Small Key (Color Dungeon)",
"Small Key (Eagle's Tower)",
"Small Key (Face Shrine)",
"Small Key (Key Cavern)",
"Small Key (Tail Cave)",
"Small Key (Turtle Rock)",
},
"Compasses": {
"Compass (Angler's Tunnel)",
"Compass (Bottle Grotto)",
"Compass (Catfish's Maw)",
"Compass (Color Dungeon)",
"Compass (Eagle's Tower)",
"Compass (Face Shrine)",
"Compass (Key Cavern)",
"Compass (Tail Cave)",
"Compass (Turtle Rock)",
},
"Maps": {
"Dungeon Map (Angler's Tunnel)",
"Dungeon Map (Bottle Grotto)",
"Dungeon Map (Catfish's Maw)",
"Dungeon Map (Color Dungeon)",
"Dungeon Map (Eagle's Tower)",
"Dungeon Map (Face Shrine)",
"Dungeon Map (Key Cavern)",
"Dungeon Map (Tail Cave)",
"Dungeon Map (Turtle Rock)",
},
"Stone Beaks": {
"Stone Beak (Angler's Tunnel)",
"Stone Beak (Bottle Grotto)",
"Stone Beak (Catfish's Maw)",
"Stone Beak (Color Dungeon)",
"Stone Beak (Eagle's Tower)",
"Stone Beak (Face Shrine)",
"Stone Beak (Key Cavern)",
"Stone Beak (Tail Cave)",
"Stone Beak (Turtle Rock)",
},
"Trading Items": {
"Yoshi Doll",
"Ribbon",
"Dog Food",
"Bananas",
"Stick",
"Honeycomb",
"Pineapple",
"Hibiscus",
"Letter",
"Broom",
"Fishing Hook",
"Necklace",
"Scale",
"Magnifying Glass",
},
"Rupees": {
"20 Rupees",
"50 Rupees",
"100 Rupees",
"200 Rupees",
"500 Rupees",
},
"Upgrades": {
"Max Powder Upgrade",
"Max Bombs Upgrade",
"Max Arrows Upgrade",
},
"Songs": {
"Ballad of the Wind Fish",
"Manbo's Mambo",
"Frog's Song of Soul",
},
"Tunics": {
"Red Tunic",
"Blue Tunic",
},
"Bush Breakers": {
"Progressive Power Bracelet",
"Magic Rod",
"Magic Powder",
"Bomb",
"Progressive Sword",
"Boomerang",
},
"Sword": {
"Progressive Sword",
},
"Shield": {
"Progressive Shield",
},
"Power Bracelet": {
"Progressive Power Bracelet",
},
"Bracelet": {
"Progressive Power Bracelet",
},
}
35 changes: 34 additions & 1 deletion worlds/ladx/Locations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from BaseClasses import Region, Entrance, Location, CollectionState

import typing

from .LADXR.checkMetadata import checkMetadataTable
from .Common import *
Expand All @@ -25,6 +25,39 @@
def meta_to_name(meta):
return f"{meta.name} ({meta.area})"

def get_location_name_groups() -> typing.Dict[str, typing.Set[str]]:
groups = {
"Instrument Pedestals": {
"Full Moon Cello (Tail Cave)",
"Conch Horn (Bottle Grotto)",
"Sea Lily's Bell (Key Cavern)",
"Surf Harp (Angler's Tunnel)",
"Wind Marimba (Catfish's Maw)",
"Coral Triangle (Face Shrine)",
"Organ of Evening Calm (Eagle's Tower)",
"Thunder Drum (Turtle Rock)",
},
"Boss Rewards": {
"Moldorm Heart Container (Tail Cave)",
"Genie Heart Container (Bottle Grotto)",
"Slime Eye Heart Container (Key Cavern)",
"Angler Fish Heart Container (Angler's Tunnel)",
"Slime Eel Heart Container (Catfish's Maw)",
"Facade Heart Container (Face Shrine)",
"Evil Eagle Heart Container (Eagle's Tower)",
"Hot Head Heart Container (Turtle Rock)",
"Tunic Fairy Item 1 (Color Dungeon)",
"Tunic Fairy Item 2 (Color Dungeon)",
},
}
# Add region groups
for s, v in checkMetadataTable.items():
if s == "None":
continue
groups.setdefault(v.area, set()).add(meta_to_name(v))
return groups

links_awakening_location_name_groups = get_location_name_groups()

def get_locations_to_id():
ret = {
Expand Down
24 changes: 16 additions & 8 deletions worlds/ladx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
from worlds.AutoWorld import WebWorld, World
from .Common import *
from .Items import (DungeonItemData, DungeonItemType, ItemName, LinksAwakeningItem, TradeItemData,
ladxr_item_to_la_item_name, links_awakening_items, links_awakening_items_by_name)
ladxr_item_to_la_item_name, links_awakening_items, links_awakening_items_by_name,
links_awakening_item_name_groups)
from .LADXR import generator
from .LADXR.itempool import ItemPool as LADXRItemPool
from .LADXR.locations.constants import CHEST_ITEMS
Expand All @@ -23,7 +24,8 @@
from .LADXR.settings import Settings as LADXRSettings
from .LADXR.worldSetup import WorldSetup as LADXRWorldSetup
from .Locations import (LinksAwakeningLocation, LinksAwakeningRegion,
create_regions_from_ladxr, get_locations_to_id)
create_regions_from_ladxr, get_locations_to_id,
links_awakening_location_name_groups)
from .Options import DungeonItemShuffle, ShuffleInstruments, LinksAwakeningOptions, ladx_option_groups
from .Rom import LADXDeltaPatch, get_base_rom_path

Expand Down Expand Up @@ -66,6 +68,15 @@ class LinksAwakeningWebWorld(WebWorld):
)]
theme = "dirt"
option_groups = ladx_option_groups
options_presets: typing.Dict[str, typing.Dict[str, typing.Any]] = {
"Keysanity": {
Copy link
Member

@Exempt-Medic Exempt-Medic Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably change this. Maps, compasses, and stone beaks are not very "key" related. You could add in Instruments and call it "All Shuffle" or something maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upstream ladx rando has a keysanity setting that shuffles dungeon items this way, I think its a generally understood term.

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I think upstream's preset is poorly named, then. "Shuffle Dungeon Items" maybe?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the points made by Medic and Scipio, HOWEVER: At the moment, presets always change every option. As a result, I think it's fine to add other options that seem to have a similar "spirit"

"shuffle_nightmare_keys": "any_world",
"shuffle_small_keys": "any_world",
"shuffle_maps": "any_world",
"shuffle_compasses": "any_world",
"shuffle_stone_beaks": "any_world",
}
}

class LinksAwakeningWorld(World):
"""
Expand Down Expand Up @@ -98,12 +109,9 @@ class LinksAwakeningWorld(World):

# Items can be grouped using their names to allow easy checking if any item
# from that group has been collected. Group names can also be used for !hint
item_name_groups = {
"Instruments": {
"Full Moon Cello", "Conch Horn", "Sea Lily's Bell", "Surf Harp",
"Wind Marimba", "Coral Triangle", "Organ of Evening Calm", "Thunder Drum"
},
}
item_name_groups = links_awakening_item_name_groups

location_name_groups = links_awakening_location_name_groups

prefill_dungeon_items = None

Expand Down
Loading