• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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.
     
    According to PokeBattle_Battler line 29 there is already an attribute for calling the type of the last move used.
    Code:
    lastMoveUsedType
     
    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