The PokéCommunity Forums Fan Games Game Development Scripts, Tutorials & Tools
Essentials Script Gen VII Scripts (Z-Moves, Abilities and Moves,)

Scripts, Tutorials & Tools This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Reply
 
Thread Tools
  #51    
Old January 1st, 2017 (11:32 AM).
icsir3's Avatar
icsir3 icsir3 is offline
     
    Join Date: Aug 2016
    Location: Hungary
    Gender: Male
    Nature: Relaxed
    Posts: 30
    Quote:
    Originally Posted by M3rein View Post
    I'm not so sure how relevant this is, but this script isn't working for me. I've been trying desperately to make something myself, but don't have any luck. Your script tells me it doesn't understand ">".
    Same here
    Reply With Quote
      #52    
    Old January 4th, 2017 (12:10 PM).
    PIMOC PIMOC is offline
       
      Join Date: Jul 2016
      Gender: Male
      Posts: 15
      I tried to create a Spectral Thief, since I'm also having trouble with that code. Could you guys
      check if it is working properly? Here it is:


      Code:
      class PokeBattle_Move_167 < PokeBattle_Move
        def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
          if opponent.pbOwnSide.effects[PBEffects::CraftyShield]
            @battle.pbDisplay(_INTL("But it failed!"))
            return -1
          end
          pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
          for i in [PBStats::ATTACK,PBStats::DEFENSE,PBStats::SPEED,
                    PBStats::SPATK,PBStats::SPDEF,PBStats::ACCURACY,PBStats::EVASION]
            attacker.stages[i]=opponent.stages[i]
            opponent.stages[i]=0
          end
          @battle.pbDisplay(_INTL("{1} copied {2}'s stat changes!",attacker.pbThis,opponent.pbThis(true)))
          ret=super(attacker,opponent,hitnum,alltargets,showanimation)
          return ret    
        end  
      end
      Reply With Quote
        #53    
      Old January 4th, 2017 (1:27 PM).
      Rot8er_ConeX's Avatar
      Rot8er_ConeX Rot8er_ConeX is offline
         
        Join Date: May 2015
        Location: The Dissa Region
        Gender: Male
        Posts: 822
        Quote:
        Originally Posted by PIMOC View Post
        I tried to create a Spectral Thief, since I'm also having trouble with that code. Could you guys
        check if it is working properly? Here it is:


        Code:
        class PokeBattle_Move_167 < PokeBattle_Move
          def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
            if opponent.pbOwnSide.effects[PBEffects::CraftyShield]
              @battle.pbDisplay(_INTL("But it failed!"))
              return -1
            end
            pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
            for i in [PBStats::ATTACK,PBStats::DEFENSE,PBStats::SPEED,
                      PBStats::SPATK,PBStats::SPDEF,PBStats::ACCURACY,PBStats::EVASION]
              attacker.stages[i]=opponent.stages[i]
              opponent.stages[i]=0
            end
            @battle.pbDisplay(_INTL("{1} copied {2}'s stat changes!",attacker.pbThis,opponent.pbThis(true)))
            ret=super(attacker,opponent,hitnum,alltargets,showanimation)
            return ret    
          end  
        end
        Spectral Thief doesn't copy all stat changes. It actually steals positive stat changes.

        Code:
        ################################################################################
        # Steals target's stat boosts, then attacks
        ################################################################################
        class PokeBattle_Move_1A1 < PokeBattle_Move
          def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
            if opponent.stages[1]>0 || opponent.stages[2]>0 || opponent.stages[3]>0 ||
               opponent.stages[4]>0 || opponent.stages[5]>0 || opponent.stages[6]>0 ||
               opponent.stages[7]>0
              stolenstats=[0,0,0,0,0,0,0,0]
              for i in 0...8
                stolenstats[i]=opponent.stages[i]*1 if opponent.stages[i]>0
                opponent.stages[i]=0 if opponent.stages[i]>0
              end
              @battle.pbDisplay(_INTL("{1} stole {2}'s stat boosts!",attacker.pbThis,opponent.pbThis(true)))
              showanim=true
              for i in 0...6
                if attacker.pbCanIncreaseStatStage?(i,true,attacker) && stolenstats[i]>0
                  attacker.pbIncreaseStat(i,stolenstats[i],true,showanim,attacker)
                  showanim=false
                end
              end
            end
            ret=super(attacker,opponent,hitnum,alltargets,showanimation)
            return ret
          end
        end
        __________________
        Features of Pokemon Entropy

        The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
        Reply With Quote
          #54    
        Old January 5th, 2017 (12:53 AM).
        PIMOC PIMOC is offline
           
          Join Date: Jul 2016
          Gender: Male
          Posts: 15
          Quote:
          Originally Posted by Rot8er_ConeX View Post
          Spectral Thief doesn't copy all stat changes. It actually steals positive stat changes.

          Code:
          ################################################################################
          # Steals target's stat boosts, then attacks
          ################################################################################
          class PokeBattle_Move_1A1 < PokeBattle_Move
            def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
              if opponent.stages[1]>0 || opponent.stages[2]>0 || opponent.stages[3]>0 ||
                 opponent.stages[4]>0 || opponent.stages[5]>0 || opponent.stages[6]>0 ||
                 opponent.stages[7]>0
                stolenstats=[0,0,0,0,0,0,0,0]
                for i in 0...8
                  stolenstats[i]=opponent.stages[i]*1 if opponent.stages[i]>0
                  opponent.stages[i]=0 if opponent.stages[i]>0
                end
                @battle.pbDisplay(_INTL("{1} stole {2}'s stat boosts!",attacker.pbThis,opponent.pbThis(true)))
                showanim=true
                for i in 0...6
                  if attacker.pbCanIncreaseStatStage?(i,true,attacker) && stolenstats[i]>0
                    attacker.pbIncreaseStat(i,stolenstats[i],true,showanim,attacker)
                    showanim=false
                  end
                end
              end
              ret=super(attacker,opponent,hitnum,alltargets,showanimation)
              return ret
            end
          end
          Thanks for your swift answer! I thought the line "opponent.stages[i]=0" after would reset the foe's stat changes to 0, which would be the same as "steal" it. However, I guess if the opponent uses Swords Dance on turn 1, and then Bulk Up on turn 2, "my" Spectral Thief would end with +1 from Bulk Up and would discard the +2 from the Swords Dance, correct?
          Anyway, there seems to be a problem with your code. Everytime I use the move it doesn't work, and the error message says something about the ">". Undefined value or method, I don't remember.
          Reply With Quote
            #55    
          Old January 6th, 2017 (10:04 AM).
          PIMOC PIMOC is offline
             
            Join Date: Jul 2016
            Gender: Male
            Posts: 15
            Well, after the correction from Rot8er_Conex I managed to create a new code for Spectral Thief.
            It's horribly ugly, incredibly long and far, far - really far - from elegant, since I can't script, but it
            does seems to be working so far.
            If there's anybody interested, just post on this thread that I'll put it here.
            Reply With Quote
              #56    
            Old January 12th, 2017 (5:02 PM).
            Ice Cream Sand Witch's Avatar
            Ice Cream Sand Witch Ice Cream Sand Witch is offline
               
              Join Date: Aug 2008
              Gender: Female
              Posts: 185
              I need help with First Impression.

              To add it, I created a new Move Effect which copies the part of Fake Out's code that fails if it isn't the first turn, but didn't copy the part about flinching since First Impression doesn't make the target flinch unlike Fake Out. I assumed this should work, but I'm getting a Syntax Error on the line where First Impression's move effect ends.

              This is the part of Fake Out that I copied (15D being the code for the new First Impression move effect):

              lass PokeBattle_Move_15D < PokeBattle_Move
              def pbMoveFailed(attacker,opponent)
              return (attacker.turncount>1)
              end

              If this works for Fake Out, why wouldn't it work for First Impression?

              EDIT: Never mind, I figured it out. I had to add another "end" before the end at the end, I assume for spacing reasons.
              Reply With Quote
                #57    
              Old January 13th, 2017 (5:58 AM).
              Marin's Avatar
              Marin Marin is offline
              Not Bored
               
              Join Date: Nov 2016
              Age: 16
              Gender: Other
              Posts: 792
              Quote:
              Originally Posted by PIMOC View Post
              Well, after the correction from Rot8er_Conex I managed to create a new code for Spectral Thief.
              It's horribly ugly, incredibly long and far, far - really far - from elegant, since I can't script, but it
              does seems to be working so far.
              If there's anybody interested, just post on this thread that I'll put it here.
              I'd be interested to check it out!;)
              Reply With Quote
                #58    
              Old January 13th, 2017 (10:46 AM).
              PIMOC PIMOC is offline
                 
                Join Date: Jul 2016
                Gender: Male
                Posts: 15
                Quote:
                Originally Posted by M3rein View Post
                I'd be interested to check it out!;)
                I said it is awfully long and probably overcomplicated, right?
                But here's what I got:

                Code:
                ################################################################################
                # Spectral Thief
                ################################################################################
                class PokeBattle_Move_167 < PokeBattle_Move
                  def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
                    if opponent.pbOwnSide.effects[PBEffects::CraftyShield]
                      @battle.pbDisplay(_INTL("But it failed!"))
                      return -1
                    end
                    if opponent.stages[PBStats::ATTACK]==0
                      attacker.pbIncreaseStat(PBStats::ATTACK,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==1
                      attacker.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==2
                      attacker.pbIncreaseStat(PBStats::ATTACK,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==3
                      attacker.pbIncreaseStat(PBStats::ATTACK,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==4
                      attacker.pbIncreaseStat(PBStats::ATTACK,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==5
                      attacker.pbIncreaseStat(PBStats::ATTACK,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==6
                      attacker.pbIncreaseStat(PBStats::ATTACK,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    end
                    if opponent.stages[PBStats::DEFENSE]==0
                      attacker.pbIncreaseStat(PBStats::DEFENSE,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==1
                      attacker.pbIncreaseStat(PBStats::DEFENSE,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==2
                      attacker.pbIncreaseStat(PBStats::DEFENSE,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==3
                      attacker.pbIncreaseStat(PBStats::DEFENSE,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==4
                      attacker.pbIncreaseStat(PBStats::DEFENSE,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==5
                      attacker.pbIncreaseStat(PBStats::DEFENSE,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==6
                      attacker.pbIncreaseStat(PBStats::DEFENSE,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    end
                    if opponent.stages[PBStats::SPEED]==0
                      attacker.pbIncreaseStat(PBStats::SPEED,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==1
                      attacker.pbIncreaseStat(PBStats::SPEED,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==2
                      attacker.pbIncreaseStat(PBStats::SPEED,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==3
                      attacker.pbIncreaseStat(PBStats::SPEED,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==4
                      attacker.pbIncreaseStat(PBStats::SPEED,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==5
                      attacker.pbIncreaseStat(PBStats::SPEED,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==6
                      attacker.pbIncreaseStat(PBStats::SPEED,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    end
                    if opponent.stages[PBStats::SPATK]==0
                      attacker.pbIncreaseStat(PBStats::SPATK,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==1
                      attacker.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==2
                      attacker.pbIncreaseStat(PBStats::SPATK,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==3
                      attacker.pbIncreaseStat(PBStats::SPATK,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==4
                      attacker.pbIncreaseStat(PBStats::SPATK,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==5
                      attacker.pbIncreaseStat(PBStats::SPATK,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==6
                      attacker.pbIncreaseStat(PBStats::SPATK,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    end
                    if opponent.stages[PBStats::SPDEF]==0
                      attacker.pbIncreaseStat(PBStats::SPDEF,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    elsif opponent.stages[PBStats::SPDEF]==1
                      attacker.pbIncreaseStat(PBStats::SPDEF,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    elsif opponent.stages[PBStats::SPDEF]==2
                      attacker.pbIncreaseStat(PBStats::SPDEF,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    elsif opponent.stages[PBStats::SPDEF]==3
                      attacker.pbIncreaseStat(PBStats::SPDEF,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    elsif opponent.stages[PBStats::SPDEF]==4
                      attacker.pbIncreaseStat(PBStats::SPDEF,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)  
                    elsif opponent.stages[PBStats::SPDEF]==5
                      attacker.pbIncreaseStat(PBStats::SPDEF,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    elsif opponent.stages[PBStats::SPDEF]==6
                      attacker.pbIncreaseStat(PBStats::SPDEF,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    end
                    if opponent.stages[PBStats::ACCURACY]==0
                      attacker.pbIncreaseStat(PBStats::ACCURACY,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    elsif opponent.stages[PBStats::ACCURACY]==1
                      attacker.pbIncreaseStat(PBStats::ACCURACY,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    elsif opponent.stages[PBStats::ACCURACY]==2
                      attacker.pbIncreaseStat(PBStats::ACCURACY,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)  
                    elsif opponent.stages[PBStats::ACCURACY]==3
                      attacker.pbIncreaseStat(PBStats::ACCURACY,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    elsif opponent.stages[PBStats::ACCURACY]==4
                      attacker.pbIncreaseStat(PBStats::ACCURACY,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    elsif opponent.stages[PBStats::ACCURACY]==5
                      attacker.pbIncreaseStat(PBStats::ACCURACY,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    elsif opponent.stages[PBStats::ACCURACY]==6
                      attacker.pbIncreaseStat(PBStats::ACCURACY,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    end
                    if opponent.stages[PBStats::EVASION]==0
                      attacker.pbIncreaseStat(PBStats::EVASION,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==1
                      attacker.pbIncreaseStat(PBStats::EVASION,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==2
                      attacker.pbIncreaseStat(PBStats::EVASION,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==3
                      attacker.pbIncreaseStat(PBStats::EVASION,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==4
                      attacker.pbIncreaseStat(PBStats::EVASION,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==5
                      attacker.pbIncreaseStat(PBStats::EVASION,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==6
                      attacker.pbIncreaseStat(PBStats::EVASION,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    end  
                    @battle.pbDisplay(_INTL("{1} stole {2}'s stat changes!",attacker.pbThis,opponent.pbThis(true)))
                    ret=super(attacker,opponent,hitnum,alltargets,showanimation)
                    return ret    
                  end  
                end
                Reply With Quote
                  #59    
                Old January 13th, 2017 (1:31 PM).
                Marin's Avatar
                Marin Marin is offline
                Not Bored
                 
                Join Date: Nov 2016
                Age: 16
                Gender: Other
                Posts: 792
                Quote:
                Originally Posted by PIMOC View Post
                I said it is awfully long and probably overcomplicated, right?
                But here's what I got:

                Code:
                ################################################################################
                # Spectral Thief
                ################################################################################
                class PokeBattle_Move_167 < PokeBattle_Move
                  def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
                    if opponent.pbOwnSide.effects[PBEffects::CraftyShield]
                      @battle.pbDisplay(_INTL("But it failed!"))
                      return -1
                    end
                    if opponent.stages[PBStats::ATTACK]==0
                      attacker.pbIncreaseStat(PBStats::ATTACK,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==1
                      attacker.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==2
                      attacker.pbIncreaseStat(PBStats::ATTACK,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==3
                      attacker.pbIncreaseStat(PBStats::ATTACK,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==4
                      attacker.pbIncreaseStat(PBStats::ATTACK,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==5
                      attacker.pbIncreaseStat(PBStats::ATTACK,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    elsif opponent.stages[PBStats::ATTACK]==6
                      attacker.pbIncreaseStat(PBStats::ATTACK,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ATTACK,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                    end
                    if opponent.stages[PBStats::DEFENSE]==0
                      attacker.pbIncreaseStat(PBStats::DEFENSE,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==1
                      attacker.pbIncreaseStat(PBStats::DEFENSE,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==2
                      attacker.pbIncreaseStat(PBStats::DEFENSE,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==3
                      attacker.pbIncreaseStat(PBStats::DEFENSE,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==4
                      attacker.pbIncreaseStat(PBStats::DEFENSE,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==5
                      attacker.pbIncreaseStat(PBStats::DEFENSE,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    elsif opponent.stages[PBStats::DEFENSE]==6
                      attacker.pbIncreaseStat(PBStats::DEFENSE,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                      opponent.pbReduceStat(PBStats::DEFENSE,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                    end
                    if opponent.stages[PBStats::SPEED]==0
                      attacker.pbIncreaseStat(PBStats::SPEED,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==1
                      attacker.pbIncreaseStat(PBStats::SPEED,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==2
                      attacker.pbIncreaseStat(PBStats::SPEED,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==3
                      attacker.pbIncreaseStat(PBStats::SPEED,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==4
                      attacker.pbIncreaseStat(PBStats::SPEED,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==5
                      attacker.pbIncreaseStat(PBStats::SPEED,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    elsif opponent.stages[PBStats::SPEED]==6
                      attacker.pbIncreaseStat(PBStats::SPEED,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPEED,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                    end
                    if opponent.stages[PBStats::SPATK]==0
                      attacker.pbIncreaseStat(PBStats::SPATK,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==1
                      attacker.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==2
                      attacker.pbIncreaseStat(PBStats::SPATK,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==3
                      attacker.pbIncreaseStat(PBStats::SPATK,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==4
                      attacker.pbIncreaseStat(PBStats::SPATK,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==5
                      attacker.pbIncreaseStat(PBStats::SPATK,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    elsif opponent.stages[PBStats::SPATK]==6
                      attacker.pbIncreaseStat(PBStats::SPATK,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPATK,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                    end
                    if opponent.stages[PBStats::SPDEF]==0
                      attacker.pbIncreaseStat(PBStats::SPDEF,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    elsif opponent.stages[PBStats::SPDEF]==1
                      attacker.pbIncreaseStat(PBStats::SPDEF,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    elsif opponent.stages[PBStats::SPDEF]==2
                      attacker.pbIncreaseStat(PBStats::SPDEF,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    elsif opponent.stages[PBStats::SPDEF]==3
                      attacker.pbIncreaseStat(PBStats::SPDEF,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    elsif opponent.stages[PBStats::SPDEF]==4
                      attacker.pbIncreaseStat(PBStats::SPDEF,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)  
                    elsif opponent.stages[PBStats::SPDEF]==5
                      attacker.pbIncreaseStat(PBStats::SPDEF,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    elsif opponent.stages[PBStats::SPDEF]==6
                      attacker.pbIncreaseStat(PBStats::SPDEF,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                      opponent.pbReduceStat(PBStats::SPDEF,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                    end
                    if opponent.stages[PBStats::ACCURACY]==0
                      attacker.pbIncreaseStat(PBStats::ACCURACY,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    elsif opponent.stages[PBStats::ACCURACY]==1
                      attacker.pbIncreaseStat(PBStats::ACCURACY,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    elsif opponent.stages[PBStats::ACCURACY]==2
                      attacker.pbIncreaseStat(PBStats::ACCURACY,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)  
                    elsif opponent.stages[PBStats::ACCURACY]==3
                      attacker.pbIncreaseStat(PBStats::ACCURACY,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    elsif opponent.stages[PBStats::ACCURACY]==4
                      attacker.pbIncreaseStat(PBStats::ACCURACY,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    elsif opponent.stages[PBStats::ACCURACY]==5
                      attacker.pbIncreaseStat(PBStats::ACCURACY,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    elsif opponent.stages[PBStats::ACCURACY]==6
                      attacker.pbIncreaseStat(PBStats::ACCURACY,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                      opponent.pbReduceStat(PBStats::ACCURACY,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                    end
                    if opponent.stages[PBStats::EVASION]==0
                      attacker.pbIncreaseStat(PBStats::EVASION,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==1
                      attacker.pbIncreaseStat(PBStats::EVASION,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==2
                      attacker.pbIncreaseStat(PBStats::EVASION,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==3
                      attacker.pbIncreaseStat(PBStats::EVASION,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==4
                      attacker.pbIncreaseStat(PBStats::EVASION,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==5
                      attacker.pbIncreaseStat(PBStats::EVASION,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    elsif opponent.stages[PBStats::EVASION]==6
                      attacker.pbIncreaseStat(PBStats::EVASION,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                      opponent.pbReduceStat(PBStats::EVASION,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                    end  
                    @battle.pbDisplay(_INTL("{1} stole {2}'s stat changes!",attacker.pbThis,opponent.pbThis(true)))
                    ret=super(attacker,opponent,hitnum,alltargets,showanimation)
                    return ret    
                  end  
                end
                I tested it out real quick and it appears to be working as described on Bulbapedia. I haven't really stresstested it though, since I'm lacking time. Even though it's massive, it worked well, which is what matters. Other Spectral Thief's I tested didn't work for me, so this one ends up being the best one for me.
                Reply With Quote
                  #60    
                Old January 13th, 2017 (7:21 PM).
                Rot8er_ConeX's Avatar
                Rot8er_ConeX Rot8er_ConeX is offline
                   
                  Join Date: May 2015
                  Location: The Dissa Region
                  Gender: Male
                  Posts: 822
                  Quote:
                  Originally Posted by PIMOC View Post
                  I said it is awfully long and probably overcomplicated, right?
                  But here's what I got:

                  Code:
                  ################################################################################
                  # Spectral Thief
                  ################################################################################
                  class PokeBattle_Move_167 < PokeBattle_Move
                    def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
                      if opponent.pbOwnSide.effects[PBEffects::CraftyShield]
                        @battle.pbDisplay(_INTL("But it failed!"))
                        return -1
                      end
                      if opponent.stages[PBStats::ATTACK]==0
                        attacker.pbIncreaseStat(PBStats::ATTACK,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ATTACK,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                      elsif opponent.stages[PBStats::ATTACK]==1
                        attacker.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ATTACK,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                      elsif opponent.stages[PBStats::ATTACK]==2
                        attacker.pbIncreaseStat(PBStats::ATTACK,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ATTACK,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                      elsif opponent.stages[PBStats::ATTACK]==3
                        attacker.pbIncreaseStat(PBStats::ATTACK,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ATTACK,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                      elsif opponent.stages[PBStats::ATTACK]==4
                        attacker.pbIncreaseStat(PBStats::ATTACK,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ATTACK,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                      elsif opponent.stages[PBStats::ATTACK]==5
                        attacker.pbIncreaseStat(PBStats::ATTACK,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ATTACK,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                      elsif opponent.stages[PBStats::ATTACK]==6
                        attacker.pbIncreaseStat(PBStats::ATTACK,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ATTACK,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ATTACK,attacker,false,self)
                      end
                      if opponent.stages[PBStats::DEFENSE]==0
                        attacker.pbIncreaseStat(PBStats::DEFENSE,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                        opponent.pbReduceStat(PBStats::DEFENSE,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                      elsif opponent.stages[PBStats::DEFENSE]==1
                        attacker.pbIncreaseStat(PBStats::DEFENSE,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                        opponent.pbReduceStat(PBStats::DEFENSE,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                      elsif opponent.stages[PBStats::DEFENSE]==2
                        attacker.pbIncreaseStat(PBStats::DEFENSE,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                        opponent.pbReduceStat(PBStats::DEFENSE,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                      elsif opponent.stages[PBStats::DEFENSE]==3
                        attacker.pbIncreaseStat(PBStats::DEFENSE,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                        opponent.pbReduceStat(PBStats::DEFENSE,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                      elsif opponent.stages[PBStats::DEFENSE]==4
                        attacker.pbIncreaseStat(PBStats::DEFENSE,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                        opponent.pbReduceStat(PBStats::DEFENSE,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                      elsif opponent.stages[PBStats::DEFENSE]==5
                        attacker.pbIncreaseStat(PBStats::DEFENSE,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                        opponent.pbReduceStat(PBStats::DEFENSE,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                      elsif opponent.stages[PBStats::DEFENSE]==6
                        attacker.pbIncreaseStat(PBStats::DEFENSE,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                        opponent.pbReduceStat(PBStats::DEFENSE,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::DEFENSE,attacker,false,self)
                      end
                      if opponent.stages[PBStats::SPEED]==0
                        attacker.pbIncreaseStat(PBStats::SPEED,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPEED,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                      elsif opponent.stages[PBStats::SPEED]==1
                        attacker.pbIncreaseStat(PBStats::SPEED,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPEED,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                      elsif opponent.stages[PBStats::SPEED]==2
                        attacker.pbIncreaseStat(PBStats::SPEED,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPEED,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                      elsif opponent.stages[PBStats::SPEED]==3
                        attacker.pbIncreaseStat(PBStats::SPEED,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPEED,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                      elsif opponent.stages[PBStats::SPEED]==4
                        attacker.pbIncreaseStat(PBStats::SPEED,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPEED,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                      elsif opponent.stages[PBStats::SPEED]==5
                        attacker.pbIncreaseStat(PBStats::SPEED,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPEED,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                      elsif opponent.stages[PBStats::SPEED]==6
                        attacker.pbIncreaseStat(PBStats::SPEED,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPEED,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPEED,attacker,false,self)
                      end
                      if opponent.stages[PBStats::SPATK]==0
                        attacker.pbIncreaseStat(PBStats::SPATK,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPATK,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                      elsif opponent.stages[PBStats::SPATK]==1
                        attacker.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPATK,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                      elsif opponent.stages[PBStats::SPATK]==2
                        attacker.pbIncreaseStat(PBStats::SPATK,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPATK,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                      elsif opponent.stages[PBStats::SPATK]==3
                        attacker.pbIncreaseStat(PBStats::SPATK,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPATK,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                      elsif opponent.stages[PBStats::SPATK]==4
                        attacker.pbIncreaseStat(PBStats::SPATK,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPATK,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                      elsif opponent.stages[PBStats::SPATK]==5
                        attacker.pbIncreaseStat(PBStats::SPATK,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPATK,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                      elsif opponent.stages[PBStats::SPATK]==6
                        attacker.pbIncreaseStat(PBStats::SPATK,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPATK,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPATK,attacker,false,self)
                      end
                      if opponent.stages[PBStats::SPDEF]==0
                        attacker.pbIncreaseStat(PBStats::SPDEF,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPDEF,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                      elsif opponent.stages[PBStats::SPDEF]==1
                        attacker.pbIncreaseStat(PBStats::SPDEF,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPDEF,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                      elsif opponent.stages[PBStats::SPDEF]==2
                        attacker.pbIncreaseStat(PBStats::SPDEF,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPDEF,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                      elsif opponent.stages[PBStats::SPDEF]==3
                        attacker.pbIncreaseStat(PBStats::SPDEF,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPDEF,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                      elsif opponent.stages[PBStats::SPDEF]==4
                        attacker.pbIncreaseStat(PBStats::SPDEF,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPDEF,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)  
                      elsif opponent.stages[PBStats::SPDEF]==5
                        attacker.pbIncreaseStat(PBStats::SPDEF,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPDEF,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                      elsif opponent.stages[PBStats::SPDEF]==6
                        attacker.pbIncreaseStat(PBStats::SPDEF,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                        opponent.pbReduceStat(PBStats::SPDEF,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::SPDEF,attacker,false,self)
                      end
                      if opponent.stages[PBStats::ACCURACY]==0
                        attacker.pbIncreaseStat(PBStats::ACCURACY,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ACCURACY,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                      elsif opponent.stages[PBStats::ACCURACY]==1
                        attacker.pbIncreaseStat(PBStats::ACCURACY,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ACCURACY,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                      elsif opponent.stages[PBStats::ACCURACY]==2
                        attacker.pbIncreaseStat(PBStats::ACCURACY,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ACCURACY,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)  
                      elsif opponent.stages[PBStats::ACCURACY]==3
                        attacker.pbIncreaseStat(PBStats::ACCURACY,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ACCURACY,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                      elsif opponent.stages[PBStats::ACCURACY]==4
                        attacker.pbIncreaseStat(PBStats::ACCURACY,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ACCURACY,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                      elsif opponent.stages[PBStats::ACCURACY]==5
                        attacker.pbIncreaseStat(PBStats::ACCURACY,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ACCURACY,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                      elsif opponent.stages[PBStats::ACCURACY]==6
                        attacker.pbIncreaseStat(PBStats::ACCURACY,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                        opponent.pbReduceStat(PBStats::ACCURACY,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::ACCURACY,attacker,false,self)
                      end
                      if opponent.stages[PBStats::EVASION]==0
                        attacker.pbIncreaseStat(PBStats::EVASION,0,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                        opponent.pbReduceStat(PBStats::EVASION,0,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                      elsif opponent.stages[PBStats::EVASION]==1
                        attacker.pbIncreaseStat(PBStats::EVASION,1,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                        opponent.pbReduceStat(PBStats::EVASION,1,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                      elsif opponent.stages[PBStats::EVASION]==2
                        attacker.pbIncreaseStat(PBStats::EVASION,2,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                        opponent.pbReduceStat(PBStats::EVASION,2,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                      elsif opponent.stages[PBStats::EVASION]==3
                        attacker.pbIncreaseStat(PBStats::EVASION,3,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                        opponent.pbReduceStat(PBStats::EVASION,3,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                      elsif opponent.stages[PBStats::EVASION]==4
                        attacker.pbIncreaseStat(PBStats::EVASION,4,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                        opponent.pbReduceStat(PBStats::EVASION,4,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                      elsif opponent.stages[PBStats::EVASION]==5
                        attacker.pbIncreaseStat(PBStats::EVASION,5,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                        opponent.pbReduceStat(PBStats::EVASION,5,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                      elsif opponent.stages[PBStats::EVASION]==6
                        attacker.pbIncreaseStat(PBStats::EVASION,6,attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                        opponent.pbReduceStat(PBStats::EVASION,6,attacker,false,self) if opponent.pbCanReduceStatStage?(PBStats::EVASION,attacker,false,self)
                      end  
                      @battle.pbDisplay(_INTL("{1} stole {2}'s stat changes!",attacker.pbThis,opponent.pbThis(true)))
                      ret=super(attacker,opponent,hitnum,alltargets,showanimation)
                      return ret    
                    end  
                  end
                  1.) If a stat stage is 0, nothing happens. No need to raise attacker by 0 and lower opponent by 0.

                  2.) As shown by this video, the stats do not get lowered, they get reset. There's no animation.

                  3.) Rather than doing "if x==1, f(1), elsif x==2, f(2), elsif x==3, f(3), etc.", this can be all combined into "f(x) if x>0".

                  Code:
                  ################################################################################
                  # Spectral Thief
                  ################################################################################
                  class PokeBattle_Move_167 < PokeBattle_Move
                    def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
                      if opponent.pbOwnSide.effects[PBEffects::CraftyShield]
                        @battle.pbDisplay(_INTL("But it failed!"))
                        return -1
                      end
                      @battle.pbDisplay(_INTL("{1} stole {2}'s stat changes!",attacker.pbThis,opponent.pbThis(true)))
                      if opponent.stages[PBStats::ATTACK]>0
                        attacker.pbIncreaseStat(PBStats::ATTACK,opponent.stages[PBStats::ATTACK],attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
                        opponent.stages[PBStats::ATTACK]=0
                      end
                      if opponent.stages[PBStats::DEFENSE]>0
                        attacker.pbIncreaseStat(PBStats::DEFENSE,opponent.stages[PBStats::DEFENSE],attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
                        opponent.stages[PBStats::DEFENSE]=0
                      end
                      if opponent.stages[PBStats::SPATK]>0
                        attacker.pbIncreaseStat(PBStats::SPATK,opponent.stages[PBStats::SPATK],attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
                        opponent.stages[PBStats::SPATK]=0
                      end
                      if opponent.stages[PBStats::SPDEF]>0
                        attacker.pbIncreaseStat(PBStats::SPDEF,opponent.stages[PBStats::SPDEF],attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
                        opponent.stages[PBStats::SPDEF]=0
                      end
                      if opponent.stages[PBStats::SPEED]>0
                        attacker.pbIncreaseStat(PBStats::SPEED,opponent.stages[PBStats::SPEED],attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::SPEED,attacker,false,self)
                        opponent.stages[PBStats::SPEED]=0
                      end
                      if opponent.stages[PBStats::ACCURACY]>0
                        attacker.pbIncreaseStat(PBStats::ACCURACY,opponent.stages[PBStats::ACCURACY],attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
                        opponent.stages[PBStats::ACCURACY]=0
                      end
                      if opponent.stages[PBStats::EVASION]>0
                        attacker.pbIncreaseStat(PBStats::EVASION,opponent.stages[PBStats::EVASION],attacker,false,self) if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
                        opponent.stages[PBStats::EVASION]=0
                      end
                      ret=super(attacker,opponent,hitnum,alltargets,showanimation)
                      return ret
                    end  
                  end
                  Optimization. It's a thing.
                  __________________
                  Features of Pokemon Entropy

                  The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                  Reply With Quote
                    #61    
                  Old January 22nd, 2017 (3:48 AM).
                  Marin's Avatar
                  Marin Marin is offline
                  Not Bored
                   
                  Join Date: Nov 2016
                  Age: 16
                  Gender: Other
                  Posts: 792
                  How would I make a move like Revelation Dance that checks for the user's first type and change the move's type to match it? This is what I made out of it, but it doesn't work.

                  Code:
                  class PokeBattle_Move_CF25 < PokeBattle_Move
                    def pbModifyType(type,attacker,opponent)
                      type=getConst(attacker.type1)
                      return type
                    end
                  end
                  Reply With Quote
                    #62    
                  Old January 23rd, 2017 (11:04 PM).
                  rigbycwts's Avatar
                  rigbycwts rigbycwts is offline
                  Hmm, hmm.
                     
                    Join Date: Mar 2013
                    Gender: Male
                    Nature: Timid
                    Posts: 98
                    Tried coding the ability Dancer. First, this goes in PokeBattle_Move, below the isBombMove function block:
                    Code:
                      def isDanceMove?
                        return isConst?(@id,PBMoves,:QUIVERDANCE) ||
                               isConst?(@id,PBMoves,:DRAGONDANCE) ||
                               isConst?(@id,PBMoves,:FIERYDANCE) ||
                               isConst?(@id,PBMoves,:FEATHERDANCE) ||
                               isConst?(@id,PBMoves,:PETALDANCE) ||
                               isConst?(@id,PBMoves,:SWORDSDANCE) ||
                               isConst?(@id,PBMoves,:TEETERDANCE) ||
                               isConst?(@id,PBMoves,:LUNARDANCE) ||
                               isConst?(@id,PBMoves,:RAINDANCE) ||
                               isConst?(@id,PBMoves,:REVELATIONDANCE)
                      end
                    Then this goes in PokeBattle_Battler above Intimidate:
                    Code:
                        # Dancer. Kinda buggy.
                        if self.hasWorkingAbility(:DANCER)
                          user=self
                          targetIndex=0
                          hasMoved=false
                          for i in 0...4       
                            targetLastMoveUsed = PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(@battle.battlers[i].lastMoveUsed))
                            if targetLastMoveUsed.isDanceMove?
                              target = @battle.battlers[i]
                              targetIndex=i
                              moveToCopy = targetLastMoveUsed
                              moveIDToCopy = @battle.battlers[i].lastMoveUsed
                            end
                          end
                          if moveToCopy && moveToCopy.isDanceMove?
                            PBDebug.log("[Ability triggered] #{pbThis}'s Dancer")
                            @battle.pbDisplay(_INTL("Dancer copied {1}!",moveToCopy))
                            user.pbUseMoveSimple(moveIDToCopy,-1,pbOppositeOpposing)
                          end
                        end
                    I don't know what causes the user, Oricorio in this case, to repeat this ability over and over. If any other Pokemon use a move like Swords Dance for example, then this Ability activates, it goes to an infinite loop. The infinite loop also happens when Oricorio is under the effects of Taunt and any other Pokemon uses a status move that is a dance move, such as Dragon Dance.
                    __________________
                    Coming soon: Pokemon Collective and Mercantile Versions.

                    My college-life-advice blog.
                    Reply With Quote
                      #63    
                    Old January 24th, 2017 (7:19 AM).
                    Rot8er_ConeX's Avatar
                    Rot8er_ConeX Rot8er_ConeX is offline
                       
                      Join Date: May 2015
                      Location: The Dissa Region
                      Gender: Male
                      Posts: 822
                      Mutant Yoshi and I got Dancer to work. Lemme look at the code we used:

                      Code:
                          if thismove.isDanceMove? && !specialusage
                            for battler in @battle.battlers
                              if battler.hasWorkingAbility(:DANCER) && battler.index != user.index
                                @battle.pbDisplayEffect(battler)
                                movedalready=battler.lastRoundMoved*1
                                battler.pbUseMoveSimple(thismove.id,-1,user.index)
                                battler.lastRoundMoved=movedalready*1
                              end
                            end
                          end
                      This goes in PokeBattle_Battler, above line 3770 which is in the middle of the game recording which move was just moved.
                      __________________
                      Features of Pokemon Entropy

                      The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                      Reply With Quote
                        #64    
                      Old January 24th, 2017 (7:56 AM).
                      Marin's Avatar
                      Marin Marin is offline
                      Not Bored
                       
                      Join Date: Nov 2016
                      Age: 16
                      Gender: Other
                      Posts: 792
                      Quote:
                      Originally Posted by Rot8er_ConeX View Post
                      Mutant Yoshi and I got Dancer to work. Lemme look at the code we used:

                      Code:
                          if thismove.isDanceMove? && !specialusage
                            for battler in @battle.battlers
                              if battler.hasWorkingAbility(:DANCER) && battler.index != user.index
                                @battle.pbDisplayEffect(battler)
                                movedalready=battler.lastRoundMoved*1
                                battler.pbUseMoveSimple(thismove.id,-1,user.index)
                                battler.lastRoundMoved=movedalready*1
                              end
                            end
                          end
                      This goes in PokeBattle_Battler, above line 3770 which is in the middle of the game recording which move was just moved.
                      PokeBattle_Battler naturally only has 3355 lines, could you specify a line it's below or above? I tried a few things but they didn't work.
                      Reply With Quote
                        #65    
                      Old January 24th, 2017 (2:57 PM).
                      rigbycwts's Avatar
                      rigbycwts rigbycwts is offline
                      Hmm, hmm.
                         
                        Join Date: Mar 2013
                        Gender: Male
                        Nature: Timid
                        Posts: 98
                        Quote:
                        Originally Posted by M3rein View Post
                        PokeBattle_Battler naturally only has 3355 lines, could you specify a line it's below or above? I tried a few things but they didn't work.
                        If you are using Essentials 16.2, try checking the function def pbProcessTurn(choice). Possibly it's this function.
                        __________________
                        Coming soon: Pokemon Collective and Mercantile Versions.

                        My college-life-advice blog.
                        Reply With Quote
                          #66    
                        Old January 24th, 2017 (7:30 PM).
                        Rot8er_ConeX's Avatar
                        Rot8er_ConeX Rot8er_ConeX is offline
                           
                          Join Date: May 2015
                          Location: The Dissa Region
                          Gender: Male
                          Posts: 822
                          Quote:
                          Originally Posted by M3rein View Post
                          PokeBattle_Battler naturally only has 3355 lines, could you specify a line it's below or above? I tried a few things but they didn't work.
                          Okay, I looked at a clean version of 16.2. The code you need to paste it under is found on lines 3233-3238 of PokeBattle_Battler.
                          __________________
                          Features of Pokemon Entropy

                          The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                          Reply With Quote
                            #67    
                          Old February 4th, 2017 (12:39 AM).
                          The Evil Mewtwo The Evil Mewtwo is offline
                             
                            Join Date: Dec 2015
                            Gender: Male
                            Posts: 293
                            I'm trying to code Core Enforcer but it does nothing when it goes lost even if I gave it 85 base power.

                            Code:
                            ################################################################################
                            # If used after the target Attacks, the target's ability is removed. (Core Enforcer)
                            ################################################################################
                            
                            class PokeBattle_Move_15A < PokeBattle_Move
                              def pbBaseDamage(basedmg,attacker,opponent)
                                if @battle.choices[opponent.index][0]!=1 || # Didn't choose a move
                                   opponent.hasMovedThisRound? # Used a move already
                                  return pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
                                opponent.effects[PBEffects::GastroAcid]=true
                                end
                                return basedmg
                              end
                            end
                            __________________
                            Reply With Quote
                              #68    
                            Old February 4th, 2017 (2:05 PM).
                            Marin's Avatar
                            Marin Marin is offline
                            Not Bored
                             
                            Join Date: Nov 2016
                            Age: 16
                            Gender: Other
                            Posts: 792
                            Quote:
                            Originally Posted by The Evil Mewtwo View Post
                            I'm trying to code Core Enforcer but it does nothing when it goes lost even if I gave it 85 base power.

                            Code:
                            ################################################################################
                            # If used after the target Attacks, the target's ability is removed. (Core Enforcer)
                            ################################################################################
                            
                            class PokeBattle_Move_15A < PokeBattle_Move
                              def pbBaseDamage(basedmg,attacker,opponent)
                                if @battle.choices[opponent.index][0]!=1 || # Didn't choose a move
                                   opponent.hasMovedThisRound? # Used a move already
                                  return pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
                                opponent.effects[PBEffects::GastroAcid]=true
                                end
                                return basedmg
                              end
                            end
                            I'm not sure if I had this fully functional yet, but this is what I once made:
                            Code:
                            ################################################################################
                            # Deals damage. If target has already moved, its ability will be supressed.
                            # (Core Enforcer)
                            ################################################################################
                            class PokeBattle_Move_CF21 < PokeBattle_Move
                              def pbEffectAfterHit(attacker,opponent,turneffects)
                                if opponent.hasMovedThisRound?
                                  if opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker)
                                    @battle.pbDisplay(_INTL("But it failed!"))  
                                    return -1
                                  end
                                  if isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
                                     isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
                                     isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
                                     isConst?(opponent.ability,PBAbilities,:COMATOSE) ||
                                     isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN) ||
                                     isConst?(opponent.ability,PBAbilities,:DISGUISE) ||
                                     isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
                                     isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
                                     isConst?(opponent.ability,PBAbilities,:POWERCONSTRUCT)
                                    return -1
                                  end
                                  pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
                                  oldabil=opponent.ability
                                  opponent.effects[PBEffects::GastroAcid]=true
                                  opponent.effects[PBEffects::Truant]=false
                                  @battle.pbDisplay(_INTL("{1}'s Ability was suppressed!",opponent.pbThis)) 
                                  if opponent.effects[PBEffects::Illusion] && isConst?(oldabil,PBAbilities,:ILLUSION)
                                    PBDebug.log("[Ability triggered] #{opponent.pbThis}'s Illusion ended")    
                                    opponent.effects[PBEffects::Illusion]=nil
                                    @battle.scene.pbChangePokemon(opponent,opponent.pokemon)
                                    @battle.pbDisplay(_INTL("{1}'s {2} wore off!",opponent.pbThis,PBAbilities.getName(oldabil)))
                                  end
                                  return 0
                                end
                              end
                            end
                            Reply With Quote
                              #69    
                            Old February 4th, 2017 (6:13 PM).
                            Rot8er_ConeX's Avatar
                            Rot8er_ConeX Rot8er_ConeX is offline
                               
                              Join Date: May 2015
                              Location: The Dissa Region
                              Gender: Male
                              Posts: 822
                              Quote:
                              Originally Posted by M3rein View Post
                              I'm not sure if I had this fully functional yet, but this is what I once made:
                              Code:
                              ################################################################################
                              # Deals damage. If target has already moved, its ability will be supressed.
                              # (Core Enforcer)
                              ################################################################################
                              class PokeBattle_Move_CF21 < PokeBattle_Move
                                def pbEffectAfterHit(attacker,opponent,turneffects)
                                  if opponent.hasMovedThisRound?
                                    if opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker)
                                      return -1
                                    end
                                    if isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
                                       isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
                                       isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
                                       isConst?(opponent.ability,PBAbilities,:COMATOSE) ||
                                       isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN) ||
                                       isConst?(opponent.ability,PBAbilities,:DISGUISE) ||
                                       isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
                                       isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
                                       isConst?(opponent.ability,PBAbilities,:POWERCONSTRUCT)
                                      return -1
                                    end
                                    pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
                                    oldabil=opponent.ability
                                    opponent.effects[PBEffects::GastroAcid]=true
                                    opponent.effects[PBEffects::Truant]=false
                                    @battle.pbDisplay(_INTL("{1}'s Ability was suppressed!",opponent.pbThis)) 
                                    if opponent.effects[PBEffects::Illusion] && isConst?(oldabil,PBAbilities,:ILLUSION)
                                      PBDebug.log("[Ability triggered] #{opponent.pbThis}'s Illusion ended")    
                                      opponent.effects[PBEffects::Illusion]=nil
                                      @battle.scene.pbChangePokemon(opponent,opponent.pokemon)
                                      @battle.pbDisplay(_INTL("{1}'s {2} wore off!",opponent.pbThis,PBAbilities.getName(oldabil)))
                                    end
                                    return 0
                                  end
                                end
                              end
                              Fixed your code. It doesn't say "but it failed!" since the move does do damage.

                              Also, here's a version of the move written for v15 where the "effects after hit" function doesn't exist.

                              Code:
                              ################################################################################
                              # If the target has already moved this round, supresses target's ability
                              ################################################################################
                              class PokeBattle_Move_1B8 < PokeBattle_Move
                                def pbAdditionalEffect(attacker,opponent)
                                  if !(opponent.hasMovedThisRound? && opponent.lastMoveUsed<=0)
                                    return false
                                  end
                                  if isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
                                     isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
                                     isConst?(opponent.ability,PBAbilities,:DELTASTREAM) ||
                                     isConst?(opponent.ability,PBAbilities,:PRIMORDIALSEA) ||
                                     isConst?(opponent.ability,PBAbilities,:DESOLATELAND) ||
                                     isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
                                     isConst?(opponent.ability,PBAbilities,:COMATOSE) ||
                                     isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN) ||
                                     isConst?(opponent.ability,PBAbilities,:DISGUISE) ||
                                     isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
                                     isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
                                     isConst?(opponent.ability,PBAbilities,:POWERCONSTRUCT)
                                    return false
                                  end
                                  opponent.effects[PBEffects::GastroAcid]=true
                                  opponent.effects[PBEffects::Truant]=false
                                  @battle.pbDisplay(_INTL("{1}'s ability was suppressed!",opponent.pbThis)) 
                                  if opponent.effects[PBEffects::Illusion]!=nil #ILLUSION
                                    # Animation should go here
                                    # Break the illusion
                                    opponent.effects[PBEffects::Illusion]=nil
                                    @battle.pbDisplayEffect(opponent)
                                    @battle.scene.pbChangePokemon(opponent,opponent.pokemon)
                                    @battle.pbDisplay(_INTL("{1}'s {2} wore off!",opponent.pbThis,
                                        PBAbilities.getName(opponent.ability)))
                                  end #ILLUSION
                                  return true
                                end
                              end
                              __________________
                              Features of Pokemon Entropy

                              The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                              Reply With Quote
                                #70    
                              Old February 5th, 2017 (1:15 AM).
                              Marin's Avatar
                              Marin Marin is offline
                              Not Bored
                               
                              Join Date: Nov 2016
                              Age: 16
                              Gender: Other
                              Posts: 792
                              Quote:
                              Originally Posted by Rot8er_ConeX View Post
                              Fixed your code. It doesn't say "but it failed!" since the move does do damage.

                              Also, here's a version of the move written for v15 where the "effects after hit" function doesn't exist.

                              Code:
                              ################################################################################
                              # If the target has already moved this round, supresses target's ability
                              ################################################################################
                              class PokeBattle_Move_1B8 < PokeBattle_Move
                                def pbAdditionalEffect(attacker,opponent)
                                  if !(opponent.hasMovedThisRound? && opponent.lastMoveUsed<=0)
                                    return false
                                  end
                                  if isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
                                     isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
                                     isConst?(opponent.ability,PBAbilities,:DELTASTREAM) ||
                                     isConst?(opponent.ability,PBAbilities,:PRIMORDIALSEA) ||
                                     isConst?(opponent.ability,PBAbilities,:DESOLATELAND) ||
                                     isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
                                     isConst?(opponent.ability,PBAbilities,:COMATOSE) ||
                                     isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN) ||
                                     isConst?(opponent.ability,PBAbilities,:DISGUISE) ||
                                     isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
                                     isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
                                     isConst?(opponent.ability,PBAbilities,:POWERCONSTRUCT)
                                    return false
                                  end
                                  opponent.effects[PBEffects::GastroAcid]=true
                                  opponent.effects[PBEffects::Truant]=false
                                  @battle.pbDisplay(_INTL("{1}'s ability was suppressed!",opponent.pbThis)) 
                                  if opponent.effects[PBEffects::Illusion]!=nil #ILLUSION
                                    # Animation should go here
                                    # Break the illusion
                                    opponent.effects[PBEffects::Illusion]=nil
                                    @battle.pbDisplayEffect(opponent)
                                    @battle.scene.pbChangePokemon(opponent,opponent.pokemon)
                                    @battle.pbDisplay(_INTL("{1}'s {2} wore off!",opponent.pbThis,
                                        PBAbilities.getName(opponent.ability)))
                                  end #ILLUSION
                                  return true
                                end
                              end
                              Glad you could work what wasn't working, I didn't know if it was already or not.

                              By the way, I see you added Desolate Land and stuff, but this is a quote from Bulbapedia:
                              Quote:
                              The target's Ability will not be suppressed if it is Multitype, Stance Change, Schooling, Comatose, Shields Down, Disguise, RKS System, Battle Bond, or Power Construct.
                              I always use Bulbapedia for my information, but maybe it's not true. Who knows.
                              Reply With Quote
                                #71    
                              Old February 5th, 2017 (12:12 PM).
                              Rot8er_ConeX's Avatar
                              Rot8er_ConeX Rot8er_ConeX is offline
                                 
                                Join Date: May 2015
                                Location: The Dissa Region
                                Gender: Male
                                Posts: 822
                                Quote:
                                Originally Posted by M3rein View Post
                                Glad you could work what wasn't working, I didn't know if it was already or not.

                                By the way, I see you added Desolate Land and stuff, but this is a quote from Bulbapedia:

                                I always use Bulbapedia for my information, but maybe it's not true. Who knows.
                                I think I copied the abilities list from another move that has a lot of abilities that are immune to it - probably Gastro Acid.

                                So if Bulbapedia says that the Primal abilities aren't immune to Zygarde, go ahead.
                                __________________
                                Features of Pokemon Entropy

                                The black circular "doodles" in the lower right corner of my avatar are actually my username written in Gallifreyan. Yes I'm a Whovian.
                                Reply With Quote
                                  #72    
                                Old February 18th, 2017 (1:44 PM).
                                xac95's Avatar
                                xac95 xac95 is offline
                                   
                                  Join Date: Feb 2017
                                  Location: Spain
                                  Gender: Male
                                  Nature: Mild
                                  Posts: 5
                                  Hi! Someone knows the move effects of Throat Chop? I can't find it D:
                                  Thanks!
                                  Reply With Quote
                                    #73    
                                  Old April 22nd, 2017 (6:05 PM).
                                  MotoxChmpn10 MotoxChmpn10 is offline
                                     
                                    Join Date: Feb 2011
                                    Gender: Male
                                    Posts: 2
                                    Here are some move abilities that I have added to the Pokebattle_MoveEffects. If someone wants to test and verify these I would appreciate it! It seems they are working fine for me but I have been hacking away at some codes left and right so Idk if it will work for a standard version. :p

                                    Spoiler:
                                    ################################################################################
                                    # Heals user by an amount depending on the weather. (Shore Up)
                                    ################################################################################
                                    class PokeBattle_Move_159 < PokeBattle_Move
                                    def isHealingMove?
                                    return true
                                    end

                                    def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
                                    if attacker.hp==attacker.totalhp
                                    @battle.pbDisplay(_INTL("{1}'s HP is full!",attacker.pbThis))
                                    return -1
                                    end
                                    hpgain=0
                                    if @battle.pbWeather==PBWeather::SANDSTORM
                                    hpgain=(attacker.totalhp*2/3).floor
                                    elsif @battle.pbWeather!=0
                                    hpgain=(attacker.totalhp/4).floor
                                    else
                                    hpgain=(attacker.totalhp/2).floor
                                    end
                                    pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
                                    attacker.pbRecoverHP(hpgain,true)
                                    @battle.pbDisplay(_INTL("{1}'s HP was restored.",attacker.pbThis))
                                    return 0
                                    end
                                    end


                                    Spoiler:
                                    ################################################################################
                                    # Heals a burn if the target is burned. (Sparkling Aria)
                                    ################################################################################
                                    class PokeBattle_Move_15B < PokeBattle_Move
                                    def pbEffectAfterHit(attacker,opponent,turneffects)
                                    if !opponent.isFainted? && opponent.damagestate.calcdamage>0 &&
                                    !opponent.damagestate.substitute && opponent.status==PBStatuses::BURN
                                    opponent.pbCureStatus
                                    @battle.pbDisplay(_INTL("{1}'s burn was cured.",opponent.pbThis))
                                    end
                                    end
                                    end


                                    I saw that someone already posted this one, but here is a corrected one that you can just "copy and paste" without changing.

                                    Spoiler:
                                    ################################################################################
                                    # Fails if this isn't the user's first turn. (First Impression)
                                    ################################################################################
                                    class PokeBattle_Move_15A < PokeBattle_Move
                                    def pbMoveFailed(attacker,opponent)
                                    return (attacker.turncount>1)
                                    end
                                    end



                                    All of the other effects have been a huge help, and I will post anymore that I figure out on here for everyone to see/use! Great forum!
                                    Reply With Quote
                                      #74    
                                    Old July 16th, 2017 (7:57 AM).
                                    ItaloCTA99 ItaloCTA99 is offline
                                       
                                      Join Date: Jun 2017
                                      Posts: 2
                                      I only have one question , Are these moves and abilities working in v16.2 too?
                                      Reply With Quote
                                        #75    
                                      Old July 16th, 2017 (11:22 AM).
                                      Marin's Avatar
                                      Marin Marin is offline
                                      Not Bored
                                       
                                      Join Date: Nov 2016
                                      Age: 16
                                      Gender: Other
                                      Posts: 792
                                      Quote:
                                      Originally Posted by ItaloCTA99 View Post
                                      I only have one question , Are these moves and abilities working in v16.2 too?
                                      That is the latest version and I assume everyone here was as wise as to use that, so yes.
                                      Reply With Quote
                                      Reply

                                      Quick Reply

                                      Join the conversation!

                                      Create an account to post a reply in this thread, participate in other discussions, and more!

                                      Create a PokéCommunity Account
                                      Thread Tools

                                      Posting Rules
                                      You may not post new threads
                                      You may not post replies
                                      You may not post attachments
                                      You may not edit your posts

                                      BB code is On
                                      Smilies are On
                                      [IMG] code is On
                                      HTML code is Off

                                      Forum Jump


                                      All times are GMT -8. The time now is 11:48 AM.