• 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!
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

[Custom Feature Question] New weather: Windy weather

DarkFoxVerdigris

Founder of Pokémon Verdigris
  • 11
    Posts
    5
    Years
    • Seen Nov 26, 2020
    Hello people, I'm very new to programming so I wanted some help with programming a new weather I'm planning to add to my game. It is the windy weather, which:
    - makes powder-based moves ineffective
    - powers up wind-based moves (I already created the flag) by 50%
    And also I wanted to add a feature for hail to make it boost Ice types physical defence by 50%, but I was perplexed because when I checked the Sandstorm code to see if I could rip it I saw that the code doesn't specify special defence when increasing Rock types stats.

    Sorry if they're dumb questions and thanks in advance for anybody who decides to help ^^
     
    Hello people, I'm very new to programming so I wanted some help with programming a new weather I'm planning to add to my game. It is the windy weather, which:
    - makes powder-based moves ineffective
    - powers up wind-based moves (I already created the flag) by 50%
    And also I wanted to add a feature for hail to make it boost Ice types physical defence by 50%, but I was perplexed because when I checked the Sandstorm code to see if I could rip it I saw that the code doesn't specify special defence when increasing Rock types stats.

    Sorry if they're dumb questions and thanks in advance for anybody who decides to help ^^

    shouldn't be too hard to code in.

    since hail thing is seperate, i can show you that, atleast in 16.2 there is a bit in PokeBattle_Move about sandstorms defense boost
    Code:
        if @battle.pbWeather==PBWeather::SANDSTORM &&
           opponent.pbHasType?(:ROCK) && applysandstorm
          defense=(defense*1.5).round
        end

    you'll probably have to check where "applysandstorm" appears and make a replica for hail.

    for the second one i wont focus on the weather setup (so how long it lasts, caused by an ability, or with a rock/move blah blah) but the effect. specifically.

    head to pokebattle_Battler and find soundproof:
    Code:
    if !user.hasMoldBreaker && target.hasWorkingAbility(:SOUNDPROOF) &&
           thismove.isSoundBased? &&
           thismove.function!=0xE5 &&   # Perish Song handled elsewhere
           thismove.function!=0x151     # Parting Shot handled elsewhere
          PBDebug.log("[Ability triggered] #{target.pbThis}'s Soundproof blocked #{user.pbThis(true)}'s #{thismove.name}")
          @battle.pbDisplay(_INTL("{1}'s {2} blocks {3}!",target.pbThis,
             PBAbilities.getName(target.ability),thismove.name))
          return false
        end
    Just make a replica for the weather like this:
    Code:
    if !user.hasMoldBreaker && @battle.weather==PBWeather::WIND &&
           thismove.isPowderMove? 
          @battle.pbDisplay(_INTL("The weather blocks {1}!",thismove.name))
          return false
        end
    for wind moves its not much harder, never specified the flag so going to say its "def isWindMove?"

    And find analytic and toxic boost in pokebattle_move (mentions damagemult) then add this:
    Code:
        if @battle.pbWeather==PBWeather::WIND && isWindMove?
          damagemult=(damagemult*1.5).round
        end

    Hopefully thats all right, not 100% sure but should be.
     
    shouldn't be too hard to code in.

    since hail thing is seperate, i can show you that, atleast in 16.2 there is a bit in PokeBattle_Move about sandstorms defense boost
    Code:
        if @battle.pbWeather==PBWeather::SANDSTORM &&
           opponent.pbHasType?(:ROCK) && applysandstorm
          defense=(defense*1.5).round
        end

    you'll probably have to check where "applysandstorm" appears and make a replica for hail.

    for the second one i wont focus on the weather setup (so how long it lasts, caused by an ability, or with a rock/move blah blah) but the effect. specifically.

    head to pokebattle_Battler and find soundproof:
    Code:
    if !user.hasMoldBreaker && target.hasWorkingAbility(:SOUNDPROOF) &&
           thismove.isSoundBased? &&
           thismove.function!=0xE5 &&   # Perish Song handled elsewhere
           thismove.function!=0x151     # Parting Shot handled elsewhere
          PBDebug.log("[Ability triggered] #{target.pbThis}'s Soundproof blocked #{user.pbThis(true)}'s #{thismove.name}")
          @battle.pbDisplay(_INTL("{1}'s {2} blocks {3}!",target.pbThis,
             PBAbilities.getName(target.ability),thismove.name))
          return false
        end
    Just make a replica for the weather like this:
    Code:
    if !user.hasMoldBreaker && @battle.weather==PBWeather::WIND &&
           thismove.isPowderMove? 
          @battle.pbDisplay(_INTL("The weather blocks {1}!",thismove.name))
          return false
        end
    for wind moves its not much harder, never specified the flag so going to say its "def isWindMove?"

    And find analytic and toxic boost in pokebattle_move (mentions damagemult) then add this:
    Code:
        if @battle.pbWeather==PBWeather::WIND && isWindMove?
          damagemult=(damagemult*1.5).round
        end

    Hopefully thats all right, not 100% sure but should be.

    Thank you very much, it works :))
    (I have no way of actually testing the hail thing yet but it's not giving me any errors and I switched SPDEF with DEFENSE so it should be good)
     
    Back
    Top