################################################################################
# All current battlers will perish after 3 more rounds. (Perish Song)
################################################################################
class PokeBattle_Move_0E5 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.hasWorkingAbility(:PRANKSTER)
for i in @battle.battlers
if @battle.field.effects[PBEffects::PsychicTerrain]>0 && !i.isAirborne?
PBDebug.log("Psychic Terrain prevented #{i.pbThis}'s priority move")
@battle.pbDisplay(_INTL("The psychic terrain prevented the use of priority moves!"))
return -1
elsif attacker.pbIsOpposing?(i.index) &&
(i.hasWorkingAbility(:QUEENLYMAJESTY) || i.hasWorkingAbility(:DAZZLING))
PBDebug.log("[Ability triggered] prevents #{attacker.pbThis}'s priority move")
@battle.pbDisplay(_INTL("{1} cannot use {2}!",attacker.pbThis,PBMoves.getName(@id)))
return -1
end
end
end
failed=true
for i in 0...4
if @battle.battlers[i].effects[PBEffects::PerishSong]==0 &&
(attacker.hasMoldBreaker ||
[email protected][i].hasWorkingAbility(:SOUNDPROOF))
failed=false; break
end
end
if failed
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
@battle.pbDisplay(_INTL("All Pokémon that hear the song will faint in three turns!"))
for i in 0...4
if @battle.battlers[i].effects[PBEffects::PerishSong]==0
if !attacker.hasMoldBreaker && @battle.battlers[i].hasWorkingAbility(:SOUNDPROOF)
@battle.pbDisplay(_INTL("{1}'s {2} blocks {3}!",@battle.battlers[i].pbThis,
PBAbilities.getName(@battle.battlers[i].ability),@name))
else
@battle.battlers[i].effects[PBEffects::PerishSong]=4
@battle.battlers[i].effects[PBEffects::PerishSongUser]=attacker.index
end
end
end
return 0
end
end
################################################################################
# Increases the Attack and Special Attack of all Grass-type Pokémon on the field
# by 1 stage each. Doesn't affect airborne Pokémon. (Rototiller)
################################################################################
class PokeBattle_Move_13E < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.hasWorkingAbility(:PRANKSTER)
for i in @battle.battlers
if @battle.field.effects[PBEffects::PsychicTerrain]>0 && !i.isAirborne?
PBDebug.log("Psychic Terrain prevented #{i.pbThis}'s priority move")
@battle.pbDisplay(_INTL("The psychic terrain prevented the use of priority moves!"))
return -1
elsif attacker.pbIsOpposing?(i.index) &&
(i.hasWorkingAbility(:QUEENLYMAJESTY) || i.hasWorkingAbility(:DAZZLING))
PBDebug.log("[Ability triggered] prevents #{attacker.pbThis}'s priority move")
@battle.pbDisplay(_INTL("{1} cannot use {2}!",attacker.pbThis,PBMoves.getName(@id)))
return -1
end
end
end
didsomething=false
for i in [attacker,attacker.pbPartner,attacker.pbOpposing1,attacker.pbOpposing2]
next if !i || i.fainted?
next if !i.pbHasType?(:GRASS)
next if i.isAirborne?(attacker.hasMoldBreaker)
next if !i.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self) &&
!i.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation) if !didsomething
didsomething=true
showanim=true
if i.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
i.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self,showanim)
showanim=false
end
if i.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
i.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self,showanim)
showanim=false
end
end
if !didsomething
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
return 0
end
end
################################################################################
# Increases the Defense of all Grass-type Pokémon on the field by 1 stage each.
# (Flower Shield)
################################################################################
class PokeBattle_Move_13F < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.hasWorkingAbility(:PRANKSTER)
for i in @battle.battlers
if @battle.field.effects[PBEffects::PsychicTerrain]>0 && !i.isAirborne?
PBDebug.log("Psychic Terrain prevented #{i.pbThis}'s priority move")
@battle.pbDisplay(_INTL("The psychic terrain prevented the use of priority moves!"))
return -1
elsif attacker.pbIsOpposing?(i.index) &&
(i.hasWorkingAbility(:QUEENLYMAJESTY) || i.hasWorkingAbility(:DAZZLING))
PBDebug.log("[Ability triggered] prevents #{attacker.pbThis}'s priority move")
@battle.pbDisplay(_INTL("{1} cannot use {2}!",attacker.pbThis,PBMoves.getName(@id)))
return -1
end
end
end
didsomething=false
for i in [attacker,attacker.pbPartner,attacker.pbOpposing1,attacker.pbOpposing2]
next if !i || i.fainted?
next if !i.pbHasType?(:GRASS)
next if !i.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation) if !didsomething
didsomething=true
showanim=true
if i.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self)
i.pbIncreaseStat(PBStats::DEFENSE,1,attacker,false,self,showanim)
showanim=false
end
end
if !didsomething
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
return 0
end
end