• 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.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • 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] Giving Ice type Pokemon a Defense Boost in Hail

  • 79
    Posts
    9
    Years
    • Seen Jan 12, 2024
    To make Hail more of a counterpart to Sandstorm (and not a worse version of it) I wanted to give ice types a physical defense boost in Hail, similar to what rock types get with special defense. The only thing is that the code for sandstorm's special defense boost is:

    Code:
        if @battle.pbWeather==PBWeather::SANDSTORM &&
           opponent.pbHasType?(:ROCK) && applysandstorm
          defense=(defense*1.5).round
        end
    Why is it listed as 'defense' and not special defense?
    How would I format it to boost physical defense and not special defense?

    Thank you
     
    I assume that at this point we've already figured out whether the damage is physical or special. If you check where "applysandstorm" gets set I expect you'll see that it checks (or is inside a check) for special moves.
     
    I assume that at this point we've already figured out whether the damage is physical or special. If you check where "applysandstorm" gets set I expect you'll see that it checks (or is inside a check) for special moves.

    Yeah I was thinking it had something to do with that too. Meaning it doesn't matter that it says defense because of where it's placed, it's assumed to be spdef. Meaning if you find the section where just defense is checked, then you can place the same code you have now into that section and just replace sandstorm with hail and rock type with ice
     
    Back
    Top