• 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!
  • Akari, Red, Kris, May - which Pokémon protagonist is your favorite? Let us know by voting in our semifinal favorite protagonist poll!
  • 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.

Help adding sixth gen features

  • 55
    Posts
    11
    Years
    • Seen Jun 12, 2018
    Hello pokecommunity!

    I'm trying to add some of the new games features into my project.

    I managed to add:
    -MegaEvolutions.
    -Grass inmunity to Spore, StunSpore, SleepPowder and PoisonPowder.
    -Electric inmunity to be paralized.
    -The ability Pixilate.
    -Sylveon and its evolution method.
    -Some fairy type moves.

    And more, but I'm having problem making sound based moves bypass substitute, can someone give me a hand?

    I know this code checks if the move has the sound flag.

    Code:
    (thismove.flags&0x400)!=0 && # flag k: Is sound-based move
    And I know this code handles the damage taken by the substitute

    Code:
      def pbReduceHPDamage(damage,attacker,opponent)
        endure=false
        if opponent.effects[PBEffects::Substitute]>0 && (!attacker || attacker.index!=opponent.index)
          damage=opponent.effects[PBEffects::Substitute] if damage>opponent.effects[PBEffects::Substitute]
          opponent.effects[PBEffects::Substitute]-=damage
          opponent.damagestate.substitute=true
          @battle.scene.pbDamageAnimation(opponent,0)
          @battle.pbDisplayPaused(_INTL("The substitute took damage for {1}!",opponent.name))
          if opponent.effects[PBEffects::Substitute]<=0
            opponent.effects[PBEffects::Substitute]=0
            @battle.pbDisplayPaused(_INTL("{1}'s substitute faded!",opponent.name))
          end
          opponent.damagestate.hplost=damage
          damage=0
          (...)

    Greetings!
     
    Back
    Top