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

Checking Bag for Muiltiforms

Status
Not open for further replies.

Zeak6464

Zeak #3205 - Discord
  • 1,099
    Posts
    12
    Years
    I'm trying to make the game check your bag to see if you have an Alolan Flower and if you do then Pokemon in your party become Alolan form
    but for some reason it's by passing the item check and just makes them Alolan form without having the item in bag.

    Code:
    ##########################################################
    #TEST
    ##########################################################
    MultipleForms.register(:BULBASAUR,{
    "getForm"=>proc{|pokemon|
       next 1 if $PokemonBag.pbQuantity(:ALOLANFLOWER)>0 # Alolan Form
       next 0                                            # Ordinary Form
    },
    "type1"=>proc{|pokemon|
       next getID(PBTypes,:POISON) 
       next
    },
    "type2"=>proc{|pokemon|
       next getID(PBTypes,:POISON) 
       next
    }
     
    Code:
      shinyretries+=2 if hasConst?(PBItems,:SHINYCHARM) &&
                         $PokemonBag.pbQuantity(:SHINYCHARM)>0
    That's how the game checks for Shiny Charm.
    Code:
             if hasConst?(PBItems,:OVALCHARM) && $PokemonBag.pbQuantity(PBItems::OVALCHARM)>0
    And the Oval Charm


    Going by those two examples, what you posted should work. As long as you know you have the ALOLANFLOWER constant, you don't need to perform the hasConst?() check.
     
    Final Code & Worked !
    Code:
    ##########################################################
    #TEST
    ##########################################################
    MultipleForms.register(:BULBASAUR,{
    "getForm"=>proc{|pokemon|
       if hasConst?(PBItems,:ALOLANFLOWER) && $PokemonBag.pbQuantity(:ALOLANFLOWER)>0
         next 1
       end
       next 0
    },
    "type1"=>proc{|pokemon|
       next if pokemon.form==0
       next getID(PBTypes,:POISON) 
    },
    "type2"=>proc{|pokemon|
       next if pokemon.form==0
       next getID(PBTypes,:POISON)
    }
    })
     
    Status
    Not open for further replies.
    Back
    Top