• We've opened up applications for site moderators! Head over to the announcement to learn more!

v18 (V18.1) Weather not dealing damage?

This thread pertains to v18 of Pokémon Essentials.

ValiantSoul

World Traveller
Member
Joined
Sep 12, 2020
Posts
103
Hey peeps!

Just a quick question, I noticed that when weather is happening in battle (Sand, Hail) that it isn't dealing any damage to participants. I haven't changed any of the weather related scripts, and I was wondering if this was just a bug in v18.1 that I haven't updated past, or something I may have changed.

If it's the latter, could someone kindly direct me to the script section that denotes weather damage so I can paste a working version over it?

Cheers in advance!
 
Solution
I remember this line being the problem:
Ruby:
next if !b.hasActiveAbility?(:ICEBODY)
I believe this skips the weather damage step unless the Pokémon has the Ice Body ability. You obviously don't want that. 😆

ValiantSoul

World Traveller
Member
Joined
Sep 12, 2020
Posts
103
It looks like this:
Ruby:
def pbEORWeather(priority)
    # NOTE: Primordial weather doesn't need to be checked here, because if it
    #       could wear off here, it will have worn off already.
    # Count down weather duration
    @field.weatherDuration -= 1 if @field.weatherDuration>0
    # Weather wears off
    if @field.weatherDuration==0
      case @field.weather
      when PBWeather::Sun
        pbDisplay(_INTL("The sunlight faded."))
      when PBWeather::Rain
        pbDisplay(_INTL("The rain stopped."))
      when PBWeather::Sandstorm
        pbDisplay(_INTL("The sandstorm subsided."))
      when PBWeather::Hail
        pbDisplay(_INTL("The hail stopped."))
      when PBWeather::ShadowSky
        pbDisplay(_INTL("The shadow sky faded."))
      end
      @field.weather = PBWeather::None
      # Check for form changes caused by the weather changing
      eachBattler { |b| b.pbCheckFormOnWeatherChange }
      # Start up the default weather
      pbStartWeather(nil,@field.defaultWeather) if @field.defaultWeather!=PBWeather::None
      return if @field.weather==PBWeather::None
    end
    # Weather continues
    pbCommonAnimation(PBWeather.animationName(@field.weather))
    case @field.weather
#    when PBWeather::Sun;         pbDisplay(_INTL("The sunlight is strong."))
#    when PBWeather::Rain;        pbDisplay(_INTL("Rain continues to fall."))
    when PBWeather::Sandstorm;   pbDisplay(_INTL("The sandstorm is raging."))
    when PBWeather::Hail;        pbDisplay(_INTL("The hail is crashing down."))
#    when PBWeather::HarshSun;    pbDisplay(_INTL("The sunlight is extremely harsh."))
#    when PBWeather::HeavyRain;   pbDisplay(_INTL("It is raining heavily."))
#    when PBWeather::StrongWinds; pbDisplay(_INTL("The wind is strong."))
    when PBWeather::ShadowSky;   pbDisplay(_INTL("The shadow sky continues."));
    end
    # Effects due to weather
    curWeather = pbWeather
    priority.each do |b|
      # Weather-related abilities
      if b.abilityActive?
        next if !b.hasActiveAbility?(:ICEBODY)
        BattleHandlers.triggerEORWeatherAbility(b.ability,curWeather,b,self)
        b.pbFaint if b.fainted?
      end
      # Weather damage
      # NOTE:
      case curWeather
      when PBWeather::Sandstorm
        next if !b.takesSandstormDamage?
        pbDisplay(_INTL("{1} is buffeted by the sandstorm!",b.pbThis))
        @scene.pbDamageAnimation(b)
        b.pbReduceHP(b.totalhp/16,false)
        b.pbItemHPHealCheck
        b.pbFaint if b.fainted?
      when PBWeather::Hail
        next if !b.takesHailDamage?
        pbDisplay(_INTL("{1} is buffeted by the hail!",b.pbThis))
        @scene.pbDamageAnimation(b)
        b.pbReduceHP(b.totalhp/16,false)
        b.pbItemHPHealCheck
        b.pbFaint if b.fainted?
      when PBWeather::ShadowSky
        next if !b.takesShadowSkyDamage?
        pbDisplay(_INTL("{1} is hurt by the shadow sky!",b.pbThis))
        @scene.pbDamageAnimation(b)
        b.pbReduceHP(b.totalhp/16,false)
        b.pbItemHPHealCheck
        b.pbFaint if b.fainted?
      end
    end
  end
 
Top