• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Akari, Red, Kris, May - which Pokémon protagonist is your favorite? Let us know by voting in our semifinal favorite protagonist poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Question] How do I check the type of the last move used in the battle?

  • 2
    Posts
    4
    Years
    • Seen Dec 30, 2020
    As in I use "move X", and if the last move used (no matter who used it) was "Y type", "move X" changes.
    I saw "@battle.lastMoveUsed" in the code but I can't retrieve the move's type with my very limited knowledge.
    Using essentials 17.
     
    I think that refers to a specific pokemon's last move used, not the last move used in the battle.
     
    I think that refers to a specific pokemon's last move used, not the last move used in the battle.

    You can use @battle.lastMoveUsed to get the ID of the last move used in battle, but you might have to create a new Pokebattle_Move object with that ID to get its type. Alternatively, you could probably replicate the code for lastMoveUsedType in Pokebattle_Battler to Pokebattle_Battle to get it working like that.
     
    As in I use "move X", and if the last move used (no matter who used it) was "Y type", "move X" changes.
    I saw "@battle.lastMoveUsed" in the code but I can't retrieve the move's type with my very limited knowledge.
    Using essentials 17.

    Don't know if this will help but what about checking the code for keckleons ability that changes its type based on what move was last used against it., there could be something there.
     
    Back
    Top