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

How should this move be formatted?

  • 220
    Posts
    14
    Years
    • Seen Nov 29, 2021
    As I stated in a previous thread, I'm very new to this. So I have this move to implement, but it lost all spaces (is it necessary even?) before the script. maybe it'd be easier to show:
    Code:
    class PokeBattle_Move_0H < PokeBattle_Move
    failed=false
    def pbBaseDamage(basedmg,attacker,opponent)
    return basedmg
    end
    def pbAdditionalEffect(attacker,opponent)
      if opponent.effects[PBEffects::Curse] || opponent.effects[PBEffects::Substitute]>0
       failed=true
      else
       @battle.pbAnimation(@id,attacker,opponent)
       opponent.effects[PBEffects::Curse]=true
       @battle.pbDisplay(_INTL("{1} was Cursed!",opponent.pbThis))
      end
     if failed
      @battle.pbDisplay(_INTL("But it failed!"))
     end
     return failed ? -1 : 0
    end
    end
    So how should it be layed out?
     
    Last edited:
    This:

    Code:
    class PokeBattle_Move_13F < PokeBattle_Move 
    failed=false 
    def pbBaseDamage(basedmg,attacker,opponent)
     return basedmg
     end
     def pbAdditionalEffect(attacker,opponent)
       if opponent.effects[PBEffects::Curse] || opponent.effects[PBEffects::Substitute]>0
        failed=true
       else
        @battle.pbAnimation(@id,attacker,opponent)
        opponent.effects[PBEffects::Curse]=true
        @battle.pbDisplay(_INTL("{1} was Cursed!",opponent.pbThis))
       end
      if failed
       @battle.pbDisplay(_INTL("But it failed!"))
      end
      return failed ? -1 : 0
     end
    end

    I have absolutely no idea how you did that, but this is the fix.
     
    Here's a simplified and improved version:

    Code:
    class PokeBattle_Move_13F < PokeBattle_Move
      def pbAdditionalEffect(attacker,opponent)
        return false if opponent.effects[PBEffects::Curse] ||
                        opponent.effects[PBEffects::Substitute]>0
        opponent.effects[PBEffects::Curse]=true
        @battle.pbDisplay(_INTL("{1} was cursed!",opponent.pbThis))
        return true
      end
    end
    The spacing is unnecessary, but it does help a lot for the user to see how it all works.

    Remember that the first available function code is 133. IceGod64 used 13F, which is valid although not the first available one - it doesn't really matter so long as you're consistent and remember what you've done.
     
    Back
    Top