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

How should this move be formatted?

  • 217
    Posts
    15
    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