I'd be interested to check it out!;)
I said it is awfully long and probably overcomplicated, right?
But here's what I got:
################################################################################
# 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