Option to randomize the Frogs 2 melody#2064
Conversation
ebb0cda to
4666a5c
Compare
|
|
||
|
|
||
| # create a list of 12 songs, none of which are sub-strings of any other song | ||
| def generate_song_list(world: World, frog: bool, warp: bool) -> dict[str, Song]: |
There was a problem hiding this comment.
Is there a technical reason that frogs2 is using this same function? Like will the mini-game break if the frog-song has another song as a sub-string?
If not, I think it would be cleaner to have it have its own function for generating randomly and probably its own dictionary entry for plando. If more enough code is similar perhaps it could be refactored into a few more functions shared between them.
If so, perhaps this could also fix that issue so that the code can be separated.
There was a problem hiding this comment.
I just tested this and it looks like the minigame doesn't break, so I will remove the subsong check.
There was a problem hiding this comment.
Actually, looking at the code, the subsong check is already skipped for frogs 2. I don't think moving it to a separate function makes sense, as it would have to duplicate a lot of the existing behavior, namely selecting between using a plando'd melody, the vanilla melody, or a random one.
|
Reviewed by @GSKirox and @rrealmuto in voice. |
This PR turns the “Randomize Ocarina Melodies” setting into a multiselect and adds a 3rd option “Frogs Ocarina Game” which randomizes the song that needs to be played for the “ZR Frogs Ocarina Game” check. The notes appear in the spoiler log and can be plando'd like the other melodies, but the melody is locked to a length of exactly 14 notes. Rather than using the existing algorithm for generating random songs, a fully random sequence of notes with even weights is generated.
Special thanks to @rrealmuto whose
random_frog_songbranch served as the basis for this PR.I've also included a drive-by fix where the misc. location hint for frogs 2 was incorrectly assumed to be reachable as adult.