- 16
- Posts
- 5
- Years
- Seen May 1, 2023
Hey guys,
as the title suggests i am trying to implement a custom ability that attacks twice if the attack is super effective. However i have a problem with the necessary condition for the script.
I tried variations like "Effectiveness.super_effective?(target.damageState.typeMod)" but i get an error saying that damageState is undefined.
My code above works but it always hits twice and seems to ignore the effectiveness.
Hope anybody can help
Cheers
as the title suggests i am trying to implement a custom ability that attacks twice if the attack is super effective. However i have a problem with the necessary condition for the script.
Code:
def pbNumHits(user,targets)
if user.hasActiveAbility?(:ONCEMORE) && pbDamagingMove? && Effectiveness::SUPER_EFFECTIVE_ONE &&
!chargingTurnMove? && targets.length==1
user.effects[PBEffects::OnceMore] = 3
return 2
end
return 1
end
My code above works but it always hits twice and seems to ignore the effectiveness.
Hope anybody can help
Cheers