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

Make Camouflage Baton Passable?

1
Posts
12
Years
    • Seen Aug 22, 2014
    Hi all!

    I am looking to alter the move Camouflage to make it's type change effect transferable via baton pass. I am also working on implementing terrain moves such as Electric Terrain, Grassy Terrain, and Misty Terrain, which are temporary field effects, so ideally I would prefer the passed type to reflect the terrain condition when the move was first used (ie it does not recheck the terrain when passing, it just passes the type).

    This tutorial was really all the information I could find on creating moves with baton passable effects:

    Spoiler:


    Following from that, here's what I'm thinking so far:



    1. Add Camouflage to PBEffects like so

      Code:
      Camouflage   = XXX

      where "XXX" is the next available effect code.


    2. Add

      Code:
      @effects[PBEffects::Camouflage]    = false

      to PokeBattle_Battler under the Baton Pass function.


    3. Not sure if I need to add anything under PokeBattle_Battle to define the status??? Currently Camouflage's functionality is handled completely within PokeBattle_MoveEffects (see below).


    4. Lastly add

      Code:
      attacker.effects[PBEffects::Camouflage]=true

      under the Camouflage's class in PokeBattle_MoveEffects, like so:

      Code:
      class PokeBattle_Move_060 < PokeBattle_Move
        def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
          if isConst?(attacker.ability(true),PBAbilities,:MULTITYPE)
            @battle.pbDisplay(_INTL("But it failed!"))
            return -1
          end
          envtypes=[
             :NORMAL, # None
             :GRASS,  # Grass
             :GRASS,  # Tall grass
             :WATER,  # Moving water
             :WATER,  # Still water
             :WATER,  # Underwater
             :ROCK,   # Rock
             :ROCK,   # Cave
             :GROUND  # Sand
          ]
          type=envtypes[@battle.environment]
          if attacker.pbHasType?(type)
            @battle.pbDisplay(_INTL("But it failed!"))
            return -1  
          end
          pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
          attacker.effects[PBEffects::Camouflage]=true #####added effect
          newtype=getConst(PBTypes,type) || 0
          attacker.type1=newtype
          attacker.type2=newtype
          typename=PBTypes.getName(newtype)
          @battle.pbDisplay(_INTL("{1} transformed into the {2} type!",attacker.pbThis,typename))  
          return 0
        end
      end

      I don't believe there needs to be a check whether the effect is already active because Camouflage can overwrite itself.

    However, as is the actual type change is being handled by the MoveEffect, so I'm not sure if it will update the type of the swapped pokemon at all? Any ideas if I need to alter the function so the type change applies within PokeBattle_Battle? Again, ideally the original "type" variable needs to be retained as well!

    Thanks in advance for any help.
     
    Last edited:
    Back
    Top