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

Making damaging versions of certain status moves?

53
Posts
8
Years
  • Is there a way to make moves that deal damage but have the effects of certain status moves? I've just used the same function codes as the status moves, but the move just does the effect but no damage. I'll assume that I need to make a whole new function code so it deals damage AND performs the effect.
    How would I go about doing that?
    There's a two in particular that I really want to know how to make into damaging moves:

    A damaging taunt:
    854,INSULTANDINJURY,Insult & Injury,0BA,60,DARK,Physical,95,20,0,00,0,bce,"The target is taunted and beat, causing it to use only attack moves for three turns."

    A damaging move that causes weather to appear:
    955,DOWNPOUR,Downpour,100,60,WATER,Special,100,10,100,00,0,abef,"The user drops a torrential downpour down on the target which causes it to rain."
     
    824
    Posts
    8
    Years
  • There's some function codes that work for both damaging and nondamaging versions of moves - most notably the ones that cause "volatile" status effects. As far as I can tell, there's nothing in the code for Taunt or for Rain Dance that would cause it to be incompatible with damaging in the normal way, they just aren't coded to do that.

    From what I've observed of these functions, you need two things:
    1.) a way to ignore the normal effect function if the move has a base damage above zero.
    2.) an "additional effect" function.

    Here's the code for Taunt's effect. Adding in the red portions allows you to make a damaging version using the same function codes.
    Code:
    ################################################################################
    # For 3 rounds, disables the target's non-damaging moves.
    ################################################################################
    class PokeBattle_Move_0BA < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    [COLOR="Red"]    return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0[/COLOR]
        if opponent.effects[PBEffects::Taunt]>0
          @battle.pbDisplay(_INTL("But it failed!"))
          return -1
        end
        if opponent.hasWorkingAbility(:OBLIVIOUS) && !attacker.hasBypassingAbility
          @battle.pbDisplayEffect(opponent)
          if EFFECTMESSAGES
            @battle.pbDisplay(_INTL("It doesn't affect {1}...",opponent.pbThis))
          else
            @battle.pbDisplay(_INTL("{1}'s Oblivious prevents taunting!",opponent.pbThis))
          end
          return -1
        end
        if @battle.pbCheckSideAbility(:AROMAVEIL,opponent) && !attacker.hasBypassingAbility
          @battle.pbDisplay(_INTL("{1} is protected by Aroma Veil!",opponent.pbThis))
          return -1
        end
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
        opponent.effects[PBEffects::Taunt]=3
        @battle.pbDisplay(_INTL("{1} fell for the taunt!",opponent.pbThis))
        return 0
      end
    
    [COLOR="red"]  def pbAdditionalEffect(attacker,opponent)
        return false if opponent.effects[PBEffects::Taunt]>0
        return false if opponent.hasWorkingAbility(:OBLIVIOUS) && !attacker.hasBypassingAbility
        return false if @battle.pbCheckSideAbility(:AROMAVEIL,opponent) && !attacker.hasBypassingAbility
        opponent.effects[PBEffects::Taunt]=3
        @battle.pbDisplay(_INTL("{1} fell for the taunt!",opponent.pbThis))
        return true
      end[/COLOR]
    end



    And a damaging Rain Dance:
    Code:
    ################################################################################
    # Starts rainy weather.
    ################################################################################
    class PokeBattle_Move_100 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
    [COLOR="Red"]    return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0[/COLOR]
        if @battle.weather==PBWeather::RAINDANCE || @battle.isPrimordialWeather?
          @battle.pbDisplay(_INTL("But it failed!"))
          return -1
        end
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
        @battle.weather=PBWeather::RAINDANCE
        @battle.weatherduration=5
        @battle.weatherduration=8 if attacker.hasWorkingItem(:DAMPROCK)
        @battle.pbCommonAnimation("Rain",nil,nil)
        @battle.pbDisplay(_INTL("It started to rain!"))
        return 0
      end
    
    [COLOR="Red"]  def pbAdditionalEffect(attacker,opponent)
        return false if @battle.weather==PBWeather::RAINDANCE || @battle.isPrimordialWeather?
        @battle.weather=PBWeather::RAINDANCE
        @battle.weatherduration=5
        @battle.weatherduration=8 if attacker.hasWorkingItem(:DAMPROCK)
        @battle.pbCommonAnimation("Rain",nil,nil)
        @battle.pbDisplay(_INTL("It started to rain!"))
        return true
      end[/COLOR]
    end
     
    Last edited:
    53
    Posts
    8
    Years
  • Thanks so much man, things should be smooth sailing from here on out.

    EDIT:
    Actually, I tested the Taunt one out and now it just does the damage, but no effect. Downpour works perfectly fine though.
    I'm not using the Gen 6 Patch, so I removed things that aren't in v15.
    Here's the code I have
    Code:
    ################################################################################
    # For 4 rounds, disables the target's non-damaging moves.
    ################################################################################
    class PokeBattle_Move_0BA < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0
        if opponent.effects[PBEffects::Taunt]>0
          @battle.pbDisplay(_INTL("But it failed!"))
          return -1
        end
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
        opponent.effects[PBEffects::Taunt]=4
        @battle.pbDisplay(_INTL("{1} fell for the taunt!",opponent.pbThis))
        return 0
      end
      
      def pbAdditionalEffect(attacker,opponent)
        return false if opponent.effects[PBEffects::Taunt]>0
        return false if opponent.hasWorkingAbility(:OBLIVIOUS) && !attacker.hasBypassingAbility
        return false if @battle.pbCheckSideAbility(:AROMAVEIL,opponent) && !attacker.hasBypassingAbility
        opponent.effects[PBEffects::Taunt]=3
        @battle.pbDisplay(_INTL("{1} fell for the taunt!",opponent.pbThis))
        return true
      end
    end
     
    Last edited:
    824
    Posts
    8
    Years
  • Did you make sure to change the Additional Effect chance in the move's entry in moves.txt?

    854,INSULTANDINJURY,Insult & Injury,0BA,60,DARK,Physical,95,20,100,00,0,bce,"The target is taunted and beat, causing it to use only attack moves for three turns."

    Also, you want to edit the 3 in the pbAdditionalEffect function as well, as that's what Insult & Injury will use, not the pbEffect function.
     
    824
    Posts
    8
    Years
  • To make a damaging version of a move that only has the code for a nondamaging version, you need to do as follows:

    Take this:
    Code:
    class Pokebattle_Move_[whatever number] < Pokebattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        [COLOR="red"]# COPY ALL OF THIS CODE[/COLOR]
      end
    end

    And change it to:
    Code:
    class Pokebattle_Move_[whatever number] < Pokebattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        [COLOR="red"]return super(attacker,opponent,hitnum,alltargets,showanimation) if @basedamage>0[/COLOR]
        # This is the code you copied
      end[COLOR="DarkOrange"]
    
      def pbAdditionalEffect(attacker,opponent)
        [COLOR="red"]# PASTE THE COPIED CODE HERE
        # Then change any "return -1"s to "return false"
        # also change any "return 0" s to "return true"[/COLOR]
      end[/COLOR]
    end
     
    Back
    Top