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

  • 5
    Posts
    8
    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:
    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..
     
    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