• 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!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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

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