• 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!
  • Serena, Kris, Dawn, Red - which Pokémon protagonist is your favorite? Let us know by voting in our grand final favorite protagonist poll!
  • PokéCommunity supports the Stop Killing Games movement. If you're a resident of the UK or EU, consider signing one of the petitions to stop publishers from destroying games. Click here for more information!
  • 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] Howl won't boost the attack of both pokemon

  • 67
    Posts
    4
    Years
    • He/Him
    • Seen Nov 16, 2023
    So I changed howl in the pbs text from user to userside and it does the exact same thing how do I make howl boost both the user and ally's attack stat
     
    Here's a script for the move Gear Up, which has a similar effect:
    Code:
    ################################################################################
    # Raises the Attack and Special Attack of an ally. (Gear Up)
    ################################################################################
    class PokeBattle_Move_CF12 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        if [email protected] || !opponent ||
           !opponent.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self) ||
           !opponent.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
          @battle.pbDisplay(_INTL("But it failed!"))
          return -1
        end
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
        opponent.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self)
        opponent.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self)
        return 0
      end
    end

    If you were to edit it a bit, I bet you could make it work for Howl. You would need to change the move class to match Howl's, and maybe take out the [email protected] to make it work in Singles. Let me know if you have any questions or it doesn't work!
     
    Here's what I did:
    Code:
    ################################################################################
    # Increases the user and its partner's Attack by 1 stage. (Howl)
    ################################################################################
    class PokeBattle_Move_1A9 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
        return -1 if !attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,true,self) &&
                     !attacker.pbPartner.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,true,self)
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
        attacker.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self)
        attacker.pbPartner.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self)
        return 0
      end
    
      def pbAdditionalEffect(attacker,opponent)
        if attacker.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
          attacker.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self)
        end
        if attacker.pbPartner.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self)
          attacker.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self)
        end
      end
    end
     
    Here's a script for the move Gear Up, which has a similar effect:
    Code:
    ################################################################################
    # Raises the Attack and Special Attack of an ally. (Gear Up)
    ################################################################################
    class PokeBattle_Move_CF12 < PokeBattle_Move
      def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
        if [email protected] || !opponent ||
           !opponent.pbCanIncreaseStatStage?(PBStats::ATTACK,attacker,false,self) ||
           !opponent.pbCanIncreaseStatStage?(PBStats::SPATK,attacker,false,self)
          @battle.pbDisplay(_INTL("But it failed!"))
          return -1
        end
        pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
        opponent.pbIncreaseStat(PBStats::ATTACK,1,attacker,false,self)
        opponent.pbIncreaseStat(PBStats::SPATK,1,attacker,false,self)
        return 0
      end
    end

    If you were to edit it a bit, I bet you could make it work for Howl. You would need to change the move class to match Howl's, and maybe take out the [email protected] to make it work in Singles. Let me know if you have any questions or it doesn't work!

    Also this is the wrong code for Gear Up. It should raise the Attack and Special Attack of the user and its ally if they have the Plus or Minus ability. Check Magnetic Flux's implementation, because Gear Up is exactly the same as that except it affects Atk and Sp. Atk instead of Def and Sp. Def.
     
    Back
    Top