• 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.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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] Move that changes user and target's stats

  • 37
    Posts
    8
    Years
    • Seen Jan 21, 2021
    I'm trying to script a move that raises the user's Atk, lowers Spe, and lowers the foe's Atk (based on a pufferfish inflating). The following script works with the move set to "AllFoes" in the PBS, but causes the animation to occur on the opponent's side, which I'd like to change to the user's side. I'm able to do this by changing the PBS to "AllBattlers" but this also lowers the user's Atk (I could make the Atk increase 2 to offset this but that's starting to get rather ugly / excessive). Unless there's a way to shift the location of the animation (maybe something to do with ShowAnim?) I'm thinking I need to make the move class into one targeting the user primarily (i.e. PokeBattle_StatUpMove) and then add the second def effect for lowering the opponent's Atk afterward, but attempts at this have been causing errors. How would I go about scripting this? Here's what I'm working with so far:
    Code:
    class PokeBattle_Move_303 < PokeBattle_TargetStatDownMove
      def initialize(battle,move)
        super
        @statDown = [PBStats::ATTACK,1]
      end
    
      def pbEffectGeneral(user)
        if user.pbCanRaiseStatStage?(PBStats::ATTACK,user,self)
          user.pbRaiseStatStage(PBStats::ATTACK,1,user)
        end
        showAnim = true
        if user.pbCanLowerStatStage?(PBStats::SPEED,user,self)
          if user.pbLowerStatStage(PBStats::SPEED,1,user,showAnim)
            showAnim = true
          end
        end
      end
    end
     
    Try changing the animation in the animation editor.
     
    Try changing the animation in the animation editor.

    Good idea. So I've made a new animation for the move in question, and named it "Move:BLOAT" in accordance with the format the other unique moves seem to have, but when used in battle the new animation doesn't show up. I exported the .anm file into the root folder and used an internal SE - the animation only involves the user expanding. What else do I need to do in order for the animation to show up in-game?

    EDIT: Working now; not sure why though.
     
    Last edited:
    Back
    Top