LagoLunatic / wwrando

Wind Waker Randomizer
https://lagolunatic.github.io/wwrando/
MIT License
383 stars 85 forks source link

Allow players to start a game with fewer than 3 hearts #370

Closed Aelire closed 6 months ago

Aelire commented 7 months ago

Currently the minimum number of heart containers to start a seed with is set to 3, matching vanilla. As a difficulty option, letting the player start with fewer heart containers adds some difficulty. This changes the starting_hcs option to be the absolute number of starting heart containers, and sets the minimum to 1 (but leaves the default at 3) so that it's possible to start with 2 or 1 heart containers instead of 3

The only bug I ran into while testing that so far is that when saving and quitting, the current health was always reset to 3 regardless of the max number of hearts. I addressed that by piggybacking on the patch to refill the magic meter on save load, adding a cap to the current health so it doesn't go over the max

Finally to avoid incessant beeping, there is a tweak included that prevents beeping at full health. Otherwise when the maximum health is 1 heart the game gives the low health beep permanently. However, I haven't done anything to the link "tired" animation/hitbox that is active at low health, since it's not as annoying as the beeping (and I have no idea how to disable it)

Things I have tested:

LagoLunatic commented 7 months ago

There's a bug where if you get a game over and choose to continue, your health will be reset to 3 hearts, exceeding the maximum.

Aelire commented 7 months ago

Added the same kind of patch to the gameover continue code too, thanks for catching that! I also updated the addresses to offset from the start of g_dComIfG_gameInfo instead of pointing in the middle of it

Aelire commented 7 months ago

Found another bug, when checking / resetting against maxLife it needs to be rounded to the lower full heart, otherwise if you have 1 heart container and 1 piece of heart on reset you'll have 1 and 1/4 heart, but the maximum should still be 1 heart until 4 pieces are collected