• 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] Ability of Gen 7 Corrosion

  • 37
    Posts
    7
    Years
    I've been trying to implement the Corrosion ability in Pokémon Essentials V17.1 where I downloaded the pack with everything needed for it. Only 1 movement was incomplete because I could not find one of the sections in the scripts to modify. But the problem that is taking away my patience is with a ability, which is called Corrosion.

    As most will know, it allows the attacker to poison any type of opponent, even if it is Poison or Steel. type.

    The modified script is PokeBattle_BattleEffects, at line 127, where only one exception is added. "! attacker.hasWorkinAbility (: CORROSION)"

    The skill works perfectly, the problem is when any other Pokémon of the type Steel or Poison uses attacks of physical contact with some other pokémon that has the Poison Point ability. The error is as follows:
    [PokeCommunity.com] Ability of Gen 7 Corrosion


    As I included the 7th generation, the Pokemon that has this ability would lose its identity if I put another ability in the place, could someone explain to me what happens and why this error happens...
     
    Last edited:
    In PokeBattle_BattlerEffects search this line "if (pbHasType?(:POISON) || pbHasType?(:STEEL)) && !hasWorkingItem(:RINGTARGET)" and add this to it:

    || !attacker.hasWorkingAbility(:CORROSION)

    You should have this line now: if (pbHasType?(:POISON) || pbHasType?(:STEEL)) && !hasWorkingItem(:RINGTARGET) || !attacker.hasWorkingAbility(:CORROSION)

    I did that and it seems that works. Btw, I have the v17.2
     
    If you inflict Toxic against Steelix, it won't take Poison.
    I made that code:

    Inside 'def pbCanPoison?(attacker,showMessages,move=nil)', below that code:
    Code:
        if status==PBStatuses::POISON
          @battle.pbDisplay(_INTL("{1} is already poisoned.",pbThis)) if showMessages
          return false
        end

    Paste:
    Code:
        if attacker.hasWorkingAbility(:CORROSION)
          return true
        end
     
    Pokemons with that ability works fine. Usinf Wolfs code. But the same error appears from the other pokemon poison abilities, for ex: When a wild pokemon like nidoking against my nidoking, that reported error above appears again. I tried other methods and ways but no sucess for now.
     
    For the benefit of anyone reading this thread in the future, pbCanPoison? is sometimes called without an attacker (e.g. for something like a Toxic Orb). That means you'd need something like (attacker && attacker.hasWorkingAbility(:CORROSION)).
     
    For the benefit of anyone reading this thread in the future, pbCanPoison? is sometimes called without an attacker (e.g. for something like a Toxic Orb). That means you'd need something like (attacker && attacker.hasWorkingAbility(:CORROSION)).

    Thanks for point me!
    V2.0
    Spoiler:


    V3.0
    Inside def pbPoison?(attacker,showMessages,move=nil), replace the code to recognize STEEL and POISON types to:
    Code:
    if (pbHasType?(:POISON) || pbHasType?(:STEEL))  && !(attacker && attacker.hasWorkingAbility(:CORROSION)) && !hasWorkingItem(:RINGTARGET)
      @battle.pbDisplay(_INTL("It doesn't affect {1}...",pbThis(true))) if showMessages
      return false
    end
     
    Last edited:
    Back
    Top