Resource icon

Supereffective Hail and Sandstorm

Pokémon Essentials Version
v17.2 ✅
By a copy and paste you'll be able to check for the pokemon type before applying hail and sandstorm damages.

Hail damages are Ice type.
Sandstorm damages are Ground type.

So, let's go !
In pokebattle_battle, locate this part of the code:

Code:
        pbCommonAnimation("Rain",nil,nil)
#        pbDisplay(_INTL("Rain continues to fall."))
      end
Just after this, you have the case
Code:
when PBWeather::SANDSTORM
Select the whole code, so, until just before the When PBWeather::HAIL case.
eeeer.png

And paste this instead:

Code:
 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

Next, you'll select the entire hail case, following the sandstorm case.
Screenshot_14.png

Paste this:
Code:
    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

If you wanna edit sandstorm damages to rock, juste change the GROUND to ROCK.
And you're done !
Credits
No credit required, have fun !
Likes: MGriffin
Author
Simeo
First release
Last update
Rating
0.00 star(s) 0 ratings
Top