• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Ability move modifier

772
Posts
13
Years
  • Hi

    I'm trying to program an ability that affects just a single move ( battle bond), the ability is working but it affecting all moves currently. Does anyone know what the code to check for a specific move is?

    So far i have
    Code:
        if attacker.hasWorkingAbility(:BATTLEBOND)
          damagemult=(damagemult*1.3).round
        end
     
    Last edited:
    971
    Posts
    7
    Years
    • Age 21
    • Seen Nov 28, 2022
    Hi

    I'm trying to program an ability that affects just a single move ( battle bond), the ability is working but it affecting all moves currently. Does anyone know what the code to check for a specific move is?

    So far i have
    Code:
        if attacker.hasWorkingAbility(:BATTLEBOND)
          damagemult=(damagemult*1.3).round
        end

    What method is this in? It's important that we know, because we need to know what variables are in scope of this piece of code. If there's something called move or moveid nearby, you can use that with isConst?:

    Code:
    if attacker.hasWorkingAbility(:BATTLEBOND) && isConst?(move.id,PBMoves,:TACKLE)
    Code:
    if attacker.hasWorkingAbility(:BATTLEBOND) && isConst?(moveid,PBMoves,:TACKLE)

    If not, please let me know what method you added this to and I'll have a look for you ;)
     
    971
    Posts
    7
    Years
    • Age 21
    • Seen Nov 28, 2022
    Ah, @id should work, then.

    That would be something like this:
    Code:
    if attacker.hasWorkingAbility(:BATTLEBOND) && isConst?(@id,PBMoves,:TACKLE)
     
    Last edited:
    Back
    Top