• 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.
  • Dawn, Gloria, Juliana, or Summer - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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!
  • 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] Abilities similar to plus and minus?

  • 55
    Posts
    11
    Years
    • Seen Jul 8, 2023
    I've been trying to add new abilities similar to plus and minus. The ability true sword is supposed to increase the attack stats if their partner has the ability true shield. This ability is working as intended. However, the other ability, true shield, which is supposed to increase defenses if their partner has the ability true sword, is not working and just causes an error to pop up.

    Code:
    if attacker.hasWorkingAbility(:TRUESWORD) #True Sword
    partner=attacker.pbPartner
    if partner.hasWorkingAbility(:TRUESHIELD)
    atkmult=(atkmult*1.5).round
    end
    end
    if opponent.hasWorkingAbility(:TRUESHIELD) #True Shield
    if opponent.pbPartner.hasWorkingAbility(:TRUESWORD)
    defense=(defense*1.5).round
    end
    end

    Any help would be appreciated, thanks!
     
    Last edited:
    it should be like this
    if attacker.hasWorkingAbility(:TRUESHIELD) #True Shield
    partner=attacker.pbPartner
    if partner.hasWorkingAbility(:TRUESWORD)
    atkmult=(defmult*1.5).round
    end
    end
     
    That's what I had originally. I've tried a few different things, but the pokemon still takes normal damage. Thanks for the response though!
     
    Maybe the second part could be something like
    Code:
    if opponent.hasWorkingAbility(:TRUESHIELD) #True Shield
      if opponent.pbPartner.hasWorkingAbility(:TRUESWORD)
        atkmult=(atkmult*2.0/3.0).round
      end
    end

    I'm reducing the attack multiplier by ⅔, which should be the same as multiplying the defense by 1.5.

    There's probably some way to do it through defense, but because you didn't post the error message I have no idea what's wrong.
     
    Maybe the second part could be something like
    Code:
    if opponent.hasWorkingAbility(:TRUESHIELD) #True Shield
      if opponent.pbPartner.hasWorkingAbility(:TRUESWORD)
        atkmult=(atkmult*2.0/3.0).round
      end
    end

    I'm reducing the attack multiplier by ⅔, which should be the same as multiplying the defense by 1.5.

    There's probably some way to do it through defense, but because you didn't post the error message I have no idea what's wrong.

    Hey, this worked, thanks!
     
    Back
    Top