Advertiser Content

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 1 Hour Ago
Posted 3 Hours Ago
806 posts
1.2 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):
  def hasMovedThisRound?
    return false if !@lastRoundMoved
    return @lastRoundMoved==@battle.turncount
  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!

WolfPP

Discord: Wolf#1235

Male
Brazil
Seen 1 Hour Ago
Posted 3 Hours Ago
806 posts
1.2 Years
In PokeBattle_Battle class that would be:
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?
Advertiser Content