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.