- 14
- Posts
- 8
- Years
- Seen Apr 15, 2025
Hey! I was working on implementing the new Seventh-Gen moves into Pokemon Essentials, but I'm having a little trouble with Pollen Puff. So far, I've got this:
However, I'm worried that this implementation will still injure allies before healing them. Could somebody give me feedback on it? Sorry to be a bother!
Code:
class PokeBattle_Move_165 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=false)
if [email protected]?(attacker.index)
if opponent.effects[PBEffects::Substitute]>0
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
if opponent.hp==opponent.totalhp
@battle.pbDisplay(_INTL("{1}'s HP is full!",opponent.pbThis))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
hpgain=((opponent.totalhp+1)/2).floor)
opponent.pbRecoverHP(hpgain,true)
@battle.pbDisplay(_INTL("{1}'s HP was restored.",opponent.pbThis))
return 0
else
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
end
end
end
However, I'm worried that this implementation will still injure allies before healing them. Could somebody give me feedback on it? Sorry to be a bother!