• 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 make an ability check the Opponent's ability, check which category I've placed that foe's ability into and change its form based on the result?

  • 413
    Posts
    5
    Years
    Let's say you send out a Pikachu with this new ability called "rEvolution", that's the ability I want to make. It's like Trace but better.

    If your foe has sent out a Charizard, rEvolution will check the Charizard's current ability and see that it's Blaze. rEvolution will then check which category of ability I have placed Blaze into while coding this ability. Upon realizing Blaze is in Category 1(which is for abilities that boost the effectiveness of moves), rEvolution will change itself to Adaptability.

    However, if your foe has instead sent out a Buneary with the Limber(prevents paralysis) ability, rEvolution will see that this fits into Category 2(Status Negation) and change its own ability to Magic Bounce.

    If your foe has sent out a Politoed with Drizzle, rEvolution will see this fits into Category 3(Weather Inducer) and change its own ability to Air Lock.

    If your foe has sent out a Shedinja with Wonder Guard, this Pokemon will see it fits into Category 4(Wonder Guard) and give itself Wonder Guard.

    If your foe has a Pikachu that gained the ability Swift Swim from some ability-switching shenanigans, rEvolution will notice this and see that Swift Swim fits into Category 5(Speed Boosters) and give itself Speed Boost.

    Other categories for abilities that weaken the user(obtain Defeatist), inflict damage upon attackers(obtain Iron Barbs), and so on also exist. This Pokemon will get the "highest form" of that category's ability, for better or for worse.

    I was thinking I could make multiple copies of the original Pokemon with this ability: a regular form with rEvolution and a separate form for each ability. rEvolution could be coded to change the pokemon into the correct form upon detecting the foe's ability and checking which category I've placed that ability into. When knocked out or switched out and when battle ends, the Pokemon changes back to Regular Form with rEvolution. I know how to do that part. But I don't know how to code a check for a Pokemon's ability and check which category I have placed that ability into, or how to place abilities within categories.

    As for balancing questions, this is a plot-relevant Legendary and completely original Pokemon. Its stats are mediocre for a Legendary, to make up for how great this ability can be if used correctly.
     
    Last edited:
    Let's say you send out a Pikachu with this new ability called "rEvolution", that's the ability I want to make. It's like Trace but better.

    If your foe has sent out a Charizard, rEvolution will check the Charizard's current ability and see that it's Blaze. rEvolution will then check which category of ability I have placed Blaze into while coding this ability. Upon realizing Blaze is in Category 1(which is for abilities that boost the effectiveness of moves), rEvolution will change itself to Adaptability.

    However, if your foe has instead sent out a Buneary with the Limber(prevents paralysis) ability, rEvolution will see that this fits into Category 2(Status Negation) and change its own ability to Magic Bounce.

    If your foe has sent out a Politoed with Drizzle, rEvolution will see this fits into Category 3(Weather Inducer) and change its own ability to Air Lock.

    If your foe has sent out a Shedinja with Wonder Guard, this Pokemon will see it fits into Category 4(Wonder Guard) and give itself Wonder Guard.

    If your foe has a Pikachu that gained the ability Swift Swim from some ability-switching shenanigans, rEvolution will notice this and see that Swift Swim fits into Category 5(Speed Boosters) and give itself Speed Boost.

    Other categories for abilities that weaken the user(obtain Defeatist), inflict damage upon attackers(obtain Iron Barbs), and so on also exist. This Pokemon will get the "highest form" of that category's ability, for better or for worse.

    I was thinking I could make multiple copies of the original Pokemon with this ability: a regular form with rEvolution and a separate form for each ability. rEvolution could be coded to change the pokemon into the correct form upon detecting the foe's ability and checking which category I've placed that ability into. When knocked out or switched out and when battle ends, the Pokemon changes back to Regular Form with rEvolution. I know how to do that part. But I don't know how to code a check for a Pokemon's ability and check which category I have placed that ability into, or how to place abilities within categories.

    As for balancing questions, this is a plot-relevant Legendary and completely original Pokemon. Its stats are mediocre for a Legendary, to make up for how great this ability can be if used correctly.

    Try something out like this (check out how "foe" is defined with Trace):
    Code:
    if isConst?(foe.ability,PBAbilities,:DRIZZLE) || isConst?(foe.ability,PBAbilities,:SANDSTREAM) || isConst?(foe.ability,PBAbilities,:SNOWWARNING) || isConst?(foe.ability,PBAbilities,:DROUGHT)
      @ability=PBAbilities::AIRLOCK
    elsif isConst?(foe.ability,PBAbilities,:BLAZE) || isConst?(foe.ability,PBAbilities,:OVERGROW) || isConst?(foe.ability,PBAbilities,:TORRENT)
      @ability=PBAbilities::ADAPTABILITY
    end
     
    Back
    Top