• 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.

Adding in "Cobra Strike" Ability

378
Posts
11
Years
    • Seen Oct 18, 2017
    I want to code in the ability "Cobra Strike" which makes all poison type moves stronger. Would this code work? I put right above Torrent, Blaze and Overgrow.

    Spoiler:
     
    1,224
    Posts
    10
    Years
  • I want to code in the ability "Cobra Strike" which makes all poison type moves stronger. Would this code work? I put right above Torrent, Blaze and Overgrow.

    Spoiler:

    Should work fine. You can shorten it to

    Code:
    if isConst?(attacker.ability,PBAbilities,:COBRASTRIKE) &&  isConst?(type,PBTypes,:POISON)
            basedmg=(basedmg*1.5).floor
          end
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Did you consider testing it before asking?
     
    378
    Posts
    11
    Years
    • Seen Oct 18, 2017
    Should work fine. You can shorten it to

    Code:
    if isConst?(attacker.ability,PBAbilities,:COBRASTRIKE) &&  isConst?(type,PBTypes,:POISON)
            basedmg=(basedmg*1.5).floor
          end

    Thanks! It worked! Just wanted confirmation.
     
    1,224
    Posts
    10
    Years
  • Thanks! It worked! Just wanted confirmation.

    For future reference, you can test if something works pretty easily.

    Code:
    if isConst?(attacker.ability,PBAbilities,:COBRASTRIKE) &&  isConst?(type,PBTypes,:POISON)
            basedmg=(basedmg*200).floor
          end

    Battle a higher level pokemon, and you should be able to tell if it changed it or not with ease.
     
    Back
    Top