• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
8
Years
  • Age 28
  • 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
 
1,403
Posts
10
Years
  • Seen Apr 18, 2024
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.
 
172
Posts
7
Years
  • Age 31
  • Seen Sep 6, 2022
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