This is a block that when hit from below, will flip the ON/OFF switch for a set duration of time, before reverting back. You can also set a duration multiplier, and have it trigger by sprites and capespins. Uses 2 bytes of freeRAM.
Requested by Stivi.
Tested with: Lunar Magic 3.21, GPS 1.4.21, UberASM Tool 1.4, SA-1 1.32, Snes9x 1.60.
Works fine for the most part, but there's an issue which needs to be fixed. If you hit/interact with the block on the same frame that the timer goes to 0, you can make it trigger it again without it changing the state, which will result in the ON/OFF having the wrong status when the timer goes to 0 again (actually, the state changes on that frame, but it's then changed again on the next frame. This is pretty easy to do with cape, as you just need to spin jump some time before the switch reverts back, but it's also possible with sprites and Mario (although frame perfect). Also, I'm not sure the !freeram2 flag is needed, shouldn't the timer be enough?
Another suggestion is to also add a Mario fireball option.