• 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] Attack Effectiveness Ability

  • 36
    Posts
    6
    Years
    • Seen Apr 18, 2024
    I've been trying to add a new ability that modifies the effectiveness of certain type attacks and boosts your STAB.
    The boosting STAB part was simple enough, but I can't for the life of me figure out how to make certain attack types supereffective against a Pokemon with this ability.

    I tried modifying Scrappy like so:

    Scrappy:
    Code:
       if attacker.hasWorkingAbility(:SCRAPPY) || opponent.effects[PBEffects::Foresight]
          mod1=2 if isConst?(otype1,PBTypes,:GHOST) && PBTypes.isIneffective?(atype,otype1)
          mod2=2 if isConst?(otype2,PBTypes,:GHOST) && PBTypes.isIneffective?(atype,otype2)
          mod3=2 if isConst?(otype3,PBTypes,:GHOST) && PBTypes.isIneffective?(atype,otype3)
        end

    My Ability:
    Code:
       if attacker.hasWorkingAbility(:VAMPIRISM)
          mod1=4 if isConst?(otype1,PBTypes,:FIRE) && PBTypes.isNormalEffective?(atype,otype1)
          mod2=4 if isConst?(otype2,PBTypes,:FIRE) && PBTypes.isNormalEffective?(atype,otype2)
          mod3=4 if isConst?(otype3,PBTypes,:FIRE) && PBTypes.isNormalEffective?(atype,otype3)
          mod1=4 if isConst?(otype1,PBTypes,:STEEL) && PBTypes.isNormalEffective?(atype,otype1)
          mod2=4 if isConst?(otype2,PBTypes,:STEEL) && PBTypes.isNormalEffective?(atype,otype2)
          mod3=4 if isConst?(otype3,PBTypes,:STEEL) && PBTypes.isNormalEffective?(atype,otype3)
        end

    But the problem is, it's now making MY moves 2x effective against Fire and Steel types. How can I make it so that Fire and Steel types are 2x effective against Pokemon with this ability?

    The specifics: The ability is called Vampirism, and it causes Fire and Steel type moves to be super effective against you.

    Thanks so much!
     
    Never mind, I figured it out. It was as simple as

    Code:
        if opponent.hasWorkingAbility(:VAMPIRISM) && atype==getConst(PBTypes,:FIRE)
          mod1=4 if mod1==2
          mod2=4 if mod2==2
          mod3=4 if mod3==2
        end
     
    Back
    Top