Advertiser Content

Error Error related with pbUseMove

Started by Gammazeth August 28th, 2019 2:04 PM
  • 928 views
  • 4 replies
Seen 4 Weeks Ago
Posted September 8th, 2019
31 posts
78 Days
I don't think so, I did CTRL+SHIFT+F and searched for def pbUseMove and found this :

and here's my code :
def pbUseMoveSimple(moveid,index=-1,target=-1)
choice=[]
choice[0]=1 # "Use move"
choice[1]=index # Index of move to be used in user's moveset
choice[2]=PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(moveid)) # PokeBattle_Move object of the move
choice[2].pp=-1
choice[3]=target # Target (-1 means no target yet)
if index>=0
@battle.choices[@index][1]=index
end
PBDebug.log("#{pbThis} used simple move #{choice[2].name}")
side=(@battle.pbIsOpposing?(self.index)) ? 1 : 0
owner=@battle.pbGetOwnerIndex(self.index)
if @battle.zMove[side][owner]==self.index
crystal = pbZCrystalFromType(choice[2].type)
PokeBattle_ZMoves.new(@battle,self,choice[2],crystal,choice)
else
pbUseMove(choice,true)
end
return
end
def pbUseMove(choice,specialusage=false)
# TODO: lastMoveUsed is not to be updated on nested calls
# Note: user.lastMoveUsedType IS to be updated on nested calls; is used for Conversion 2
turneffects=[]
turneffects[PBEffects::SpecialUsage]=specialusage
turneffects[PBEffects::SkipAccuracyCheck]=(specialusage && choice[2]!=@battle.struggle)
turneffects[PBEffects::PassedTrying]=false
turneffects[PBEffects::TotalDamage]=0
# Start using the move
pbBeginTurn(choice)
# Force the use of certain moves if they're already being used
if @effects[PBEffects::TwoTurnAttack]>0
@effects[PBEffects::HyperBeam]>0
@effects[PBEffects::Outrage]>0
@effects[PBEffects::Rollout]>0
@effects[PBEffects::Uproar]>0
@effects[PBEffects::Bide]>0
choice[2]=PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(@currentMove))
turneffects[PBEffects::SpecialUsage]=true
PBDebug.log("Continuing multi-turn move #{choice[2].name}")
elsif @effects[PBEffects::Encore]>0 && choice[1]>=0
if @battle.pbCanShowCommands?(@index) &&
@battle.pbCanChooseMove?(@index,@effects[PBEffects::EncoreIndex],false)
if choice[1]!=@effects[PBEffects::EncoreIndex] # Was Encored mid-round
choice[1]=@effects[PBEffects::EncoreIndex]
choice[2]=@moves[@effects[PBEffects::EncoreIndex]]
choice[3]=-1 # No target chosen
end
PBDebug.log("Using Encored move #{choice[2].name}")
end
end
thismove=choice[2]
return if !thismove thismove.id==0 # if move was not chosen
if !turneffects[PBEffects::SpecialUsage]
# TODO: Quick Claw message
Advertiser Content