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

TLoZ: Implementing The Legend of Zelda #1354

Merged
merged 115 commits into from
Mar 5, 2023

Conversation

Rosalie-A
Copy link
Contributor

@Rosalie-A Rosalie-A commented Dec 28, 2022

Please format your title with what portion of the project this pull request is
targeting and what it's changing.

ex. "MyGame4: implement new game" or "Docs: add new guide for customizing MyGame3"

What is this fixing or adding?

Support for The Legend of Zelda for the NES, including randomizer, client, and emulator connector, as well as website documentation.

N.B.: while I'm the one putting in the pull request, @t3hf1gm3nt put in a nontrivial amount of work and as such deserves joint credit.

How was this tested?

Public and private sync beta tests, with multiple players playing both Z1 and non-Z1 games.

If this makes graphical changes, please attach screenshots.

Rosalie-A and others added 30 commits September 16, 2022 18:38
Making it no longer possible to strand items in a take any cave permanently in edge cases
remove read_rom as it no longer exists.
turns out I need to actually update that line with the new util function instead of just ripping out the one that doesn't exist anymore. using something labeled to be used for snes on a nes rom feels weird but if it works, it works.
@Rosalie-A
Copy link
Contributor Author

Went ahead and sent a PR to this branch to fix the lambda issues

oops I didn't see this until after I'd already written and pushed your suggested changes. Don't take my missing it as anything other than my being absent-minded

@Alchav
Copy link
Contributor

Alchav commented Feb 13, 2023

It's fine as long as it's fixed :)

Copy link
Collaborator

@alwaysintreble alwaysintreble left a comment

Choose a reason for hiding this comment

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

mostly lgtm

]
]

all_level_locations = []
Copy link
Collaborator

@alwaysintreble alwaysintreble Feb 15, 2023

Choose a reason for hiding this comment

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

all_level_locations = [location for level in level_locations for location in level]


floor_location_game_ids_early = {}
floor_location_game_ids_late = {}
for key, value in floor_location_game_offsets_early.items():
Copy link
Collaborator

@alwaysintreble alwaysintreble Feb 15, 2023

Choose a reason for hiding this comment

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

floor_location_game_ids_early = {key, value + Rom.first_quest_dungeon_items_early for key, value in floor_location_game_offsets_early.items()}

for key, value in floor_location_game_offsets_late.items():
floor_location_game_ids_late[key] = value + Rom.first_quest_dungeon_items_late

dungeon_items = {**floor_location_game_ids_early, **floor_location_game_ids_late}
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you use all 3 of these dictionaries separately? seems like it'd be better to just build a single dictionary with a single generator using collections.ChainMap

"Ocean Heart Container"
]

underworld1_locations = [*floor_location_game_offsets_early.keys()]
Copy link
Collaborator

Choose a reason for hiding this comment

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

list(floor_location_game_offsets_early)

world = tloz_world.multiworld

# Boss events for a nicer spoiler log play through
for level in range(1, 9):
Copy link
Collaborator

Choose a reason for hiding this comment

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

python ranges are end exclusive so this only does 1-8 if that matters here

add_rule(world.get_location("Ocean Heart Container", player),
lambda state: state.has("Stepladder", player))

if world.StartingPosition[player] != 2:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd recommend importing the actual Option class and using the value, or using a string comparison, instead of a hardcoded number comparison that doesn't mean anything when you reread this code in 3 months.

add_rule(world.get_location(location.name, player),
lambda state: state.has("Bow", player))

add_rule(world.get_location("Potion Shop Item Left", player),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could these be a Region?

lambda state: ganon in state.locations_checked)

self.multiworld.completion_condition[self.player] = lambda state: state.has("Rescued Zelda!", self.player)
generate_itempool(self)
Copy link
Collaborator

Choose a reason for hiding this comment

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

create items in the function dedicated to it please.

Copy link
Collaborator

Choose a reason for hiding this comment

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

since all of the item creation is done in this function that is in a whole other file (ItemPool.py), sticking it in create_items seemed redundant to me? unless theres something fundamental im not understanding

Copy link
Member

Choose a reason for hiding this comment

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

You're doing it later than expected, which has lead to bugs before and in the future AP is likely to reject your world for it.

"Level 4 Map", "Level 4 Key Drop (Keese North)"
]
for location in stepladder_locations:
add_rule(world.get_location("Ocean Heart Container", player),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing this should be
add_rule(world.get_location(location, player),

@Berserker66
Copy link
Member

Merging this for now, but I'd like to see the code quality concerns that were commented addressed soon. Almost inevitably someone will copy from your world.

@Berserker66 Berserker66 merged commit efb2ab4 into ArchipelagoMW:main Mar 5, 2023
kindasneaki pushed a commit to kindasneaki/Archipelago that referenced this pull request Jun 28, 2023
FlySniper pushed a commit to FlySniper/Archipelago that referenced this pull request Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: new game Pull requests for implementing new games into Archipelago.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants