• 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.
  • 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!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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] Help with ability called Brainless

What exactly did you do for the ability?

Here's the code!
Spoiler:

I put it under where Encore makes the Pokemon repeat moves.
 
Here's what I came up with after seeing your code, though I haven't tested it out (actually turned out to be simpler than I initially expected). Put this after
"elsif @effects[PBEffects::Encore]>0 && choice[1]>=0" in Pokebattle_Battler:
Code:
    elsif hasWorkingAbility(:BRAINLESS) && choice[1]>=0 # Chose a move
      [email protected](@moves.length)
      if @battle.pbCanShowCommands?(@index) && @battle.pbCanChooseMove?(@index,r,false)
        choice[1]=r
        choice[2]=@moves[r]
        choice[3]=-1 # No target chosen
      end
In your original code, you put it so it would show an animation, but Pokebattle_MoveEffects already does that so you don't need to. Also I don't think you're using "choices" correctly.
 
Here's what I came up with after seeing your code, though I haven't tested it out (actually turned out to be simpler than I initially expected). Put this after
"elsif @effects[PBEffects::Encore]>0 && choice[1]>=0" in Pokebattle_Battler:
Code:
    elsif hasWorkingAbility(:BRAINLESS) && choice[1]>=0 # Chose a move
      [email protected](@moves.length)
      if @battle.pbCanShowCommands?(@index) && @battle.pbCanChooseMove?(@index,r,false)
        choice[1]=r
        choice[2]=@moves[r]
        choice[3]=-1 # No target chosen
      end
In your original code, you put it so it would show an animation, but Pokebattle_MoveEffects already does that so you don't need to. Also I don't think you're using "choices" correctly.

So should I try your code first?
 
Here's what I came up with after seeing your code, though I haven't tested it out (actually turned out to be simpler than I initially expected). Put this after
"elsif @effects[PBEffects::Encore]>0 && choice[1]>=0" in Pokebattle_Battler:
Code:
    elsif hasWorkingAbility(:BRAINLESS) && choice[1]>=0 # Chose a move
      [email protected](@moves.length)
      if @battle.pbCanShowCommands?(@index) && @battle.pbCanChooseMove?(@index,r,false)
        choice[1]=r
        choice[2]=@moves[r]
        choice[3]=-1 # No target chosen
      end
In your original code, you put it so it would show an animation, but Pokebattle_MoveEffects already does that so you don't need to. Also I don't think you're using "choices" correctly.

Thanks! It worked! :D
 
Back
Top