while using a custom powerup isn't a bad idea, i'd like to note that this isn't as difficult as one might think. while it's far from a trivial undertaking (and thus i don't have time to write cohesive working code as an example), the ideas would be something like this:
memory offset 0x172 can be set to stop the player from shooting fireballs. while run is held, you can count a timer up in the background and then, upon the run key being released, spawn a different npc depending on the charge time.
as for the double jump, something like this should work for checking whether or not the player is midair:
Code: Select all
local function playerMidAir()
return not ((player:isOnGround() and math.abs(player.speedY) <= 0.01) or player:mem(0x48, FIELD_WORD) > 0 or player:mem(0x176, FIELD_WORD) > 0)
end
then, if the down key is pressed, you can spawn a fireball with the "dontMove" flag set, and force the player to jump again (this double jump code is old but should still work):
Code: Select all
player:mem(0x11C, FIELD_WORD, Defines.jumpheight)
player.speedY = (-5.7) - math.abs(player.speedX) * 0.2
player:mem(0x11E, FIELD_BOOL, false)
player:mem(0x50, FIELD_BOOL, false)
(for this to work with multiple players, you'd replace the "player" variable with whichever player you're targeting)