• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
5
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:

    mybusiness

    Guest
    0
    Posts
    In PokeBattle_Battle class that would be:
    Code:
    def hasAllBattlersMovedThisRound?
      for this in priority
        return false if @battlers[this].hasMovedThisRound?
      end
      return true
    end
     

    WolfPP

    Spriter/ Pixel Artist
    1,309
    Posts
    5
    Years
  • In PokeBattle_Battle class that would be:
    Code:
    def hasAllBattlersMovedThisRound?
      for this in priority
        return false if @battlers[this].hasMovedThisRound?
      end
      return true
    end

    Did you try to add that code into yours Shields Down script?
     
    153
    Posts
    4
    Years
    • Seen Feb 4, 2020
    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