################################################################################ # Burns the target if at least one stat is raised ################################################################################ class PokeBattle_Move_XXX < PokeBattle_Move def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true) if pbIsDamaging? ret=super(attacker,opponent,hitnum,alltargets,showanimation) return ret else return -1 if pbTypeImmunityByAbility(pbType(@type,attacker,opponent),attacker,opponent) return -1 if !opponent.pbCanBurn?(attacker,true,self) return -1 if !opponent.stages.any?{|s| s>0} pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation) opponent.pbBurn(attacker) return 0 end return -1 end def pbAdditionalEffect(attacker,opponent) return if opponent.damagestate.substitute return if !opponent.stages.any?{|s| s>0} if opponent.pbCanBurn?(attacker,false,self) opponent.pbBurn(attacker) end end end ################################################################################ # Base Damage doubled on terrain if grounded, move type changes based on # terrain ################################################################################ class PokeBattle_Move_XXY < PokeBattle_Move def pbBaseDamage(basedmg,attacker,opponent) return basedamage if attacker.isAirborne? if @battle.field.effects[PBEffects::GrassyTerrain]>0 || @battle.field.effects[PBEffects::ElectricTerrain]>0 || @battle.field.effects[PBEffects::MistyTerrain]>0 #|| #@battle.field.effects[PBEffects::PsychicTerrain]>0 return basedmg*2 end return basedmg end def pbModifyType(type,attacker,opponent) type=getConst(PBTypes,:NORMAL) || 0 return type if attacker.isAirborne? if @battle.field.effects[PBEffects::GrassyTerrain]>0 type=(getConst(PBTypes,:GRASS) || type) elsif @battle.field.effects[PBEffects::ElectricTerrain]>0 type=(getConst(PBTypes,:ELECTRIC) || type) elsif @battle.field.effects[PBEffects::MistyTerrain]>0 type=(getConst(PBTypes,:FAIRY) || type) #elsif @battle.field.effects[PBEffects::PsychicTerrain]>0 # type=(getConst(PBTypes,:PSYCHIC) || type) end return type end end ################################################################################ # Priority increased by 1 if on Grassy Terrain ################################################################################ class PokeBattle_Move_XXZ < PokeBattle_Move def pbPriority(attacker) ret=super(attacker) ret+=1 if @battle.field.effects[PBEffects::GrassyTerrain]>0 return ret end end ################################################################################ # Boosts Ally's Attack and defense, failes if no ally # !!!! Requires exception to crafty shield like Perish Song !!!! ################################################################################ class PokeBattle_Move_XYX < PokeBattle_Move def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true) if !@battle.doublebattle || opponent.fainted? @battle.pbDisplay(_INTL("But it failed!")) return -1 end raiseatk=opponent.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self) raisedef=opponent.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self) failed=false if !raiseatk && !raisedef failed=true else pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation) showanim=true if raiseatk opponent.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self,showanim) showanim=false end if raisedef opponent.pbIncreaseStat(PBStats::DEFENSE,1,attacker,false,self,showanim) showanim=false end end if failed @battle.pbDisplay(_INTL("But it failed!")) end return failed ? -1 : 0 end end ################################################################################ # Two turn attack. Raise Sp Atk first turn, attacks second turn. ################################################################################ class PokeBattle_Move_XYY < PokeBattle_Move def pbTwoTurnAttack(attacker) @immediate=false if !@immediate && attacker.hasWorkingItem(:POWERHERB) @immediate=true end return false if @immediate return attacker.effects[PBEffects::TwoTurnAttack]==0 end def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true) if @immediate || attacker.effects[PBEffects::TwoTurnAttack]>0 pbShowAnimation(@id,attacker,opponent,1,alltargets,showanimation) # Charging anim if attacker.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self) attacker.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self) end @battle.pbDisplay(_INTL("{1} did the message!",attacker.pbThis)) # i dunno? end if @immediate @battle.pbCommonAnimation("UseItem",attacker,nil) @battle.pbDisplay(_INTL("{1} became fully charged due to its Power Herb!",attacker.pbThis)) attacker.pbConsumeItem end return 0 if attacker.effects[PBEffects::TwoTurnAttack]>0 return super(attacker,opponent,hitnum,alltargets,showanimation) end end ################################################################################ # Base Damage times 1.5 on Psychic terrain if grounded. # !!!! Need to make target change, look to pbTarget in Battler!!!! ################################################################################ class PokeBattle_Move_XYZ < PokeBattle_Move def pbBaseDamage(basedmg,attacker,opponent) return basedamage if attacker.isAirborne? #if @battle.field.effects[PBEffects::PsychicTerrain]>0 # return (basedmg*1.5).round #end return basedmg end end ################################################################################ # Fails if opponent doesn't have an item or item is blocked. # will need to edit if Corrosive Acid effect. ################################################################################ class PokeBattle_Move_XZX < PokeBattle_Move def pbMoveFailed(attacker,opponent) return opponent.item==0 || @battle.field.effects[PBEffects::MagicRoom]>0 || opponent.hasWorkingAbility(:KLUTZ) || opponent.effects[PBEffects::Embargo]>0 end end ################################################################################ # Removes all terrains, fails if there are no terrains ################################################################################ class PokeBattle_Move_XZY < PokeBattle_Move def pbMoveFailed(attacker,opponent) return @battle.field.effects[PBEffects::ElectricTerrain]==0 || @battle.field.effects[PBEffects::GrassyTerrain]==0 || @battle.field.effects[PBEffects::MistyTerrain]==0 # || #@battle.field.effects[PBEffects::PsychicTerrain]==0 end def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true) return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging? if @battle.field.effects[PBEffects::ElectricTerrain]==0 || @battle.field.effects[PBEffects::GrassyTerrain]==0 || @battle.field.effects[PBEffects::MistyTerrain]==0 # || #@battle.field.effects[PBEffects::PsychicTerrain]==0 @battle.pbDisplay(_INTL("But it failed!")) return -1 end pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation) @battle.field.effects[PBEffects::ElectricTerrain]=0 @battle.field.effects[PBEffects::GrassyTerrain]=0 @battle.field.effects[PBEffects::MistyTerrain]=0 #@battle.field.effects[PBEffects::PsychicTerrain]=0 @battle.pbDisplay(_INTL("All terrains were removed!")) return 0 end def pbAdditionalEffect(attacker,opponent) @battle.field.effects[PBEffects::ElectricTerrain]=0 @battle.field.effects[PBEffects::GrassyTerrain]=0 @battle.field.effects[PBEffects::MistyTerrain]=0 #@battle.field.effects[PBEffects::PsychicTerrain]=0 @battle.pbDisplay(_INTL("All terrains were removed!")) end end ################################################################################ # User faints. Power raised by 1.5x in Misty Terrain ################################################################################ class PokeBattle_Move_XZZ < PokeBattle_Move def pbBaseDamage(basedmg,attacker,opponent) return basedamage if attacker.isAirborne? if @battle.field.effects[PBEffects::MistyTerrain]>0 return (basedmg*1.5).round end return basedmg end def pbOnStartUse(attacker) if !attacker.hasMoldBreaker bearer=@battle.pbCheckGlobalAbility(:DAMP) if bearer!=nil @battle.pbDisplay(_INTL("{1}'s {2} prevents {3} from using {4}!", bearer.pbThis,PBAbilities.getName(bearer.ability),attacker.pbThis(true),@name)) return false end end return true end def pbShowAnimation(id,attacker,opponent,hitnum=0,alltargets=nil,showanimation=true) super(id,attacker,opponent,hitnum,alltargets,showanimation) if !attacker.fainted? attacker.pbReduceHP(attacker.hp) attacker.pbFaint if attacker.fainted? end end end