if target.hasWorkingAbility(:EFFECTSPORE,true) && @battle.pbRandom(10)<3
if USENEWBATTLEMECHANICS &&
(user.pbHasType?(:GRASS) ||
user.hasWorkingAbility(:OVERCOAT) ||
user.hasWorkingItem(:SAFETYGOGGLES))
else
PBDebug.log("[Ability triggered] #{target.pbThis}'s Effect Spore")
case @battle.pbRandom(3)
when 0
if user.pbCanPoison?(nil,false)
user.pbPoison(target,_INTL("{1}'s {2} poisoned {3}!",target.pbThis,
PBAbilities.getName(target.ability),user.pbThis(true)))
end
when 1
if user.pbCanSleep?(nil,false)
user.pbSleep(_INTL("{1}'s {2} made {3} fall asleep!",target.pbThis,
PBAbilities.getName(target.ability),user.pbThis(true)))
end
when 2
if user.pbCanParalyze?(nil,false)
user.pbParalyze(target,_INTL("{1}'s {2} paralyzed {3}! It may be unable to move!",
target.pbThis,PBAbilities.getName(target.ability),user.pbThis(true)))
end
end
end
end
# Immunity to powder-based moves
if USENEWBATTLEMECHANICS && thismove.isPowderMove? &&
(target.pbHasType?(:GRASS) ||
(!user.hasMoldBreaker && !thismove.ignoresAbilities? &&
target.hasWorkingAbility(:OVERCOAT)) ||
target.hasWorkingItem(:SAFETYGOGGLES))
@battle.pbDisplay(_INTL("It doesn't affect\r\n{1}...",target.pbThis(true)))
PBDebug.log("[Move failed] #{target.pbThis} is immune to powder-based moves somehow")
return false
end
# pbDisplay(_INTL("The sandstorm rages."))
if pbWeather==PBWeather::SANDSTORM
PBDebug.log("[Lingering effect triggered] Sandstorm weather damage")
for i in priority
next if i.fainted?
if !i.pbHasType?(:GROUND) && !i.pbHasType?(:ROCK) && !i.pbHasType?(:STEEL) &&
!i.hasWorkingAbility(:SANDVEIL) &&
!i.hasWorkingAbility(:SANDRUSH) &&
!i.hasWorkingAbility(:SANDFORCE) &&
!i.hasWorkingAbility(:MAGICGUARD) &&
!i.hasWorkingAbility(:OVERCOAT) &&
!i.hasWorkingItem(:SAFETYGOGGLES) &&
![0xCA,0xCB].include?(PBMoveData.new(i.effects[PBEffects::TwoTurnAttack]).function) # Dig, Dive
@scene.pbDamageAnimation(i,0)
i.pbReduceHP((i.totalhp/16).floor)
pbDisplay(_INTL("{1} is buffeted by the sandstorm!",i.pbThis))
if i.fainted?
return if !i.pbFaint
end
end
end
end
end
when PBWeather::HAIL
if pbWeather==PBWeather::HAIL
PBDebug.log("[Lingering effect triggered] Hail weather damage")
for i in priority
next if i.fainted?
if !i.pbHasType?(:ICE) &&
!i.hasWorkingAbility(:ICEBODY) &&
!i.hasWorkingAbility(:SNOWCLOAK) &&
!i.hasWorkingAbility(:MAGICGUARD) &&
!i.hasWorkingAbility(:OVERCOAT) &&
!i.hasWorkingItem(:SAFETYGOGGLES) &&
![0xCA,0xCB].include?(PBMoveData.new(i.effects[PBEffects::TwoTurnAttack]).function) # Dig, Dive
@scene.pbDamageAnimation(i,0)
i.pbReduceHP((i.totalhp/16).floor)
pbDisplay(_INTL("{1} is buffeted by the hail!",i.pbThis))
if i.fainted?
return if !i.pbFaint
end
end
end
end
end
when PBWeather::HEAVYRAIN
So download Pokémon Reborn and check if they did that part, they use v16. This code is from to v17.2.