sonicfan7895
Just a dude, I guess
- 122
- Posts
- 14
- Years
- He/Him/His
- Akala Island, Alola
- Seen Feb 22, 2025
I wanted to try making a move that functions exactly like Smelling Salts. Except the difference with that and this new move is that it is supposed to deal double damage on an attracted target, and then cure the target's attraction.
Obviously I'm not doing something right, because Attraction is totally different from most other statuses (one of them being confusion and the other being flinching), and I know I need to try and call the target.effects line, but for some reason it's still not working.
Here's my code:
Any help to try and solve this conundrum of mine would be fantastic. Thanks!
Obviously I'm not doing something right, because Attraction is totally different from most other statuses (one of them being confusion and the other being flinching), and I know I need to try and call the target.effects line, but for some reason it's still not working.
Here's my code:
Code:
class Battle::Move::DoublePowerIfTargetAttractedCureTarget < Battle::Move
def pbBaseDamage(baseDmg, user, target)
if target.effects[PBEffects::Attract] >= 0 &&
(target.effects[PBEffects::Substitute] == 0 || ignoresSubstitute?(user))
baseDmg *= 2
end
return baseDmg
end
def pbEffectAfterAllHits(user, target)
return if target.fainted?
return if target.damageState.unaffected || target.damageState.substitute
return if target.effects[PBEffects::Attract] >= 0
target.pbCureAttract
end
end
Any help to try and solve this conundrum of mine would be fantastic. Thanks!