Advertiser Content

fauno

Non-binary
Brazil
Seen 6 Hours Ago
Posted 1 Day Ago
21 posts
1.7 Years
Guys I need help one more time. In my project there is a gym leader who is a dance teacher but she uses fighting-type Pokémon. So far so good. As you already know, Oricorio has a ability (Dancer) that copies the dance moves if your opponent uses any.
My idea is to give only this Gym Leader's Pokes the same effect as the Dancer ability, without change the original abilities of your Pokémon, can anyone guide me how to do this?
I'll leave here the code I use to Dancer

Spoiler:
if thismove.isDanceMove? && !dancercheck
      if @battle.doublebattle
        for k in @battle.pbPriority(true)
          if k!=user && !k.isFainted?
            if !k.effects[PBEffects::Dancer] &&
            k.hasWorkingAbility(:DANCER)
            @battle.battlers[user.index].effects[PBEffects::Dancer]=true
              if k==user.pbPartner
                if !target.isFainted?
                  if target==user.pbPartner
                    if !user.pbOpposing1.isFainted?
                      @battle.pbDisplay(_INTL("{1} also dances!",k.pbThis))
                      k.effects[PBEffects::Dancer]=true
                      pbProcessMoveAgainstTarget(thismove,k,user.pbOpposing1,numhits,turneffects,nocheck,alltargets,showanimation,true)
                    elsif !user.pbOpposing2.isFainted?
                      @battle.pbDisplay(_INTL("{1} also dances!",k.pbThis))
                      k.effects[PBEffects::Dancer]=true
                      pbProcessMoveAgainstTarget(thismove,k,user.pbOpposing2,numhits,turneffects,nocheck,alltargets,showanimation,true)
                    elsif !user.isFainted?
                      @battle.pbDisplay(_INTL("{1} wants to dance, but will not attack its ally!",user.pbPartner.pbThis))
                    else
                      @battle.pbDisplay(_INTL("What a pity! {1} wanted to dance...",user.pbPartner.pbThis))
                    end
                  else
                    @battle.pbDisplay(_INTL("{1} also dances!",k.pbThis))
                    k.effects[PBEffects::Dancer]=true
                    pbProcessMoveAgainstTarget(thismove,k,target,numhits,turneffects,nocheck,alltargets,showanimation,true)
                  end
                elsif !target.pbPartner.isFainted?
                  @battle.pbDisplay(_INTL("{1} also dances!",k.pbThis))
                  k.effects[PBEffects::Dancer]=true
                  pbProcessMoveAgainstTarget(thismove,k,target.pbPartner,numhits,turneffects,nocheck,alltargets,showanimation,true)
                elsif !user.isFainted?
                  @battle.pbDisplay(_INTL("{1} wants to dance, but will not attack its ally!",user.pbPartner.pbThis))
                else
                  @battle.pbDisplay(_INTL("What a pity! {1} wanted to dance...",user.pbPartner.pbThis))
                end
              elsif k==user.pbOpposing1
                if !user.isFainted?
                  @battle.pbDisplay(_INTL("{1} also dances!",k.pbThis))
                  k.effects[PBEffects::Dancer]=true
                  pbProcessMoveAgainstTarget(thismove,k,user,numhits,turneffects,nocheck,alltargets,showanimation,true)
                elsif !user.pbPartner.isFainted?
                  @battle.pbDisplay(_INTL("{1} also dances!",k.pbThis))
                  k.effects[PBEffects::Dancer]=true
                  pbProcessMoveAgainstTarget(thismove,k,user.pbPartner,numhits,turneffects,nocheck,alltargets,showanimation,true)
                elsif !user.pbOpposing2.isFainted?
                  @battle.pbDisplay(_INTL("{1} wants to dance, but will not attack its ally!",user.pbOpposing1.pbThis))
                else
                  @battle.pbDisplay(_INTL("What a pity! {1} wanted to dance...",user.pbOpposing1.pbThis))
                end
              elsif k==user.pbOpposing2
                if !user.isFainted?
                  @battle.pbDisplay(_INTL("{1} also dances!",k.pbThis))
                  k.effects[PBEffects::Dancer]=true
                  pbProcessMoveAgainstTarget(thismove,k,user,numhits,turneffects,nocheck,alltargets,showanimation,true)
                elsif !user.pbPartner.isFainted?
                  @battle.pbDisplay(_INTL("{1} also dances!",k.pbThis))
                  k.effects[PBEffects::Dancer]=true
                  pbProcessMoveAgainstTarget(thismove,k,user.pbPartner,numhits,turneffects,nocheck,alltargets,showanimation,true)
                elsif !user.pbOpposing1.isFainted?
                  @battle.pbDisplay(_INTL("{1} wants to dance, but will not attack its ally!",user.pbOpposing1.pbThis))
                else
                  @battle.pbDisplay(_INTL("What a pity! {1} wanted to dance...",user.pbOpposing2.pbThis))
                end
              end
            end
          end
        end
      elsif target.hasWorkingAbility(:DANCER) && !target.isFainted? && !user.isFainted?
           @battle.pbDisplay(_INTL("{1} also dances!",target.pbThis))
           pbProcessMoveAgainstTarget(thismove,target,user,numhits,turneffects,nocheck,alltargets,showanimation,true)
      elsif target.hasWorkingAbility(:DANCER) && !target.isFainted? && user.isFainted?
           @battle.pbDisplay(_INTL("What a pity! {1} wanted to dance...",target.pbThis))
      end
    end


Ty~@

mgriffin

Online now
Posted 23 Hours Ago
443 posts
5.2 Years
Good point. In the switch check you could check that it's also a Pokémon controlled by the AI (which I think you do by looking at the index of the Pokémon, there's two numbers for player-owned, and two for AI-owned).
Advertiser Content