authorblues / bizhawk-shuffler-2

A script to randomly shuffle between games played in Bizhawk, with plugins to enhance the experience
MIT License
58 stars 21 forks source link

MMXTreme 1 and 2 - address Options menu shuffles and character swaps #77

Closed Phiggle closed 3 months ago

Phiggle commented 3 months ago

This should address issue #66 (which, by the way, had an extremely helpful clip of the problem!)

This adds a couple of flexible options to generic_swap to swap/not swap after HP and lives are processed. If a method isn't given, nothing happens, like with gmode. These could be useful for other scenarios.

MMXTreme 1 I couldn't replicate the swap on the Options menu, but it absolutely was happening on hitting Retry on a game over. It's because your lives "drop" to 255, or -1 if it's considered a signed byte. You do swap on losing your last life. This doesn't need those generic_swap changes.

MMXTreme 2 The same lives-as-signed-byte fix was needed as for MMXTreme 1.

In addition, going into Options or Boss Attack sets your lives to 0. This causes a wrong swap. Used swap_exceptions on this.

Also, Boss Attack sets your maxhp to 32, and if you fire up a game with less than 32 maxhp (like 16 on a new game), you'll swap because hp dropped. Used swap_exceptions to address this.

Finally, fixed a problem where you swap if you tag in X/Zero and they have less HP than the character you had been using. swap_exceptions is true on the frame where the character and HP switch together.

Phiggle commented 3 months ago

There are some similar issues in MMX3 (swap Zero in/out) and possibly MMX4 (swaps on entering any of the three areas after you get a "grade" in Cyber Peacock's stage, not sure what causes this).

I could dive in on those too if this general idea works for you all.