when PBWeather::SANDSTORM
@weatherduration=@weatherduration-1 if @weatherduration>0
if @weatherduration==0
pbDisplay(_INTL("The sandstorm subsided."))
@weather=0
PBDebug.log("[End of effect] Sandstorm weather ended")
else
pbCommonAnimation("Sandstorm",nil,nil)
# 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
atype=getConst(PBTypes,:GROUND) || 0
eff=PBTypes.getCombinedEffectiveness(atype,i.type1,i.type2,i.effects[PBEffects::Type3])
@scene.pbDamageAnimation(i,0)
i.pbReduceHP(((i.totalhp*eff)/64).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
@weatherduration=@weatherduration-1 if @weatherduration>0
if @weatherduration==0
pbDisplay(_INTL("The hail stopped."))
@weather=0
PBDebug.log("[End of effect] Hail weather ended")
else
pbCommonAnimation("Hail",nil,nil)
# pbDisplay(_INTL("Hail continues to fall."))
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
atype=getConst(PBTypes,:ICE) || 0
eff=PBTypes.getCombinedEffectiveness(atype,i.type1,i.type2,i.effects[PBEffects::Type3])
@scene.pbDamageAnimation(i,0)
i.pbReduceHP(((i.totalhp*eff)/64).floor)
pbDisplay(_INTL("{1} is buffeted by the hail!",i.pbThis))
if i.fainted?
return if !i.pbFaint
end
end
end
end
end