• 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.

Help with adding a new in-battle weather and its effect

30
Posts
10
Years
    • Seen Mar 25, 2017
    I can't seem to get this weather to do what I want it to do.

    Code:
    when PBWeather::TORNADO
            @weatherduration=@weatherduration-1 if @weatherduration>0
            if @weatherduration==0
              pbDisplay(_INTL("The winds died down."))
              @weather=0
            else
              pbCommonAnimation("Tornado",nil,nil)
              pbDisplay(_INTL("The winds are howling!"));
              if pbWeather==PBWeather::TORNADO
                for i in priority
                  next if i.hp<=0
                  if !i.pbHasType?(:DARK) && !i.pbHasType?(:WATER) &&
                    !isConst?(i.ability,PBAbilities,TORNADOWATCH) &&
                    !isConst?(i.ability,PBAbilities,:OVERCOAT) &&
                     ![0xCA,0xCB].include?(PBMoveData.new(i.effects[PBEffects::TwoTurnAttack]).function)  &&
                     !isConst?(i.item,PBItems,:SAFETYGOGGLES)
                    pbDisplay(_INTL("{1} was struck by debris!",i.pbThis))
                    @scene.pbDamageAnimation(i,0)
                    i.pbReduceHP((i.totalhp/8).floor)
                    if i.hp<=0
                      return if !i.pbFaint
                    end
                  end
                end
              end
            end

    I want this weather to strike only Pokemon without the DARK or WATER types, Pokemon without the Tornado Watch and Overcoat Abilities, Pokemon that aren't digging or diving, or Pokemon without Safety Goggles. The script does squat in the game. Are there any suggestions to go about fixing it?
     
    1,224
    Posts
    10
    Years
  • 1 thing,

    Code:
    !isConst?(i.ability,PBAbilities,TORNADOWATCH)
    is missing a colon.

    Also, you say it does squat, describe that more please. Does the tornado weather start, and just doesn't have the end round effects. Does it not start at all?
     
    Back
    Top