• 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!
  • 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] How to code an Auto-Reflect Ability? Like Magic Bounce but for Physical Attacks, so if you use Mach Punch on a mon with this ability you take damage.

  • 413
    Posts
    5
    Years
    How to code an Auto-Reflect Ability?

    Like Magic Bounce but for Physical Attacks, so if you use Mach Punch on a mon with this ability, the pokemon with this ability takes no damage and you take the damage instead. It's like a better version of the move Counter, but it negates incoming damage instead of taking damage and getting revenge for it, plus it's in always-active ability form not move form.

    Also, how do I code the same thing but for Special Attacks like Energy Ball?

    Don't worry, this is fair and balanced because the weak gimmicky Pokemon who gets one of these two abilities sucks.
     
    You probably can do this by changing the target of the move to be the user instead. Try pasting this after "user=pbFindUser(choice,targets)" in Pokebattle_Battler:
    Code:
        #Change target to user for Auto-Reflect
        for i in 0...targets.length
          if targets[i].hasWorkingAbility(:AUTOREFLECT) && thismove.pbIsPhysical?(thismove.type)
            @battle.pbDisplay(_INTL("{1}'s {2} reflected the attack back at {3}!",targets[i].pbThis,PBAbilities.getName(targets[i].ability),pbThis(true)))
            targets[i] = user
          end
        end
    This should also work on multi-target attacks and have it hit the other targets as normal (should also make the user take the attack twice or thrice if 2 or 3 targets have the ability). I didn't test this, so let me know if there are problems that you don't know how to fix.
     
    Back
    Top