I woke up today with motivation to do this so here you go:
https://drive.google.com/file/d/1FeFLta ... sp=sharing
How does it work?
This essentially replaces the fire and ice flower with whatever you want. It comes preinstalled with fire and ice flower replacements, and I included a little demo level with a Gold Flower to show how a custom powerup might be implemented.
- Technically infinite powerups. The biggest bottleneck is your motivation to make player hitboxes and spritesheets and code.
- As mentioned above, every powerup state can have its own hitboxes and spritesheets. Hitboxes must be named like "mario-powerupname.ini", so in the example for the gold flower that'd be "mario-ap_goldflower.ini".
- Every powerup gets onTick, onDraw, onTickEnd which run only when the powerup is active, as well as onEnable and onDisable for when the player switches to and fro.
- As a little additional feature, you can define powerup tiers, or just whether you would like to have the powerup turn into a mushroom when the player is small.
- Powerups save across levels.
- You cannot make mini mario since every powerup has the properties of a full grown adult (can smash bricks and turn blocks).
- Only works with Mario, Luigi, Peach, Toad. Link's projectile timers make extracting fire and ice flower for this impossible. The rest all have custom code that is impossible to fight against.
-- registerPowerup registers a new powerup to the system
--- libraryName: string - The name of the library containing powerup information. One library per powerup. Think of it as a require(libraryName) call
-- Returns the library table for the powerup
-- Returns the player's current powerup, accounting for anotherpowerup powerups. Use this instead of player.powerup.
-- Use this instead of setting powerup. Silent avoids the powerup animation and sound.
function ap.setPlayerPowerup(appower, silent)
-- registerItemTier registers a new tier chain for items.
-- spawnedItem: number - The item that spawns from a block.
-- chain: table - The list of states ordered by significance. Numbers correspond to vanilla states, strings correspond to the names of anotherpowerup powerups. See demo for more info.
-- if you provide chain as "true", it will accept everything except for small mario
function ap.registerItemTier(spawnedItem, chain)
Score is doubled up for vanilla powerup npcs but literally who cares.
If you make powerups for this make sure that they're clearly marked as anotherpowerup mods so people can find them.