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

Player Gets Keys Back #42

Open
LittleCube-hax opened this issue Nov 16, 2024 · 1 comment
Open

Player Gets Keys Back #42

LittleCube-hax opened this issue Nov 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@LittleCube-hax
Copy link
Collaborator

The player will get their keys for a dungeon back if they unlock a door, save and load.

@LittleCube-hax LittleCube-hax added the bug Something isn't working label Nov 16, 2024
@LittleCube-hax LittleCube-hax self-assigned this Nov 16, 2024
@LittleCube-hax
Copy link
Collaborator Author

Some small research on this:

This is the line that checks whether a locked door is still locked. If so, set unk_1A6 to 10, denoting that the door should be drawn as "fully locked" (on a scale of 0 to 10, 0 being a complete absence of the chains drawn as explained by this line of z_actor).

This is part of a later commit of the decomp that documents what the types of doors are. What is now confirmed by zeldaret is that ENDOOR_TYPE_1 (now ENDOOR_TYPE_LOCKED in that later commit) denotes that a door should be treated as locked, and the game should perform the relevant flag checks.

What needs to be done to implement key save reconstruction is simply to document the switch flag ids of each locked door (there are 9 total), and then upon loading a save: iterate through the flags in gSaveContext.cycleSceneFlags[Play_GetOriginalSceneId(<whatever-dungeon-scene-id>)] and count how many doors have been unlocked in each of the four dungeons. Subtract that from the number of small keys the server says the player has for each respective dungeon, and that is the value of keys the player should now be set to have.

Implementing this change would almost complete the save reconstruction feature, aside from setting Rupees, BankRupees, and the ammo values into AP DataStorage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant