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

[Scripting Question] Scripting Ability - More damage if opponent is evolved

Impo

Playhouse Pokemon
2,458
Posts
14
Years
  • Hi all,

    Sorry for the potentially silly question:

    Is there a way to check if the target in a battle is an evolved form? I want to implement an ability that increases damage if the opponent is evolved

    Code:
    BattleHandlers::DamageCalcUserAbility.add(:UNDERESTIMATED,
      proc { |ability,user,target,move,mults,baseDmg,type|
        mults[:attack_multiplier] *= 1.5 if target.???
      }
    )

    I'm not sure what property to check on the target object to see if it's evolved.

    Thanks for any help :)
     
    124
    Posts
    3
    Years
  • Maybe Eviolite could help here. There's this bit of code that checks whether a Pokémon has an evolution:
    Code:
    target.pokemon.species_data.get_evolutions(true).length > 0
    There are other evolution methods in class Species that might be useful as well.
     

    Impo

    Playhouse Pokemon
    2,458
    Posts
    14
    Years
  • Thanks, that did the trickl

    Code:
    #Does more damage if an enemy is fully evolved
    BattleHandlers::DamageCalcUserAbility.add(:UNDERESTIMATED,
      proc { |ability,user,target,move,mults,baseDmg,type|
        mults[:base_damage_multiplier] *= 1.5 if target.pokemon.species_data.get_evolutions(true).length == 0
      }
    )
     
    Back
    Top