• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Custom Sandstorm Weather Variant Not Damaging

  • 4
    Posts
    4
    Years
    • Seen Nov 26, 2020
    Hello. I'm making an exclusive ability for Flygon which would put into the field a version of Sandstorm that doesn't end until it is overriden or Flygon leaves the field. However, I'm encountering a problem:
    Code:
    case curWeather
          when PBWeather::Sandstorm || PBWeather::HuntingSands # This is what was added
            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?
    Despite adding this line to the code (with HuntingSands being the weather) - it won't deal damage.

    I'll leave in this spoiler every single other modification I made to insert HuntingSands - except the ones regarding the text it produces (which it produces just fine, including start - end - end of round "rages on", except, of course, for the buffered by sandstorm message, since that doesn't happen) and the ones regarding the fact that it acts the same as sandstorm for sandstorm abilities.
    Thank you very much in advance :)
    Spoiler:
     
    I think I can help you.
    Rather than combining them, separate them like in these two codes here:
    Code:
    def takesHuntingSandsDamage?
        return false if !takesIndirectDamage?
        return false if isSpecies?(:FLYGON)
        return false if inTwoTurnAttack?("0CA","0CB")   # Dig, Dive
        return false if hasActiveAbility?([:OVERCOAT,:SANDFORCE,:SANDRUSH,:SANDVEIL])
        return false if hasActiveItem?(:SAFETYGOGGLES)
        return true
      end

    Code:
    when PBWeather::HuntingSands
            next if !b.takesHuntingSandsDamage?
            pbDisplay(_INTL("{1} is buffeted by the sandstorm!",b.pbThis))
            @scene.pbDamageAnimation(b)
            b.pbReduceHP(b.totalhp/8,false)
            b.pbItemHPHealCheck
            b.pbFaint if b.fainted?
     
    I think I can help you.
    Rather than combining them, separate them like in these two codes here:
    Code:
    def takesHuntingSandsDamage?
        return false if !takesIndirectDamage?
        return false if isSpecies?(:FLYGON)
        return false if inTwoTurnAttack?("0CA","0CB")   # Dig, Dive
        return false if hasActiveAbility?([:OVERCOAT,:SANDFORCE,:SANDRUSH,:SANDVEIL])
        return false if hasActiveItem?(:SAFETYGOGGLES)
        return true
      end

    Code:
    when PBWeather::HuntingSands
            next if !b.takesHuntingSandsDamage?
            pbDisplay(_INTL("{1} is buffeted by the sandstorm!",b.pbThis))
            @scene.pbDamageAnimation(b)
            b.pbReduceHP(b.totalhp/8,false)
            b.pbItemHPHealCheck
            b.pbFaint if b.fainted?
    Oh! That works perfectly. I wonder why grouping them together didn't...? Well, hooray for order, I guess. Thank you very much!
     
    Back
    Top