• 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] Liquid Voice in Pokemon Essentials

5
Posts
7
Years
  • Anyone can tell me why it doesn't works?

    Code:
    def pbModifyType(type,attacker,opponent)
        if type>=0
          if attacker.hasWorkingAbility(:NORMALIZE) && hasConst?(PBTypes,:NORMAL)
            type=getConst(PBTypes,:NORMAL)
      [COLOR="Red"]    if attacker.hasWorkingAbility(:LIQUIDVOICE) && thismove.hasFlags?(k)
            type=getConst(PBTypes,:WATER) || 0
          end[/COLOR]
          elsif isConst?(type,PBTypes,:NORMAL)
            if attacker.hasWorkingAbility(:AERILATE) && hasConst?(PBTypes,:FLYING)
              type=getConst(PBTypes,:FLYING)
              @powerboost=true
            elsif attacker.hasWorkingAbility(:REFRIGERATE) && hasConst?(PBTypes,:ICE)
              type=getConst(PBTypes,:ICE)
              @powerboost=true
            elsif attacker.hasWorkingAbility(:PIXILATE) && hasConst?(PBTypes,:FAIRY)
              type=getConst(PBTypes,:FAIRY)
              @powerboost=true
            end
          end
        end
        return type
      end
     
    Last edited by a moderator:
    320
    Posts
    14
    Years
    • Seen Dec 27, 2021
    You didn't end the previous 'if' statement before your added code.
    Your code is now only reached when the attacker hase the ability Normalize, in other words it will never reach your code..
     
    824
    Posts
    8
    Years
  • Code:
      def pbModifyType(type,attacker,opponent)
        if type>=0
          if attacker.hasWorkingAbility(:NORMALIZE) && hasConst?(PBTypes,:NORMAL)
            type=getConst(PBTypes,:NORMAL)
          [COLOR="Red"]elsif attacker.hasWorkingAbility(:LIQUIDVOICE) && thismove.isSoundBased?
            type=getConst(PBTypes,:WATER)[/COLOR]
          elsif isConst?(type,PBTypes,:NORMAL)
            if attacker.hasWorkingAbility(:AERILATE) && hasConst?(PBTypes,:FLYING)
              type=getConst(PBTypes,:FLYING)
              @powerboost=true
            elsif attacker.hasWorkingAbility(:REFRIGERATE) && hasConst?(PBTypes,:ICE)
              type=getConst(PBTypes,:ICE)
              @powerboost=true
            elsif attacker.hasWorkingAbility(:PIXILATE) && hasConst?(PBTypes,:FAIRY)
              type=getConst(PBTypes,:FAIRY)
              @powerboost=true
            end
          end
        end
        return type
      end

    A more human-readable version.
     
    Back
    Top