• 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.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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!
  • 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,297
    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