- 58
- Posts
- 9
- Years
- Seen Oct 6, 2019
Much appreciated. :-)
I've not yet figured out how to add Psychic Terrain. How would I do that?
I've not yet figured out how to add Psychic Terrain. How would I do that?
Why are you treating a Boolean as a string? Is there a change since 16.2 that makes the Critical hit function return a string instead of a Boolean?
Exception: NameErrorMessage: undefined local variable or method `target' for
#<PokeBattle_Battle:0x883a6b8>PokeBattle_Battle:3480:in
`__clauses__pbEndOfRoundPhase'PokeBattle_Clauses:42:in
`pbEndOfRoundPhase'PokeBattle_Battle:2591:in
`pbStartBattleCore'PokeBattle_Battle:2590:in `logonerr'PokeBattle_Battle:2590:in
`pbStartBattleCore'PokeBattle_Battle:2572:in `loop'PokeBattle_Battle:2595:in
`pbStartBattleCore'PokeBattle_Battle:2395:in `pbStartBattle'PTrainer_NPCTrainers:345:in
`pbTrainerBattle'PTrainer_NPCTrainers:344:in `pbSceneStandby'
I tested Stamina, and it gives me an error too.
Code:Exception: NameErrorMessage: undefined local variable or method `target' for #<PokeBattle_Battle:0x883a6b8>PokeBattle_Battle:3480:in `__clauses__pbEndOfRoundPhase'PokeBattle_Clauses:42:in `pbEndOfRoundPhase'PokeBattle_Battle:2591:in `pbStartBattleCore'PokeBattle_Battle:2590:in `logonerr'PokeBattle_Battle:2590:in `pbStartBattleCore'PokeBattle_Battle:2572:in `loop'PokeBattle_Battle:2595:in `pbStartBattleCore'PokeBattle_Battle:2395:in `pbStartBattle'PTrainer_NPCTrainers:345:in `pbTrainerBattle'PTrainer_NPCTrainers:344:in `pbSceneStandby'
Assuming you put my code in the right place, the variable "target" should be defined. Unless, again, this is something in v16 that I'm unaware of.
if target.hasWorkingAbility(:STAMINA)
if target.pbIncreaseStatWithCause(PBStats::DEFENSE,1,target,PBAbilities.getName(target.ability))
PBDebug.log("[Ability triggered] #{target.pbThis}'s Stamina")
end
end
Exception: ArgumentError
Message: wrong number of arguments(3 for 1)
PokeBattle_Battler:1279:in `pbIsPhysical?'
PokeBattle_Battler:1279:in `pbEffectsOnDealingDamage'
PokeBattle_Battler:2780:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:2699:in `each'
PokeBattle_Battler:2699:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:3175:in `pbUseMove'
PokeBattle_Battler:3155:in `loop'
PokeBattle_Battler:3178:in `pbUseMove'
PokeBattle_Battler:3376:in `pbProcessTurn'
PokeBattle_Battler:3375:in `logonerr'
Exception: NoMethodError
Message: undefined method `index' for true:TrueClass
PokeBattle_BattlerEffects:747:in `pbCanReduceStatStage?'
PokeBattle_MoveEffects:1592:in `pbEffect'
PokeBattle_Battler:2881:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:2837:in `each'
PokeBattle_Battler:2837:in `pbProcessMoveAgainstTarget'
PokeBattle_Battler:3313:in `pbUseMove'
PokeBattle_Battler:3293:in `loop'
PokeBattle_Battler:3316:in `pbUseMove'
PokeBattle_Battler:3514:in `pbProcessTurn'
PokeBattle_Battler:3513:in `logonerr'
I haven't done Pollen Puff yet, but here's Spectral Thief:
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 # actually attack now ret=super(attacker,opponent,hitnum,alltargets,showanimation) return ret end end
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 ">".
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
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
################################################################################
# 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
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
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!;)
################################################################################
# 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 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 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
################################################################################
# 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