• 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!
  • 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!
  • Serena, Kris, Red - which Pokémon protagonist is your favorite? Let us know by voting in our bonus favorite protagonist poll! This poll will only last 24 hours!
  • 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.

Adding new move effect

  • 51
    Posts
    19
    Years
    I've tried to adding a new move effect, that's power is depending on the beauty-value of the attacker. But it doesn't work, so I guess I must first create an variable, that is pointing to the beauty-value. Here's the code that I have tried:

    Code:
    class PokeBattle_Move_133 < PokeBattle_Move
      def pbBaseDamage(basedmg,attacker,opponent)
        basedmg = 10
        basedmg = 200 if attacker.beauty >= 200
        return basedmg
      end
    end

    It's very basic yet, becauce I'm testing the function first and afterwards I espand the function...

    Could anyone tell me what I must change, to work it properly? Thanks.
     
    Beauty isn't a property needed in battles, so it's not a property battlers can have. You'll need to refer to the Pokémon itself for that. That's easy, though:

    Code:
    class PokeBattle_Move_133 < PokeBattle_Move
      def pbBaseDamage(basedmg,attacker,opponent)
        basedmg = 10
        basedmg = 200 if attacker[COLOR=Red].pokemon[/COLOR].beauty >= 200
        return basedmg
      end
    end
    As a brief explanation, a "battler" is an entity created just for battles, which copy a number of important properties from the Pokémon it's based on. A battler can be changed in whatever way you like (e.g. via Mimic or Conversion or Power Split or Transform) without affecting the actual Pokémon, which is very useful. Not all properties are copied, though, because things like ribbons and markings aren't important in battle and they'd just be a waste of space.
     
    Back
    Top