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

Add item and location name groups #14

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion worlds/stardew_valley/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .bundles.bundle_room import BundleRoom
from .bundles.bundles import get_all_bundles
from .items import item_table, create_items, ItemData, Group, items_by_group, get_all_filler_items, remove_limited_amount_packs
from .locations import location_table, create_locations, LocationData
from .locations import location_table, create_locations, LocationData, locations_by_tag
from .logic.bundle_logic import BundleLogic
from .logic.logic import StardewLogic
from .logic.time_logic import MAX_MONTHS
Expand Down Expand Up @@ -64,6 +64,12 @@ class StardewValleyWorld(World):
item_name_to_id = {name: data.code for name, data in item_table.items()}
location_name_to_id = {name: data.code for name, data in location_table.items()}

item_name_groups = {group.name.replace("_", " ").title() + (" Group" if group.name.replace("_", " ").title()
Copy link
Owner

Choose a reason for hiding this comment

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

Should this behavior of renaming some groups to "X Group" if they are named the same as an item, be also applied to locations?

Copy link
Author

Choose a reason for hiding this comment

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

I don't believe it causes any collisions right now? unless those aren't checked for in unit tests?

Copy link
Owner

Choose a reason for hiding this comment

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

Agreed, but as a future-proofing type of thing, I think they should both have it

in item_table else ""):
[item.name for item in items] for group, items in items_by_group.items()}
location_name_groups = {group.name.replace("_", " ").title(): [item.name for item in locations]
Alchav marked this conversation as resolved.
Show resolved Hide resolved
for group, locations in locations_by_tag.items()}

data_version = 3
required_client_version = (0, 4, 0)

Expand Down