• 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!
  • 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