• 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!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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] Unknown Unown move

  • 22
    Posts
    12
    Years
    • Seen Jun 30, 2024
    So i had this idea where Unown would get a move that interacts with what letter it is. Lets say the letter "G". When the "G" Unown uses this move against a foe, the damage would double for each G that the opposing had in its name. I have have no idea how or where I could start to figure out this move. Any help or direction would be wonderful
     
    Hello developer, it's not that I want to ruin your idea, but according to my knowledge in video game development, that will require you to create a kind of database with the name of all the Pokémon in your game, which would require a lot of annoying work having to write all these values in a script, and we are not talking about just 10 species. What you can do and I think it is the most convenient, is to create a database for the movement, but this time with the Pokémon types, which is very common with this type of special movements.

    I just want to give you and keep you from breaking your head, but remember that you can do anything that you think is ideal and the community will be willing to respond to you in case of any inconvenience.
     
    It's okay. I honestly didn't think it was super feasible. That's okay tho, there's always plan B. It'll be ugly but totally doable. Just gonna go with the first letter of every name instead. Thanks for giving me a quick response. I really appreciate you saving me all that headache!
     
    Huh? A database? This really doesn't seem that complex.
    At most you'd might want an array or hash that converts Unown form numbers to letters.
    This one only doubles if it finds at least 1 shared letter
    Ruby:
    class Battle::Move::DoublePowerIfUnownLetterName < Battle::Move
      UNOWN_FORM_LETTERS = ['A','B','C','D','E','F',
                            'G','H','I','J','K','L',
                            'M','N','O','P','Q','R',
                            'S','T','U','V','W','X'
                            'Y','Z','?','!']
      def pbBaseDamage(baseDmg, user, target)
        return baseDmg unless user.isSpecies?(:UNOWN)
        check_name = target.name.upcase
        baseDmg *= 2 if check_name.count(UNOWN_FORM_LETTERS[user.form])>0
        return baseDmg
      end
    end

    This one should work as you described it, so hitting Eevee with a form E Unown should deal like 16x the damage, but only 2x damage if it was a form V Unown.
    Ruby:
    class Battle::Move::DoublePowerIfUnownLetterName < Battle::Move
      UNOWN_FORM_LETTERS = ['A','B','C','D','E','F',
                            'G','H','I','J','K','L',
                            'M','N','O','P','Q','R',
                            'S','T','U','V','W','X'
                            'Y','Z','?','!']
      def pbBaseDamage(baseDmg, user, target)
        return baseDmg unless user.isSpecies?(:UNOWN)
        check_name = target.name.upcase
        return baseDmg << check_name.count(UNOWN_FORM_LETTERS[user.form])
      end
    end
     
    Back
    Top