• 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!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • 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.

[Scripting Question] [SOLVED] 'hasMovedThisRound?' for all battlers

WolfPP

Spriter/ Pixel Artist
  • 1,309
    Posts
    6
    Years
    3How can I make a 'hasMovedThisRound?' but for all battlers (if single or double battle)?

    Here is the code for 'hasMovedThisRound?' (inside PokeBattle_Battler script):
    Code:
      def hasMovedThisRound?
        return false if !@lastRoundMoved
        return @[email protected]
      end

    Now, I would like to create a code (hasAllBattlersMovedThisRound?) to recognize if all pokémon into the battle has used its moves.
    The reason is to make a better script for some abilities that use 'end of turn' to be triggered to change the pokémon's form (like Power Construct, Zen Mode, Schooling, etc).

    Thank you!
     
    Last edited:
    In PokeBattle_Battle class that would be:
    Code:
    def hasAllBattlersMovedThisRound?
      for this in priority
        return false if @battlers[this].hasMovedThisRound?
      end
      return true
    end
     
    Sorry bro,

    I am only starting to understand the language and I never tried to manipulate battle stuff. hope someone can help you
     
    Back
    Top