- 428
- Posts
- 5
- Years
- Zekko
- Seen Nov 21, 2023
Hello, I'd like to remove an element of RNG from the game by making the optional effects of some moves (For example, Psychic and its chance to reduce the foe's Special Defense stat) only trigger when the move is super effective.
What am I doing wrong? When I attack a Pokemon Super Effectively, I get an error that says
Code:
# Additional effect ON SUPER EFFECTIVES ONLY
if !user.hasActiveAbility?(:SHEERFORCE)
targets.each do |b|
next if b.damageState.calcDamage>=0 && Effectiveness.super_effective?(target.damageState.typeMod)
move.pbAdditionalEffect(user,b)
end
end
What am I doing wrong? When I attack a Pokemon Super Effectively, I get an error that says
Code:
Exception `NameError' at 155:Battler_UseMove:721 - undefined local variable or method `target' for #<PokeBattle_Battler>