hirokimura

Miltank's Fanboy Number One

Age 25
Male
France
Seen 1 Week Ago
Posted 1 Week Ago
136 posts
2.7 Years
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:

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


And paste this instead:

Spoiler:
 when PBWeather::SANDSTORM
      @[email protected] 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.
Spoiler:


Paste this:
Spoiler:
    when PBWeather::HAIL
      @[email protected] 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 !
Seen 1 Hour Ago
Posted 1 Day Ago
298 posts
3.6 Years
Can we make Rain Super Effective on fire types?
So rain does damage to fire types and is SE? or does damage in general?

if so just take how sandstorm damage works and how it doesnt hit steel etc. but change it from !i.pbHasType?(:ROCK) to i.pbHasType?(:FIRE) aswell as keeping the checks if it doesnt have items/abilities
and that should work

and for SE most likely just rework the code here like it was for hail/sandstorm