Postby yoshiegg » Mon Apr 20, 2020 1:11 pm
As we have a range of dummy npc since, I think, Beta 3, I imagine you could create a new NPC in that range having the same behavior and properties of a vanilla powerup and then make an onNPCKill event in lua setting a variable to true. Now you only need to set this variable back to false if the powerup state of the player is unequal to the one the new NPC turns the player into or if the player collects another powerup that makes him turn into that state. I have seen someone (TheDinoKing, if I remember correctly) using this method to add a superball flower over one of the three fireflower slots. However, I'm not the greatest expert there is when it comes to NPC modification so please correct me incase I'm wrong or approve if this is indeed possible.
Another thought of mine would be just making that NPC collectable, then toggle a variable to true when collecting it and make it change to false when the player is hit via a player:mem offset or when he collects a powerup via the onNPCKill event with if KiledNPC.id == 9 or killedNPC.id == 14 and so on (the npc ids of all powerups except for the mushrooms). Also I think you might want to look into the AnotherPowerup Script written by Enjl.